歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux管理 >> Linux維護

CentOS6.5系統中的yum如何安裝LAMP

CentOS6.5系統中LAMP是yum的一種常用環境,在CentOS6.5系統中的yum安裝LAMP的方法也是很簡單的,下面就來介紹一下CentOS6.5系統中的yum如何安裝LAMP,一起來看一下。

1、安裝源

rpm -Uvh http://mirrors.yun-idc.com/epel/6/x86_64/epel-release-6-8.noarch.rpm

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

2、更新並安裝基本庫

yum -y update

yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre pcre-devel

3、安裝Apache和mysql

yum --enablerepo=remi -y install mysql mysql-server mysql-devel httpd httpd-devel

chkconfig httpd on

chkconfig mysqld on

service mysqld start

mysql安全設置

mysql_secure_installation

mysql -u root -p 輸入密碼

建立你要用數據庫。。。

4、安裝php

yum --enablerepo=remi -y install php php-mysql php-common php-devel php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel

加密模塊

wget http://www.dmasoftlab.com/cont/download/ioncube_loaders_lin_x86-64.tar.gz

tar zxvf ioncube_loaders_lin_x86-64.tar.gz

cp -rf ioncube /usr/local/

sed -i ‘s/post_max_size = 8M/post_max_size = 50M/g’ /etc/php.ini

sed -i ‘s/upload_max_filesize = 2M/upload_max_filesize = 50M/g’ /etc/php.ini

sed -i ‘s/;date.timezone =/date.timezone = PRC/g’ /etc/php.ini

sed -i ‘s/; cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g’ /etc/php.ini

sed -i ‘s/max_execution_time = 30/max_execution_time = 300/g’ /etc/php.ini

sed -i ‘s/disable_functions =.*/disable_functions =passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server/g’ /etc/php.ini

echo “zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.4.so” 》》 /etc/php.ini

php加速模塊

wget http://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz

tar -zxvf xcache-3.2.0.tar.gz

cd xcache-3.2.0

phpize --clean

phpize

./configure --enable-xcache

make && make install

cat xcache.ini 》》 /etc/php.ini

vi /etc/httpd/conf/httpd.conf

將DirectoryIndex後添加index.php

service httpd start

5、測試

vi /var/www/html/index.php

<?php

phpinfo();

?>

在浏覽器輸入http://yourserverip/,看到phpinfo信息就OK。

以上就是CentOS6.5系統中的yum如何安裝LAMP的全部內容了,如果想要在CentOS中卸載LAMP,可以參考:CentOS卸載lamp環境的步驟。

Copyright © Linux教程網 All Rights Reserved