0

I'm new to phantomjs and I don't know how to use it on linux. The same code that is provided below is working fine on windows but don't know what is wrong with it on linux.
First I just wanna tell you that phantomjs text file and PHP file are in the same folder.

Here is my php file:

<?php
$response =  exec ('phantomjs get.js', $one, $two);
var_dump($response);
?>

Here is get.js

var page = require('webpage').create();
page.settings.loadImages = false;
var fs = require('fs');
var path = 'file.txt';

page.open('http://www.google.com', function () {
page.render('page.png');
var content = page.content;
fs.write(path, content, 'w');
phantom.exit();
});

But there is no response on file.txt and var_dump(). I have a shared hosting plan. Is it due to some permission problems?

Jahanzaib Asgher
  • 252
  • 1
  • 11

0 Answers0