fedora19 yum 安装php5.5.1 nginx1.4.2 mysql

安装mysql

首先输入如下命令:
yum install mysql mysql-server
系统将自动完成mysql安装

如果不仅仅在本机访问数据库需要注释#skip-networking
vi /etc/my.cnf

将mysql加入开机启动,并启动mysql

systemctl enable mysqld.service
systemctl start mysqld.service

mysql安装完成!

安装nginx 与 php

yum install nginx php php-fpm
如果 没有nginx可以从http://nginx.org/en/linux_packages.html添加nginx源到yum

配置nginx.conf使nginx支持php,去掉如下代码的注释
nano /etc/nginx/nginx.conf

location ~ .php{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME  /usr/share/nginx/htmlfastcgi_script_name;
include fastcgi_params;
}

将nginx设为开机启动,启动nginx

systemctl enable nginx.service
systemctl start nginx.service

将php设为开机启动,启动php

systemctl enable php-fpm.service
systemctl start php-fpm.service

创建测试文件

info.php
<php
phpinfo();