The operation step of building PHP development environment under Linux environment _php skill

Source: Internet
Author: User
Tags manual php development environment

This article mainly records the compilation of software/development environment through the installation process, other installation methods ignored!
article background:
Because PHP and Apache, such as the installation of a compile installation, but the way to compile the installation, you need to c,c++ the compilation environment,
Install Build-essential by apt method
$ sudo apt-get install build-essential
The steps for compiling the installation are generally divided into:
Compiling configuration
$./configure--xxx (parameter s)
problem with compiling configuration:
A, the software is not fully understood before the installation
b, if not fully understand, and do not know how to install (with which parameters)
C, you can first choose the simplest installation method, with the use of multiple installations to solve this problem
This process is more complex, requires a very complex configuration of specific parameters, specific parameters through configure--help view
Compile
$ make
Installation
$sudoMake install
**************************************
Apache Installation
1, download httpd-2.2.11.tar.gz
2, decompression
Tar zxvf httpd-2.2.11.tar.gz
Under the path of the tar instruction, a httpd-2.2.11 directory is generated
3, look at the compilation of configuration information
Switch to the httpd-2.2.11 directory after decompression
./configure--help
This step allows you to learn about the modules that you can install and the settings you need to install the configuration information
Read more about the manual, as well as the relevant information

4, compile the configuration
$./configure--prefix=/usr/local/apache2 \ Specify installation directory
--ENABLE-SO \ Allow use of external so module
--with-mpm=prefork URL Request Jump Policy
5, compile:
$ make
6, Installation: (using sudo is because the path to install/usr/local/apache2 not belong to personal path)
$ sudo make install
"Installation Completed"
7, testing
Modify Httpd.conf.
Modify the #ServerName www.example.com:80 to ServerName 127.0.0.1:80 (localhost:80)
Start sudo./apachectl-k start
Stop sudo./apachectl-k stop
Restart sudo./apachectl-k Restart (the command is sometimes invalid and replaced with Stop+start)

****************************************
PHP Installation

1, download php-5.2.8.tar.gz
2, decompression tar zxvf php-5.2.8.tar.gz
3, look at the compilation of configuration information
Switch to the httpd-2.2.11 directory after decompression
./configure--help
This step allows you to learn about the modules that you can install and the settings you need to install the configuration information
Read more about the manual, as well as the relevant information
4, compile the configuration
./configure--prefix=/home/guandl/webenv/php528 \
--enable-mbstring \
--with-apxs2=/usr/local/apache2/bin/apxs
5 Compiling
Make
6, installation
sudo make install
"Installation Completed"
7. Copy php.ini
Since the general installation of the PHP directory $php/lib under the PHP configuration file, you need to extract the php.ini-recommended directory to copy to the PHP lib directory
sudo cp Php.ini-recommended/home/guandl/webenv/php528/lib/php.ini
8, modify the Apache configuration file httpd.conf
Add a little bit of content
LoadModule Php5_module modules/libphp5.so is automatically generated when installing PHP
AddType application/x-httpd-php. php
9, testing
Write a PHP file, such as any.php
<?php
Phpinfo ();
?>
Put it in the Htdocs directory of Apache.
Restart Apache
http://127.0.0.1/any.php

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.