PHP: exec command not working; debugging exec command

While using PHP exec command, if it is not working , Follow these to debug

1. Check your web server error_log.
Usually in MAC, for APACHE web server, it is located at /var/log/apache2/
1.1 Case1: the web server does not have permission to read/execute a command/file.
Solution to Case1: Simple, change file permissions.

1.2 Case2: The exec command will throw sh: Command Not found
Solution to Case2: Read this

2. Append 2>&1 to your command to get std errors as well. Read this for more info

No comments:

Post a Comment

Python contextlib for Timing Python code

If you've ever found yourself needing to measure the execution time of specific portions of your Python code, the `contextlib` module o...