PHP Source Installation

Source: Internet
Author: User
Tags ldap mcrypt openldap

I put the downloaded package into the virtual machine/home directory, the virtual machine is centos6.4
If you want to know the Nginx source installation http://blog.csdn.net/zkg510168343/article/details/43703635
MySQL Source installation http://blog.csdn.net/zkg510168343/article/details/43284071
PHP Pre-installation, package
Libmcrypt Bag
Http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.bz2/download
Mhash
Http://sourceforge.net/projects/mhash/files/mhash/0.9.9.9/mhash-0.9.9.9.tar.bz2/download
MCrypt
Http://sourceforge.net/projects/mcrypt/files/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz/download
Php
Http://www.php.net
First to install several source package dependencies:
TAR-JXVF LIBMCRYPT-2.5.8.TAR.BZ2 # This package is bz2 using the-J parameter decompression
CD libmcrypt-2.5.8
./configure
Make && make install




####################################################
TAR-JXVF mhash-0.9.9.9.tar.bz2
CD mhash-0.9.9.9
./configure
Make && make install
# After the two packages are installed, make a soft connection to the/usr/lib, assuming that the next mcrypt depends on the two packages
Ln-s/usr/local/lib/libmcrypt*/usr/lib
Ln-s/usr/local/lib/libmhash.*/usr/lib/
Ln-s/usr/local/bin/libmcrypt-config/usr/bin/libmcrypt-config
###########################################################
TAR-ZXVF mcrypt-2.6.8.tar.gz
CD mcrypt-2.6.8
./configure
Make && make install
PHP Installation
Installation dependencies:
Yum–y Install libxml2-devel curl-devel libpng-devel openldap-devel
TAR-JXVF php-5.4.0.tar.bz2
CD php-5.4.0
./configure--prefix=/usr/local/php--with-mysql=/usr/local/mysql/--with-zlib--enable-xml--disable-rpath-- Enable-safe-mode--enable-bcmath--enable-shmop--enable-sysvsem--with-curl--with-curlwrappers--enable-fpm-- enable-fastcgi--with-mcrypt--with-gd--with-openssl--with-mhash--enable-sockets--with-ldap--WITH-LDAP-SASL-- With-xmlrpc-enable-zip--enable-soap
This step will have a variety of problems, mostly because of the lack of software
First, pre-compilation prompts for the first time
Configure:error: * * * Libmcrypt was not found
This is because of the problem of environment variables, GCC compile time according to their own defined variables to find the relevant function library and other files,
Libmcrypt is also just installed and is not defined in the variable, so add it manually:
[Email protected] modules]# export ld_library_path=/usr/local/lib: $LD _library_path
Compile again, error once again
Checking for CURL in default path ... not found
Configure:error:Please Reinstall the Libcurl distribution-
Easy.h should be in/include/curl/
This is the Curl Dev package that is not installed, the solution:
Yum-y Install Curl-devel
Compile again, error:
If Configure fails try--with-vpx-dir=<dir>
If Configure fails try--with-jpeg-dir=<dir>
Configure:error:png.h not found.
This is because libpng was not installed, so I executed the order.
Yum Install Libpng-devel
Compile again, still error
Configure:error:Cannot Find Ldap.h
Well, the missing OpenLDAP library.
Yum Install Openldap-devel
Continue compiling, or error
Configure:error:Cannot Find LDAP Libraries in/usr/lib.
This error usually occurs when compiling and installing PHP.
Here's how to fix it:
cp-frp/usr/lib64/libldap*/usr/lib/
Possible cause is the installation of a 64-bit system, under the LIB64 has this file, may not be in the Lib folder, so force replication once.


is about to collapse, and once again compile, when the advent of thanks you using the PHP interface, finally precompiled passed, here in fact, everyone encountered the error will not be the same, these are my compilation encountered problems
Perform make && do install feel it's time to end, the problem comes again
Prompt error:
/root/dev/php-5.4.0/sapi/cli/php:error while loading shared libraries:libmysqlclient.so.18:cannot open Shared object F Ile:no such file or directory
Make: * * * [ext/phar/phar.php] Error 127
The solution found online is
Ln-s/usr/local/mysql/lib/libmysqlclient.so.18/usr/lib/
After doing so still error, because this method is suitable for 32-bit system, 64-bit system should use the following line
Ln-s/usr/local/mysql/lib/libmysqlclient.so.18/usr/lib64/
Make && make install again
I also have PHP installed successfully
Here the entire LNMP has been installed. Let's configure PHP and Nginx to run the PHP site:
First create a configuration file for PHP:
CP Php.ini-production/usr/local/php/php.ini # If you are developing, copy Php.ini-development
Cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf
Ln-s/usr/local/php/bin/php/usr/bin/
Start PHP-FPM
/usr/local/php/sbin/php-fpm
NETSTAT-TUNLP | grep php-fpm
PHP-FPM start
Configuring Nginx and PHP
Find this paragraph, before adding index.php type
Location/{
root HTML;
Index index.php index.htm index.html;
}
Open this section of the note
Location ~ \.php$ {
root HTML;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param script_filename/usr/local/nginx/html/$fastcgi _script_name;Here directory is the Web server site code storage directory
Include Fastcgi_params;
}
Restart Nginx service Nginx restart after saving
Add index.php file to/usr/local/nginx/html
Inside Input <?php echo phpinfo ();? >
Access to the site 192.168.2.151 PHP configuration information, such a simple site is deployed, if you want to deploy multiple virtual sites on a single server, read: http://blog.csdn.net/zkg510168343/article/ details/42835109
Of course Nginx powerful, here is just a start

PHP Source Installation

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.