linux+php+apache web调用python脚本权限问题


lamp : linux + apache + mysql + php

在近期项目中使用 linux + apache + php调用python脚本是出现以下权限问题:

 

build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 1823, in get_resource_filename
build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 1853, in _extract_resource
build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 1193, in get_cache_path
build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 1173, in extraction_error
pkg_resources.ExtractionError: Can't extract file(s) to egg cache
The following error occurred while trying to extract file(s) to the Python egg
Permission denied: '/var/www/.python-eggs'
The Python egg cache directory is currently set to: /var/www/.python-eggs
Perhaps your account does not have write access to this directory? You can change the cache directory by
setting the PYTHON_EGG_CACHE environment variable to point to an accessible directory.

 

从打印输出来看:没有权限访问'/var/www/.python-eggs'

可以使用chmod来设置该文件,但不能彻底解问题,具体解决方案,请看下篇随笔。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM