LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-24-2010, 11:43 AM   #1
icsbcn
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Rep: Reputation: 0
gnome-web-photo & php


Hello,

I have implemented this script:

PHP Code:
<?php
shell_exec
('gnome-web-photo -t 0 --mode=thumbnail -w 512 -s 256 http://www.google.com /tmp/google.jpg');
?>
If I execute it in the shell it runs perfectly, but if I execute it in a browser I view this error: Cannot open display:

Somebody can help me please?

Thank you so much.
 
Old 02-24-2010, 11:57 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi, welcome to LQ!

The problem is that the script (run via browser) is run as
the apache user, not as your user account that owns the DISPLAY.

You could try (as yourself in the GUI):
xhost +localhost

and in the script:
export DISPLAY=:0.0



Cheers,
Tink
 
Old 02-24-2010, 12:11 PM   #3
icsbcn
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Same error

Hello,

First,
thank you for your quickly reply.

After done "gnome-web-photo" i have tried this sentences in the script and all of them has returned the same error:

gnome-web-photo -t 0 --mode=thumbnail -w 512 -s 256 --display=localhost:0.0 http://www.google.com /tmp/google.jpg

gnome-web-photo -t 0 --mode=thumbnail -w 512 -s 256 --display=:0.0 http://www.google.com /tmp/google.jpg

gnome-web-photo -t 0 --mode=thumbnail -w 512 -s 256 --display=localhost:10.0 http://www.google.com /tmp/google.jpg

Best regards
 
Old 02-24-2010, 12:14 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Try
Code:
DISPLAY=:0.0 gnome-web-photo -t 0 --mode=thumbnail -w 512 -s 256 --display=localhost:10.0 http://www.google.com /tmp/google.jpg
 
Old 02-24-2010, 12:24 PM   #5
icsbcn
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks again
I tried your new option and I see the same error ...

Cannot open display
 
Old 02-24-2010, 12:26 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Next question: are apache & the browser running on the same machine?
 
Old 02-24-2010, 12:31 PM   #7
icsbcn
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Yes,

and I am working with Fedora.
 
Old 02-24-2010, 12:35 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Try something for me, please:

open a shell, become the apache user, and try running the above manually.
 
Old 02-24-2010, 01:18 PM   #9
icsbcn
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Nobody user

with apache user appears the same error.
 
Old 02-24-2010, 03:17 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Please copy & paste the screen content of your activities here into [ code ] [ /code ] tags ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error when trying to compile gnome-web-photo-0.5 jhilgeman Linux - Server 0 10-24-2008 06:26 PM
Using PHP & MySQL to make a small web puzzle; help? Jorophose Programming 15 06-20-2007 09:38 PM
gnome-web-photo running against large files robbbert Linux - Desktop 0 10-01-2006 11:18 AM
Apache2, MySQL & PHP Web Server. FTP Needed! Bobson Linux - Networking 4 02-07-2005 05:25 PM
Apache Web Server w/PHP & Perl Mark Grinstead Linux - Software 2 07-18-2003 08:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration