php execution phantom js works but casperjs does not work permission denied

前端 未结 1 1491
-上瘾入骨i
-上瘾入骨i 2020-12-17 08:21

okay so i am running centos 6.5 with zpanel setup. this then has phantom js and casperjs both setup and working it the

/usr/local/bin 

dir

相关标签:
1条回答
  • 2020-12-17 08:56

    Another one of my own questions answered by myself I am happy that I am starting to understand this new Hobby :) well any way luckily I am using virtual box whilst developing my server to my needs and every time I complete a task like install Zpanel configure it I create a clone.

    so what I done is I reverted back to my server set up before the PhantomJS and CasperJS. I then installed both PhantomJS and CasperJS using the following methods and then used my test.php script to test server functionality

    Okay I used the following to install PhantomJS

    # wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-i686.tar.bz2
    # tar xvf phantomjs-1.9.1-linux-i686.tar.bz2
    # cp phantomjs-1.9.1-linux-i686/bin/phantomjs /usr/local/bin
    

    Then I use these Commands For CasperJS install

    # cd /opt
    # wget https://codeload.github.com/n1k0/casperjs/legacy.zip/1.1-beta3
    # unzip 1.1-beta3
    # ln -s n1k0-casperjs-4f105a9/ casperjs
    # ln -s /opt/casperjs/bin/casperjs /usr/local/bin/
    

    I then created this on my server

    PHP Test File Test.php

    <?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');
    
    ?>
    

    After this I ran Test.php And got this result

    Running PhantomJS version: 1.9.7
    Running CasperJS version: 1.1.0-beta3
    

    My Server Now Runs CasperJs With PhantomJS

    Please Uprate This Answer if you like it :)

    0 讨论(0)
提交回复
热议问题