So, you’ve been working on your WordPress website and are now receiving an error: the uploaded file exceeds the upload_max_filesize directive in php.ini. when attempting to add new media. Don’t worry, this can happen to any type of website, large or small.
The reason for this is simple – Your default server settings have an uploadable file size limit. The only thing left for you to do now is jump in and change that default setting to allow you to upload larger files. Follow these next few simple steps to make the change:
1. Edit the .htaccess file
The easiest way to fix the uploaded file exceeds the upload_max_filesize directive in php.ini. error is increasing your PHP resource limits with the .htaccess file. You can access this .htaccess file through your file manager or through an FTP client. The .htaccess file can be found inside the public_html directory. Once you find it, either edit the file in the file in the file manager or download the file and open with Notepad.
Now locate the .htaccess file withing the file manager.
Simply add this line of code to the bottom of your .htaccess file to initiate the changes:
php_value upload_max_filesize 256M
Now save the changes. If you downloaded the file, save the changes and upload your file back into the public_html directory where your found it.
Please note: You can set the PHP limits to any preferred values if your server supports it. If you aren’t uploading unusually large files, your best bet is to increase the php_value upload_max_filesize to 256M.
Now check to make sure the changes are initialized. Upload the media file that was once too large to upload.
2. Edit the wp-config.php file
What makes the Wp-config.php so important is that it contains the base configuration details for your WordPress installation. This can be found in the root of your file directory.
First you need to to edit the memory limit and upload limit. Find the line:
Now increase the memory limit to 128M.
3. Edit PHP variable options
If none of the options above were effective, the problem is likely within your server settings. If you are facing php upload limit issues and the error reads: (…. exceeds the maximum upload size for this site), you can fix them at your end as follows:
- Login to your cPanel account
- Find and click on Select PHP version
- Select Switch to PHP options
- You can see several PHP variable options listed. Search for “upload_max_filesize” and “post_max_size” option and increase the value to a higher one, for example 2M to be increased to 16M and so on.
- Ensure that the changes are saved.
Contact your hosting provider if you are still experiencing issues.
How to effectively stage a WordPress website for development
You’ve already registered your domain, setup hosting, and built a website for your existing business. But now you’re ready to update… and want a better, more professional looking website. So, what do you do?
Look no further for the steps you can take to effectively stage your new WordPress to turn live when complete.
Register a new domain or transfer an existing domain
A few things you need to think about when choosing your name:
- Keep it relevant
- Easy to remember
If you plan on using the same URL in the same hosting account, you can simply create a sub-directory under your main domain name
Now you need a place for your website to live. If your plan is to work with a new hosting provider, you will be able to setup and create a new database with them under your domain name. Be sure to either transfer the domain here or plan on pointing your domain name servers here one the new site is complete. If you are planning on staying with the same hosting provider, you will simply be able to create a sub-directory within your cPanel > File Manager to create your new website.
Shared hosting is a great way to start since you are likely looking for the most affordable option to get your site up and running. Unless your website is attracting hundreds of visitors per day, a shared hosting package should suffice.
Connect your domain and hosting
Whether you decided to stay with your existing hosting provider and create a new website in a sub-directory, or decided to work with a new hosting provider, you need to make sure you update your nameservers.
Wherever your domain is registered, you will have access to decide where your nameservers are pointing. Typically, once you’ve finished creating an updated website, you will then point the new nameservers to your domain to make the website officially live.
cPanel & Softaculous WordPress Installation
Now that you’ve established a domain name and hosting, it’s time to access your New or existing cPanel to install WordPress. Installing WordPress is completed using Softaculous app installer. After setting up a username, password and input other required information Your new WordPress dashboard for website development is ready to rock and roll.
To access your new dashboard, the URL will something like http://yourdomain.com/wp-admin. If you decided to install WordPress in a sub-directory of your current domain, accessing the new WordPress dashboard will follow the order of the file structure in addition to wp-admin/ to effectively access the login page
Wait… Why does my development site point to my old site?
In this case it is beyond just pointing to the right nameservers… because the main idea is to develop your new website behind the scenes and then go live, right? So if you have decided to setup a new hosting package and create a new database under the same domain name as your current website that’s already live, anything you do is going to be directed there, unless you perform a work around.
A popular option is to edit your htaccess file on your computer, locally. This is possible by configuring “A” record for yourdomain.com in your local machine hosts file (htaccess). That way whenever you access yoursite.com, you will be accessing it from the new hosts server
On a Windows operating system, you need to perform the following:
Using the File -> Open feature: