Install PHP5-PHP Tutorial

Source: Internet
Author: User
Tags zts
The installation steps of LinuxPHP5 are described in detail. How can we install PHP5 in Linux? Here we will introduce in detail the installation of LinuxPHP5. After the server runs for a period of time, it may suddenly need to add an extension, such as curl and p. how can we install PHP5 in Linux? Here we will introduce in detail the installation of Linux PHP5. After the server runs for a period of time, it may suddenly need to add an extension, such as curl, pdo, and xmlrpc. This requires that the extension be added independently without re-compiling PHP.

The following uses curl installation as an example to describe how to install Linux PHP5.

1. install crul wget http://curl.haxx.se/download/curl-7.19.6.tar.gz tar-zxvf curl-7.19.6.tar.gz cd curl-7.19.6./configure -- prefix =/usr/local/curl

 
 
  1. make
  2. make install

2. Compile and generate extensions and enter the ext directory in the php source code directory. the source code of each extension module is stored here. select the required module, such as the curl module:

 
 
  1. cd curl

Run phpize to generate the compilation file. when phpize runs in the bin directory of the PHP installation directory/usr/local/php5/bin/phpize, the following error may be reported: Cannot find autoconf. please check your autoconf installation and the $ PHP_AUTOCONF environment variable is set correctly and then rerun this script. ", you need to install autoconf: yum install autoconf (RedHat or CentOS), apt-get install autoconf (Ubuntu Linux) to generate the configuration file, and compile and generate the module:

 
 
  1. /usr/local/php5/bin/phpize
  2. ./configure --with-curl=/usr/local/curl --with-php-config=/usr/local/php5/bin/php-config
  3. make
  4. make install

In this way, curl. so is copied to the corresponding PHP Directory (such as:/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626 /)

3. modify the configuration in php. ini and set the extension directory:

 
 
  1. extension_dir = "/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/"

Add extension module reference:

 
 
  1. extension = curl.so

4. check and restart Apache

 
 
  1. /usr/local/php/bin/php -v

When executing this command, php will check whether the configuration file is correct. if there is a configuration error, an error will be reported here. you can check the error according to the error information. The preceding steps are used to install Linux PHP5.


Why? Here we will introduce in detail the installation of Linux PHP5. After the server runs for a period of time, it may suddenly need to add an extension, such as curl, p...

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.