hosted by liquidweb

Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : exec or something like it

Forum Jump

exec or something like it

Reply Post New Thread In Programming Discussion Subscription
Send news tip View All Posts Thread Tools Search this Thread Display Modes
New Member
Join Date: Sep 2002
Location: TX
Posts: 4

exec or something like it


what I need to do is from a PHP script, spawn a GUI program (not in PHP). exec does not seem to work for that and I'm not sure how to aproach this. It's probably very simple. Could someone please help?



Sponsored Links
New Member
Join Date: Sep 2002
Posts: 4
try shell_exec

this should work add & at the end of the command not to get the output sent back to the script

Hassan El Forkani
Founder And Maintainer of : EveryOne's Africa
Freelance IT Consultant / Web Applications Developer.
Tel : 0021671880014

New Member
Join Date: Sep 2002
Location: TX
Posts: 4
this does not work either
i think this might be a special case because the program i wish to start up is a gui
this is driving me crazy

Sponsored Links
New Member
Join Date: Sep 2002
Posts: 4
need details

what is the platform you are working on ? (OS, WebServer...)
also, could you post the code, so i can get a better idea.

New Member
Join Date: Sep 2002
Location: TX
Posts: 4
I'm on a Sun system
Solaris environment
Apache web server

right now, I'm just trying to get the test script working. something like this:



//system( "/homes/mgurtova/public_html/DL/mikehup/mikehup /usr/fdlib/bin/cvsgui
&" );
//shell_exec( "/usr/fdlib/bin/cvsgui &" );
exec( "/usr/openwin/bin/xterm -e /usr/local/gnu/bin/ls" )



The "Hi" and "Done" both print, but an xterm never opens
same with shell_exec and system

the goal of my program will not be to open an xterm, of course, but this is just for testing

WHT Addict
Join Date: Aug 2002
Location: Davis, CA
Posts: 168
Your X server probably isn't allowing the script to display because its run by your web server user.. This is to prevent random people from loading programs into your X. Look at the 'xhost' command or xauth (?? not sure if thats right or not) to allow this..

You can test it by logging in as a different user and try running an graphical program.. It'll probably say something like this:

Xlib: connection to ":0.0" refused by server
Xlib: Client is not authorized to connect to Server
Error: Can't open display: :0.0

Also, I don't usually run scripts from php, but have you tried the back-tick for run a command? back-tick meaning ` (not an apostrophe, a `). For example:

echo `ls -al`;

Registered User
Join Date: Jul 2001
Location: Coventry, England
Posts: 130
Just as a side note, I'm sure this doesn't really need saying but when executing system commands, make sure there's no holes for users to execute anything they want etc!

New Member
Join Date: Sep 2002
Location: TX
Posts: 4
after wakkow's post, I realized I was trying to do something very wrong and suddenly felt much shame!

the solution, if anyone is interested to know: i need to write a plugin

thank you all for your time and comments and help!


Related posts from
Title Type Date Posted
Joyent Raises $15M as it Emphasizes Use of Trendy Container Technology Web Hosting News 2014-10-31 10:32:40
Lack of Cloud Training and Education Creates Poor Cloud Experience for UK Public Sector Workers Web Hosting News 2014-05-21 11:22:56
BackupAgent Launches Cloud Backup Service for Managed Service Providers Web Hosting News 2013-12-05 10:56:26
Symantec to Discontinue Backup Exec.Cloud; Customers Presented with Next-Step Options Web Hosting News 2013-12-03 14:49:46
Colocation Firm PeakColo Names VP of Finance and Administration Web Hosting News 2013-01-08 16:51:02

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

Forum Jump
Log in with your username and password

Forgot Password?
WHT Host Brief Email:

We respect your privacy. We will never sell, rent, or give away your address to any outside party, ever.

Web Hosting News:
WHT Membership
WHT Membership



Welcome to

Create your username to jump into the discussion! is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.

(4 digit year)

Already a member?