差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
public:it:php [2015/10/12 14:46] – oakfire | public:it:php [2019/03/26 17:38] (当前版本) – [Others] oakfire | ||
---|---|---|---|
行 8: | 行 8: | ||
===== Syntax ===== | ===== Syntax ===== | ||
+ | ==== 代码组织 ==== | ||
+ | * **include**: | ||
+ | * **require** 和 include 几乎完全一样,除了处理失败的方式不同之外 | ||
+ | |||
==== 面向对象(OO) ==== | ==== 面向对象(OO) ==== | ||
* [[http:// | * [[http:// | ||
行 31: | 行 35: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
+ | ==== Notes ==== | ||
+ | * <wrap em> | ||
+ | * '' | ||
+ | * '' | ||
===== Others ===== | ===== Others ===== | ||
- | * Ubuntu 14.04 安装 php 环境: < | + | |
+ | | ||
# 安装 php5-cli | # 安装 php5-cli | ||
sudo apt-get install php5-cli | sudo apt-get install php5-cli | ||
# 安装 php5-fpm | # 安装 php5-fpm | ||
sudo apt-get install php5-fpm | sudo apt-get install php5-fpm | ||
+ | </ | ||
+ | * nginx 中关于 php 的适用 pathinfo 模式的配置:< | ||
+ | location ~ \.php { | ||
+ | fastcgi_split_path_info ^(.+\.php)(/ | ||
+ | # NOTE: You should have " | ||
+ | |||
+ | ## With php5-cgi alone: | ||
+ | # fastcgi_pass 127.0.0.1: | ||
+ | # With php5-fpm: | ||
+ | fastcgi_pass unix:/ | ||
+ | fastcgi_index index.php; | ||
+ | include fastcgi_params; | ||
+ | fastcgi_param PATH_INFO $fastcgi_path_info; | ||
+ | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | ===== Tips ===== | ||
+ | * 输出对象信息:< | ||
+ | error_log(print_r($php_object, | ||
</ | </ | ||