Ubuntu 16.04上安装Lighttpd+PHP 7(PHP(2)

这将创建符号链接
/etc/lighttpd/conf-enabled/10-fastcgi.conf 指向/etc/lighttpd/conf-available/10-fastcgi.conf
/etc/lighttpd/conf-enabled/15-fastcgi-php.conf 指向 /etc/lighttpd/conf-available/15-fastcgi-php.conf

ls -l /etc/lighttpd/conf-enabled

执行情况:

root@server1:/etc/lighttpd/conf-available# ls -l /etc/lighttpd/conf-enabled total 0 lrwxrwxrwx 1 root root 33 Apr 27 11:26 10-fastcgi.conf -> ../conf-available/10-fastcgi.conf lrwxrwxrwx 1 root root 37 Apr 27 11:26 15-fastcgi-php.conf -> ../conf-available/15-fastcgi-php.conf lrwxrwxrwx 1 root root 42 Apr 21 11:10 90-javascript-alias.conf -> ../conf-available/90-javascript-alias.conf root@server1:/etc/lighttpd/conf-available#

重新加载Lighttpd:

service lighttpd force-reload

注意:如果提示你的语言环境错误,那么你可以下面的命令删除错误:

apt-get -y install language-pack-en-base
dpkg-reconfigure locales

6、建立一个探针文件看看安装情况:

nano /var/www/html/info.php

内容:

<?php phpinfo(); ?>

好了,浏览器访问这个探针文件:

7、PHP 获得 MySQL 支持

产看模块:

apt-cache search php7.0

安装模块:

apt-get -y install php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php-gettext

apt-get -y install php-apcu

重新加载php7.0-fpm:

service php7.0-fpm reload

8、安装phpmyadmin

命令:

apt-get -y install phpmyadmin

安装过程中询问设置:

Web server to reconfigure automatically: Configure database for phpmyadmin with dbconfig-common? MySQL application password for phpmyadmin:

如果出现错误:
Run /etc/init.d/lighttpd force-reload to enable changes
dpkg: error processing package phpmyadmin (–configure):
subprocess installed post-installation script returned error exit status 2
E: Sub-process /usr/bin/dpkg returned an error code (1)
运行下面的命令:

/etc/init.d/lighttpd force-reload
apt-get -y install phpmyadmin
然后访问 phpMyAdmin 浏览器输入:

9、使PHP-FPM使用TCP连接(可选)

编辑:
ano /etc/php/7.0/fpm/pool.d/www.conf

内容如下:

[...] ;listen = /var/run/php/php7.0-fpm.sock listen = 127.0.0.1:9000 [...]

重新加载PHP-FPM:

service php7.0-fpm reload

再配置一个文件:

nano /etc/lighttpd/conf-available/15-fastcgi-php.conf

配置内容如下:

# /usr/share/doc/lighttpd-doc/fastcgi.txt.gz # :ConfigurationOptions#mod_fastcgi-fastcgi ## Start an FastCGI server for php (needs the php7.0-cgi package) fastcgi.server += ( ".php" => (( "host" => "127.0.0.1", "port" => "9000", "broken-scriptfilename" => "enable" )) )

重新加载 Lighttpd:
service lighttpd force-reload

Ubuntu 16.04 上怎样试用 Mir 和 Unity 8 

Ubuntu 16.04 LTS正式发布下载,长达5年技术支持 

Ubuntu 16.04 U盘安装图文教程

Ubuntu 16.04 LTS安装好需要设置的15件事

Ubuntu 16.04 LTS 今日发布 Canonical公布系统新特性

将Ubuntu 15.10升级到Ubuntu 16.04 

Ubuntu 16.04安装Lua游戏引擎Love

Ubuntu 16.04 需要你的帮助,让 GNOME Software 更美观

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/618bde756a928c7f429136280ea8e1ff.html