Profile cover photo
Profile photo
Marie Sutton
71 followers -
Love to write about Kids, Hello Kitty and Toys.
Love to write about Kids, Hello Kitty and Toys.

71 followers
About
Posts

I have Selenium working with Phantomjs on a Centos 7 server, 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 (in the same directory),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 it's 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

I have Selenium working with Phantomjs on a Centos 7 server, 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 (in the same directory),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 it's 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

I have Selenium working with Phantomjs on a Centos 7 server, 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 (in the same directory),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 it's 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

Post has attachment
Add a comment...

Post has attachment
Add a comment...

Post has attachment

Post has attachment
Add a comment...

Post has attachment

Post has attachment
I've enjoyed putting together my new site about toys. it's very much a work in progress, but it is on the way!

Post has attachment
I'm developing my new website.Some interesting things about children's toys history.
Wait while more posts are being loaded