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

  • 相关阅读:
    scrapy--Cookies
    python--signal
    python--redis
    TCP/IP 协议
    python--Wrapper
    python--inspect
    python--pexpect
    linux 特殊命令(一)
    day45 Pyhton 数据库Mysql 02
    day44 Pyhton 数据库Mysql
  • 原文地址:https://www.cnblogs.com/xiehy/p/5104948.html
Copyright © 2011-2022 走看看