Ubuntu环境下配置ThinkPHP开发环境
来源:互联网 发布:ecshop sql注入漏洞 编辑:程序博客网 时间:2024/06/07 14:50
1.首先还是安装php
这里不多说,具体参考这篇文章
2.安装composer
cd 你要下载的目录curl -sS https://getcomposer.org/installer | php
这里如果之前php配置的时候没有开启openssl拓展的话就会报错,我们可以尝试开启openssl拓展,当然也可以重新编译php
我们首先得保证openssl已经正确地安装
wget https://www.openssl.org/source/openssl-1.1.0g.tar.gztar -zxvf openssl-1.1.0g.tar.gz./config --prefix=/usr/local/opensslmake make install
切换到php安装目录,编译安装openssl拓展
cd /ext/opensslphpize ./configuree --with-openssl=/usr/local/opensslmake make install
phpize这一步可能会出现autoconf未配置的问题,依次安装m4和autoconf就可以了
wget http://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.gzwget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz//然后解压编译安装
然后在php.ini中添加
extension_dir=你的拓展位置extension=openssl.so
用phpinfo()查看配置信息,看到下图时说明openssl拓展已经成功配置了
再次下载composer,如果php没有开启zlib拓展的话会得到这样的信息,大致就是没有zlib拓展的话composer就会不稳定,而且速度会大幅下降,那我们可以开启zlib拓展,方法和上面的一致,这里就不多说了
接下来将composer添加到/usr/local/bin
mv composer.phar /usr/local/bin/composer
3.安装TP5
切换到web根目录下面并执行下面的命令
composer create-project topthink/think tp5 --prefer-dist
如果之前没有安装过git的话会报错,因为要用到git来clone
apt-get install git就好了
浏览器访问/localhost/tp5/public,看到下图说明tp5已经成功配置
4.配置Nginx支持Pathinfo
Nginx默认是不支持Pathinfo的,可以在nginx.conf文件中修改
fastcgi_split_path_info ^(.+\.php)(.*)$; #增加这一句 fastcgi_param PATH_INFO $fastcgi_path_info; #增加这一句
重启Nginx就可以了
到这里所有的配置都完成了,希望这篇文章能够帮到有需要的人
阅读全文
0 0
- Ubuntu环境下配置ThinkPHP开发环境
- Ubuntu下开发环境配置
- Ubuntu下Java开发环境配置
- Ubuntu下配置OpenCV开发环境
- ubuntu下配置android开发环境
- Ubuntu下配置PHP开发环境LAMP
- 在 Ubuntu 下配置 Android 开发环境
- 配置ubuntu下android开发环境
- ubuntu下配置android开发环境
- Ubuntu下配置android sdk 开发环境
- Ubuntu下安装配置PHP开发环境
- ubuntu下c/c++开发环境配置
- 在ubuntu下配置Android开发环境
- 在 Ubuntu 下配置 Android 开发环境
- Ubuntu 下配置Android开发环境
- ubuntu下配置Android开发环境
- [Linux] Ubuntu下CodeBlock开发环境配置
- ubuntu下android开发环境配置
- BFC与IFC
- 异步请求与同步请求之间的转换
- 2017-11-06-linux-解决vi中backspace无法删除字符
- Applet 类
- 发现小服务器被入侵了 cpu长期100%
- Ubuntu环境下配置ThinkPHP开发环境
- 笔记:udacity计算机导论 -5-29/30 查找、提取、并输出超链 if vs while
- java日常学习:泛型
- 个人知乎 ##基础九——爬虫入门PySpider
- 我的Raspberry Pi/树莓派有线网和无线网接通了------不需要树莓派显示器,键盘,鼠标,串口
- Ionic3学习笔记(十)实现夜间模式功能
- bzoj 4260: Codechef REBXOR(01字典树)
- 怎么在S12X上使用XGATE协处理器
- Excel在统计分析中的应用—第八章—假设检验-总体方差未知且为小样本下的均值之差检验