Snacks
Snacks

Reputation: 513

command works in the terminal, wont work in php

I've made an extension for my web application in php. I want the php script to remake the extension, so I'm trying to send a command to the terminal. It looks like this:

shell_exec("make -C /folder1/folder2");

And it won't make the .so file no matter what. I've used chmod 777 on that folder to make it editable but it didn't help. When I'm directly using the command in the terminal it works just fine:

make -C /folder1/folder2

The .so file gets created without a problem, functions from my extension work like they should. Does anyone have a solution for this?

Upvotes: 1

Views: 111

Answers (1)

aynber
aynber

Reputation: 23011

Make sure that PHP is not running in safe mode and that the PHP user has read/write access to the files and folders. Read the comments at shell-exec for more information.

Upvotes: 1

Related Questions