我正在尝试在Ubuntu上安装phpsh,并且在安装指南中做了所有操作,但出现此错误:
Starting php
Traceback (most recent call last):
File "/usr/local/bin/phpsh", line 47, in <module>
verbose=opts.verbose)
File "/usr/local/lib/python2.7/dist-packages/phpsh/__init__.py",
line 503, in __init__
self.php_open_and_check()
File "/usr/local/lib/python2.7/dist-packages/phpsh/__init__.py",
line 641, in php_open_and_check
self.php_open()
File "/usr/local/lib/python2.7/dist-packages/phpsh/__init__.py",
line 698, in php_open
preexec_fn=os.setsid)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
为什么会出现这些错误?如何在Linux上安装phpsh?
最佳答案
使用以下命令从终端打开〜/.bashrc:
linux@terminal:vi ~/.bashrc
在其中设置PYTHONPATH和路径:
export PYTHONPATH=~/lib/python2.6/site-packages
//Put the above value as your site-packages directory location,
//yours may have a different python version number.
然后将
~/bin
以及您的目录结构添加到PATH中。