LAMP

# Apache
version:2.4 source code
yum -y install apr* gcc-c++ make pcre-devel zlib-devel
tar -xvf httpd-2.4.37.tar.gz
cd httpd-2.4.37
./configure --prefix=/usr/local/httpd --enable-so --enable-cgi --enable-rewrite --enable-charset-lite --enable-deflate && make && make install
cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
sed -i -e '2s/#/#chkconfig: 2345 85 32/' /etc/init.d/httpd 
chkconfig httpd on
sed -i -e 's/#ServerName/ServerName/' httpd.conf
/etc/init.d/httpd start
ln -s /usr/local/httpd/bin/* /usr/local/bin

# Php
version:7.2 source code

yum -y install gd gd-devel libpng libpng-devel libjepg libjepg-devel mysql-devel gcc gcc-c++ autoconf httpd-manual mod_perl mod_auth_mysql httpd
	   mysql-connector-odbc libdbi-dbd-mysql net-snmp-devel curl-devel unixODBC-devel java-devel openldap openldap-devel ncurses-devel httpd-devel
	   libxml2-devel
tar -xvf php-7.2.11.tar.gz 
cd php-7.2.11
./configure --prefix=/usr/local/php7 --with-apxs2=/usr/bin/apxs --with-pdo-mysql=/usr/bin/mysql --with-openssl --enable-sockets --enable-sysvshm 
--with-mysqli=/usr/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-libxml-dir=/usr 
--enable-xml --with-mhash --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-curl --with-gd --with-gettext --enable-bcmath --enable-opcache
make && make install
cd /root/php-7.2.11/php.ini-production /etc/php.ini

vim /etc/httpd/conf/httpd.conf

<IfModule dir_module>
    DirectoryIndex index.html index.php  #添加index.php
</IfModule>

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php   #添加这一句

# Mysql
version:5.7 yum

yum -y install mysql-community-server


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值