Jump to content

Server page with Putenv on Macos

Pasquale Cariello

Recommended Posts

Hi Everyone,

I need to call gcc compiler from my server page. In windows it works while on Macos it isn't.

// putenv("PATH=C:/MinGW/bin");// works on windows

putenv("PATH=/user/bin");//  doesn't work on macos


$objBlock= $scriptPath.$scriptName.".o";

$exeBlock= $scriptPath.$scriptName.".exe";

//echo $sourceBlock."<br>";echo $objBlock."<br>";echo $exeBlock."<br>";

exec("gcc ".$sourceBlock." -o ".$objBlock);

exec("gcc ".$sourceBlock." -o ".$exeBlock);



Thanks :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...