instalar o activar cache en servidor

  • ¿Como podría hacer para activar la cache en el servidor, tengo una web en un xeon E3124 a 3.30GHz con 8 nucleos y 16gb ram, y me sirve la web más lentamente que cuando lo tenía en vps simplón. La web usa php 5.3 y tengo puesto el php switcher, puede ir mas lenta por esto?, en el otro el 5.3 venia de serie.

  • Hello,


    If you use the PhpSwitcher plugin, you must install the APC Pecl extension. See the README file to know how. If you really need a howto, ask me and I'll write it in few minutes.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Give me some minutes to write a howto ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @Puntonetsvb


    Here, comes the howto ;) Note that you have nothing to download manually.


    Howto install APC Pecl extension for PHP 5.3.29 (as provided by the PhpSwitcher plugin)


    As root user, run the following command:

    Code
    1. # /opt/phpswitcher/php5.3/bin/pecl install apc


    For the questions, just press enter.
    Once done, you must enable the APC extension by creating a dedicated ini file. For instance:


    Shell-Script
    1. # echo "extension=apc.so" > /opt/phpswitcher/php5.3/etc/php/conf.d/01_apc.ini


    Once done, you must configure the APC extension according your needs. For instance, you could add the following configuration snippet in the /opt/phpswitcher/php5.3/etc/php/php.ini file:


    PHP
    1. [apc]apc.enabled = 1apc.shm_segments = 1apc.shm_size = 48Mapc.num_files_hint = 7000apc.user_entries_hint = 4096apc.ttl = 7200apc.user_ttl = 7200apc.gc_ttl = 3600apc.stat = 0;apc.include_once_override = 0apc.enable_cli = 0apc.file_update_protection = 2apc.max_file_size = 2Mapc.cache_by_default = 1apc.use_request_time = 1apc.slam_defense = 0apc.mmap_file_mask = /tmp/apc.XXXXXXapc.stat_ctime = 0apc.canonicalize = 1apc.write_lock = 1apc.report_autofilter = 0apc.rfc1867 = 0apc.rfc1867_prefix = upload_apc.rfc1867_name = APC_UPLOAD_PROGRESSapc.rfc1867_freq = 0apc.rfc1867_ttl = 3600apc.lazy_classes = 0apc.lazy_functions = 0


    Once done, you must restart Apache2 or the PHP-FPM instance according the i-MSCP httpd server implementation that you use:


    If you use the PHP-FPM Apache2 httpd server implementation:

    Shell-Script
    1. # service psw-5.3-fpm restart


    If you use the Fcgid Apache2 httpd server implementation:

    Shell-Script
    1. # service apache2 restart


    phpinfo result


    apc_01.pngapc_02.png

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Howto edited. Replaced zend_extension by extension. APC is not a Zend extension.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206