0

* edit * After reinstalling the module, everything worked fine.

I have installed a python module on my webserver.

When I do "whereis python" I get following path:

python: /usr/bin/python2.4 /usr/bin/python /usr/lib/python2.4 /usr/include/python2.4 /usr/share/man/man1/python.1.gz

Later when I check my modules path, it was installed here:

/usr/llib/python2.4/site-packages/MyModule/myModule

Now in my PHP script, I am doing this:

exec("python /usr/lib/python2.4/site-packages/MyModule/myModule script.py -v pixfx.xml 2>&1", $output, $return);

This script does not get executed.

Any issues with what I am doing so far?

Thanks

******************* edit ******************

#! /usr/bin/env python 
import sys 
import os 
import getopt 
import re 
from fontTools.ttLib import TTFont 
from fontTools.ttLib.tables.otBase import OTLOffsetOverflowError 
from fontTools.ttLib.tables.otTables import fixLookupOverFlows, fixSubTableOverFlows     
from fontTools.misc.macCreatorType import getMacCreatorAndType 
from fontTools import version 

1
  • Do not put things like SOLVED: in the title. Commented Dec 25, 2015 at 9:42

2 Answers 2

1

Should you be doing

exec("/usr/bin/python /usr/lib/python2.4/site-packages/MyModule/myModule script.py -v pixfx.xml 2>&1", $output, $return);

OR

exec("/usr/bin/python/python /usr/lib/python2.4/site-packages/MyModule/myModule script.py -v pixfx.xml 2>&1", $output, $return);
Sign up to request clarification or add additional context in comments.

13 Comments

ok I ran into another bug after I got the exec() to work. I have the module installed correctly, still I get following error: ************ Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/MyModule/myModulw/script.py", line 60, in ? from myModule.ttLib import TTFont ImportError: No module named myModule.ttLib ************** Any idea?
you would have to show the source of script.py and it loks like it cant import some fonts, im not that good at Python but if you post your code ill take a look
The script itself is about generating fonts. Thats why you see things like "TTFont" etc. These are module names :)
uts not the modules causing the script, its a parser error, witch to fix we need the source code of the .py
Hi, THis is how the .py script looks like: **************** #! /usr/bin/env python import sys import os import getopt import re from fontTools.ttLib import TTFont from fontTools.ttLib.tables.otBase import OTLOffsetOverflowError from fontTools.ttLib.tables.otTables import fixLookupOverFlows, fixSubTableOverFlows from fontTools.misc.macCreatorType import getMacCreatorAndType from fontTools import version ************************************ I have removed all the comments.... so the line 60 is "from fontTools.ttLib import TTFont"
|
0

You might find it useful to debug under the user that php is running under, ie www-data, apache, etc. This is helpful for uncovering any permission, path or environment issues that may arise.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.