Jump to content

System() Return Values


RayTaylorII

Recommended Posts

From the php manual entry for system: Returns the last line of the command output on success, and FALSE on failure.

 

I did see that in the PHP manual, but the command does not complete, so I would expect a false, but the return code is 50. 50 isn't part of the command output?

 

This is the actual line of code being executed:

 

system("unzip -qq  -P password /FTPRTLORD/ORDERS/ROrders_01012012_000501.ZIP -d /FTPRTLORD/ORDERS/",$retValue);

 

$retValue comes back 50.

AFAIK, system() returns FALSE if system() fails to execute, not the command within it. The value is what is being returned from the command. Have you run the command from the CLI?

 

I run the command in the linux command line interace on the IBM i and it runs fine.

Does the PHP/web user have permissions to run the command?

 

Actually, you are dead on!!!! I assumed (and you know what that does) that the user name I used to connect to the database was the same user who was used to run system commands...not so. Once I found the correct user being used, I updated permissions for that user and it works....

Thanks so much!!!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.