I want to remove output_buffering and want to make change to memory_limit by editing etc/php.ini file
But none of my changes are taking effect.
After editing etc/php.ini file as a super user. I’ve restarted httpd.service using following command
sudo systemctl restart httpd.service
I am using centOS 8
[root@backend adminuser]# cat /etc/*release
CentOS Linux release 8.0.1905 (Core)
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"
CentOS Linux release 8.0.1905 (Core)
CentOS Linux release 8.0.1905 (Core)
php-common packages are as below
[root@backend adminuser]# rpm -qc php-common
/etc/php-zts.d/20-bz2.ini
/etc/php-zts.d/20-calendar.ini
/etc/php-zts.d/20-ctype.ini
/etc/php-zts.d/20-curl.ini
/etc/php-zts.d/20-exif.ini
/etc/php-zts.d/20-fileinfo.ini
/etc/php-zts.d/20-ftp.ini
/etc/php-zts.d/20-gettext.ini
/etc/php-zts.d/20-iconv.ini
/etc/php-zts.d/20-phar.ini
/etc/php-zts.d/20-sockets.ini
/etc/php-zts.d/20-tokenizer.ini
/etc/php.d/20-bz2.ini
/etc/php.d/20-calendar.ini
/etc/php.d/20-ctype.ini
/etc/php.d/20-curl.ini
/etc/php.d/20-exif.ini
/etc/php.d/20-fileinfo.ini
/etc/php.d/20-ftp.ini
/etc/php.d/20-gettext.ini
/etc/php.d/20-iconv.ini
/etc/php.d/20-phar.ini
/etc/php.d/20-sockets.ini
/etc/php.d/20-tokenizer.ini
/etc/php.ini
For SSE Script I want to make output_buffer as null or Off like my another server but its not taking any change. I tested by changing php.ini as a root user and restarted httpd services.
3
Answers
You don’t mention whether you’re using
mod_php
orphp-fpm
. Runningsudo systemctl restart httpd.service
only helps formod_php
. If you’re usingphp-fpm
, you needsudo systemctl restart php-fpm.service
instead.Changing etc/php.ini does not work any more.
You need to add your own .ini file now under “/etc/php.d” and restart php
confirm the path from phpinfo. Look for
“Scan this dir for additional .ini files /etc/php.d”
create file (30 prefix to file name is like priority or how late to load):
Add entries like:
Restart PHP (restarting Apache does not help)
Check the service (if not present ..restarting Apache should work: sudo systemctl restart httpd )
Resart the service
I am assuming you are using php-fpm
Following command worked for me.
Connect via terminal and Make sure you are Super(Root) user
sudo su
Now run following command
sudo systemctl restart php-fpm.service
Note : Test by making small change like increasing or decreasing memory_limit in php config file and run above command and review change using phpinfo()