原文:https://www.codecasts.com/blo...如果你是设计师,我强烈推荐你去看看Laravist上的《从零部署一个网站》系列视频!当然这一切都是免费的!软件版本说明:Ubuntu:16.04LTS;WordPress:4.7zh-CN适用人群:PHP初学者和想拥有自己网站的设计师!安装PHP7.11。首先添加PPAsudoapt-getupdatesudoLC_ALL=en_US.UTF-8add-apt-repositoryppa:ondrej/php-ysudoapt-getupdate2。然后,安装PHP7.1sudoapt-get-yinstallphp7。1sudoapt-get-yinstallphp7.1-mysqlphp7.1-fpminstallMysqlsudoapt-get-yinstallmysql-server-5.7设置密码,OK。至此,基本的WordPress环境已经准备就绪。部署WordPress,首先通过git拉取WordPress源码:gitclonehttps://github.com/JellyBool/wordpress.git/var/www/wordpress配置Mysql登录mysql,命令如下:mysql-uroot-p在mysql中执行:CREATEDATABASEwordpressDEFAULTCHARACTERSETutf8COLLATEutf8_unicode_ci;创建由“laravist”标识的用户“jellybool”;授予wordpress上的所有权限。*TO'jellybool';quit注意上面的jellybool和laravist是根据自己的需要设置的。配置Nginx打开配置文件:vim/etc/nginx/sites-available/default如下配置配置:root/var/www/wordpress;indexindex.phpindex.htmlindex.htmindex.nginx-debian.html;#注意我们添加了index.phplocation/{try_files$uri$uri//index.php?$query_string;}location~\.php${try_files$uri/index.php=404;fastcgi_split_path_info^(.+\.php)(/.+)$;fastcgi_passunix:/var/run/php/php7.1-fpm.sock;fastcgi_indexindex.php;fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;包括fastcgi_params;五分钟的WordPress安装过程!安装后,您就有了一个WordPress站点!最后配置WordPress文件上传,打开wp-config.php文件:define('FS_METHOD','direct');define('FS_CHMOD_DIR',0777);define('FS_CHMOD_FILE',0777);安装其他php扩展sudoaptinstall-yphp7.1-gdphp7.1-mbstringphp7.1-xmlrpc到目前为止,收工了。
