PHP call python script - problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ianripping
Forum Newbie
Posts: 17
Joined: Thu Feb 05, 2004 3:20 am
Location: Leeds, UK

PHP call python script - problem

Post by ianripping »

Hi,
I am calling a python command from PHP using

system($command)

The python script copies a file from one serer to another server.

If I run the python script outside of PHP - i.e from the command line, it works.
If I call it from PHP it doesn't.

All other function work in python - except when copying a file from one server to another.
Is there some problem with PHP's / Apache's interaction with system commands?


Someone has recommended doing the following with Apache but would like some advice first...
Start>Run>services.msc
Right click "Apache...", select properties.
Click on the "LOG ON" tab
Check the box "Allow this service to interact with desktop"
Click OK
Restart Apache


Any ideas?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Someone has recommended doing the following with Apache but would like some advice first...
Start>Run>services.msc
Right click "Apache...", select properties.
Click on the "LOG ON" tab
Check the box "Allow this service to interact with desktop"
Click OK
Restart Apache
possible. Does the python script interact with the desktop (windows, message boxes etc)?

The default apache installation creates a service running on the account localsystem that (usually) has other settings and permissions than your interactive user account.
ianripping
Forum Newbie
Posts: 17
Joined: Thu Feb 05, 2004 3:20 am
Location: Leeds, UK

Post by ianripping »

volka wrote:
Someone has recommended doing the following with Apache but would like some advice first...
Start>Run>services.msc
Right click "Apache...", select properties.
Click on the "LOG ON" tab
Check the box "Allow this service to interact with desktop"
Click OK
Restart Apache
possible. Does the python script interact with the desktop (windows, message boxes etc)?

The default apache installation creates a service running on the account localsystem that (usually) has other settings and permissions than your interactive user account.
Hi, no it doesn't interact with desktop.

Do you know how to enable the apache account to have access to a shared folder on another server?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

What kind of shared folder is it?
What permissions/credentials do you need to access the server?
Post Reply