Skip to content

Instantly share code, notes, and snippets.

@chzyer
Last active December 10, 2015 22:48
Show Gist options
  • Save chzyer/4504722 to your computer and use it in GitHub Desktop.
Save chzyer/4504722 to your computer and use it in GitHub Desktop.
解决一个使用AMPServ建立虚拟主机的session权限问题

面对一个电脑上的多个网页,建立虚拟主机是一个很好的归类方法 一般为了方便,我是使用APMSERV建立虚拟主机的,但是在建立phpmyadmin的虚拟主机时,无法正常运行,而是显示

	Warning: session_start() [function.session-start]: open_basedir restriction in effect. File(C:\WINDOWS\TEMP) is not within the
	allowed path(s): ….

警告说明,是session_start()这个函数执行出现异常,原因是文件不允许被写入C:\WINDOWS\TEMP 设置允许写入文件的路径是open_basedir参数 找到apache目录下的conf/apmserv/vhost.conf,配置虚拟主机信息 找到open_basedir在后面加上C:\WINDOWS\TEMP

如 PS:我的设置的域名是fd.cn,目录在D:/Site/www/htdocs/fl_document,

<VirtualHost *:80>
ServerName fd.cn
DocumentRoot "D:/Site/www/htdocs/fl_document"
<Directory "D:/Site/www/htdocs/fl_document">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.shtml index.aspx default.aspx
AllowOverride None
Order Deny,Allow
Allow from all
php_admin_value open_basedir "D:/Site/www/htdocs/fl_document/;D:/Site/tmp/uploadtemp/;C:\WINDOWS\TEMP;"
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment