Search the Community
Showing results for tags 'exec'.
-
Hallo forum Im runing IIS 8.5 (windows 8.1) and i want to execute a .bat file on my windows 8.1 from my home page.. So i create a link that opens test.php: And here i want to call my test.bat (test.php and test.bat is located in the same folder) test.bat content (tried all these options) system('c:\WINDOWS\system32\cmd.exe /c C:\inetpub\www.kekec.dk\include\test.bat'); system('test.bat'); exec('c:\WINDOWS\system32\cmd.exe /c C:\inetpub\www.kekec.dk\include\test.bat'); exec('test.bat'); shell_exec("C:\windows\system32\cmd.exe /c test.bat"); shell_exec('test.bat'); My test.bat files content is (only for test): %SystemRoot%\explorer.exe This should open explorer on the host but what i managed to get is only the output: C:\inetpub\www.kekec.dk\include>C:\Windows\explorer.exe please advise (and just to mention that im executing with my admin user from test.php- after i have logged in to my web-page)
-
Hi, I'm Chris, first time here, I usually post on stackoverflow but I think that this is a little bit more complex than usual. I believe I really need a PHP expert to solve this issue. We have an application which is crawling the web. There's 2 main PHP scripts that are doing the work, using using proc_open, and exec() and running over a circular reference. Both scripts that compose the main structure are saving all and every single error on a custom error log, defined this way: //error_log @ini_set('error_reporting', -1); @ini_set('log_errors','On'); @ini_set('display_errors','On'); @ini_set('error_log','/var/www/vhosts/xxx/xxx/resonance/such_a_mess'); The problem is simple, after running for some hours or days, the application stops crawling. And there's no error information at all on the error_logs that could explain the problem or the reason why it stopped. I've been trying to get more details using Newrelic and XHProf, no luck.- There's no HTTP server involved on the execution of the scripts as they are being executed like I mentioned, using exec() and proc_open: exec("sh -c \"$cmd | logger\" > /dev/null &"); It has been around 3 months on the same situation... and to be honest the only thing I want at this point is to see a fatal error on the logs, to understand what's going on...
-
I am trying to execute git commands through exec() in php file. The php file is run in my localhost and i am trying to mainly execute these three commands:- cd change_to_git_directory git add * git commit -m hfwejfk git push but these commands are not getting executed as no changes are there in my git repository. So, what to do?
-
I have a shell command in Windows that copies and renames a folder to the same location. The working command looks like this: xcopy \\my-server\ourstuff\live_projects\xxxx_Project\*.* \\my-server\ourstuff\live_projects\projectstr /e /k /i /c I want to execute this command from within PHP using the exec() function. projectstr should really be a string variable ($projectstr) that, at present, may contain alphanumeric characters, spaces, minus signs, and underscores, but not commas, apostophes, or quotation marks. Is there a simple technique for rewriting this for the exec() command? I get so lost in backslashes and quotation marks that I don't know whether I'm coming or going. Any help appreciated.