Source code Compile Install PHP5.5.0, resolve curl_exec Access HTTPS return 502 error problem (modify path Path)

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

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.

[Plain]View PlainCopy 
  1. [Email protected] ~]# php-v
  2. Failed loading/usr/local/zend/zendoptimizer.so:/usr/local/zend/zendoptimizer.so:undefined symbol:zend_throw_ Exception_internal
  3. PHP warning:php Startup:memcache:Unable to initialize module
  4. Module compiled with module api=20060613
  5. PHP compiled with module api=20090626
  6. These options need to match
  7. In Unknown on line 0
  8. PHP warning:php startup:unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ Openssl.so '
  9. -/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

[HTML]View PlainCopy 
  1. ./configure '--prefix=/usr/local/php '--with-config-file-path=/usr/local/php/etc '--with-mysql=/usr /local/mysql ' \
  2. '--with-mysqli=/usr/local/mysql/bin/mysql_config '--with-iconv-dir '--with-freetype-dir '--with-jpeg-dir ' --with-png-dir '--with-zlib ' \
  3. '--with-libxml-dir=/usr '--enable-xml '--disable-rpath '--enable-discard-path '--enable-magic-quotes '-- Enable-safe-mode '--enable-bcmath ' \
  4. '--enable-shmop '--enable-sysvsem '--enable-inline-optimization '--with-curl '--with-curlwrappers '-- Enable-mbregex '--enable-fastcgi ' \
  5. '--enable-fpm '--enable-force-cgi-redirect '--enable-mbstring '--with-mcrypt '--enable-ftp '--with-gd '-- Enable-gd-native-ttf '--with-openssl ' \
  6. '--enable-exif '--with-mhash '--enable-pcntl '--enable-sockets '--with-xmlrpc '--enable-zip '-- Without-pear '--with-gettext ' \
  7. '--with-mime-magic ' php_sapis="CLI CGI"
  8. # make zend_extra_libs='-liconv '
  9. # Make Test
  10. # make Install
  11. Directories that need to be specified one is the MySQL installation directory, and one is the directory where the Mysql_config resides.



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.

http://blog.csdn.net/langeldep/article/details/44227973

Source code Compile install PHP5.5.0, resolve curl_exec Access HTTPS return 502 error problem (modify path Path)

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.