编译安装php7,thinkphp框架的安装


#1

编译安装php7,thinkphp框架的安装
一、编译php7
1、下载php7源代码php-7.0.0.tar.gz。
2、解压 tar xvf php-7.0.0.tar.gz, 并进入php-7.0.0目录。
3、./configure --prefix=/usr/local/php7 --exec-prefix=/usr/local/php7 --bindir=/usr/local/php7/bin --sbindir=/usr/local/php7/sbin --includedir=/usr/local/php7/include --libdir=/usr/local/php7/lib/php --mandir=/usr/local/php7/php/man --with-config-file-path=/usr/local/php7/etc --with-mysql-sock=/tmp/mysql.sock --with-mcrypt=/usr/include --with-mhash --with-openssl --with-mysql=shared,mysqlnd --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd --with-iconv --with-zlib --enable-zip --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-mbregex --enable-mbstring --enable-ftp --enable-gd-native-ttf --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir --with-freetype-dir --enable-opcache --enable-fpm --enable-fastcgi --without-gdbm --disable-fileinfo
4、编译, 安装。
$make -j 4 #针对多核处理器,加快编译速度。
$sudo make install

5、启动php-fpm。sudo /usr/local/php/sbin/php-fpm
二、编译nginx
1、下载最新版本的nginx。nginx-1.9.7.tar.gz
2、解压 tar xvf nginx-1.9.7.tar.gz,并进入nginx路径,cd nginx-1.9.7
3、./configure --prefix=/usr/local/nginx
4、编译安装。make && sudo make install
5、修改nginx的默认配置文件。/usr/local/nginx/conf/nginx.conf

6、在/data/www下建立test.php,并输入:

7、测试phpinfo信息。在浏览器中输入:http://10.128.8.65:8888/test.php,可以看到

三、安装thinkphp_3.2.3_core
1、下载thinkphp_3.2.3_core.zip
2、解压thinkphp。 unzip thinkphp_3.2.3_core.zip
3、将ThinkPHP 文件夹,放入nginx 的web路径下。如:

4、在nginx的web目录下面新建一个index.php的入口文件,就是要通过index.php这个入口文件来访问你的网站的,这只是一个单入口。
5、在index.php中写入, 更详细的内容可以参考thinkphp官方手册。

6、最后在你的浏览器中输入http://10.128.8.65:8888/index.php