473,800 Members | 2,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3806
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
3256
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 Win executables from this Linux-based Apache server. Actually if I use exec() command running Linux commands, something like : $command="mv /store1/www/file1.txt /store1/www/file2.txt"; exec($command, $ar_output, $res_command);
14
11686
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 php script. The code is given below (with line numbers). 01 <?php 02 $output = exec("pwd");
2
5295
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 time. The transcript so far is reproduced for your amusement below. To summarise: I've put up a Sudoku-solving program called Sudoku.exe. I want to call it in a php script to solve a puzzle and output the solution. It works fine with...
6
8388
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 problem is this line: set oCommand = WshShl.Exec(sCommand) (it's about halfway down)  Is there a problem with the Exec method in some versions of VBS?  Is the problem Windows version I'm on, or is it something more obvious that I'm just not...
1
5081
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 them with a batch file that changes to my apps home directory. I've tried exec() with a full pathname (which seems to have problems on Windows if it has spaces in it, but I'm not sure if that's really the problem), with just the simple short batch...
5
40502
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 files junk1, junk2, junk3, and i want to have the java program delete all of these files.
0
1292
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
3666
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. Or for a day. Or even for a week. At a certain point, when a php script calls the exe file, the application freezes. The following happens:
8
6616
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 ability for the page to start a file browser via PHP's exec() function. I can't get this working under Ubuntu though e.g. <?php exec('nautilus /var/www'); ?>
0
10507
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10255
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10036
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7582
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6815
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2948
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.