|
做開發的時候,操作session有時候會遇到這個問題:Warning: session_start() [function.session-start]……
php環境:
OS:CentOS release 5.2 (Final)
Apache:
Server version: Apache/2.2.3
Server built: Jan 15 2008 20:33:30
php:
php 5.1.6 (cli) (built: May 24 2008 14:07:53)
Copyright (c) 1997-2006 The php Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
報錯信息如下:
復制代碼 代碼如下:
Warning:session_start()[function.session-start]:open(/var/lib/php/session/sess_itqfqua1554rmkgcb8u89ujem5,O_RDWR)failed:Permission denied(13)in www_path on line 9
Warning:Unknown:open(/var/lib/php/session/sess_itqfqua1554rmkgcb8u89ujem5,O_RDWR)failed:Permission denied(13)in Unknown on line 0
Warning:Unknown:Failed to write session data (files);Please verify that the current setting of session.sav_path is correct (/var/lib/php/session)in Unknown on line 0
解決辦法:
方法1、注釋掉/etc/php.ini中
session.save_path = “/var/lib/php/session”
方法2、查看apache用戶和組,然后將該用戶加到session文件夾所處的組中。
方法3,在session_start() 前不要有任何輸出!
然后重啟Apache;
OK,問題解決!
php技術:PHP錯誤WARNING: SESSION_START() [FUNCTION.SESSION-START]解決方法,轉載需保留來源!
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。