First download apachesourcecode: www. apache. orgdyncloser. cgiconfigure: error: Cannotfindldaplibrariesinusrlibcp-frpusrlib64libldap * usrlibconfigure: error: CannotfindMySQLheaderfilesunderusrlocalmysqlgperf:
First download apache sourcecode: http://www.apache.org/dyn/closer.cgi configure: error: Cannot find ldap libraries in/usr/lib cp-frp/usr/lib64/libldap */usr/lib/configure: error: cannot find MySQL header files under/usr/local/mysql gperf:
First download apache sourcecode: http://www.apache.org/dyn/closer.cgi
Configure: error: Cannot find ldap libraries in/usr/lib
cp -frp /usr/lib64/libldap* /usr/lib/
Configure: error: Cannot find MySQL header files under/usr/local/mysql
Gperf:
Http://www.gnu.org/software/gperf/
Openssl and openssldevel installation:
Cannot find OpenSSL's
yum install openssl openssl-devel
Freetype. h not found.
yum install freetype-devel
Configure: error: Cannot find ldap. h
yum install openldapyum install openldap-devel
Install the required modules in apache:
Apr & apr-util: http://apr.apache.org/download.cgi
Download and use
Tar-xvzf # Extract
./configuremakemake install clear
Libmcrypt 2.5.x: http://mcrypt.hellug.gr/lib/index.html
tar -zxvf libmcrypt-2.5.7.tar.gz cd libmcrypt-2.5.7 mkdir -p /usr/local/libmcrypt ./configure prefix=/usr/local/libmcrypt/ make && make install
Uninstall old versions of apache, php, and mysql:
sudo yum erase httpdsudo yum erase php php-clisudo yum erase mysql
cd ~wget http://mirror.bjtu.edu.cn/apache/httpd/httpd-2.2.19.tar.bz2tar -jxvf httpd-2.2.19.tar.bz2cd httpd-2.2.19sudo yum install gcc./configure --prefix=/opt/httpd --enable-so --enable-rewritemakesudo make installsudo /opt/httpd/bin/httpd -k start
After installing apache, access http: // localhost in a browser. The instructions are properly displayed.
Download and install mysql,
Http://dev.mysql.com/downloads/mysql/#downloads
Download these two (64-bit): MySQL-client MySQL-server
sudo yum install libaiosudo rpm -i MySQL-client-5.5.13-1.rhel5.x86_64.rpmsudo rpm -i MySQL-server-5.5.13-1.rhel5.x86_64.rpmsudo /etc/init.d/mysql start/usr/bin/mysqladmin -u root password '1'sudo cp /usr/share/mysql/my-medium.cnf /etc/my.cnfsudo /etc/init.d/mysql restartmysql -uroot -p1
Download and compile PHP
http://php.net/downloads.phpsudo yum install libxml2 libxml2-devel curl curl-devel libjpeg libjpeg-devel libpng libpng-devel libmcrypt libmcrypt-devel libtool-ltdl-develtar -jxvf php-5.3.6.tar.bz2cd php-5.3.6./configure --prefix=/opt/php -with-apxs2=/opt/httpd/bin/apxs --with-curl --with-mcrypt --enable-mbstring --with-iconv --with-gd -with-jpeg-dir=/usr/local/lib --enable-pdo --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlndmakesudo make installsudo cp php.ini-development /opt/php/lib/php.inisudo ln -s /opt/php/bin/php /usr/bin/phpsudo vi /opt/php/lib/php.ini
If you need apache to have the fastcgi function, the compilation option is:
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-gd --enable-gd-native-ttf --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --without-pea
Delete the semicolon before include_path and change it to include_path = "/opt/php/lib/php"
sudo vi /opt/httpd/conf/httpd.conf
Add an AddHandler application/x-httpd-php. php line at the bottom
sudo /opt/httpd/bin/httpd -k restartsudo vi /opt/httpd/htdocs/phpinfo.php
The content of phpinfo. php is as follows:
After installing php, restart apache and use a browser to access http: // localhost/phpinfo. php. If it is displayed normally, php is installed. Search for mysqlnd, pdo_mysql, and mysqli. If yes, php can access mysql.
Common PHP configurations
Http://www.cnblogs.com/sink_cup/archive/2011/10/28/php_ini.html
Add apache to the system service and start it on startup.
sudo cp /opt/httpd/bin/apachectl /etc/init.d/httpdsudo vi /etc/init.d/httpd
Add the following lines at the beginning of the file:
#!/bin/sh# chkconfig: 2345 85 15# description: Apache is a World Wide Web server. sudo chmod +x /etc/init.d/httpdsudo /sbin/chkconfig --add httpdsudo /sbin/chkconfig --list httpdsudo ln -s /sbin/chkconfig /usr/bin/chkconfigsudo ln -s /sbin/service /usr/bin/service
Add mysql to the system service and start it on startup
sudo /sbin/chkconfig --list mysql
Mysql installed through rpm has been started on its own.
Install php extension ssh2
http://sourceforge.net/projects/libssh2/./configuremakesudo make install
Install ssh2 again
http://pecl.php.net/package/ssh2/opt/php/bin/phpize && ./configure --with-ssh2 && makesudo make install
Add one line in/opt/php/lib/php. ini:
extension=ssh2.so
Install the Chinese Input Method for centos 6.2
Yum install "@ Chinese Support" // install the Chinese Input Method
1) Configure: error: xml2-config not found. Please check your libxml2 installation.
Solutions:
Quote :#Yum installLibxml2Libxml2-devel(For Redhat & Fedora)
# Aptitude install libXml2-Dev (For ubuntu)
2) Checking for pkg-config... /Usr/bin/pkg-config
Configure: error: Cannot find OpenSSL's
Solutions:
Quote :#Yum installOpensslOpenssl-devel
3) Configure: error: Please reinstall the BZip2 distribution
Solutions:
Quote :#Yum installBzip2Bzip2-devel
4) Configure: error: Please reinstall the libcurl distribution-
Easy. h shoshould be in /Include/curl/
Solutions:
Quote :#Yum installCurlCurl-devel (For Redhat & Fedora)
# Install libcurl4-gnutls-dev (For Ubuntu)
5) Configure: error: libjpeg. (also) not found.
Solutions:
Quote :#Yum installLibjpegLibjpeg-devel
6) Configure: error: libpng. (also) not found.
Solutions:
Quote :#Yum installLibpngLibpng-devel
7) Configure: error: freetype. h not found.
Solutions:
Quote :#Yum install freetype-devel
8) Configure: error: Unable to locate gmp. h
Solutions:
Quote :#Yum install gmp-devel
9) Configure: error: Cannot find MySQL header files under/usr.
Note that the MySQL client library is not bundled anymore!
Solutions:
Quote :#Yum install mysql-devel (For Redhat & Fedora)
# Apt-get install libmysql ++-dev (For Ubuntu)
10) Configure: error: Please reinstall the ncurses distribution
Solutions:
Quote :#Yum installNcursesNcurses-devel
11) Checking for unixODBC support... Configure: error: ODBC header file '/usr/include/sqlext. H' not found!
Solutions:
Quote :#Yum install unixODBC-devel
12) Configure: error: Cannot find pspell
Solutions:
Quote :#Yum install pspell-devel
13) configure: error: mcrypt. h not found. Please reinstall libmcrypt.
Solutions:
Quote :#Yum install libmcrypt-devel (For Redhat & Fedora)
# Apt-get install libmcrypt-dev
14) Configure: error: snmp. h not found. Check your SNMP installation.
Solutions:
Quote:
#Yum installNet-snmpNet-snmp-devel