Ubuntu系统安装php开发环境

1:安装php5,和php5-fpm



2:安装nginx

Ubuntu系统安装php开发环境_第1张图片

配置nginx支持php,只需要设置下图中红色区域即可

Ubuntu系统安装php开发环境_第2张图片

3:安装MySQL

Ubuntu系统安装php开发环境_第3张图片

给MySQL的root用户设置密码

Ubuntu系统安装php开发环境_第4张图片

4:绑定本地hosts

   vim /etc/hosts 



  编辑后,你需要重新启动一下你的网络。 

     /etc/init.d/networkingrestart


5:php代码测试

index.php

<?

  phpinfo();

?>

Ubuntu系统安装php开发环境_第5张图片

到此,lnmp环境搭建完成



你可能感兴趣的:(PHP,mysql,nginx,ubuntu,php5)