日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

yum安装nginx php mysql_yum安装nginx+mysql+php

發布時間:2024/9/3 数据库 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 yum安装nginx php mysql_yum安装nginx+mysql+php 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

使用yum安裝lnmp,nginx,php,mysql。這里給大家一個簡單安裝lnmp的方法,對于初學者來說,可以快速高效搭建一個lnmp開發環境。

目錄

Nginx + MySQL + PHP安裝文檔

一、Install

二、Configure

1、修改nginx配置文件nginx.conf

三、Testing

1、檢查php可用,建立hello.php

2、檢查可連接mysql,建立test_mysql.php

3、輸入網址ip/hello.php 和ip/test_mysql.php

四、Error solution

1、libprotobuf-lite.so.6 : cannot found

2、libJudy.so.1 : cannot found

3、Requires: GeoIP Requires: libGeoIP.so.1()(64bit)

環境 –> CentOS6.2 : Nginx + MySQL + PHP

‘◆’代表命令行執行

一、Install

1

2

3

4

5

◆wgethttp://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

◆rpm-ivhnginx-release-centos-6-0.el6.ngx.noarch.rpm

◆yuminstallmysqlmysql-serverphpphp-mysqlphp-fpmnginx

二、Configure

1、修改nginx配置文件nginx.conf

◆vi /etc/nginx/nginx.conf

找到此處:這樣改寫

1

2

3

4

5

6

7

8

9

10

location~\.php${

set$web_root/usr/share/nginx/html;

root$web_root;

fastcgi_pass127.0.0.1:9000;

fastcgi_indexindex.php;

fastcgi_paramSCRIPT_FILENAME$web_root$fastcgi_script_name;

includefastcgi_params;

}

三、Testing

1、檢查php可用,建立hello.php

◆vi /usr/share/nginx/html/hello.php

1

2

3

4

5

phpinfo();

?>

2、檢查可連接mysql,建立test_mysql.php

◆vi /usr/share/nginx/html/test_mysql.php

1

2

3

4

5

6

7

8

9

10

11

12

$con=mysql_connect("localhost","root","");

if(!$con)

{die('Could not connect: '.mysql_error());}

mysql_select_db("mysql",$con);

$result=mysql_query("SELECT * FROM user");

while($row=mysql_fetch_array($result))

{echo$row['User']." ".$row['Password'];echo"
";}

mysql_close($con);

?>

3、輸入網址ip/hello.php 和ip/test_mysql.php,查看結果

hello.php:

test_mysql.php:

四、Error solution

1、libprotobuf-lite.so.6 : cannot found

1

2

3

4

◆wgetftp://ftp.is.co.za/mirror/fedora.redhat.com/epel/6/x86_64/protobuf-lite-2.3.0-7.el6.x86_64.rpm

yuminstallprotobuf-lite-2.3.0-7.el6.x86_64.rpm

2、libJudy.so.1 : cannot found

1

2

3

4

◆wgetftp://ftp.is.co.za/mirror/fedora.redhat.com/epel/6/x86_64/Judy-1.0.5-1.el6.x86_64.rpm

yuminstallJudy-1.0.5-1.el6.x86_64.rpm

3、Requires: GeoIP Requires: libGeoIP.so.1()(64bit)

http://pkgs.repoforge.org/geoip/

1

2

3

4

◆wgethttp://pkgs.repoforge.org/geoip/geoip-1.4.6-1.el6.rf.x86_64.rpm

◆rpm–ivhgeoip-1.4.6-1.el6.rf.x86_64.rpm

總結

以上是生活随笔為你收集整理的yum安装nginx php mysql_yum安装nginx+mysql+php的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。