Home  >  Article  >  Backend Development  >  ubuntu11.04上搭建php环境

ubuntu11.04上搭建php环境

WBOY
WBOYOriginal
2016-06-13 13:08:01777browse

ubuntu11.04下搭建php环境
这里只是搭建一个最基本的环境,很简单依次执行以下命令:

sudo apt-get install apache2
sudo apt-get install mysql-server
sudo apt-get install php5 libapache2-mod-php5 php5-mysql


最后建立软链接到/var/www/php
sudo ln -s /home/username/php /var/www/php

在/home/username/php中建立文件phpinfo.php
<?php
       phpinfo();
?>


重启apache2命令:
sudo /etc/init.d/apache2 restart


最后登录http://127.0.0.1/php/phpinfo.php查看各项配置信息。

经后开发可能用到的内容:

sudo apt-get install php5-gd
sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install mysql-client
sudo apt-get install libapache2-svn
//  在/etc/init.d/apache2/mods-enabled/php5.conf中添加下面一行
AddType application/x-httpd-php .php .phtml .php3 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn