Ubuntu 18.04 安装微擎框架
针对微擎的PHP环境要求
| 选项 | 要求 |
|---|---|
| PHP版本 | 5.3或以上 |
| cURL | enable |
| PDO | enable |
| openssl | enable |
| GD2 | enable |
| DOM | enable |
| session.auto_start | disable |
| asp_tags | disable |
查找软件包
apt-cache search <你要查找的软件包>
启用cURL
apt-get update
apt-cache search php7.2-curl
# result
# php7.2-curl - CURL module for PHP
apt-get install php7.2-curl -y
Ensure the path in extension_dir exists, and contains curl.so, if not, change to the correct path.
php -i | grep extension_dir
# result
# extension_dir => /usr/lib/php/20170718 => /usr/lib/php/20170718
cd /usr/lib/php/20170718 && ls
# ... calendar.so curl.so fileinfo.so ...
Ensure the /etc/php/7.2/mods-available/curl.ini exists and has the curl.so loaded
; configuration for php curl module
; priority=20
extension=curl.so
If everything is correct, restart PHP-FPM
/etc/init.d/php7.2-fpm restart
剩下的扩展
apt-cache search php7.2-gd php7.2-xml
# php7.2-gd - GD module for PHP
apt-cache search php7.2-xml
# php7.2-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP
# php7.2-xmlrpc - XMLRPC-EPI module for PHP
apt-get install php7.2-gd php7.2-xml -y
/etc/init.d/php7.2-fpm restart
目录权限
# 假设运行微擎的用户是 www 网站目录为 /www/wwwroot/we7,请根据实际情况修改
chown -R www:www /www/wwwroot/we7
chmod -R 744 /www/wwwroot/we7
参考资料: