Default memory_limit in PHP 8.1 - php

I have one confusion here, what if memory_limit is not mentioned in PHP.INI file of PHP 8.1 then what will be limit of memory_limit in this case?
Recently we migrated from PHP 7.3 to PHP 8.1 and looks like memory_limit was not mentioned in PHP.INI file of PHP 7.3 as well

Related

changes php.ini file are being ignored

I am having a hard time with this.
I am trying to increase
post_max_size = 90M
upload_max_filesize = 50M
but my info.php is still showing default values 20M
I have tried many solutions available but no success.
One of those were: /questions/14327409/changes-to-upload-max-filesize-in-ubuntu-php-ini-will-not-take-effect
First answer seem to work for people but it would not work for me.
I created 30-user.ini file with these values but no luck.
(I checked correct path for config directory I double checked)
I am using ubuntu 16 server and php7.0
I restarted apache2 but not sure how to restart php, if thats required too.
Maybe putting those values into .htaccess file would help? but not sure how syntax should look like.
it might not be ideal solution, but as I could not get changes in php.ini file to work,
I added .htaccess file
php_value upload_max_filesize 100M
php_value post_max_size 105M
and it appear to be working now.
I still don't know why it would not work directly in php.ini file.
Not sure if you are using php 7.0 or php 7.0-fpm...
Using php-fpm, it is not enough to restart apache, you have to restart php-fpm.
For example, on an Ubuntu 20.04 server and php 7.4 fpm, i had to
/etc/init.d/php7.4-fpm restart
in order for my php.ini to get obeyed.

Can't update php.ini on MAMP v4.4.1

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)

PHP POST Content-Length warning

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.

PHP 5.5.27 Opcache not working on Apache 2.4 CentOS 7

I've using PHP 5.5.27 installed on Apache 2.4 on CentOS 7. Opcache is showing on a phpinfo() page as:
Opcode Caching: Disabled
Yet below opcache.enable shows 'On'. I verified the proper php.ini is being used (/etc/php.d/opcache.ini) and it shows that it is loading up above in the list of loaded config files. I tried replacing zend_extension=opcache.so with the full path to the file, but that didn't work either. I even restarted apache after each of the changes.
I feel like I must be missing something simple, but I have no idea what it is.
Turns out I had zend_extension=opcache.so in my /etc/php.ini file as well as in the /etc/php.d/opcache.ini. Removing it from /etc/php.ini fixed the issue. Guessing that either it couldn't find the path, or didn't like that it was listed twice.

PHP upload size not changing from 2MB in phpinfo()

I'm trying to change the PHP file upload from 2MB. I've changed the php.ini files found in /etc/php5/apache2 and in /etc/php5/cli to other values, but my phpinfo() page shows me that the upload_max_filesize is still stuck on 2MB!
I've checked upload_max_filesize and post_max_size in both the php.ini files with no luck. I've restarted the Apache server multiple times and haven't seen any changes. I'm running Ubuntu 12.04 and I'm completely stumped!

Categories