How to accesss installed program from PHP script

Discussion in 'Installation/Configuration' started by Niro, Dec 13, 2009.

  1. Niro

    Niro New Member

    I installed s3cmd and can run it from command line but from PHP script using shell_exec() it does not run and no error is returned. I suspect that the reason is that the PHP user is 'apache' and not the root user.

    My qustion is : how can I install s3cmd (I used Yum Install) on Centos5 so that the PHP script will be able to run it?

    Thanks,
    Niro
     
  2. id10t

    id10t Member

    Have you tried giving shell_exec() the full path to the binary?
     
  3. Niro

    Niro New Member

    Yes I have, Its not the path.
     
  4. id10t

    id10t Member

    What are the permissions on the binary?
     
  5. topdog

    topdog Active Member

    you can also use passthru, exec and system to run commands, these are better options as they provide u with feedback on the success or failure of the command.
     
  6. Niro

    Niro New Member

    permission is 755 .The owner was 0 but I tried also after changing the owner to 48 (apache user id)
     
  7. falko

    falko Super Moderator Howtoforge Staff

    Do you use PHP Safe Mode? Is SELinux disabled?
     
  8. Niro

    Niro New Member

    I see in my phpinfo SELINUX_INIT =YES

    PHP safe mode is off.

    Please help.
    - Nir
     
  9. Niro

    Niro New Member

    I used passthru and system and the feedback It gives is '1' (using the extra parameter that returns the output).

    Please help
    - Nir
     
  10. falko

    falko Super Moderator Howtoforge Staff

    What happens when you turn off SELinux?
     

Share This Page