Results 1 to 2 of 2

Thread: GIT alias from PHP

  1. #1
    Join Date
    Oct 2013
    Beans
    17

    GIT alias from PHP

    Does anyone know how to call a GIT alias from php? I have an GIT alias referencing a shell script outside of the webfoot, yet shell_exec cannot excite it as it says it doesn't have the correct permissions. If I run the php code from CLI, all is fine and the alias is executed. I gave full file permissions just for testing 777 but unfortunately php still reports.

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,199
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: GIT alias from PHP

    First, if PHP is running in safe mode, shell_exec() cannot be used.

    PHP scripts run with the same permissions as Apache, those of the "www-data" user. That means the www-data user must be able to see and execute the file. If you have root privileges, put the script in /var/www for testing purposes with user and group www-data and execute privileges. Can you run it from there? Can you run any script from there, even a simple one like
    Code:
    #!/bin/sh
    echo "$(date +%c) - I was called" >> /var/www/test-script.log
    exit 0
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •