473,383 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

exec() with Linux

I have to execute vlc (Video Lan) using exec() function under Linux debian
distribution. Running vlc from a shell works perfectly, but I have a lot of
problems if it is executed with function exec:

TEST 1

<php
$command = "vlc";
exec ($command);
?>

I get an error message in apache log file:

VLC media player 0.8.6c Janus
[00000287] skins2 interface error: Cannot open display
[00000287] skins2 interface error: cannot initialize OSFactory
Error: Unable to initialize gtk, is DISPLAY set properly?

What is the DISPLAY to set ? Please consider I am a newbie in Linux.
TEST 2

Same as before but running vlc with --daemon option. Now seems that vlc
process is running and I don't get any error message in apache log file, but
it does not record any input stream.

Is there anybody that can help me ?
Thank you.
Stefano
Nov 5 '07 #1
2 3791
On Nov 5, 6:45 pm, "Stefano" <o...@interfree.itwrote:
I have to execute vlc (Video Lan) using exec() function under Linux debian
distribution. Running vlc from a shell works perfectly, but I have a lot of
problems if it is executed with function exec:

TEST 1

<php
$command = "vlc";
exec ($command);
?>

I get an error message in apache log file:

VLC media player 0.8.6c Janus
[00000287] skins2 interface error: Cannot open display
[00000287] skins2 interface error: cannot initialize OSFactory
Error: Unable to initialize gtk, is DISPLAY set properly?

What is the DISPLAY to set ? Please consider I am a newbie in Linux.

TEST 2

Same as before but running vlc with --daemon option. Now seems that vlc
process is running and I don't get any error message in apache log file, but
it does not record any input stream.

Is there anybody that can help me ?

Thank you.
Stefano
Think about executing another application in the web-environment: do
you think it would work if you tried to exec( "winword" ) (Microsoft
(R) Word)? Of course not. You can't just "run" an application from php
and have it shown in the browser window.

Nov 6 '07 #2
You are probably on the right track, but it's going to be hard for anyone
to help without knowing that program. Here's an idea: From a shell window,
do "unset DISPLAY", then try to get the program to do what you want. Once
you can do that, you can try it from the web server.
It doesn't work unsetting DISPLAY.
May be using vlc is not the right way to record a video stream in php. Do
you know other ways to do that ?
Nov 6 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paolo Scolamacchia | last post by:
Hi everybody, this is my environment : Apache is installed on a Linux server (RedHat9A) and I launch the browser on a PC running WindowsXP to execute php scripts on the Linux server. I would run...
14
by: Hemanth | last post by:
Hello there, I'm new to PHP. I'm trying to run a simple php script (on a Red hat linux machine with apache web server ) through a windows web browser (IE). I'm using an exec() function in my...
2
by: Greg Chapman | last post by:
I am at my wit's end trying to get information out of Streamline.net's support dept about my problem. They reply quickly enough, but seem to try and give out the least possible amount of info each...
6
by: Hal Vaughan | last post by:
I have a script used to find and run Java on a Windows system.  It worked fine on original tests (on a Windows XP system).  It's now running on a Windows 2000 (sp3) system, and it won't work -- the...
1
by: Hal Vaughan | last post by:
I've been using Runtime.exec() like this: Runtime rt = Runtime.getRuntime(); try {Process p = rt.exec("MyCommand.bat");} catch (Exception e) {do stuff} When I start my Java classes, I start...
5
by: JW | last post by:
Hi, I don't seem to get any results from the following use of Runtime.getRuntime().exec(cmd) using Java 1.4 on Redhat linux. Suppose that in the same directory as my java file below, I have...
0
by: Ernie | last post by:
Hi, I spent more than an hour wondering why the following works in my Python 2.3.4 Linux box: formula = """ def dummy(): print "This is Ok!" """
26
by: warth33 | last post by:
Hello I have a php site. Some page needs to call an external program. The programs are home made c# applications. It uses to work without problem. For a while. Maybe it work for some hour....
8
by: r0g | last post by:
Hi There, I'm trying to migrate a locally hosted page from windows to a private Ubuntu development server and one of the key bits of functionality (which used to work fine in Windows) was the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.