cd /opt/ git clone https://github.com/star7th/showdoc.git
#(慎用,应该指定到特定用户组)
chmod 777 /opt/showdoc
安装php依赖,接上文安装php7.2
cd /usr/local/src/php-7.2.32/ext
安装phpize
yum install php-devel
生成gcc编译文件
phpize
安装依赖并编译
yum install libjpeg-devel yum install libpng-devel yum install freetype-devel ./configure --with-php-config=/usr/local/php/bin/php-config --with-png-dir --with-freetype-dir --with-jpeg-dir --with-gd
make&&make install
以后如下
然后修改php.ini
vim /etc/php.ini
添加
extension=gd
配置nginx(网上很多傻逼就写了一点点,坑死我了)
server { listen 81; # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location / { root /opt/showdoc; index index.php index.html index.htm; } location ~ .php$ { root /opt/showdoc; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
重启服务
service php-fpm restart
nginx -s reload
访问 http://xxx.xxx.xxx.xxx:81/index.php
依次执行,安装后效果如下