Join the community today
Register Now

Php.ini file issue

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Afterward, Sep 28, 2014.

  1. Afterward

    Afterward Member

    94
    29
    18
    Jul 20, 2014
    Ratings:
    +29
    Local Time:
    5:08 AM
    1.7.5
    5.5
    So i was editing the php.ini file to raise the max upload file limit and upon saving i got a broken pipe ssh error, wich means it timeout i think so i connected back and now my php.ini end in this line and the rest is missing
    Code:
    ;;;;;;;;;;;;;;;;;;;
    ; Quick Reference ;
    ;;;;;;;;;;;;;;;;;;;
    ; The following are all the settings which are different in either the produc$
    ; or development versions of the INIs with respect to PHP's default behavior.
    ; Please see
    
    What shall i do in this case?

     
  2. eva2000

    eva2000 Administrator Staff Member

    54,087
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    2:08 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    you're php source extracted folder should have a copy at /svr-setup/php-5.4.33/php.ini-production

    using copy command to overwrite your messed up php.ini
    Code:
    cp -a /svr-setup/php-5.4.33/php.ini-production /usr/local/lib/php.ini
    then manually reapply the custom php.ini tweaks Centmin Mod from inc/phpsededit.inc, by typing these commands in SSH window as root user
    Code:
        sed -i 's/max_execution_time = 30/max_execution_time = 60/g' /usr/local/lib/php.ini
        sed -i 's/short_open_tag = Off/short_open_tag = On/g' /usr/local/lib/php.ini
        sed -i 's/;realpath_cache_size = 16k/realpath_cache_size = 4096k/g' /usr/local/lib/php.ini
        sed -i 's/;realpath_cache_ttl = 120/realpath_cache_ttl = 360/g' /usr/local/lib/php.ini
        sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 15M/g' /usr/local/lib/php.ini
        sed -i 's/post_max_size = 8M/post_max_size = 15M/g' /usr/local/lib/php.ini
        sed -i 's/expose_php = On/expose_php = Off/g' /usr/local/lib/php.ini
        sed -i 's/mail.add_x_header = On/mail.add_x_header = Off/g' /usr/local/lib/php.ini
        sed -i 's/;max_input_nesting_level = 64/max_input_nesting_level = 128/g' /usr/local/lib/php.ini
        sed -i 's/; max_input_vars = 1000/max_input_vars = 2000/g' /usr/local/lib/php.ini
        sed -i 's/;mysqlnd.net_cmd_buffer_size = 2048/mysqlnd.net_cmd_buffer_size = 16384/g' /usr/local/lib/php.ini
    and you don't need to edit php.ini directory but use a custom .ini file - setting a custom.ini for php.ini customisatons
     
  3. Afterward

    Afterward Member

    94
    29
    18
    Jul 20, 2014
    Ratings:
    +29
    Local Time:
    5:08 AM
    1.7.5
    5.5
    Thank you, seems like my internet is derping and i get broken pipe every second now i will wait until it gets stable and try what you said and report back :)
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,087
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    2:08 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  5. Afterward

    Afterward Member

    94
    29
    18
    Jul 20, 2014
    Ratings:
    +29
    Local Time:
    5:08 AM
    1.7.5
    5.5
    I wonder i wanted to upgrade to php 5.6 anyway, if i do that the old one will be overwritten when i upgrade?
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,087
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    2:08 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yes old php.ini will, hence use custom ini file which will keep your customisations even for upgrades setting a custom.ini for php.ini customisatons