Set up under the PHP runtime environment [PHP] under CentOS

In the company there are assigned testing machine, all development code runs in a test machine inside. Because the company's test machine room surrender, so to build a development environment on several test computers new applications. Development environment as far as possible and wire agreement on the environment, including the directory path code, the process of running the program user, log directory, and so on. linux version of my test machine or centos6.5, build lnmp environment is primarily these commands.

Clean All yum
yum makecache
yum Update
// install nginx
yum install nginx
// install php php-fpm and the necessary expansion, gd library, mysql extensions (php-mysql Bahrain mysql, mysqli, pdo it all loaded it), pdo expansion, mbstring extension, redis expand
yum install php php-fpm php- devel php-pear php-gd php-pdo php-mbstring php-mysql php-redis
that form // above memcache do not know why there is no extension, use the following command to install, the installation needs above php-devel, generates a .so file, a new file memcahce expanded configuration, so adding this
pecl install memcache

Benefits modify session storage and processing mechanism is that when more than one machine can solve the session sharing mechanism
to modify the default session handling mechanism, from the file into memcache, use the following command to configure the search for the next session of the position, in addition to php.ini is also possible www.conf php-fpm under a covering, commented give
grep "save_handler" / etc -R & lt
session.save_handler = memcache
the session.save_path = "TCP: //xxx.sina.com. cn: 5xxxx8 "

www.conf php-fpm under cover configured to have a session mechanism, or also get rid of, or commented.
; php_value to [session.save_handler] = memcache
; php_value to [the session.save_path] = TCP: //xxx.sina. com.cn:5xxxx8


Php configuration error log in the php-fpm, when a 500 error, usually we have a problem php code, php error log should open, if the / var / log / php, after the directory path to create a new directory , the owner and group directory should be modified to run user fpm using chown command
example: WWW-chown Data: WWW-Data / var / log / PHP-fpm
php_admin_value [the error_log] = / var / log / PHP- fpm / www-error.log

If you want to use a newer version of php, you can add the following to this source, and then when you install php software, written like this example: php71w php71w-fpm and other
rpm -Uvh https://dl.fedoraproject.org/pub/epel/ Latest--Release-EPEL 6.noarch.rpm
RPM -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

Guess you like

Origin www.cnblogs.com/taoshihan/p/11794155.html