• 0

in ATOM - the editor:  unable to run php-script :: guess that i miss some php-indigriends on the Linux-machine


Question

dear experts, 

 

the issue in ATOM - the editor:  unable to run php-script :: guess that i miss some php-indigriends on the Linux-machine

 

well i guess that i need to set the php - 
note: i am on MX-Linux - and i can install all what is needed via terminal

 

 

 

    <?php
    include_once('../../simple_html_dom.php');

    function scraping_IMDB($url) {
        // create HTML DOM
        $html = file_get_html($url);

        // get title
        $ret['Title'] = $html->find('title', 0)->innertext;

        // get rating
        $ret['Rating'] = $html->find('div[class="general rating"] b', 0)->innertext;

        // get overview
        foreach($html->find('div[class="info"]') as $div) {
            // skip user comments
            if($div->find('h5', 0)->innertext=='User Comments:')
                return $ret;

            $key = '';
            $val = '';

            foreach($div->find('*') as $node) {
                if ($node->tag=='h5')
                    $key = $node->plaintext;

                if ($node->tag=='a' && $node->plaintext!='more')
                    $val .= trim(str_replace("\n", '', $node->plaintext));

                if ($node->tag=='text')
                    $val .= trim(str_replace("\n", '', $node->plaintext));
            }

            $ret[$key] = $val;
        }
        
        // clean up memory
        $html->clear();
        unset($html);

        return $ret;
    }


    // -----------------------------------------------------------------------------
    // test it!
    $ret = scraping_IMDB('http://imdb.com/title/tt0335266/');

    foreach($ret as $k=>$v)
        echo '<strong>'.$k.' </strong>'.$v.'<br>';

    ?>

 

whe i activate the Run in the scripts - then i get back the following ..:


 

 

    unable to run
    php
    Did you start Atom from the command line?
      atom .
    Is it in your PATH?
    PATH: /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin


well i guess that i need to set the php - 
note: i am on MX-Linux - and i can install all what is needed via terminal


look forward to your advices 

regards
 

btw: i want to install vscode on MX-Linux - if you have any ideas & hints - i would be more than glad. - just contact me#!

Edited by tarifa
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.