Programming :: Can Php Script Execute X11 Applications

Jun 2, 2010

If I put

Code:

$r = exec('whoami');
echo $r;

into my php script, it works fine. However, if I put

Code:

$r = exec('myX11application');
echo $r;

it doesn't (to be precise, the script still works, but myX11application is not executed). Of course, scripts are run by user "apache", who doesn't have access to X11 server and doesn't even have DISPLAY variable defined.I installed virtual framebuffer Xvfb, created a small bash script:

Code:

Xvfb :2
export DISPLAY=:2
myX11application

and called it with exec from php, but it still doesn't run since it looks like Xvfb can't start if the normal X server is running (I need that for development purposes). The reported error from Xvfb is

Code:

(EE) config/hal: NewInputDeviceRequest failed (2)

Is there a solution to have php running your X11 applications with normal X server running?

View 6 Replies


ADVERTISEMENT

Ubuntu :: Bug Trying To Execute All Update Applications And Reporting

Feb 8, 2010

I have a bug in the latest release of Ubuntu wich is stoppping me running update manager, or syn package manager. I cannot run a bug report as it comes back error. Is there a way to run using a command line. My system was fully up to date about a week ago.

View 3 Replies View Related

Programming :: Socket And Timer Programming - Server Doesn't Execute Any Msg Which Client Sent

May 16, 2011

i have a server program which accept multiple client connection and am using polling. like every 2 secs it will look to client whether any data is received after it binded. i have used setitimer but there is runtime error i got.. the server accept all client connection but doesn't execute any msg which client sent.

#include<stdio.h>
#include<stdlib.h>
#include<sys/socket.h>
#include<sys/types.h>
#include<netdb.h>
#include<unistd.h>
#include<pthread.h>
#include<string.h>
[Code]....

View 1 Replies View Related

Programming :: Code That Will Never Execute

May 23, 2011

Is there, by chance, a fancy name to describe code that must be in a program but will never be executed? In one of my (Haskell) programs, I have some error-handling code that must be in the program to keep the compiler happy (due to the type checking). However I know that, due to the logical structure of the program, it is impossible for the code to be evaluated. I am curious if there is a technical name given to code that must exist but cannot be executed.

View 6 Replies View Related

Programming :: Execute The String That Sed Actually Outputs?

Aug 2, 2010

I've been able to get the right output that I need from sed, but how can I execute the string that sed actually outputs?

View 3 Replies View Related

Programming :: Cannot Execute Binary File

Feb 11, 2011

I'm trying to compile a simple script for a ar71xx (bleeding edge /from snapshots) Openwrt router.I have previously compiled scripts for Kamikaze 8.09. I just copied the gcc file inside the SDK dir and used it without problems.

View 4 Replies View Related

Programming :: Execute Code For N Time?

Apr 23, 2011

I'm doing a program and I want it to execute some code during n seconds. For example e put a command in the shell like this 'ls % 10' and the program should run the command ls for 10 seconds.I'm trying something like this:

Code:
pid = fork();
if(pid == 0) {

[code]....

View 2 Replies View Related

Programming :: Execute Commands After Run Command?

Jan 13, 2011

I am executing a run command in a script after that i need to copy files into a directory which are the inputs for the run,on run a new shell is created and the remaining commands in the script does not execute,wot should i do to execute the remaining commands in the script??

View 2 Replies View Related

Programming :: Execute External Program Using C?

Mar 30, 2011

Assume two applications, Application A and Application B. Both are written in C language.I had tried to use system() function in Application A to execute Application B. It success, but Application A cannot continue its own tasks before Application B exit. I want Application A to execute Application B, but Application A can continue its tasks without waiting for Application B to exit.

View 3 Replies View Related

Programming :: Execute Bash Script In C?

Jan 31, 2009

I want to execute a bash script in a C program. Bash script return some message and I want to store this message in a C program. Anybody know how can I do it.
I know I can use 'system("bash myscript.sh")' command in C. But I want to store the message which script return.

View 7 Replies View Related

Programming :: Execute Iptables Command On Php?

Jul 25, 2009

i want to execute iptables command via php. i can run simple command as echo 'iptables -h'; but i can't run ipables -L and i create excutable file (firewall.sh). i can run it on console but not done on php.

View 7 Replies View Related

Programming :: Shell Can't Execute Through Ssh But Local Well?

Jan 10, 2010

The two host one is Aix 5.3 and another is Suse 10sp2 the both have the same script which including the following parts:

if [ `date +%a` = "Mon" ];then
if [ "$RESULT" = "" ]; then
echo "The `hostname` $DATE ok"

[code]...

View 1 Replies View Related

Programming :: Execute SQLite Db Commands From C++?

Jun 10, 2010

Anyone know how to execute SQLite db commands from C++?

View 1 Replies View Related

Debian Programming :: Execute System Command Using Qt

Feb 19, 2014

I was writing code to execute system command, using GDM3 an logged in as root (just commented line #auth required

pam_succeed_if.so user != root quiet_success , in /etc/pam.d/gdm3).

When i execute:

Code: Select allvoid criarWindowsDialog::on_pushButton_2_clicked() {
    ui->commandTextEdit->append("Processo iniciado ...");
    QProcess processo;
    QString comando;
    QStringList args;
    QString fullCommand;
    QString stdOut;
    QString stdError;

[CODE]..

View 0 Replies View Related

Programming :: Execute Multiple Sql Files Using Scripting?

May 19, 2010

My query is i have a.sql , b.sql , c.sql files which needs to be executed using "$ db2 -tvf a.sql"; "$ db2 -tvf b.sql"; "$db2 -tvf c.sql" , script with which i can execute all these sql files in a single shot.

View 4 Replies View Related

Programming :: Parallel Shell Scripts To Execute Using LAM?

May 29, 2011

i want to know whether we can write a shell script which can utilize 2 CPU's of a cluster...I heard its possible through C Shell [URL] But im familiar with bourne shell only....So is there a possibility to write Parallel Scripts.

View 5 Replies View Related

Programming :: Write A Function That Shall Execute Periodic?

Sep 1, 2010

I want to write a function that shall execute periodic. means if i set time 1 sec that function should execute in each 1 sec. let us call that function func1. But i dnt want to wait inside the func1 for that 1 sec. Meanwhile i want to run another function say func2 in background . some thing like less priority function. Whnever the time come to execute the periodic function func1 it has to go to func1 and then again in the waiting time , the second function func2 will resume. I wanted to know how to do it.. Can somebody tell me is it possible using signal in linux.

View 6 Replies View Related

Programming :: Execute An Application Hidden From The User?

Dec 12, 2010

is there anyway i can execute an application Hidden from the user?i used to do WinExec(Path, SW_HIDE) under windows, and now i do fork() + execv() but i dunno where to specifiy any values

View 4 Replies View Related

Programming :: Get Background Jobs To Execute Sequentially?

May 4, 2009

I'm looking for a general pointer, or label for what I am trying to do. Not a specific line of code. I've written a couple of small sh script that gets some user input, then calls several programs to run in the background with the &. My problem is, they all run at the same time. Is there some way to get these jobs to run sequentially rather than consecutively? If yes, what is this process called? I'm thinking there should be a way to line up background jobs in a job queue, similar to how a print queue works, one job at a time. After searching for a couple of hours, I'm thinking there must be a name for this, but I don't know what it is.

View 11 Replies View Related

Programming :: Unable To Execute FOR Loop In Shell?

Apr 19, 2011

hint me why and how to execute the below for loop, the way i am trying to?

[bkcreddy17@local:~]$ cat -n test
1 date
2 ls -l

[code]...

View 14 Replies View Related

Programming :: Unable To Execute A 4GE File In Ksh Shell ?

Apr 7, 2010

I am trying to execute a 4GE file using command something like this "/usr/bin/ksh path of the file with some arguments " ex: /usr/bin/ksh /home/abc.4ge S "./xyz" . I am able to execute the 4GE without this "/usr/bin/ksh" specifying in the command which basically runs in ksh shell itself. But when i try to run it exclusively using the path of the shell it gives me an error something like this "/usr/bin/ksh: /home/abc.4ge: cannot execute". I did check the permissions and all the file has execute permission.

View 7 Replies View Related

Programming :: Using Bash Command To Execute Output Of Awk?

Mar 24, 2011

I am trying to process a column separated data file, with a few bash command. For example, I have

Code:

file1 aaaa yes
file2 aaaa no
file3 bbbb yes

Let say I want to create new file with the output of first column and do something else with the output of 3rd column. Of course there are many ways to process this data file, but I wish to know by using awk, how could I do it. I'm trying:

Code:

awk '{system("touch $1")}' datafile

but the shell command will not able to get the awk '$1' output. How do I get this done ? And for another question, if the data file contains the variable name of a shell variable, how could I make use of it during a awk output ? For example I have a datafile1:

Code:

server1 yes
server2 no

And in another server declaration data file, I got this datafile2:

Code:

server1=xxx1
server2=yyy1

And in my awk script, I want to achieve something like (the syntax is definitely wrong, just to demonstrate what I assume it will like):

[code]....

View 12 Replies View Related

Programming :: __attribute__ ((constructor)) Function Does Not Execute

Mar 16, 2011

My setup is Ubuntu 10.04, eclipse 3.5.2 I have created the source for a shared object and a test program to test it. The program executes dlopen() and I get back a valid library handle. I can use that handle and dlsym() to get the address of my C exported functions just as I expect. I recently added a change to have the so instantiate an object at load time by using a __attribute__ ((constructor)) function named so_init(). I also added a main() function (one wasn't required before). Adding a bunch of printf()s and using the debugger in eclipse I watch the code run and the so_init() and main() functions are never called. As far as I can tell, eclipse has -shared, -fPIC and -Wl setup and specified correctly. Am I missing a compile/link flag? Is there some magic I need in the so_main.cpp to get this working. I have this written as dual source code. The same code works quite nicely in Windows which calls dllMain() as expected.

View 4 Replies View Related

Programming :: Execute C Program Through HTML On HTTP Web Server?

Oct 15, 2009

I would like to execute an already written C program that I am running on my embedded Linux, but from afar - through a HTML page. I am running an embedded Linux on my FPGA prototype board with a MicroBlaze soft processor. On this Linux i am running a httpd web server - I can serve html web pages to the outside through Ethernet connection. Now, I have a program written in C in this embedded Linux in /bin/gpio-test that does some stuff with my IO devices. Now I would like to control these IO devices through HTML web page - so I would like to be able to run this gpio-test program from a html web page and possibly send the program some parameters.

View 2 Replies View Related

Programming :: Automatically Mount USB Device - Execute Script

Jul 2, 2010

I got a headless server which should, when I plug in a usb stick/device, automatically mount it and execute a script (the script is located on the usb stick). Actually I'm talking about auto-mount & auto-run which is already present in desktop systems but not in server systems. until now I had manually mounted the usb stick via ssh connection and then executed the script by hand.

View 4 Replies View Related

Programming :: Execute Clia Commands At CLI Prompt Through Script?

Feb 18, 2011

I have a requirement to execute a series of cli commands and to show the outputs. The problem is with the below script I could able to log in to cli prompt and bring CLI prompt but after that cli commands have just get printed at the cli prompt for e.g. board 2, it never gets executed and terminates the script.

FYI : I am unable to post the script as getting You are only allowed to post URLs to other sites after you have made 15 posts or more. error. I need for throwing some commands at a prompt like ftp prompt through script.

View 2 Replies View Related

Programming :: Getting Shell Script To Execute IF New Row In Postgres SQL Is Added?

Mar 17, 2009

I do not want to use cron.I want it to be instantaneous. I am working on a web server where the hosts turned-on safe mode and turned off a-lot of the functions for PHP (including exec) in order to secure their servers. Outside of that, I do have access to chroot and can pretty much do anything on the server. I want to use ImageMagick to create dynamic images based on form data.

I was trying to find a work-around with PHP where I can still use ImageMagick (a shell-based imagining program) by causing SQL to execute a shell script after the form data is saved to a table. Is there anyway it could cause a flag to automatically run a shell script when someone adds a new row to a certain table. It has to be instantaneous, more or less, so that the user isn't sitting there waiting for a minute for cron to catch any changes to the database.

View 1 Replies View Related

Programming :: Execute A Shell Script (with Source Command)?

Nov 19, 2010

This is weird. I have a shell script with no execute rights.$ chmod -x test.shThen I try$ test.shwhich does not work. (I have "." in PATH)When I do$ . test.shit works! I can run the script even though I have no execute rights. Why is that?Another question: If I have a shell script without a hash bang, I still can execute the shell script. Why? What does hash bang do? If there is no hash bang, why is the shell script run? What does the hash bang do

View 9 Replies View Related

Programming :: Simultaneously Execute All Perl Scripts Within A Folder?

Apr 27, 2011

Is it possible to simultaneously execute all perl scripts within a folder? How?

View 1 Replies View Related

Programming :: Perl One-lines Within A Ksh Script In Aix Environment Not Execute?

Jul 19, 2011

I have a script to utilize the perl one liner to replace a ip address.

Code:

#!/usr/bin/ksh
set -x
PRIP=172.15.100.176
OPRIP=172.15.100.115

[code]....

the script runs fine. but the perl one liner seems not working at all. but if i copy the perl line to a command line, it runs correctly.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved