我们这里选择的是使用源码的方式搭建。
(1)php的搭建。
php环境安装的过程中遇到了一个难以解决的问题。
就是总是找不到扩展fileinfo。
网上参考的链接,感兴趣的可以试一下,可能是博主操作方式不正确,总是没有成功。
最后是讲上边的链接中的.config脚本中的一个配置重新设置了一下。原来是这个样子的
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl-dir=/usr/bin/curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts
修改后是这个样子的。
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl-dir=/usr/bin/curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-fileinfo --enable-maintainer-zts
(2)composer
下载地址: https://mirrors.aliyun.com/composer/composer.phar
下载下来以后,还需要做部分修改:
具体参考:链接
全部完成以后,进入到我们的项目中。然后执行
composer update
修改项目下的.env.example 位.env
通过命令生成一个key,这样在.env中的就会自动添加进去key的值(APP_KEY=)。
php artisan key:generate
修改.env 中的mysql的用户名和密码,在mysql中手动创建一个数据库。
给public 和stora ge 目录设置执行权限为755
chmod -R public/ 755
chmod -R storage/ 755
修改nginx 中 nginx.conf 中的用户为系统当前的用户名。
nginx的配置可以参考该链接。