码迷,mamicode.com
首页 > 数据库 > 详细

linux-apache-mysql-php

时间:2018-03-17 18:52:12      阅读:257      评论:0      收藏:0      [点我收藏+]

标签:lanp

CentOS release 6.5 (Final)x86_64

apache:
wget http://archive.apache.org/dist/httpd/httpd-2.2.27.tar.gz
tar cd
./configure --prifix=/application/apache2.2.27 --enable-deflate --enable-expires --enable-headers --enable-modules=most --enable-so --with-mpm=worker --enable-rewrite
yum install -y zlib-devel
make && make install
ln -s /application/apache2.2.27/ /application/apache
ll /application/apache/conf/httpd.conf
/application/apache/bin/apachectl -t
/application/apache/bin/apachectl graceful
ps -ef|grep httpd

mqsql
wget https://downloads.mysql.com/archives/get/file/mysql-5.1.68.tar.gz
tar cd
./configure --prefix=/application/mysql5.1.68/ --with-unix-socket-path=/application/mysql5.1.68/tmp/mysql.sock --localstatedir=/application/mysql5.1.68/data --enable-assembler --enable-thread-safe-client --with-mysqld-user=mysql --with-big-tables --without-debug --with-pthread --enable-assembler --with-extra-charsets=complex --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-plugin-PLUGIN
echo $?
yum install -y ncurses-devel
make && make install
/home/oldboy/mysql-5.1.68/support-files/my-small.cnf /etc/my.cnf
/application/mysql/bin/mysql_install_db --basedir=/application/mysql --datadir=/application/mysql/data --user=mysql
/home/oldboy/mysql-5.1.68/support-files/mysql.server /etc/init.d/mysqld
登陆mysql测试

php
1.php依赖包
yum install -y zlib libxml libpng libjpeg freetype gd curl libiconv zlib-devel libxml2-devel libpng-devel libjpeg-devel freetype-devel gd-devel curl-devel libcronv-devel openssl-devel libcurl-devel libxslt-devel
2.php包
http://php.net/get/php-5.3.27.tar.gz/from/a/mirror下到本地,传到用户家目录
tar xf php-5.3.27.tar.gz
cd php-5.3.27
./configure --prefix=/application/php5.3.27 --with-apxs2=/application/apache/bin/apxs --with-mysql=/application/mysql --with-xmlrpc --with-openssl --with-zib --with-freetype-dir --with-gd --with-jpeg-dir --with-png-dir --with-iconv=/usr/local/libiconv --enable-short-tags --enable-sockets --enable-zend-multibyte --enable-soap --enable-mbstring --enable-gd-native-ttf --with-curl --with-xsl --enable-ftp --with-libxml-dir
make
make install
ln -s /application/php5.3.27 /application/php
cp php.ini-production /application/php/lib/php.ini
/application/apache/conf/httpd.conf 修改apache的
·LoadModule php5_module modules/libphp5.so
·User www
·Group www
·ServerName 127.0.0.1:80
·DirectoryIndex index.php index.html
useradd -M -s /sbin/nologin www
/application/apache/bin/apachectl graceful
测试浏览器--index.html>>apache--index.php>>php--php脚本>>mysql

php脚本内容
<?php
$link_id=mysql_connect(‘localhost‘,‘root‘,‘123456‘) or mysql_error();

    if ($link_id) {
                    echo "php-->mysqk successful";
    }else{
                    echo "php ->mysql error()";
    }

?>

linux-apache-mysql-php

标签:lanp

原文地址:http://blog.51cto.com/11773959/2087956

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!