在 Ubuntu Server 14.04 下安装 PHP 5.5.9
PHP(英文名: Hypertext Preprocessor,中文名:“超文本预处理器”)是一种通用开源脚本语言。语法吸收了 C 语言、Java 和 Perl 的特点,利于学习,使用广泛,主要适用于 Web 开发领域。
PHP 独特的语法混合了 C、Java、Perl 及 PHP 自创的语法。它可以比 CGI 或者 Perl 更快速地执行动态网页。PHP 是将程序嵌入到 HTML 文档中执行,用 PHP 做出的动态页面与其他的编程语言相比,执行效率比完全生成 HTML 标记的 CGI 要高很多;PHP 还可以执行编译后代码,编译可达到加密、优化代码运行目的,使代码运行更快。
PHP 原为 Personal Home Page 的缩写,已正式更名为 "PHP: Hypertext Preprocessor"。注意不是 “Hypertext Preprocessor” 的缩写,这种将名称放到定义中的写法被称作递归缩写。PHP 于 1994 年由 Rasmus Lerdorf 创建,刚开始 Rasmus Lerdorf 是为了维护个人网页而制作的一个简单的用 Perl 语言编写的程序。这些工具程序用来显示 Rasmus Lerdorf 的个人履历,以及统计网页流量。后来又用 C 语言重新编写,包括可以访问数据库。他将这些程序和一些表单直译器整合起来,称为 PHP/FI。PHP/FI 可以和数据库连接,产生简单的动态网页程序。
百度网盘
https://pan.baidu.com/s/1i5tKlZB
软件仓库
https://github.com/digitser
https://digitser.sourceforge.io/
https://pan.baidu.com/s/1TV70__Be1ta0ney1-tudFQ
高效智能 所见即所得的 "HTML5 Bootstrap4 网页 IDE" 网站站群 集成开发环境
http://ideweb.digitser.cn/ http://forum.digitser.cn/thread-2153-1-1.html
1、安装 PHP5-fpm 5.5.9- root:# apt-get install php5-fpm
- 正在读取软件包列表... 完成
- 正在分析软件包的依赖关系树
- 正在读取状态信息... 完成
- 下列软件包是自动安装的并且现在不需要了:
- linux-headers-3.13.0-37 linux-headers-3.13.0-37-generic
- linux-headers-3.13.0-39 linux-headers-3.13.0-39-generic
- linux-image-3.13.0-37-generic linux-image-3.13.0-39-generic
- linux-image-extra-3.13.0-37-generic linux-image-extra-3.13.0-39-generic
- Use 'apt-get autoremove' to remove them.
- 将会安装下列额外的软件包:
- php5-common php5-json
- 建议安装的软件包:
- php5-user-cache php-pear
- 下列【新】软件包将被安装:
- php5-common php5-fpm php5-json
- 升级了 0 个软件包,新安装了 3 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
- 需要下载 2,667 kB 的软件包。
- 解压缩后会消耗掉 10.6 MB 的额外空间。
- 您希望继续执行吗? [Y/n] y
- 获取:1 [url]http://cn.archive.ubuntu.com/ubuntu/[/url] trusty/main php5-json amd64 1.3.2-2build1 [34.4 kB]
- 获取:2 [url]http://cn.archive.ubuntu.com/ubuntu/[/url] trusty-updates/main php5-common amd64 5.5.9+dfsg-1ubuntu4.5 [442 kB]
- 获取:3 [url]http://cn.archive.ubuntu.com/ubuntu/[/url] trusty-updates/universe php5-fpm amd64 5.5.9+dfsg-1ubuntu4.5 [2,191 kB]
- 下载 2,667 kB,耗时 3秒 (713 kB/s)
- Selecting previously unselected package php5-json.
- (正在读取数据库 ... 系统当前共安装有 311042 个文件和目录。)
- Preparing to unpack .../php5-json_1.3.2-2build1_amd64.deb ...
- Unpacking php5-json (1.3.2-2build1) ...
- Selecting previously unselected package php5-common.
- Preparing to unpack .../php5-common_5.5.9+dfsg-1ubuntu4.5_amd64.deb ...
- Unpacking php5-common (5.5.9+dfsg-1ubuntu4.5) ...
- Selecting previously unselected package php5-fpm.
- Preparing to unpack .../php5-fpm_5.5.9+dfsg-1ubuntu4.5_amd64.deb ...
- Unpacking php5-fpm (5.5.9+dfsg-1ubuntu4.5) ...
- Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
- Processing triggers for ureadahead (0.100.0-16) ...
- 正在设置 php5-common (5.5.9+dfsg-1ubuntu4.5) ...
- Creating config file /etc/php5/mods-available/pdo.ini with new version
- php5_invoke: Enable module pdo for fpm SAPI
- Creating config file /etc/php5/mods-available/opcache.ini with new version
- php5_invoke: Enable module opcache for fpm SAPI
- 正在设置 php5-fpm (5.5.9+dfsg-1ubuntu4.5) ...
- Creating config file /etc/php5/fpm/php.ini with new version
- php5_invoke opcache: already enabled for fpm SAPI
- php5_invoke pdo: already enabled for fpm SAPI
- php5-fpm start/running, process 10370
- 正在设置 php5-json (1.3.2-2build1) ...
- php5_invoke: Enable module json for fpm SAPI
- Processing triggers for ureadahead (0.100.0-16) ...
- root:#
复制代码 2、查看要安装哪些 php5 相关软件包,并安装
- root:# apt-cache search php5
- libapache2-mod-php5 - server-side, HTML-embedded scripting language (Apache 2 module)
- php5 - server-side, HTML-embedded scripting language (metapackage)
- php5-cgi - server-side, HTML-embedded scripting language (CGI binary)
- php5-cli - command-line interpreter for the php5 scripting language
- php5-common - Common files for packages built from the php5 source
- php5-curl - CURL module for php5
- php5-dbg - Debug symbols for PHP5
- php5-dev - Files for PHP5 module development
- php5-gd - GD module for php5
- php5-gmp - GMP module for php5
- php5-json - JSON module for php5
- php5-ldap - LDAP module for php5
- php5-mysql - MySQL module for php5
- php5-odbc - ODBC module for php5
- php5-pgsql - PostgreSQL module for php5
- php5-pspell - pspell module for php5
- php5-readline - Readline module for php5
- php5-recode - recode module for php5
- php5-snmp - SNMP module for php5
- php5-sqlite - SQLite module for php5
- php5-tidy - tidy module for php5
- php5-xmlrpc - XML-RPC module for php5
- php5-xsl - XSL module for php5
- cakephp - MVC rapid application development framework for PHP
- libapache2-mod-php5filter - server-side, HTML-embedded scripting language (apache 2 filter module)
- libexpect-php5 - expect module for PHP 5
- libgv-php5 - PHP5 bindings for graphviz
- libkohana2-modules-php - lightweight PHP5 MVC framework (extension modules)
- libkohana2-php - lightweight PHP5 MVC framework
- libkohana3.1-core-php - PHP5 framework core classes
- libkohana3.1-php - PHP5 framework metapackage
- libkohana3.2-core-php - PHP5 framework core classes
- libkohana3.2-php - PHP5 framework metapackage
- libow-php5 - Dallas 1-wire support: PHP5 bindings
- libphp-jpgraph - Object oriented graph library for php5
- libphp-jpgraph-examples - Object oriented graph library for php5 (examples)
- libphp5-embed - HTML-embedded scripting language (Embedded SAPI library)
- php-auth - Creating an authentication system
- php-codesniffer - PHP, CSS and JavaScript coding standard analyzer and checker
- php-doc - Documentation for PHP5
- php-http-request2 - Provides an easy way to perform HTTP requests
- php-imlib - PHP Imlib2 Extension
- php-letodms-lucene - Document management system - Fulltext search
- php5-adodb - Extension optimising the ADOdb database abstraction library
- php5-apcu - APC User Cache for PHP 5
- php5-enchant - Enchant module for php5
- php5-exactimage - fast image manipulation library (PHP bindings)
- php5-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
- php5-gdcm - Grassroots DICOM PHP5 bindings
- php5-gearman - PHP wrapper to libgearman
- php5-geoip - GeoIP module for php5
- php5-gnupg - wrapper around the gpgme library
- php5-imagick - ImageMagick module for php5
- php5-imap - IMAP module for php5
- php5-interbase - interbase/firebird module for php5
- php5-intl - internationalisation module for php5
- php5-lasso - Library for Liberty Alliance and SAML protocols - PHP 5 bindings
- php5-librdf - PHP5 language bindings for the Redland RDF library
- php5-mapscript - php5-cgi module for MapServer
- php5-mcrypt - MCrypt module for php5
- php5-memcache - memcache extension module for PHP5
- php5-memcached - memcached extension module for PHP5, uses libmemcached
- php5-midgard2 - Midgard2 Content Repository - PHP5 language bindings and module
- php5-ming - Ming module for php5
- php5-mongo - MongoDB database driver
- php5-msgpack - PHP extension for interfacing with MessagePack
- php5-mysqlnd - MySQL module for php5 (Native Driver)
- php5-mysqlnd-ms - MySQL replication and load balancing module for PHP
- php5-oauth - OAuth 1.0 consumer and provider extension
- php5-pinba - Pinba module for PHP 5
- php5-ps - ps module for PHP 5
- php5-radius - PECL radius module for PHP 5
- php5-redis - PHP extension for interfacing with Redis
- php5-remctl - PECL module for Kerberos-authenticated command execution
- php5-rrd - PHP bindings to rrd tool system
- php5-sasl - Cyrus SASL Extension
- php5-stomp - Streaming Text Oriented Messaging Protocol (STOMP) client module for PHP 5
- php5-svn - PHP Bindings for the Subversion Revision control system
- php5-sybase - Sybase / MS SQL Server module for php5
- php5-tokyo-tyrant - PHP interface to Tokyo Cabinet's network interface, Tokyo Tyrant
- php5-vtkgdcm - Grassroots DICOM VTK PHP bindings
- php5-xcache - Fast, stable PHP opcode cacher
- php5-xdebug - Xdebug Module for PHP 5
- php5-xhprof - Hierarchical Profiler for PHP5
- phpunit - Unit testing suite for PHP5
- root:#
复制代码 其中 php5-cgi (CGI 通用网关接口)、php5-curl (客户端 URL)、php5-dev (开发支持)、php5-gd (GD 图像处理)、php5-mysql (MySQL 支持)、php5-pspell (拼写检查支持)、php5-recode (编码字符集支持)、php5-snmp (SNMP 简单网络管理协议支持)、php5-sqlite (SQLite 数据库支持)、php5-tidy (Tidy HTML 支持)、php5-xmlrpc (XML-RPC 支持)、php5-xsl (XLS 支持)、php5-imagick (ImageMagick 图像处理)、php5-imap (IMAP 邮件客户端支持)、php5-intl (国际化支持)、php5-mcrypt (Mcrypt 加密)、php5-memcache (memcache 客户端)、php5-memcached (memcache 服务器端)、php5-ming (swf 扩展支持)、php5-ps (PostScript 文档支持),这些都需要安装:
- root:#apt-get install php5 php5-cgi php5-curl php5-dev php5-gd php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-imagick php5-imap php5-intl php5-mcrypt php5-memcache php5-memcached php5-ming php5-ps php-pear php-apc
复制代码 3、配置 php.ini 将 ;cgi.fix_pathinfo=1 去掉注释并改为 cgi.fix_pathinfo=0
4、重载、重启 php5-fpm 5.5.9、nginx 1.4.6- root@:# service php5-fpm reload
- root:# service php5-fpm restart
- stop: Unknown instance:
- php5-fpm start/running, process 3811
- root:# service nginx reload
- * Reloading nginx configuration nginx [ OK ]
- root:# service nginx restart
- * Restarting nginx nginx [ OK ]
- root:#
复制代码 5、创建名为 “info.php” 的 PHP 探针文件,并测试
- vi /usr/share/nginx/html/info.php (或把 info.php 放到支持 php 的网站根目录下)
复制代码 文件内容:
在 FireFox 或 IE 浏览器中键入 http://localhost/info.php 或 http://127.0.0.1/info.php (或 http://服务器 IP 地址/info.php 或 http://域名地址/info.php);若出现以下图片内容,说明安装成功:
"长按二维码" 或 "扫一扫" 关注 "德云社区" 微信公众号
版权声明:
本文为独家原创稿件,版权归 德云社区,未经许可不得转载;否则,将追究其法律责任。
|