skip to Main Content

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.

enter image description here

3

Answers


  1. You don’t mention whether you’re using mod_php or php-fpm. Running sudo systemctl restart httpd.service only helps for mod_php. If you’re using php-fpm, you need sudo systemctl restart php-fpm.service instead.

    Login or Signup to reply.
  2. 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):

    sudo vi /etc/php.d/30-user.ini
    

    Add entries like:

    max_execution_time=200
    post_max_size=100M
    upload_max_filesize=100M
    

    Restart PHP (restarting Apache does not help)

    Check the service (if not present ..restarting Apache should work: sudo systemctl restart httpd )

    sudo systemctl status php-fpm
    

    Resart the service

    sudo systemctl restart php-fpm
    
    Login or Signup to reply.
  3. I am assuming you are using php-fpm
    Following command worked for me.

    1. Connect via terminal and Make sure you are Super(Root) user

      sudo su

    2. 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()

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search