find php.ini
1. Create new text file in our wp-admin directory root and name it info.php.
2. Open info.php and add these lines:
<?php
phpinfo();
?>
3. Save it.
4. Go to yourwebsitename(probably localhost)/wp-admin/info.php in any web-browser.
5. In the 8th line you will see: Configuration File (php.ini) Path, in my case it is C:\Windows, meaning it is located on my C drive.
6. In the 9th line you will see: Loaded Configuration File, and next to it is written C:\Program Files (x86)\IIS Express\PHP\v5.3\php.ini
So I found my php.ini page that is associated with my wordpress web-site.
7. Go to that path, and find php.ini.
8. Open it, and edit:
Search for post_max_size=8M, and change it to post_max_size=1000M
Search for upload_max_filesize=2M, and change it to upload_max_filesize=1000M
9. Go back to your admin page>Media>Add New
10. On the bottom you will see that 2MB has changed to 1000M.
P.S: I had problems with overwriting php.ini page, it was telling me access is denied. If you have such problems, google it, and change some permissions so you can edit that file.
Also upload_max_filesize should be changed in both php.ini files.. In the Apache folder, and the PHP folder..
How to Find the Location of Your php.ini File
A critical file you often need to manage is the php.ini file. It controls many import aspects of what you can and can not do with your site, including the size of files that you can upload.
Different hosts use different schemes for storing and accessing files and so you'll need to research where your php.ini file.
This tutorial will show you how to find the location of the file on any server.
Step 1. Create a script to display your php information
You'll need to create a very simple php script and place it in your home directory. Using a script editor or a plain text editor (not a word processor) create file called phpinfo.php with this code:
1.<?php phpinfo(); ?>
That's all you need. Just one single line. Save the file and call it phpinfo.php.
Upload this file to the public_html directory or whatever your main HTML directory is called.
In your browser address bar, access the file by typing in: http://yourdomain.com/phpinfo.php
You'll get a complete list of all your php settings. In the phpinfo.php page you can see:
• the PHP version at the top of the file.
• the location of your php.ini file
If you scroll down the page, and you can find the current version of MySQL. and php settings like safe_mode and register_globals and much much more.
This will work on your local computer using XAMPP or WAMP as well. This is what my XAMPP installation looks like.
GoDaddy Servers Are a Special Case
When you run phpinfo.php on the GoDaddy server you'll see the php5.ini file located in /web/config/php5.ini.
This folder is inaccessible using FTP or the File Manager in the control panel, so you cannot make changes to it if you need to fix errors. To fix this you need to make your own php5.ini file and upload it to your html directory.
Use FTP or your file manager to upload or create a php5.ini folder in your main directory on GoDaddy servers.
IMPORTANT: on GoDaddy, if you are running PHP 4, name your initialization file php.ini. If you are running PHP 5, name your initialization file php5.ini. Always upload the initialization file to the root directory of your site.
Now run your phpinfo.php script and you will see the path to the one you uploaded. You can edit this file to make changes to your PHP settings.
No comments:
Post a Comment