中文字幕日韩精品一区二区免费_精品一区二区三区国产精品无卡在_国精品无码专区一区二区三区_国产αv三级中文在线

unbuntu安裝PHP7&PHP-FPMnginxmysql

‍‍‍‍安裝之后的php管理位置在‍‍‍‍

$:cd/etc/init.d/ $:sudophp-fpm7.0{start|stop|status|restart|reload|force-reload}

創(chuàng)新互聯(lián)專注于樂東黎族網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠(chéng)為您提供樂東黎族營(yíng)銷型網(wǎng)站建設(shè),樂東黎族網(wǎng)站制作、樂東黎族網(wǎng)頁設(shè)計(jì)、樂東黎族網(wǎng)站官網(wǎng)定制、微信小程序服務(wù),打造樂東黎族網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供樂東黎族網(wǎng)站排名全網(wǎng)營(yíng)銷落地服務(wù)。安裝之后的nginx管理位置在

$:cd/etc/init.d/ $:sudo./nginx{start|stop|restart|reload|force-reload|status|configtest|rotate|upgrade}

nginx配置文件:

$:sudovi/etc/nginx/sites-available/default#虛擬主機(jī)默認(rèn)配置文件 $:sudovi/etc/nginx/nginx.conf#默認(rèn)配置文件

執(zhí)行文件:

/usr/sbin/php-fpm7.0 /usr/sbin/nginx Step 1 – Install PHP 7 & PHP-FPM

First install python-software-properties package on your system which provides add-apt-repository command then use the following set of commands to add PPA for PHP 7 in your Ubuntu system and install it.

$sudoapt-getinstallpython-software-properties $sudoadd-apt-repositoryppa:ondrej/php $sudoapt-getupdate $sudoapt-getinstall-yphp7.0php7.0-fpm

Step 2 — Install Nginx

First we will install Latest Nginx web server on our system. Use the following commands to add PPA for installing latest Nginx version on your Ubuntu 14.04 (Trusty).

$echo"debhttp://nginx.org/packages/mainline/ubuntu/`lsb_release-cs`nginx">>/etc/apt/sources.list $echo"deb-srchttp://nginx.org/packages/mainline/ubuntu/`lsb_release-cs`nginx">>/etc/apt/sources.list

and use the following commands to install Nginx web server.

$curlhttp://nginx.org/keys/nginx_signing.key|apt-keyadd- $sudoapt-getupdate $sudoapt-getinstallnginx

Step 3 — Install MySQL 5.6

Use the following commands to install or upgrade MySQL 5.6 on your Ubuntu systems. At the last update of this tutorial MySQL 5.6.27 is latest available MySQL version in series of MySQL 5.6.X.

$sudoadd-apt-repository-yppa:ondrej/mysql-5.6 $sudoapt-getupdate $sudoapt-getinstallmysql-server-5.6

Step 4 — Install Other Requirements

You may also need to install modules like PHP7-MySQL, etc based on your application requirements. Use the following command to find our available php 7 modules.

$sudoapt-cachesearchphp7-*

Above command will list all available PHP7 modules for installation, Let’s begin installation of modules.

$sudoapt-getinstallphp7.0-mysqlphp7.0-curlphp7.0-json

Step 5 — Configure PHP-FPM

PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features.

$sudonano/etc/php/7.0/fpm/php.ini

un-comment cgi.fix_pathinfo=1 line and set value to 0.

cgi.fix_pathinfo=0

Now set the listen parameter in /etc/php/7.0/fpm/pool.d/www.conf configuration file. Here you can use php7.0-fpm socket to work or start php7.0-fpm service on specific port. We are going to use it as service .

$sudonano/etc/php/7.0/fpm/pool.d/www.conf

Now make changes in configuration file as below. Commend listen with socket file and enable it as service

#listen=/run/php/php7.0-fpm.sock listen=127.0.0.1:9000

Step 6 — Configure Nginx VirtualHost

Finally do the configuration of Nginx virtualhost. For this example we are editing default configuration file.

$sudonano/etc/nginx/conf.d/default.conf

and make changes as below.

server{ listen80; root/var/www; indexindex.phpindex.htmlindex.htm; server_nameexample.comwww.example.com; location/{ try_files$uri$uri//index.html; } error_page404/404.html; error_page500502503504/50x.html; location=/50x.html{ root/usr/share/nginx/www; } location~.php${ try_files$uri=404; fastcgi_pass127.0.0.1:9000; fastcgi_indexindex.php; fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name; includefastcgi_params; } }

You have to do the same changes in all VirtualHosts configured.

Step 7 – Restart Services

After installing all services on your system, start all required services.

$sudoservicenginxrestart $sudoservicephp7.0-fpmrestart

Step 8 – Open Access in Firewall

If you are using iptables, Use following commands to open port 80 for public access of webserver.

Iptables Users:

$sudoiptables-AINPUT-mstate--stateNEW-ptcp--dport80-jACCEPT

UFW Users:

$sudoufwallow80/tcp

Step 9 – Verify Setup

Finally verify installation of PHP 7 with NGINX. Let’s create a file info.php on website document root using following content.
[php]
<?php
phpinfo();
?>
[/php]

Now browse this file in web browser. It will so all the details about version’s and installation.

分享文章:unbuntu安裝PHP7&PHP-FPMnginxmysql
分享路徑:http://m.rwnh.cn/article0/cpogio.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)頁設(shè)計(jì)公司網(wǎng)站排名、建站公司自適應(yīng)網(wǎng)站、定制開發(fā)、品牌網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站建設(shè)網(wǎng)站維護(hù)公司
巴里| 湘阴县| 巫溪县| 嘉善县| 万宁市| 通渭县| 尖扎县| 鲁山县| 襄垣县| 安泽县| 门源| 宣威市| 清流县| 于田县| 长沙市| 枣阳市| 龙泉市| 化隆| 望城县| 桃源县| 临朐县| 图木舒克市| 修武县| 汉川市| 双峰县| 宣威市| 浏阳市| 新泰市| 莱芜市| 和政县| 常山县| 南溪县| 社旗县| 邢台县| 钦州市| 北宁市| 哈巴河县| 盘山县| 昌乐县| 金沙县| 虞城县|