白森 发表于 2015-8-20 11:14:51

Linux 配置 LAMP 环境

  一、linux环境是debian系统的话,可以用下面的方法:
  只需要一条命令就oK了:
  apt-get install apache2 mysql-server mysql-client php5 php5-gd php5-mysql
  
  重启apache2:
  cd /etc/init.d/
  sudo ./apache2 restart
  安装完成后的phpmyadmin
  sudo apt-get install phpmyadmin
  在/usr/share/phpmyadmin/下,如果想使用phpmyadmin的话,需要使用sudo ln -s /usr/share/phpmyadmin/ /var/www
  
  http://blog.iyunv.com/wbryfl/article/details/6607223
  
  php安装路径:/usr/lib/php5/   配置文件路径:/etc/php5/
  apache安装路径:/usr/lib/apache2/  配置文件路径:/etc/apache2/
  
  二、如果系统是redhat的话:
  下面安装完以后一定要关闭SELinux!!!
  安装mysql并启动
  1、yum install mysql mysql-server
  2、chkconfig --levels 235 mysqld on
  3、/etc/init.d/mysqld start
  4、mysqladmin -u root -p password yourrootsqlpassword
  mysqladmin -h server1.example.com -u root password yourrootsqlpassword
  安装apache并启动
  1、yum install httpd
  2、chkconfig –levels 235 httpd on
  3、/etc/init.d/httpd start
在CentOS里Apache的默认文档路径的位置是在/var/www/html,配置文件的路径是/etc/httpd/conf/httpd.conf。其他的配置存储在/etc/httpd/conf.d/ 文件夹里。

  
  安装php
  1、yum install php
  3、yum search php
  4、yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
  5、/etc/init.d/httpd restart
  http://www.51testing.com/?uid-311499-action-viewspace-itemid-807468
  http://os.iyunv.com/art/201103/248774.htm
  安装phpmyadmin
  1、下载phpmyadmin,http://www.phpmyadmin.net/home_page/downloads.php
  2、解压后copy到/var/www/html/文件夹下面
  
  
  
页: [1]
查看完整版本: Linux 配置 LAMP 环境