Configure remote server php environment --- php1. Download php: cn2.php.netgetphp-5.5.8.tar.gz fromamirror2. install #. configure -- disable-rpath -- prefixusrlocalphp5 -- with-mysqlusrlocalmysql -- withz configure remote server php environment --- php
1. Download php: http://cn2.php.net/get/php-5.5.8.tar.gz/from/a/mirror
2. Installation
#./configure --disable-rpath --prefix=/usr/local/php5 --with-mysql=/usr/local/mysql --withz apxs2=/usr/local/apache/bin/apxs --with-mysql --disable-fileinfo#make#make install
? 3. configuration
?
?
#cd /usr/local/src/php-5.5.8#cp php.ini-development /usr/local/php5/lib/php.ini#vi /usr/local/apache/conf/httpd.conf
? ? Modify the apache configuration file
?
? (1) ServerName ?? 192.168.0.205: 80
? (2) add AddType application/x-httpd-php. php
? ? (3) search for DirectoryIndex index.html and add index. php intermediate addition, no.
?
#cd /usr/local/apache/bin/#./apachectl restart
?
4. Problems and Solutions
? (1) make: *** No targets specified and no makefile found. Stop.
?
1、wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz2.、tar zxvf ncurses-5.6.tar.gz3、 ./configure -prefix=/usr/local -with-shared -without-debug4、make5、make install
?
? (2) configure error xml2-config not found. please check your libxml2 installation
?
Check if the libxm package is installed # rpm-qa | grep libxml2libxml2-2.6.26-2.1.12libxml2-python-2.6.26-2.1.12 reinstalls libxml2 and the libxml2-devel package, when yum is installed, it is found that the new version will prompt updates, you need to update can be updated, do not skip this step. # Yum install libxml2 # yum install libxml2-devel-y find the xml2-config file after installation # find/-name "xml2-config"/usr/bin/xml2-config
?? See http://blog.chinaunix.net/uid-26719405-id-3409842.html
? (3) configure: error: Cannot find MySQL header files under/usr/include/mysql.
?
# Find/-name mysql. h // check whether the installation exists # yum install MySQL-devel * Note: After the installation is complete, add a path -- with-mysql after./configure.
? ? See http://blog.csdn.net/sunnyzhangwenhan/article/details/8517463
?
(4) virtual memory exhausted: Cannot allocate memory
?
# dd if=/dev/zero of=/swap bs=1024 count=1MFormat the swap file:# mkswap /swapEnable the swap file:# swapon /swapEnable swap on boot:# echo "/swap swap swap sw 0 0" >> /etc/fstab
? ? (5) make: *** [ext/fileinfo/libmagic/apprentice. lo] Error 1
? ? This is because the memory is less than 1 GB. add the option "-disable-fileinfo" to./configure.
?
?
?
?
?
?