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)的开发环境配置直接参考官方文档即可完成,不过对小白来说东西有点多,有些名词不是很好理解,这里就官方的安装文档稍微展开说一下. 中文版配置说明:不错的中文说明.官 ...
随机推荐
- 小程序block标签配合if和else
<block wx:if="{{hasMore}}"> <view class="loading-tip">拼命加载中…</vie ...
- 【开源小软件 】Bing每日壁纸 让桌面壁纸保持更新
发布一个开源小软件,Bing每日壁纸. 该小软件可以自动获取Bing的精美图片设置为壁纸,并且支持随机切换历史壁纸,查看壁纸故事. 欢迎大家下载使用,点star!有问题请留言或者提issue. 开源地 ...
- 【Java】 剑指offer(37) 序列化二叉树
本文参考自<剑指offer>一书,代码采用Java语言. 更多:<剑指Offer>Java实现合集 题目 请实现两个函数,分别用来序列化和反序列化二叉树. 思路 一般情况下 ...
- 细说java中的类
前言 最近在学习<java编程思想> 学到了内部类 类不就是class吗 天天用 还能讲出花来了不成... 其实不然,在java中,类的种类和使用方式多种多样,花样繁多.其中主要有 普通类 ...
- git小白入门全攻略
git是什么(写在前边的叨叨,就是给一点不懂的小白打个比喻,大佬请自行跳过) git在平时的开发中用的太频繁了,以至于我都不知道如何去形容它.囧. 假设我们开发的工作类似于图书整理,写的代码就是很多人 ...
- Java 之递归遍历目录
Java 之递归遍历目录 一.内容 输出指定目录(文件夹)下的所有文件(包括目录)的绝对路径 二.源代码:RecursiveListDirectory.java package cn.com.zfc. ...
- HDU.2829.Lawrence(DP 斜率优化)
题目链接 \(Description\) 给定一个\(n\)个数的序列,最多将序列分为\(m+1\)段,每段的价值是这段中所有数两两相乘的和.求最小总价值. \(Solution\) 写到这突然懒得写 ...
- BZOJ4460 : [Jsoi2013]广告计划
首先预处理出$f[i][j]$表示第$i$位是字符$j$的字符串集合. 考虑枚举答案$n$,那么模式串中模$n$相同的字符都要按顺序在同一行出现. 设$g[i][j]$表示第$i$列开始出现模$n$为 ...
- webstorm安装教程
之前有些一些破解的,但是独独忘记了安装的这个教程,现在补上:见下: 先来一官方的解释:WebStorm是JetBrains 推出的一款强大的HTML5编辑工具,拥有丰富的代码快速编辑,可以智能的补全代 ...
- javascript中break与continue,及return的区别
a).在循环体中, break是跳出整个循环,不执行以后的循环语句: continue是结束本次循环语句,进入下一个循环: b). 在if判断句,结束该函数的执行时,用 return: c). 在函数 ...