Home > Backend Development > PHP Tutorial > Installation and configuration notes of PHP accelerator APC under Linux, accelerator apc_PHP tutorial

Installation and configuration notes of PHP accelerator APC under Linux, accelerator apc_PHP tutorial

WBOY
Release: 2016-07-13 10:16:06
Original
990 people have browsed it

Installation and configuration notes of PHP accelerator APC under Linux, accelerator apc

Currently I am using APC-3.1.9 stable, you can download the latest version from http://pecl.php.net/package/APC.

1. Installation

Copy code The code is as follows:

wget http://pecl.php.net/get/APC-3.1.9.tgz
tar xzvf APC-3.1.9.tgz
cd APC-3.1.9
/usr/local/php/bin/phpize
./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/local/php/bin/php-config --prefix=/usr/local/apc
make && make install

Note: Check the corresponding directory after installation and compilation:

Copy code The code is as follows:

ll /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
-rwxr-xr-x 1 root root 659164 Apr 8 18:30 apc.so

Installation successful!

2. Configuration/usr/local/php/etc/php.ini

Copy code The code is as follows:

vi /usr/local/php/etc/php.ini

shift+g to the last line and add

at the end

Copy code The code is as follows:

[apc]
extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/apc.so"
apc.enabled = 1
apc.cache_by_default = on
apc.shm_segments = 1
apc.shm_size = 64
apc.ttl = 7200
apc.user_ttl = 7200
apc.num_files_hint = 0
apc.write_lock = On

Then copy apc.php in the APC directory to an accessible directory

Copy code The code is as follows:

cp /root/APC-3.1.9/apc.php /home/wwwroot/

3. Restart LNMPA

Copy code The code is as follows:

/root/lnmpa restart

4. Attached: How to install apc under Windows

Download address: http://kromann.info/php5_2-Release_TS/php_apc.dll

Copy code The code is as follows:

extension = php_apc.dll

The html form submits data to php, and then the php file is not executed, but prompts for download problems, apache and php configuration issues under Linux

There are many reasons for the error, and specific problems need to be analyzed in detail
1. There is a problem using the mmcache module on linux x86-64
2. There is a problem with the PHP compilation and installation process, or after the apache+php installation is completed , PHP has been recompiled and installed, and apache has been recompiled at the same time. This phenomenon will occur. It is recommended to keep httpd.conf and related configuration files, and then reinstall apache+PHP. Pay attention to the order. If you still have this prompt, please Change the php version and reinstall.
3. PHP modules zend_extension and extension conflict
4. Due to the use of APC, this is a common problem with this type of op-code cache optimization software. It is recommended to try the latest version (pecl.php.net/package/APC). Once it appears, you can only restart apache.
5. There are too many files in the /tmp directory, and it will be normal after deleting it
6. The configuration mode is worker, change to prefork
7. ZendOptimizer-3.3.0 conflicts with jdk1.7.0
8. It is caused by some special files accessed by the web. Check the access_log and you can see that the deleted files

are transferred. One problem is that there is a problem with your apache and php. Or there is something wrong with your php.
Try to submit to an empty php file and see if there is anything wrong.
means just write one
in the php file
phpinfo();
?>

How does apc in php cache opcode? If I install apc now and configure apc cache in phpini

$memcache = new Memcache;
$memcache->pconnect("127.0.0.1", 11211);

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/899058.htmlTechArticleInstallation and configuration notes of PHP accelerator APC under Linux, accelerator apc Currently I am using APC-3.1.9 stable , you can go to http://pecl.php.net/package/APC to download the latest version. 1. Installation and recovery...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template