xiehy

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来设置该文件,但不能彻底解问题,具体解决方案,请看下篇随笔。

分类:

技术点:

相关文章:

  • 2021-11-20
  • 2021-12-05
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2021-12-16
  • 2021-10-12
  • 2021-12-26
猜你喜欢
  • 2022-02-22
  • 2022-12-23
  • 2021-06-21
  • 2021-12-10
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案