PHP是一个拥有众多开发者的开源软件项目。原为PersonalHomePage的缩写,现已正式更名为“PHP:HypertextPreprocessor”。PHP由RasmusLerdorf于1994年创建,最初只是一个用Perl语言编写的简单程序,用来统计他自己网站的访问者数量。后来用C语言改写,同时可以访问数据库。1995年,PHP(PersonalHomePageTools)发布了第一个版本的PHP1。此后,越来越多的网站开始使用PHP,并强烈要求增加一些特性,如循环语句和数组变量等。1995年发布的PHP2增加了对mySQL的支持。首先需要一个VPS服务器环境。我的版本是centos7。1、下载安装包http://www.php.net/downloads.php2,yum安装环境yum-yinstall\libjpeg\libjpeg-devel\libpnglibpng-devel\freetypefreetype-devel\libxml2\libxml2-devel\zlibzlib-devel\curlcurl-devel\opensslopenssl-devel3,解压安装包tarxjvfphp-7.1.10.tar.bz24,编译文件cdphp-7.1。10./configure\--prefix=/usr/local/php\--with-apxs2=/usr/local/httpd/bin/apxs\--with-mysql-sock=/usr/local/mysql/mysql。袜子\--with-mysqli\--with-zlib\--with-curl\--with-gd\--with-jpeg-dir\--with-png-dir\--with-freetype-dir\--with-openssl\--enable-mbstring\--enable-xml\--enable-session\--enable-ftp\--enable-pdo\--enable-tokenizer\--enable-zimpake&&makeinstall5,复制配置文件并修改cpphp.ini-development/usr/local/php/lib/php.inivi/usr/local/php/lib/php.inimysqli.default_socket=/usr/local/mysql/mysql.sockdate.timezone=Asia/Shanghai/usr/local/php/bin/php-m//验证安装的模块vi/etc/httpd.confAddTypeapplication/x-httpd-php.phpAddTypeapplication/x-httpd-php-source.phps添加支持文件类型:DirectoryIndexindex.phpindex.htmlvi/usr/local/httpd/htdocs/index.php6.在浏览器中访问自己的ip
