PHP5.6.40,7.0,7.1 version installed stepped pit deployment share

A server OS and MYSQL, NGINX version is as follows:

CentOS 7.2

mysql5.7 

nginx1.15

php7.0

Two php7.0 installation

centos, mysql nginx installation thereof is omitted

Said main php installation 

A first installation (the default installation directory, use the tar package is installed, each file path after installation is different, not repeat them here) After installing the discovery can not connect to the database lacks drive, the phenomenon could not find driver, see the library file in the default directory by yum install / usr / lib64 / php / modules not pdo-mysql.so, then use php-m command to check whether pdo-mysql.so loaded, and then do not load the library files (library file is not, in general pdo-mysql.so can not be loaded).

B tried many ways to say again yum install pdo pdo-mysql php- pdo the php.ini the like, to no avail. Last download wget  http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz 

Then extract the
tar -zxvf PDO_MYSQL-1.0.2.tgz

After entering the unpacked directory cd PDO_MYSQL-1.0.2, and then execute php command phpize, if the error did not pretend to what yum install on the line.

ok 后 再执行 ./configure --with-php-config=/usr/local/bin/php-config --with-pdo-mysql=/usr/local/mysql/ 

The first --with is / usr / local / bin / php-config

--With second path is mounted mysql

Execution is complete, make compile it, no problem to continue to make install is complete, will generate a folder, there are pdo_mysql.so That's what we want.

Problems arise when the report compiled make all kinds of mistakes, said some of the ways the missing parameters, compatibility issues, unless you change the c ++ source code. After several frustrating to no avail. Abandon the practice of change.

C installation php5.7.40 found and the lack of gd.so image processing library file, the phenomenon is a graphical verification code can not be displayed. After tossing finally gave up.

D installed last php7.0 installed at a friend's repeatedly encouraged and gave guidance. Installation process is as follows:

1 using the following command yum warehouse pack upgrade replaced the rpm package PHP7.

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

2 first use yum command to install basic PHP components after use to install Han Han.

yum -y install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64

Install PHP-fpm (process management, process management provides PHP, and can effectively control memory processes, smoothing reload configuration PHP)

yum -y install php70w-fpm php70w-opcache

Start after installing php-fpm

systemctl start php-fpm

View version to detect whether the installation was successful php-v

E detect whether PHP can communicate with Nginx

See details reference php7.0 installation, this step not encountered pit.

F can detect whether PHP and mysql exchange (pit here)

Detailed look at the installation reference php7.0 met pit, and there is no error restart php-fpm and nginx or service and then Rom database through php -i or php -v found that warning information is as follows:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysqli.so' 
- /usr/lib64/php/modules/mysqli.so: symbol mysql_change_user, 
version libmysqlclient_18 not defined in file libmysqlclient.so.18 with link time reference in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_mysql.so' 
- /usr/lib64/php/modules/pdo_mysql.so: symbol mysql_options, version libmysqlclient_18 not defined in file libmysqlclient.so.18 with link time reference in Unknown on line 0
PHP 7.0.33 (cli) (built: Dec  6 2018 22:30:44) ( NTS )

Internet looking for a long time to no avail finally despaired including friends also, and then I try holding the attitude Baidu search mysql_options, version libmysqlclient_18 not defined in file libmysqlclient.so.18 saw an article

Reinstall the mysql database

yum install mysql-libs -y

Then php -v without warning and was able to connect to the database.

III summarizes

1 php and php-fpm installation requires some libraries may well not have in place, and all kinds of strange errors, need to calm down, do not give up, to try.

2 php, php-fpm, nginx, mysql many versions, it is best to use common document versions do not blindly chasing the latest version may be incompatible as a result of the continuous mining pit.

3 Use docker installation

4 problems of this sort is best to find familiar friends and colleagues to give positive guidance.

 

Remark

1 php7.0 installation  https://www.cnblogs.com/pandawan/p/11100311.html

https://blog.csdn.net/weixin_34174322/article/details/91958876

3 docker installation nignx + php7.3 + mysql environment to build links:

http://note.youdao.com/noteshare?id=7a3d1b4ab11ba81f722f9a73cc39db91&sub=2C11979406534A0A812367F70AE25AA7

 

Published 43 original articles · won praise 28 · views 40000 +

Guess you like

Origin blog.csdn.net/u013380694/article/details/103096360