I need to run from the command line (PHP CLI) some files that were encrypted by Zend Guard and php just seems to quit as soon as it reaches an encoded file without any error message. Is it possible to execute PHP scripts that are encoded by Zend Guard from the command line?
More details
In the application I'm currently working on, some tasks needs to be run periodically. At first, we implemented controllers for some urls that where used only to run the tasks. Then we would do a cron job using wget
on those pages. The problem is that some of those tasks needed parameters to run. Using wget
to do a POST request does not work since the first thing that Zend Guard does is assign a cookie and then do a redirect to the same URL. On the second request, since it's now in GET, all the parameters were lost.
We then decided to move to a command line script to correct the problem. We really like this approach since it solves issues we've had with the URL-based one. First, it does not keep an open Apache connection for an extended period of time. Also, it does not expose some internal logic on public URLs. As I stated earlier, when we try to execute these command line scripts, nothing happens, the application simply quits.
We are using Ubuntu 12.04 LTS, PHP 5.4.25 and Apache 2.2.22. I made sure that the Zend Guard extension was correctly loaded in the command line. Also, it works correctly when the pages are accessed by a web browser.
If anyone can help me with this problem, it would be much appreciated. Thank you!
curl
s the script? Firstcurl
opens the connection, gets the cookie and gets redirected. The secondcurl
does a POST request and sends the cookie. Doesn't have the advantages of your second approach but I think it'll work. – Unsupportable