0

I have created a makefile as below:

.PHONY: all update-repo dependency-install unit-tests file-permission

    all: update-repo dependency-install unit-tests file-permission

    update-repo:
        git reset --hard
        git pull origin master

    dependency-install:
        composer update

    unit-tests:
        vendor/bin/phpunit

    file-permission:
        chmod 777 application/logs
        chmod 777 application/cache
        chmod 777 application/models/proxies

Now trying to execute it from php with following script:

echo shell_exec("make");

Not that both files are given 777 permission.

Now I am trying to execute those make commands by executing the php script from web url. After executing start, I only get following output:

git reset --hard
HEAD is now at 758a275 test commit
git pull origin master

So, for some reason other commands aren't being executed. Does anyone have any clue why? Thanks.

Rana
  • 5,912
  • 12
  • 58
  • 91
  • Whatever it is that you are trying to do, **chmod 777 is always wrong** and a serious security problem. – tripleee Aug 11 '14 at 19:34

1 Answers1

1

This is a permissions issue. Make sure the errors are also going to stdout to find out what is going wrong:

echo shell_exec("make 2>&1");

More info: In the shell, what does " 2>&1 " mean?

Community
  • 1
  • 1
danemacmillan
  • 1,202
  • 12
  • 13