I am learning to use wordpress and I'm trying to adjust the php.ini file to adjust the configuration for the minimum server requirements of my template. I am running MAMP 4.4.1 and Wordpress 4.9.4 on MAC osx High Sierra.
I have a fresh install of both and would like to update the following:
memory_limit 96M
max_input_vars 3000
max_execution_time 120
post_max_size 32M
upload_max_filesize 32M
When I navigate to "http://localhost:8888/MAMP/index.php?language=English&page=phpinfo"
I see
Configuration File (php.ini) Path
/Applications/MAMP/bin/php/php7.2.1/conf
Loaded Configuration File
/Applications/MAMP/bin/php/php7.2.1/conf/php.ini
I run sudo nano /Applications/MAMP/bin/php/php7.2.1/conf/php.ini
and edit the attributes listed above and comment out opcache.
I then stop the server and start the server. When I view phpinfo again the values have not changed.
How can I change the php.ini?
Original answer: Where does MAMP keep its php.ini?
I'm not sure if in MAMP (non-PRO) is the same, but MAMP overrides the modified php.ini everytime it starts.
In my case, I needed to use the MAMP menu to change my php.ini file (File -> Edit Template -> PHP -> PHP 5.xx -> php.ini)
Related
In a OpenLiteSpeed server I used php_info() to find the path to php.ini
Loaded Configuration File /usr/local/lsws/lsphp73/etc/php/7.3/litespeed/php.ini
Then I edited max_input_vars and tried several ways to restart OpenLiteSpeed to apply the changes, but nothing is working.
php_info() shows the old value of max_input_vars
As told by #qtwrk pkill lsphp fixed the problem
I have changed every last PHP.ini, *.ini related or unrelated on my server for setting post_max_size to 8000M but its not working.But atleast 50M will do my work.I am stuck here.
restarted server after changing every php.ini
httpd - k restart
even stopped server and start again.
but i cant see a small change in PHP.info
tried various tricks like
1) php_ini
2) .htaccess
3) .user.ini
but not getting desired result .Please help
I have dedicated server.With WHM and root access but still nothing working
CentOS release 6.8 (Final)
All the suggested answers make change in HTACESS or php.ini while i already changed on it. more than any time.
First create a phpinfo.php file within your web directory (ideally in the same folder where the scripts you are testing are saved) containing:
<?php
phpinfo();
Then access this file using a browser.
Right close to the top there is a line saying:
Loaded Configuration File /etc/php/some/path/php.ini
Edit the loaded php.ini file as follows:
; Maximum allowed size for uploaded files.
upload_max_filesize = 50M
; Must be greater than or equal to upload_max_filesize
post_max_size = 50M
Your question mentions only post_max_size, but if your form accepts files you need to change upload_max_filesize too.
After that you need to restart the web sever (apache?). If you are using php-fpm then you need to restart that process. I don't know about centOS, but for ubuntu commands can be:
sudo service apache2 restart
sudo service php-fpm restart
Reload the phpinfo file in your browser and check if both values have been updated.
I just changed my PHP configs in php.ini like this :
post_max_size = 100M
upload_max_filesize = 100M
but can't see changes in phpinfo(). This function still displays 2M as upload_max_filesize. I'm using Wamp server (Apache 2.2.11, PHP 5.2.9). How can I fix this ?
You may have multiple ini files in your system. Go to your phpinfo and check for the following entry:
Loaded Configuration File
The file indicated there is the one you have to edit for your changes to take effect. Then restart Apache/Nginx.
Also, be aware that ini settings can also be changed at an .htaccess level and even at httpd.conf. So these will take precedence over settings in your php.ini.
Use the wampmanager menus to make sure you amend the php.ini file that Apache uses
wampmanager -> PHP -> php.ini
Click that link and it will open the php.ini file in the default editor, it could not be easier.
Dont forget to restart Apache when you have saved the php.ini, again using the menus
wampmanager -> Apache -> Service -> Restart Service
I set both upload_max_filesize and post_max_size to 128M in my php.ini file, restarted MAMP but it did not work. In my phpinfo() it says that upload_max_filesize is set to 32M and so is post_max_size. Why would this be happening? I made sure that I'm editing the correct php.ini and restarting everything accordingly. Any help would be great. Thanks
If you're using MAMP Pro, you need to edit your php.ini file in the MAMP menu under File > Edit Template > PHP > PHP x.xx php.ini
The problem is that MAMP Pro dynamically generates the php.ini on every start and therefore overwrites your manually edited file.
After updating to Yosemite there were a lot of changes including php and mysql versions.
I copied php.ini.default to php.ini.
Although I changed max_upload_size value (to 50M) in /etc/php.ini file, the max upload size in phpMyAdmin has not been changed.
Yes, I did not forget to restart apache.
phpinfo() from /Library/WebServer/Documents shows php.ini path as /usr/local/php5/lib.
Hence editing php.ini with max_upload_size to increased value did the job.
Thanks!!