Get the most out of your Centmin Mod LEMP stack
Become a Member

Install php.ini and APC

Discussion in 'Install & Upgrades or Pre-Install Questions' started by MarkKiss, Sep 4, 2015.

  1. MarkKiss

    MarkKiss New Member

    21
    3
    3
    Sep 2, 2015
    Ratings:
    +3
    Local Time:
    3:06 PM
    I updated php to 5.6.12 (menu5) and install APC (menu9)

    at /usr/local/lib/php.ini is memory limit 128M and execution time 30s

    but phpinfo say memory limit is 640M and execution time 60s ?

    Second APC wont work next i try APC reinstall (menu7)

    php --ini says
    Code:
    [root@webserver centminmod]# php --ini
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/apc.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0
    PHP Warning:  PHP Startup: memcache: Unable to initialize module
    Module compiled with module API=20100525
    PHP    compiled with module API=20131226
    These options need to match
    in Unknown on line 0
    PHP Warning:  PHP Startup: memcached: Unable to initialize module
    Module compiled with module API=20100525
    PHP    compiled with module API=20131226
    These options need to match
    in Unknown on line 0
    Configuration File (php.ini) Path: /usr/local/lib
    Loaded Configuration File:         /usr/local/lib/php.ini
    Scan for additional .ini files in: /etc/centminmod/php.d
    Additional .ini files parsed:      /etc/centminmod/php.d/a_customphp.ini,
    /etc/centminmod/php.d/apc.ini,
    /etc/centminmod/php.d/curlcainfo.ini,
    /etc/centminmod/php.d/geoip.ini,
    /etc/centminmod/php.d/igbinary.ini,
    /etc/centminmod/php.d/imagick.ini,
    /etc/centminmod/php.d/memcache.ini,
    /etc/centminmod/php.d/memcached.ini,
    /etc/centminmod/php.d/mongodb.ini,
    /etc/centminmod/php.d/redis.ini
    
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,024
    6,587
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,778
    Local Time:
    12:06 AM
    Nginx 1.13.x
    MariaDB 5.5
    Getting Started Guide item 13 and sticky thread PHP Opcode and Memcached statistics pages | Centmin Mod Community in Centmin Mod Insights forum explain the proper apc.ini file to set your opcache settings which is NOT in your php.ini

    For memory limit it's set in /etc/centminmod/php.d/a_customphp.ini for custom values. For customising values in php.ini see instructions at PHP-FPM - CentminMod.com LEMP Nginx web stack for CentOS

     
  3. eva2000

    eva2000 Administrator Staff Member

    29,024
    6,587
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,778
    Local Time:
    12:06 AM
    Nginx 1.13.x
    MariaDB 5.5
  4. MarkKiss

    MarkKiss New Member

    21
    3
    3
    Sep 2, 2015
    Ratings:
    +3
    Local Time:
    3:06 PM
    Thank you a lot this is what I looking

    and what about APC ? Why dont work ?
     
  5. eva2000

    eva2000 Administrator Staff Member

    29,024
    6,587
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,778
    Local Time:
    12:06 AM
    Nginx 1.13.x
    MariaDB 5.5
    If you edited /etc/centminmod/php.d/apc.ini APC settings file and restart php-fpm service should work if it's APC setting

    memory_limit is a php setting not APC setting
     
  6. eva2000

    eva2000 Administrator Staff Member

    29,024
    6,587
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,778
    Local Time:
    12:06 AM
    Nginx 1.13.x
    MariaDB 5.5
    oh you mean
    Code:
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/apc.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0
    did you run centmin.sh option 9 to install APC ? don't run centmin.sh option 7 to reinstall APC if you have Zend Opcache or non-APC opcache already installed. Instead must run centmin.sh option 9 to install APC
     
  7. MarkKiss

    MarkKiss New Member

    21
    3
    3
    Sep 2, 2015
    Ratings:
    +3
    Local Time:
    3:06 PM
    APC.INI
    Code:
    extension=apc.so
    apc.enabled=1
    apc.shm_size=32M
    apc.shm_segments=1
    apc.ttl=7200
    apc.user_ttl=7200
    apc.gc_ttl=3600
    apc.enable_cli=1
    apc.stat=1
    
    ; new settings added in v1.2.2-eva2000.16
    apc.optimization=0
    apc.num_files_hint=4096
    apc.user_entries_hint=4096
    apc.localcache=1
    apc.localcache.size=2048
    apc.slam_defense=0
    apc.write_lock=1
    apc.include_once_override=0
    
    restart php-fpm

    Code:
    service php-fpm restart
    Gracefully shutting down php-fpm . done
    Starting php-fpm [04-Sep-2015 11:41:26] NOTICE: PHP message: PHP Warning:  PHP S                                                             tartup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-n                                                             on-zts-20131226/apc.so' - /usr/local/lib/php/extensions/no-debug-non-zts-2013122                                                             6/apc.so: cannot open shared object file: No such file or directory in Unknown o                                                             n line 0
    [04-Sep-2015 11:41:26] NOTICE: PHP message: PHP Warning:  PHP Startup: memcache:                                                              Unable to initialize module
    Module compiled with module API=20100525
    PHP    compiled with module API=20131226
    These options need to match
    in Unknown on line 0
    [04-Sep-2015 11:41:26] NOTICE: PHP message: PHP Warning:  PHP Startup: memcached                                                             : Unable to initialize module
    Module compiled with module API=20100525
    PHP    compiled with module API=20131226
    These options need to match
    in Unknown on line 0
    done
    
     
  8. MarkKiss

    MarkKiss New Member

    21
    3
    3
    Sep 2, 2015
    Ratings:
    +3
    Local Time:
    3:06 PM
    I install again via (menu9) but still same
    Code:
    [root@webserver centminmod]# php --ini
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/apc.so' - /usr/local/lib/p                                 hp/extensions/no-debug-non-zts-20131226/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0
    PHP Warning:  PHP Startup: memcache: Unable to initialize module
    Module compiled with module API=20100525
    PHP    compiled with module API=20131226
    These options need to match
    in Unknown on line 0
    PHP Warning:  PHP Startup: memcached: Unable to initialize module
    Module compiled with module API=20100525
    PHP    compiled with module API=20131226
    These options need to match
    in Unknown on line 0
    Configuration File (php.ini) Path: /usr/local/lib
    Loaded Configuration File:         /usr/local/lib/php.ini
    Scan for additional .ini files in: /etc/centminmod/php.d
    Additional .ini files parsed:      /etc/centminmod/php.d/a_customphp.ini,
    /etc/centminmod/php.d/apc.ini,
    /etc/centminmod/php.d/curlcainfo.ini,
    /etc/centminmod/php.d/geoip.ini,
    /etc/centminmod/php.d/igbinary.ini,
    /etc/centminmod/php.d/imagick.ini,
    /etc/centminmod/php.d/memcache.ini,
    /etc/centminmod/php.d/memcached.ini,
    /etc/centminmod/php.d/mongodb.ini,
    /etc/centminmod/php.d/redis.ini
    
     
  9. eva2000

    eva2000 Administrator Staff Member

    29,024
    6,587
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,778
    Local Time:
    12:06 AM
    Nginx 1.13.x
    MariaDB 5.5
    what version of PHP is installed ?

    /root/centminlogs has logs of all centmin.sh menu ran options so you should be able to find one for centmin.sh menu option 9

    Code:
    ls -lArt /root/centminlogs
    can post contents of log to pastebin.com or gist.github.com
     
  10. MarkKiss

    MarkKiss New Member

    21
    3
    3
    Sep 2, 2015
    Ratings:
    +3
    Local Time:
    3:06 PM
    php 5.6.12 ( is same as at our main server )

    Code:
    [root@webserver centminmod]# ls -lArt /root/centminlogs
    total 12144
    -rw-r--r--. 1 root root   23050 Sep  3 10:55 centminmod_1.2.3-eva2000.08_030915-114301_yuminstall_centos7.log
    -rw-r--r--. 1 root root   81849 Sep  3 10:56 centminmod_yumtimes_030915-114301.log
    -rw-r--r--. 1 root root      38 Sep  3 10:56 centminmod_profiletimes_030915-114301.log
    -rw-r--r--. 1 root root     199 Sep  3 10:57 securedtmp.log
    -rw-r--r--. 1 root root      44 Sep  3 10:59 centminmod_libresslinstalltime_030915-114301.log
    -rw-r--r--. 1 root root  947329 Sep  3 11:01 centminmod_ngxinstalltime_030915-114301.log
    -rw-r--r--. 1 root root      58 Sep  3 11:08 centminmod_phpinstalltime_030915-114301.log
    -rw-r--r--. 1 root root     380 Sep  3 11:09 zendopcache_passfile.txt
    -rw-r--r--. 1 root root   25993 Sep  3 11:14 centminmod_1.2.3-eva2000.08_030915-114301_yum-log.log
    -rw-r--r--. 1 root root      20 Sep  3 11:14 install.utc.time.log
    -rw-r--r--. 1 root root 2753155 Sep  3 11:14 centminmod_1.2.3-eva2000.08_030915-114301_install.log
    -rw-r--r--. 1 root root   72797 Sep  3 11:16 centminmod_1.2.3-eva2000.08_030915-111555_apc_install.log
    -rw-r--r--. 1 root root  160148 Sep  3 11:18 centminmod_1.2.3-eva2000.08_030915-111555_memcached_reinstall.log
    -rw-r--r--. 1 root root 2557096 Sep  3 11:40 centminmod_1.2.3-eva2000.08_030915-111555_php_upgrade.log
    -rw-r--r--. 1 root root    2173 Sep  3 11:44 centminmod_1.2.3-eva2000.08_030915-111555_yuminstall_centos7.log
    -rw-r--r--. 1 root root   30650 Sep  3 11:45 centminmod_yumtimes_030915-111555.log
    -rw-r--r--. 1 root root      38 Sep  3 11:45 centminmod_profiletimes_030915-111555.log
    -rw-r--r--. 1 root root      45 Sep  3 11:47 centminmod_libresslinstalltime_030915-111555.log
    -rw-r--r--. 1 root root     877 Sep  3 11:47 gcc_native.log
    -rw-r--r--. 1 root root 3402422 Sep  3 12:02 centminmod_1.2.3-eva2000.08_030915-111555_update_all.log
    -rw-r--r--. 1 root root    8679 Sep  3 12:04 centminmod_phpmyadmin_install_030915-120359.log
    -rw-r--r--. 1 root root    4634 Sep  3 12:28 centminmod_1.2.3-eva2000.08_030915-122811_nginx_addvhost.log
    -rw-r--r--  1 root root    2671 Sep  3 13:31 centminmod_1.2.3-eva2000.08_030915-132720_yuminstall_centos7.log
    -rw-r--r--  1 root root   34950 Sep  3 13:31 centminmod_yumtimes_030915-132720.log
    -rw-r--r--  1 root root      38 Sep  3 13:31 centminmod_profiletimes_030915-132720.log
    -rw-r--r--  1 root root 2079683 Sep  3 13:49 centminmod_1.2.3-eva2000.08_030915-132720_php_upgrade.log
    -rw-r--r--  1 root root   15406 Sep  4 02:22 centminmod_phpmyadmin_update-040915-021901.log
    -rw-r--r--  1 root root   58288 Sep  4 10:58 centminmod_1.2.3-eva2000.08_040915-105640_apc_reinstall.log
    -rw-r--r--  1 root root   62576 Sep  4 11:43 centminmod_1.2.3-eva2000.08_040915-114303_apc_install.log
    
     
  11. eva2000

    eva2000 Administrator Staff Member

    29,024
    6,587
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,778
    Local Time:
    12:06 AM
    Nginx 1.13.x
    MariaDB 5.5
    It could also be APC no longer works well with PHP 5.6 as APC hasn't been updated past PHP 5.5 compatibility officially. So for PHP 5.6 best to use Zend Opcache
     
  12. MarkKiss

    MarkKiss New Member

    21
    3
    3
    Sep 2, 2015
    Ratings:
    +3
    Local Time:
    3:06 PM
    Thats why I go try Zend

    Thanks

    Have you plan add Varnish Cache ?
     
  13. eva2000

    eva2000 Administrator Staff Member

    29,024
    6,587
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,778
    Local Time:
    12:06 AM
    Nginx 1.13.x
    MariaDB 5.5
    Varnish 3 YUM repo is already supported so you can install it on Centmin Mod LEMP stack see Installing Varnish Cache ? | Centmin Mod Community and full list of supported 3rd party YUM repos at Third Party YUM Repos with Centmin Mod - CentminMod.com LEMP Nginx web stack for CentOS However, actual configuration of Varnish Cache and use with Nginx is left to end user for their specific web apps and needed default.vcl specific Varnish rules. Centmin Mod LEMP stack only provides the YUM repo for installing Varnish itself :)