• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How to install an APC with Plesk

dolomats

New Pleskian
Hi,

I am using Plesk for my website and I want speed it little bit so I wanna install an APC without screwing everything so if anyone can show me a step by step or a link to a trustful tutorial will be welcome


Thanks
 
Thanks for the Answer
I followed The instructions and the instalation was fine no errors
but the APC is not Enable i have this message :
No cache info available. APC does not appear to be running.
and in the phpinfo cant find it
HElp pls
 
APC is not officially supported and was not tested with Plesk. So, you can install and configure it on your own risk.
 
Well ty for Answear but it worked just becoz i was using nginx so didnt start properly then i retarted all server and it worked just fine in nginx and apache

thank you all
 
well for me i was able install APC but untill now dindt see big difference maybe need time to start caching....
 
It would be very useful for community if you publish detailed instruction of installation procedure here and results of this solution. Thanks.
 
Sure Sure

So i followed the link u gave me here : http://www.curvve.com/blog/servers/2012/install-apc-php-caching-on-plesk-server-with-centos-6-2/
http://www.curvve.com/blog/servers/2012/install-apc-php-caching-on-plesk-server-with-centos-6-2/
When i used the command :

pecl install apc

i got an error because of some dependencys then you can install :

sudo yum groupinstall "Development Tools"

yum install pcre-devel

if you are using appache just restart the service but if you are using Nginx better restart all server that's how it worked for me

then u can check if it s working by copying apc.php from /var/tmp/tmp2O7bTB/APC-3.1.13/apc.php to ur domaine
/var/www/vhosts/domaine.com/httpdocs/

and open it from your browser like : http://domaine.com/apc.php to see if it s working or not

And dont forget to delete it from your public_html when the test is done


Greetings....
 
Thank you @dolomats, but this "tutorial" has some holes, which I would like to fill:


Depending on your operating system, the correct installation for APC would be:

Debian / Ubuntu:
Code:
sudo apt-get install gcc automake php-apc php-pear libpcre3-dev
sudo pecl install apc

CentOS / Redhat / ... :
Code:
yum install gcc automake php-apc php-pear pcre-devel
pecl install apc

During the installation, you will be asked, if you would like to override any existing php.ini with the one from the new package installation and here you stop for a second and think over, if you already modified your php.ini in any way. If this is the case, you sure would like to keep all the changes and therefore should consider answering such questions with NO - if this is not the case, you sure could answer the question with YES.

After the PECL - installation you will see a very necessary information, which looks like this:
Build process completed successfully

Installing '/usr/lib/php5/XXXXXXXXXX/apc.so'
Installing '/usr/include/php5/ext/apc/apc_serializer.h'
install ok: channel://pecl.php.net/APC-X.X.XX
configuration option "php_ini" is not set to php.ini location
You should add "extension=apc.so" to php.ini

The path with the "/usr/lib/php5/XXXXXXXXXX/apc.so" ( On CentOS it might look like this: "/usr/lib64/php/modules/apc.so" ) various to your very own system configuration and depends on the path, where you installed your PHP - version. Please be aware to either note this information for further references, or look up your very own path on your system, in order to complete the APC - installation with the needed modification to your php.ini 's ( YES.... you have several php.ini' s on a Plesk configured server... please locate your php.ini's with the command "locate php.ini" to find all installed versions and add the modification in all needed ones. )

The needed modification will then look like this:

( for the CLI php.ini at Debian / Ubuntu - please don't forget to locate and modify the other ones as well!, if needed ) :
echo "/usr/lib/php5/XXXXXXXXXX/apc.so" >> /etc/php5/cli/php.ini
echo "apc.enabled=1" >> /etc/php5/cli/php.ini


( for the CLI php.ini at CentOS / Redhat ... - please don't forget to locate and modify the other ones as well!, if needed )

echo "/usr/lib64/php/modules/apc.so" >> /etc/php.ini
echo "apc.enabled=1" >> /etc/php.ini
If you forgot to note where your apc.so is located, please use again the "locate" command: locate apc.so



If you would like to configure your apc.ini ( the configuration file for APC ) to your very own needs, please locate the apc.ini 's with "locate apc.ini" and edit the files to your very own modification. They depend again on your system configuration and so it is pretty useless to provide a global apc.ini , but still, here are some defintions, which could be used on systems with at least 2 GB RAM:
Code:
extension = apc.so

apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 512M
apc.optimization = 0
apc.num_files_hint = 4096
apc.ttl = 7200
apc.user_ttl = 7200
apc.gc_ttl = 3600
apc.cache_by_default = 1
apc.filters = ""
apc.mmap_file_mask = "/tmp/apc.XXXXXX"
apc.slam_defense = 0
apc.file_update_protection = 2
apc.enable_cli = 0
apc.max_file_size = 10M
apc.stat = 0
apc.write_lock = 1
apc.report_autofilter = 0
apc.include_once_override = 0
;apc.rfc1867 = 0
;apc.rfc1867_prefix = "upload_"
;apc.rfc1867_name = "APC_UPLOAD_PROGRESS"
;apc.rfc1867_freq = 0
apc.localcache = 0
apc.localcache.size = 2048
apc.coredump_unmap = 0
apc.stat_ctime = 0

There are many more options for APC, please have a look at the general APC - site for a detailed description: http://php.net/manual/en/book.apc.php

At the end of your APC - installation there is always the restart of your webserver(s) and if you use FastCGI, as well php5-fpm. If you would like to administrate APC with the provided "apc.php" page on your webspace, make sure to copy the file apc.php to a secured directory ( either apache-htaccess and/or nginx-htaccess modifications !!! )

cp /usr/share/pear/apc.php /var/www/vhosts/YOUR_DOMAIN.COM/httpdocs/SECURED-DIRECTORY/apc.php
If you are unsure, how to secure a directory in your webspace, please have a look at the Plesk documentation and/or use the Parallels Knowledge Base for issues/failures regarding the correct setup.

 
Nice job

Wasen't a real tutorial i just showed how i overcome the error i got following last tutorial :p

Greetings
 
I have installed like your Tutorial but getting an error at apache2

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/apcu.so' - /usr/lib/php5/20090626/apcu.so: cannot open shared object file: No such file or directory in Unknown on line 0

On all possible php.ini files is the extension added like extension=apc.so and if I check the apc.so file inside the folder /usr/lib/php5/20090626/ than it is called apc.so and not apcu.so.

I greped all possible known files if I have somewhere mistyped the extension but I could find anything. Installed is the version of APC (3.1.13).
 
This was another tutorial I followed and had the same error. But now I cleared it already. Found out that a php.ini File had the extension = apcu.so
 
Hi All,
I told in here. Apc Cache how to install, configurated and etc but If you use CGI with PHP, you can not use APC Cache. If you think that this is wrong, say me please.

Good works.
 
Back
Top