入矿日记(一)php开发环境搭建 -- php、composer

我们这里选择的是使用源码的方式搭建。

(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的配置可以参考该链接

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值