Source code compiled install PHP5.5.0, resolve curl_exec Access HTTPS return 502 error problem

Source: Internet
Author: User
Tags gmp openssl library phpinfo recode snmp zts nginx server zend

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.


[Email protected] ~]# 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 unkn Own on line 0PHP Warning:  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 need to specify directory one is the MySQL installation directory, one is  mysql_ The directory where 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.





Source code compiled install PHP5.5.0, resolve curl_exec Access HTTPS return 502 error problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.