Recently encountered a strange problem, PHP use Curl_exec to access HTTPS Web page, return 502 error, Access HTTP Web page without problems, with Echo phpinfo (); View, support OpenSSL, support curl, online to find a lot of information, have not solved.
[Root@www ~]# php-vfailed loading/usr/local/zend/zendoptimizer.so: /usr/local/zend/zendoptimizer.so:undefined symbol:zend_throw_exception_internalphp Warning: PHP Startup:memcache:Unable to initialize Modulemodule compiled With module api=20060613php compiled with module Api=20090626these options need to match in Unknown on line 0PHP Warni NG: PHP startup:unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ Openssl.so '-/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/openssl.so:undefined symbol:zend_parse_ Parameters_none in Unknown on line 0
Using the #php-v view, prompting openssl.so load failure, seems certain to be related to the OpenSSL library. Reinstalling the OpenSSL library is still the problem. The reason is that the OpenSSL library used to Zend, see the above hint, display Zend Library also error. To process an estimate, you have to reinstall the Zend Library. Trouble, forget, do not let the source code compiled once PHP, say dry do it.
Download the PHP 5.5.0.tar.gz
#./configure --prefix=/usr --with-config-file-path=/etc --with-mysql=/usr/local/mysql/ -- With-mysqli=/usr/local/mysql/bin/mysql_config \--with-iconv-dir --with-freetype-dir -- With-jpeg-dir --with-png-dir --with-zlib--with-libxml-dir=/usr--enable-xml--disable-rpath \-- Enable-discard-path--enable-magic-quotes--enable-safe-mode--enable-bcmath--enable-shmop--enable-sysvsem-- Enable-inline-optimization \--with-curl--with-curlwrappers--enable-mbregex--enable-fastcgi--enable-fpm-- Enable-force-cgi-redirect--enable-mbstring--with-mcrypt \--enable-ftp--with-gd--enable-gd-native-ttf-- With-openssl--with-mhash--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip \--enable-soap--without-pear-- With-gettext--with-mime-magic# make zend_extra_libs= '-liconv ' # make test# make install required directory one is the MySQL installation directory, one is the The directory where the C10/>mysql_config is located.
Installation process may encounter some errors, the following is my installation encountered, the environment is not the same, each machine encountered problems will be different.
1, encountered error xpm.h not found
# yum Install libxpm-devel//Note X is uppercase
# yum Install libxext-devel//Note X is uppercase
2, encountered error Gmp.h not found
#yum Install GMP
#yum Install Gmp-devel
3, encountered error Error:utf8_mime2text () has a new signature, but U8t_canonical is missing. This should not happen
#yum Install Libc-client-devel
4, encountered error error:unable to detect ICU prefix Or/usr/bin/icu-config failed
#yum Install libicu*
#yum Install icu*
5, encountered error ERROR:ODBC header file '/usr/include/sqlext.h ' not found
#yum Install Unixodbc-devel
6. Encounter Error Error:cannot find Pspell
#yum Install Aspell-devel
7, encountered error Error:can not find recode.h anywhere under/usr/usr/local/usr/opt.
#yum Install Recode
#yum Install Recode-devel
8, encountered error error:could not find Net-snmp-config binary
#yum Install Net-snmp-devel
9. Encounter Error Error:cannot find Libtidy
#yum Install Libtidy-devel
PHP installation is complete, test the PHP page, the problem is still, finally looked carefully, phpinfo () function shows the version is 5.2.17, and I installed the 5.5.0, obviously Nginx server use or
Old PHP, did not enable my newly compiled installation of PHP, looked for a bit, the old PHP directory is/usr/local/bin/php, and my newly installed PHP directory is/usr/bin/php
Why not use the latest PHP, obviously related to the environment variable path, execute the command env, see
Path=/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
We can modify the/etc/profile file to put the last line of the file:
Export Path=/usr/local/mysql/bin: $PATH
Revision changed to
Export Path=/usr/local/mysql/bin:/usr/bin: $PATH
And then
# CD/ETC
# source profile Reloads the profiles file
Finally, test the PHP file, curl_exec can access the HTTPS file, and fetch the data.