Jump to content

Alternative function for shell_exec()?


webmaster1

Recommended Posts

I'm installing a software on a hosted web account. My web host doesn't allow use of shell_exec() unless I upgrade to a private server. I need this for object caching.

 

Does anyone know of a work-around? I read an article that suggested replacing the function with something like curl.

 

Here's the installation report:

 

PHP 5.2.8 installed

Found database drivers for: MySQL SQLite

PHP server API is cgi; using ugly URLs (index.php?title=Page_Title)

Have XML / Latin1-UTF-8 conversion support.

Session save path (/tmp) appears to be valid.

PHP's memory_limit is 32M.

Couldn't find Turck MMCache, eAccelerator, APC or XCache; cannot use these for object caching.

 

Warning: shell_exec() has been disabled for security reasons in /home/...

 

Warning: shell_exec() has been disabled for security reasons in /home/...

GNU diff3 not found.

Found GD graphics library built-in, image thumbnailing will be enabled if you enable uploads.

Installation directory: /home/...

Script URI path: /anstrell/wiki

Installing MediaWiki with php file extensions

Environment checked. You can install MediaWiki.

Link to comment
https://forums.phpfreaks.com/topic/203072-alternative-function-for-shell_exec/
Share on other sites

may be you can use backtick operator?? I m not sure this gonna work for you...you can try though.

 

<?php $output = `c:\mybat.bat`;  
// NOTE THAT ` ` ARE NOT SINGLE QUOTES.  PHP WILL ATTEMPT TO  EXECUTE BACKTICKS AS A SHELL COMMAND
echo "<pre>$output</pre>"; ?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.