I have Selenium working with Phantomjs on WebFaction, BUT...only on the SSH/CLI. What I really want to do is run a Python script from PHP and get the resultant output. When I use SSH command 'python myscript.py' it works properly. When I run the PHP (which calls the python file using the exec method)in SSH 'php myphpfile.php' it also works properly. However, when I try to run the php file in a browser (using the exec method) it quickly returns a blank page. I have another php file using the exec method to call a python file on WebFaction which works seamlessly. The difference is that this one does not use selenium (it uses Mechanize and BeautifulSoup). I have tried for hours to resolve this. Obviously there is some kind of problem between apache/and selenium but not apache and Mechanize et al. I guess more simply its that python is ok, but js is not since the browser access through php exec is fine when using python scripts. I did read that via the web apache launches a process that has PHP in it. via command line there is no apache process. That's why I am traveling down that line....??? Still does not explain why I have success with php exec when there is no selenium/phantomjs involved. Any ideas/suggestions/fixes? I do not have root access on SSH with my account asked 26 Apr '16, 02:24 maries |
On our system, PHP is served via php-cgi - so, you'll see a process like "php55.cgi" while the request is being processed, but it won't persist beyond that.
Check the PHP error logs for your site for clues, You can find the log at Hope that helps! answered 26 Apr '16, 17:40 seanf |