日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

Yii學(xué)習(xí)總結(jié)之安裝配置(2)_PHP教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:使用php的HTTP請求的庫Requests實(shí)現(xiàn)美女圖片墻
這篇文章主要介紹了使用php的HTTP請求的庫Requests實(shí)現(xiàn)美女圖片墻的方法,十分簡單實(shí)用,需要的朋友可以參考下 使用百度的接口獲取美女圖片,并用瀑布流的形式展示到自己的頁面中。 github項(xiàng)目地址:https://github.com/CraryPrimitiveMan/pretty 最終效果如下: 點(diǎn)開百

1. 開啟apache的mod_rewrite模塊,去掉LoadModule rewrite_module modules/mod_rewrite.so前的"#"符號,確保<Directory "..."></Directory>中有"AllowOverride All"。
2. 在項(xiàng)目中的/protected/config/main.php中添加代碼:

 

代碼如下:
'components'=>array(
...
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,//注意false不要用引號括上
'rules'=>array(
'sites'=>'site/index',
),
),
...
),

 

3.配置服務(wù)器,Yii可以在Apache和Nginx下配置

1)Apache

在Apache服務(wù)器下,Yii需要配置.htaccess文件。配置如下

 

代碼如下:
RewriteEngine on
# prevent httpd from serving dotfiles (.htaccess, .svn, .git, etc.)
RedirectMatch 403 /\..*$
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php

 

2)Nginx

Yii可以使用Nginx和PHP的FPM SAPI。配置如下

 

代碼如下:
server {
set $host_path "/www/mysite";
access_log /www/mysite/log/access.log main;
server_name mysite;
root $host_path/htdocs;
set $yii_bootstrap "index.php";
charset utf-8;
location / {
index index.html $yii_bootstrap;
try_files $uri $uri/ /$yii_bootstrap?$args;
}
location ~ ^/(protected|framework|themes/\w+/views) {
deny all;
}
#avoid processing of calls to unexisting static files by yii
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php {
fastcgi_split_path_info ^(.+\.php)(.*)$;
#let yii catch the calls to unexising PHP files
set $fsn /$yii_bootstrap;
if (-f $document_root$fastcgi_script_name){
set $fsn $fastcgi_script_name;
}
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fsn;
#PATH_INFO and PATH_TRANSLATED can be omitted, but RFC 3875 specifies them for CGI
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fsn;
}
# prevent nginx from serving dotfiles (.htaccess, .svn, .git, etc.)
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
}

 

使用如上配置,你可以在php.ini中設(shè)置cgi.fix_pathinfo=0,這樣可以避免許多不必要的系統(tǒng)的stat()調(diào)用。

基本安裝和配置就到這里~~

分享:PHP實(shí)現(xiàn)加密的幾種方式介紹
這篇文章主要介紹了PHP實(shí)現(xiàn)加密的幾種方式,非常全面實(shí)用,都是項(xiàng)目中經(jīng)常需要用到的,需要的朋友可以參考下 PHP中的加密方式有如下幾種 1. MD5加密 string md5 ( string $str [, bool $raw_output = false ] ) 參數(shù) str -- 原始字符串。 raw_output -- 如果可選的 raw

共2頁上一頁12下一頁
來源:模板無憂//所屬分類:PHP教程/更新時(shí)間:2015-03-12
相關(guān)PHP教程