linux centos compile php7.2 extension judy error error RETURN_STRINGL requires *** solution

solution:

1. Make sure the current extension supports php7

2. The error reported when compiling in the normal way is basically because the old version of php that comes with centos (mine is the reason) affects the .php extension and reads the files of the old version of php when compiling.

3. To solve the problem, follow Baidu search for "Completely uninstall PHP from Linux CentOS" https://www.cnblogs.com/sunshine-H/p/8117105.html and uninstall the old version of PHP to solve the problem.

=========You don’t need to read the following for normal compilation==========

php7.2 linux compilation and common errors

1. Download the source code and unzip it (the source code directory needs to have writable permissions and needs to be set) and enter the source code directory.
2. Install dependency packages
yum install epel-release -y
yum update
yum -y install wget vim pcre pcre-devel openssl openssl-devel libicu-devel gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses ncurses-devel curl curl-devel krb5-devel libidn libidn-devel openldap openldap-devel nss_ldap jemalloc-devel cmake boost-devel bison automake libevent libevent-devel gd gd-devel libtool* libmcrypt libmcrypt-devel mcrypt mhash libxslt libxslt-devel readline readline-devel gmp gmp-devel libcurl libcurl-devel openjpeg-devel
3. Configure php compilation parameters (note --prefix= php default directory) --enable-maintainer-zts --enable-zts(windows) means enable thread installation version
php.ini is placed in the php binary file directory by default (the following configuration is in /opt/php72/bin/). There is no php.ini in the source code. You can copy one from other places and modify it yourself.
--disable-debug  表示调试 应该是调试扩展用的一般不需要加上
./configure --prefix=/opt/php72 --exec-prefix=/opt/php72/ --bindir=/opt/php72/bin/ --sbindir=/opt/php72/sbin/ --includedir=/opt/php72/include/ --libdir=/opt/php72/lib/php/ --mandir=/opt/php72/php/man/ --with-config-file-path=/opt/php72/etc/  --with-mhash --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd --with-gd --with-iconv --with-zlib --enable-zip --enable-inline-optimization --disable-rpath --enable-shared --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-mbregex --enable-mbstring --enable-ftp --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --with-pear --with-gettext --enable-session --with-curl --with-openssl --with-jpeg-dir --with-freetype-dir --enable-opcache --enable-fpm  --enable-fileinfo 

4. Start compiling (if you switch the nts ts version, you need to run " make clean " and then rerun  configure   ) 

make  && make install
5. Compile extension

Download the extension source code and unzip it to the php source code ext directory, 
Enter the extension source code directory

6. Run phpize (multiple versions of php need to use the full path to run the corresponding version of phpize)

/opt/php72/bin/phpize

7. Run ./configure. Note that an error may be reported due to path problems. It is best to add --with-php-config.

./configure --with-php-config=/opt/php72/bin/php-config

8. Compile (if you switch to nts ts version, you need to run " make clean " and then rerun configure   ) 

make  && make install
The error I encountered
1. If phpinfo() finds that php.ini is not loaded  
Try   http://www.jb51.net/article/103087.htm    strace /usr/local/php7/sbin/php-fpm -i 2>1.log to query the php.ini file path (the new version of php reads and writes php first by default directory where the binary file is located)
2. Compilation errors occur. Consider whether the computer has multiple versions of php. PHP is loaded into other versions of php files. 




Guess you like

Origin blog.csdn.net/tangshangkui/article/details/80494198