phpBB3.2开发环境配置
从Github导出项目
如果只是查看代码, 可以直接clone官方的git https://github.com/phpbb/phpbb.git . 如果需要开发, 就fork一下再从自己的Git里clone.
下载依赖
PhpStorm IDE方式
在PS中打开composer.json, 右上角会提示有install, 点击后, 选择系统中的PHP可执行文件, 选择下载composer.phar, 然后确定即可.
在墙内会比较慢, 可以在composer.json里加上这一段, 使用phpcomposer.com提供的镜像服务
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
}
命令行方式:
在 phpBB 目录下执行
php ../composer.phar install
执行结果, 能看到项目依赖的各个库的版本, 其中symfony版本是3.4.15
~/PhpstormProjects/phpbb/phpBB$ php ../composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 76 installs, 0 updates, 0 removals
- Installing composer/installers (v1.5.0): Downloading (100%)
- Installing bantu/ini-get-wrapper (v1.0.1): Downloading (100%)
- Installing symfony/process (v3.4.15): Downloading (100%)
- Installing symfony/finder (v3.4.15): Downloading (100%)
- Installing symfony/polyfill-ctype (v1.9.0): Downloading (100%)
- Installing symfony/filesystem (v3.4.15): Downloading (100%)
- Installing symfony/polyfill-mbstring (v1.9.0): Downloading (100%)
- Installing psr/log (1.0.2): Downloading (100%)
- Installing symfony/debug (v3.4.15): Downloading (100%)
- Installing symfony/console (v3.4.15): Downloading (100%)
- Installing seld/phar-utils (1.0.1): Downloading (100%)
- Installing seld/jsonlint (1.7.1): Downloading (100%)
- Installing justinrainbow/json-schema (5.2.7): Downloading (100%)
- Installing composer/xdebug-handler (1.3.0): Downloading (100%)
- Installing composer/spdx-licenses (1.4.0): Downloading (100%)
- Installing composer/semver (1.4.2): Downloading (100%)
- Installing composer/ca-bundle (1.1.2): Downloading (100%)
- Installing composer/composer (1.7.2): Downloading (100%)
- Installing google/recaptcha (1.2.1): Downloading (100%)
- Installing guzzlehttp/promises (v1.3.1): Downloading (100%)
- Installing psr/http-message (1.0.1): Downloading (100%)
- Installing guzzlehttp/psr7 (1.4.2): Downloading (100%)
- Installing lusitanian/oauth (v0.8.11): Downloading (100%)
- Installing marc1706/fast-image-size (v1.1.4): Downloading (100%)
- Installing patchwork/utf8 (v1.3.1): Downloading (100%)
- Installing psr/container (1.0.0): Downloading (100%)
- Installing s9e/text-formatter (0.13.1): Downloading (100%)
- Installing symfony/config (v3.4.15): Downloading (100%)
- Installing paragonie/random_compat (v1.4.3): Downloading (100%)
- Installing symfony/polyfill-php70 (v1.9.0): Downloading (100%)
- Installing symfony/http-foundation (v3.4.15): Downloading (100%)
- Installing symfony/event-dispatcher (v3.4.15): Downloading (100%)
- Installing symfony/http-kernel (v3.4.15): Downloading (100%)
- Installing symfony/dependency-injection (v3.4.15): Downloading (100%)
- Installing zendframework/zend-eventmanager (3.2.1): Downloading (100%)
- Installing zendframework/zend-code (2.6.3): Downloading (100%)
- Installing ocramius/proxy-manager (1.0.2): Downloading (100%)
- Installing symfony/proxy-manager-bridge (v3.4.15): Downloading (100%)
- Installing symfony/routing (v3.4.15): Downloading (100%)
- Installing twig/twig (v1.35.4): Downloading (100%)
- Installing symfony/twig-bridge (v3.4.15): Downloading (100%)
- Installing symfony/dom-crawler (v3.4.15): Downloading (100%)
- Installing symfony/css-selector (v3.4.15): Downloading (100%)
- Installing symfony/browser-kit (v3.4.15): Downloading (100%)
- Installing guzzlehttp/guzzle (6.3.3): Downloading (100%)
- Installing fabpot/goutte (v3.2.3): Downloading (100%)
- Installing facebook/webdriver (1.6.0): Downloading (100%)
- Installing symfony/yaml (v3.4.15): Downloading (100%)
- Installing laravel/homestead (v7.17.0): Downloading (100%)
- Installing phing/phing (2.4.14): Downloading (100%)
- Installing webmozart/assert (1.3.0): Downloading (100%)
- Installing phpdocumentor/reflection-common (1.0.1): Downloading (100%)
- Installing phpdocumentor/type-resolver (0.4.0): Downloading (100%)
- Installing phpdocumentor/reflection-docblock (3.3.2): Downloading (100%)
- Installing sebastian/version (2.0.1): Downloading (100%)
- Installing sebastian/resource-operations (1.0.0): Downloading (100%)
- Installing sebastian/recursion-context (2.0.0): Downloading (100%)
- Installing sebastian/object-enumerator (2.0.1): Downloading (100%)
- Installing sebastian/global-state (1.1.1): Downloading (100%)
- Installing sebastian/exporter (2.0.0): Downloading (100%)
- Installing sebastian/environment (2.0.0): Downloading (100%)
- Installing sebastian/diff (1.4.3): Downloading (100%)
- Installing sebastian/comparator (1.2.4): Downloading (100%)
- Installing phpunit/php-text-template (1.2.1): Downloading (100%)
- Installing doctrine/instantiator (1.0.5): Downloading (100%)
- Installing phpunit/phpunit-mock-objects (3.4.4): Downloading (100%)
- Installing phpunit/php-timer (1.0.9): Downloading (100%)
- Installing phpunit/php-file-iterator (1.4.5): Downloading (100%)
- Installing sebastian/code-unit-reverse-lookup (1.0.1): Downloading (100%)
- Installing phpunit/php-token-stream (1.4.12): Downloading (100%)
- Installing phpunit/php-code-coverage (4.0.8): Downloading (100%)
- Installing phpspec/prophecy (1.8.0): Downloading (100%)
- Installing myclabs/deep-copy (1.7.0): Downloading (100%)
- Installing phpunit/phpunit (5.7.27): Downloading (100%)
- Installing phpunit/dbunit (2.0.3): Downloading (100%)
- Installing squizlabs/php_codesniffer (2.9.1): Downloading (100%)
symfony/console suggests installing symfony/lock
lusitanian/oauth suggests installing predis/predis (Allows using the Redis storage backend.)
patchwork/utf8 suggests installing ext-intl (Use Intl for best performance)
patchwork/utf8 suggests installing ext-wfio (Use WFIO for UTF-8 filesystem access on Windows)
s9e/text-formatter suggests installing ext-intl (Allows international URLs to be accepted by the URL filter)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
symfony/http-kernel suggests installing symfony/var-dumper
symfony/dependency-injection suggests installing symfony/expression-language (For using expressions in service container configuration)
zendframework/zend-eventmanager suggests installing container-interop/container-interop (^1.1.0, to use the lazy listeners feature)
zendframework/zend-eventmanager suggests installing zendframework/zend-stdlib (^2.7.3 || ^3.0, to use the FilterChain feature)
zendframework/zend-code suggests installing doctrine/annotations (Doctrine\Common\Annotations >=1.0 for annotation features)
zendframework/zend-code suggests installing zendframework/zend-stdlib (Zend\Stdlib component)
ocramius/proxy-manager suggests installing ocramius/generated-hydrator (To have very fast object to array to object conversion for ghost objects)
ocramius/proxy-manager suggests installing zendframework/zend-json (To have the JsonRpc adapter (Remote Object feature))
ocramius/proxy-manager suggests installing zendframework/zend-soap (To have the Soap adapter (Remote Object feature))
ocramius/proxy-manager suggests installing zendframework/zend-stdlib (To use the hydrator proxy)
ocramius/proxy-manager suggests installing zendframework/zend-xmlrpc (To have the XmlRpc adapter (Remote Object feature))
symfony/routing suggests installing doctrine/annotations (For using the annotation loader)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
symfony/twig-bridge suggests installing symfony/asset (For using the AssetExtension)
symfony/twig-bridge suggests installing symfony/expression-language (For using the ExpressionExtension)
symfony/twig-bridge suggests installing symfony/form (For using the FormExtension)
symfony/twig-bridge suggests installing symfony/security (For using the SecurityExtension)
symfony/twig-bridge suggests installing symfony/stopwatch (For using the StopwatchExtension)
symfony/twig-bridge suggests installing symfony/templating (For using the TwigEngine)
symfony/twig-bridge suggests installing symfony/translation (For using the TranslationExtension)
symfony/twig-bridge suggests installing symfony/var-dumper (For using the DumpExtension)
symfony/twig-bridge suggests installing symfony/web-link (For using the WebLinkExtension)
facebook/webdriver suggests installing ext-SimpleXML (For Firefox profile creation)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.1)
phpunit/phpunit suggests installing ext-xdebug (*)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
Generating autoload files
在PhpStorm中同时打开多个项目
点击Open后选中项目目录, 在弹出的对话框中, 选择Open in current window, 勾选 Add to currently opened projects.
Nginx配置文件
在phpBB3.2中已经默认使用Restful URL, 例如升级时, 使用的地址是 forum/install/app.php/update, FAQ页面的地址就是 forum/app.php/help/faq , 在论坛安装完成之后, 虽然还可以沿用传统的URL传参形式, 但是要追求完美的话还是要把rewrite加上. 在编写nginx配置时还有另一个考虑就是安全问题. 现在引入那么多第三方库, 可以说出现漏洞的风险是非常大的, 要尽可能地避免这些第三方库带来的安全问题, 首先最简单最容易做到的就是禁止外界直接访问这些脚本.
以下是我使用的Nginx配置文件, 可以根据自己的实际情况修改.
server {
listen 80;
server_name www.rockbb.com;
access_log logs/rockbb.access.log main;
location / {
root /var/wwwroot/rockbb;
index index.html index.htm index.php;
}
# Correctly pass scripts for installer
location /forum/app.php {
root /var/wwwroot/rockbb;
index index.html index.php;
location ~ \.php(/|$) {
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME /var/wwwroot/rockbb$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}
}
# 禁止访问内部phpbb文件
location ~ /forum/(bin|cache|config|ext|files|images/avatars/upload|includes|language|phpbb|
store|vendor|config\.php|common\.php).* {
deny all;
internal;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
root /var/wwwroot/rockbb;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /$document_root$fastcgi_script_name;
include fastcgi_params;
}
}
几个location匹配的优先级说明
规则是:
先精确匹配, 匹配上哪个就立即用哪个; 然后普通匹配, 不管是否匹配上, 继续进行正则匹配, 如果正则匹配不上, 则回退至上一个普通匹配. 其中普通匹配没有顺序之分, 哪个匹配最精确就使用哪个location, 而正则匹配按照规则的书写顺序进行, 只要匹配上哪个就用哪个:
- = 精确匹配, 匹配后停止后续匹配, 直接执行该匹配后的configuration
- [空格] 前缀匹配. 匹配后继续更长前缀匹配和正则匹配
- ^~ 非正则匹配, 终态前缀匹配(注意与空格的前缀匹配进行区别), 匹配该前缀后,停止后续正则匹配
- ~ 区分大小写的正则匹配, 按顺序匹配,一旦匹配上即停止后续匹配
- ~* 不区分大小写的匹配, 一旦匹配即停止后续匹配
所以nginx配置文件的书写顺序建议是: 先写 = 号(精确匹配)部分, 然后写[空格] 前缀匹配部分, 然后写^~这种前缀匹配, 最后写正则匹配.
phpBB3.2开发环境配置的更多相关文章
- Python开发环境配置
好久没有写博客了,自从6月份毕业后,进入一家做书法.字画文化宣传的互联网公司(www.manyiaby.com),这段时间一直在进行前端开发,对于后端的使用很少了,整天都是什么html.css.jav ...
- Visual studio 通用开发环境配置:SDL,FFMPEG为例
引言 每一个C++库的使用都是从开发环境的配置开始的,其实每个库的配置过程都是大同小异,总结下来有下面几个步骤: 下载库文件,这里假定是已经预先编译完成的. 配置库文件的包含目录(include)和库 ...
- AndroidStudio开发环境配置-Windows
Android Studio开发环境配置-Windows 最近突发奇想,开始研究Android开发.开始时使用Eclipse作为开发IDE,结果各种不好使,首先下载和安装SDK,以及不同版本的Imag ...
- WIN10下java8的开发环境配置与第一个java程序
一.开发环境配置 1.在官网上下载jdk-8u111-windows-x64.exe 2.运行安装包,可以自定义安装路径 3.进入环境变量设置: 计算机右键-->属性-->高级系统设置-- ...
- Mac下golang开发环境配置
go语言在开发效率和运行效率中的优势让很多人青睐,所以有倾向打算转向go语言的开发. 下面介绍在Mac OS X中golang的开发环境配置. 1.安装brew brew是一个mac下的由ruby开发 ...
- win7 x64 vs2010 directShow开发环境配置
近来工作需要,要用dirrectShow写一个视频播放的demo验证自己的想法.开发环境配置了好久都没有成功,最后终于弄完,现在记录下来,以后有同学遇到同样问题,可以以此法解决. windows SD ...
- 基于Eclipse的Hadoop应用开发环境配置
基于Eclipse的Hadoop应用开发环境配置 我的开发环境: 操作系统ubuntu11.10 单机模式 Hadoop版本:hadoop-0.20.1 Eclipse版本:eclipse-java- ...
- XMPP开发环境配置
首先配置XMPP开发环境配置需要的软件 先安装xampp-osx-1.8.3-5-installer.dmg 安装成功后launchpad里会多出一个XAMPP(其他),点开里面的manager-os ...
- Mac电脑配置IOS React Native开发环境配置笔记
React Native(以下简称RN)的开发环境配置直接参考官方文档即可完成,不过对小白来说东西有点多,有些名词不是很好理解,这里就官方的安装文档稍微展开说一下. 中文版配置说明:不错的中文说明.官 ...
随机推荐
- centos java tomcat 中文乱码解决办法
现象: cenos 部署java web 程序 ,java类中有中文 出现乱码现象 即使使用: System.getProperty("中文") 控制台都出现 ?????? 乱 ...
- C#之app.config、exe.config和vshost.exe.config作用区别
vshost.exe.config是程序运行时的配置文本 exe.config是程序运行后会复制到vshost.exe.config app.config是在vshost.exe.config和exe ...
- hdu 2157 从a点走到b点刚好k步的方案数是多少 (矩阵快速幂)
n个点 m条路 询问T次 从a点走到b点刚好k步的方案数是多少 给定一个有向图,问从A点恰好走k步(允许重复经过边)到达B点的方案数mod p的值把 给定的图转为邻接矩阵,即A(i,j)=1当且仅当存 ...
- js的"|"
3|4 转换为二进制之后011|100 相加得到111=7 4|4 转换为二进制之后100 |100 相加得到1000=8 8|3 转换为二进制之后1000 |011 相加得到1011=11 以 ...
- #2 codeforces 480 Parcels
题意: 就是有一个用来堆放货物的板,承重力为S.现在有N件货物,每件货物有到达的时间,运走的时间,以及重量,承重,存放盈利.如果这件货物能再运达时间存放,并在指定时间取走的话,就能获得相应的盈利值.货 ...
- [OpenCV-Python] OpenCV 中图像特征提取与描述 部分 V (二)
部分 V图像特征提取与描述 OpenCV-Python 中文教程(搬运)目录 34 角点检测的 FAST 算法 目标 • 理解 FAST 算法的基础 • 使用 OpenCV 中的 FAST 算法相关函 ...
- P1279 字串距离
P1279 字串距离一看就是字符串dp,然而并不会,骗分之后爆零了.以后dp题要好好想想转移方程.f[i][j]表示是a串选了前i个字符,b串选了前j个字符的距离.显然(QAQ)f[i][j]=min ...
- Android高效内存2:让图片占用尽可能少的内存
Android高效内存:让图片占用尽可能少的内存 一.让你的图片最小化 1.1 大图小图内存使用情况对比 大图:440 * 336 小图:220 * 168 资源目录:xhdpi 小图的高宽都是 ...
- asp.net core模块学习
一.配置管理 二.管道 三.认证与授权 四.MVCDemo 五.IdentityServer4 一.配置管理 1,读取内存配置 using System; using Microsoft.Extens ...
- Some Formulas.
目录 计数问题 在一个有\(n\)个点的完全图(complete graph)中有多少棵生成树 排列组合 1. 当 \(C_n^m\) 为奇数时,\((n\&m)==m\) 2. \[\sum ...