1

I am using a php script from github to capture screenshot of a website. Its working fine in localhost. But not working after uploading the same code to my server (linux hosting). I tried uploading to multiple servers. None of them worked. No error codes are coming.

In the documentation, it says:

Make the bin executable chmod +x /var/www/html/screen/bin/phantomjs,

Make your folder writable

I am not sure what does that mean, so i set file permissions of whole files and folder to 777. Still not working

How did i upload to my server.

I uploaded the whole code to the server. Changed file permissions of all directories and files to 777 using FileZilla. I have attached a screenshot of it. enter image description here

Community
  • 1
  • 1
Gijo Varghese
  • 11,264
  • 22
  • 73
  • 122
  • No errrors at all? Does the script work when you run it manually? Have you checked that phantomjs really is at /var/www/html/screen/bin/phantomjs on the real server ? – Vaviloff Dec 30 '15 at 05:12
  • Yes. I tried it manually. The link is http://wdudes.com/demo/screen-master/shot.php?url=google.com But how to locate it? Whats the need of it? I didn't get – Gijo Varghese Dec 30 '15 at 05:14
  • Please update question with telling about how you deployed the script on the server, with complete paths and permission you've set. Otherwise it's going to be a long string of comments here. – Vaviloff Dec 30 '15 at 05:19
  • @Vaviloff ok. I have updated the question with all details. Pls check it – Gijo Varghese Dec 30 '15 at 05:52
  • Have you set the permissions recursively? – StoryTeller Dec 30 '15 at 05:53
  • yes. I selected recursively and "apply to all files and directories" – Gijo Varghese Dec 30 '15 at 05:55
  • some server doesn't have PHP-GD library installed. if you're working with image processing check for GD lib. using php info method. and install it. – Kaleem Ullah Dec 30 '15 at 06:13
  • but i have used the same code in the same server 2 years back. It was working – Gijo Varghese Dec 30 '15 at 06:16
  • Yes. I contacted server guys, they said it is supported by default – Gijo Varghese Dec 30 '15 at 06:20
  • What hosting do you use, is it by a chance a shared(virtual) hosting? Do you have SSH access? Can you log in to server via SSH, go to the `bin` directory where phantomjs is and run `./phantomjs --version` ? – Vaviloff Dec 30 '15 at 09:29
  • i am on shared hosting. I don't have ssh access – Gijo Varghese Dec 30 '15 at 09:50
  • Then most probably you can't execute external programs with PHP, hence can't launch PhantomJS. I would strongly recommend to buy a cheap VPS (find one at lowendbox.com or just buy one from digitalocean/vultr) and experiment on it, while learning Linux server basics. – Vaviloff Jan 03 '16 at 16:16

1 Answers1

-2

I think it is still permissions issue, You need to set the proper permissions using putty.

 1. Login using putty
 2. Open root directory
 3. Set permissions file and folder using this command
     ===> chmod -R 777 folder name
Sotiris Kiritsis
  • 3,178
  • 3
  • 23
  • 31