Sentora Support Forums

Full Version: Problem getting Phantomjs and Casperjs to run on a sentora panel
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi I'm at a bit of a loss here i must admit and cant work out what the hell I'm doing wrong

I'm trying to get phantomjs and casperjs to run via a php exec command on a domain run via sentora panel.

I installed sentora panel first

Then I installed Phantomjs via


Code:
# wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 # tar xvf phantomjs-2.1.1-linux-x86_64.tar.bz2 # cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin

I then Installed CasperJs via


Code:
# cd /opt # wget https://github.com/casperjs/casperjs/zipball/master # unzip master # ln -s casperjs-casperjs-7505339/ casperjs # ln -s /opt/casperjs/bin/casperjs /usr/local/bin/


So both casperjs and phantomjs are in local bin file and my version of python is 2.6.6

I then run this php script with chmod 777


PHP Code:
<?php
    
## This Function Below Sets PhantomJs So CasperJS Can Use It
 
   putenv("PHANTOMJS_EXECUTABLE=/usr/local/bin/phantomjs");
 
   echo "Running PhantomJS version: ";
 
   echo exec('/usr/local/bin/phantomjs --version 2>&1');
 
   echo "<br />";
 
   echo "Running CasperJS version: ";
 
   echo exec('/usr/local/bin/casperjs --version 2>&1');

?>

and should get
Quote:
Code:
Running PhantomJS version: 2.1.1 Running CasperJS version: 1.1.1


but just get

Quote:Running PhantomJS version:


Is there anything at all in sentora which would stop this from running?

I've spent 4 days trying to solve it and its driving me cuckoo!
You can't! As sentora will sandbox php using openbase_dir to user directory. Otherwise it's not secure.

If it's a dev box that you are only accessing it. Then you can disable openbase_dir.

M B
Hi Me.B

There is no direct user input

I've gone into Module admin > Apache config

And turned "Use Open Base Dir" to false

I've also gone into override a virtual host setting and unticked open base dir for my domain aswell

It's still not playing ball however and im still getting Running PhantomJS version:

is there anywhere else i should disable open base dir?
No you disabled everywhere. So if any user/Script on the system can access all the server.

In case you get a hack or allow other users to set websites they will own the server in few lines.

M B