Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Problems With Executing Binaries With Exec()


I have problems with executing external programms in php with exec() and system(). When i am trying to execute some shell commands eg system('ls'), exec('whoami') there is no problem , with my binaries (the simplest hello world program in c++) - no problem.

But programms, which i've installed(./configure make make install) before, don't work.' For example i've installed cvs. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Exec - Executing External Programs
I have problem with executing external programs...
The code:
system("/home/pkunzip /arch.zip /3");
Does not work properly (nothing doeing)...

The code:
system("dir /w");
Working very-very good

View Replies !
Exec Command Executing The Program In The Background
i am running xampp on my computer from apachefriends.org, it's a apache server

this is the php script

<html>
<head>
<?php

exec ('notepad');
?>
</head>
</html>

but when i execute the php script on my computer , notepad doesnt not run

i used a process viewer and discovered that notepad is running in the background and i cannot see it

does anyone know how NOT to make it run in the background? i wan to see the notepad window on the apache server (my computer)

View Replies !
Executing Multiple Shell Commands Via One Exec()-call
I wrote a PHP shell script under Linux which puts all existing
[E]PS-Files within a directory into a list and should then start a
single Ghostview window for each file. Sounds simple, but it's not:

The following code provides for about half of the functionality I
wanted:

==============code starts
$bla = array();
foreach ($filelist as $file)
{
$bla[] = fopen("./trash/".$file.".tmp", "w");
exec ("gv ".$file." &", $bla);
}
===============code ends

Here, all files are opened one after another. The next file opens only
after closing the current one. Actually I don't know whether the
redirection of the output towards .tmp-files complies with the
intended purpose of the redirection. The PHP manual states that when
starting programs in background, the output would have to be
redirected to a stream or file, otherwise PHP would continue to run
until the respective program is terminated (which I really wouldn't
care about at all, if it did so...).

Then I thought about writing the line I would type manually for
opening all ps-files ('gv bla1.ps & ; gv bla2.ps&; ...') into a string
and then executing that string:

===============code starts
$command="";
$bla = fopen("./trash/tmp", "w");
foreach ($filelist as $i => $file)
{
if ($i < count($filelist) - 1)
{
$command = $command."gv $file & ; ";
}
else
{
$command = $command."gv $file &";
}
}
exec ($command, $bla);
===============code ends

sadly I get an error message from the shell:
================ error message starts
sh: -c: line 1: syntax error near unexpected token `;'
sh: -c: line 1: `gv uges_Boden.ps & ; gv ux_Boden.ps & ; gv
uy_Boden.ps &'
================ error message ends

View Replies !
Exec And Shell_exec Not Executing Batch File Properly
I am running Apache and PHP on windows XP. Latest versions of them all. I am trying to execute a simple .bat batch file that simply copies 4 files from one location to the batch files location.

The php exec command runs like this:
V:Corehtdocswp ransfer.bat Y:folder

here the batch file is executed and the command following is thrown into the batch file to specify where the files that need to be copied are.

The Y: directory is in windows considered to be a network drive, although it is really just a folder on the same machine, i did this because there are spaces in the folder names on its way to where I need the information copied from i.e. "Program Files"

When I run this in the command prompt by entering this in manually it runs perfectly. However when running exec in the PHP script nothing happens; when I run shell_exec it gives me the output and it shows that every line in the batch file is executed however it does not actually copy anything.

Looking into my apache error log I see that this is related:

"The system cannot find the drive specified."

Now what I am wondering is, how is it that I can run this script manually but apache tells me I cannot. My permissions are set to allow all and deny nothing since it is a machine well tucked into a safe place.

Apache resides on the machine in C:

eactorcore and it also setup a virtual drive as v:core. Trying both does not work.

View Replies !
PHP-4 And RPM Binaries...
Are there any RPM binary installations of the final PHP4 for Redhat i386? Our whole system is setup from RPM's so i can't compile PHP4 from scratch (no APXS) without reinstalling/compiling the entire system!

View Replies !
GD Win-binaries
Does anybody have the GD-library in win-binaries available?

View Replies !
Php Binaries
anyone know of any alternate sources for php binaries, php.net seems to be down.

View Replies !
Getting Latest Binaries
I've only used PHP under Windows OS. Now I'm trying to set it up in Linux. My problem is that my linux distro has an old version of PHP. So where can I get the latest binary? PHP.net doesn't distribute linux binaries anymore.

View Replies !
Linux Binaries For PHP 5.0.4?
could someone tell me where I can find the Linux binaries to
install on a hosting account? It would also be GREAT if an installer
comes with the distribution. At this time, my client as purchased
hosting from a company that does have anything installed and wants to
bill for everything that they need to do the account. Thus, I would
like to avoid them because I don't have confidence in their ability to
get it done. Thus, if anyone has a location of the PHP 5.0.4 binaries
w/installer,

View Replies !
Win32 Binaries For Mcrypt Lib
Anyone have any idea where I could get just the binaries for mcrypt? I dont do 'C' anymore (php is too much fun <g> ).

View Replies !
PHP PDFLib Lite Binaries (Windows)
I get this error with the new PHP PDF Binaries:
http://pecl.php.net/bugs/bug.php?id=9491&edit=1

And I've attempted to do the workaround (install a newer PDFLib
binary). That fixes the problem, but, I only see binaries for the
commercial version of the PHP linked PDFLib.dll which I don't need and
which drops the watermark on the page.

Does anyone know where I can find dlls for PHP for PDFLib LITE? I
don't have a compiler on this machine so I can't compile my own PDFLib
Lite source.

View Replies !
Warning: Ftp_exec() [function.ftp-exec]: SITE EXEC Is An Unknown Extension
This is kind of a part II to a question a posted earlier about exec and shell_exec not working.

I'm trying to use ftp_exec to execute some simple command:

$conn_id = ftp_connect("$server") or die ("Cannot initiate connection to host");
ftp_login($conn_id, "$username", "$userpass") or die("Cannot login");
$command = 'cd..'
if (ftp_exec($conn_id, $command)) {
   echo "$command executed successfully";
} else {
   echo "could not execute $command";
}
ftp_close($conn_id);


I'm getting the following error:

Warning: ftp_exec() [function.ftp-exec]: SITE EXEC is an unknown extension in /home/urieilam/public_html/work/video/test1.1.php on line 21
could not execute cd..

Have tried other commands as well, get the same. Could this be a security issue or something to do with p Safe Mode? I don't know much about commands, shell, etc..

View Replies !
Warning: Exec() [function.exec]:
I'm using PHP Version 5.0.4 in IIS5, Window 2003. When I execute my script, it prompt me the following error :

Warning: exec() [function.exec]: Unable to fork [ping 10.8.1.70] in c:Inetpubwwwrootswitch.php on line 62
Below is my script :

<?php
$line1 = exec("ping 10.8.1.70", $output);
exit;
?>

View Replies !
PHP Not Executing, IIS 6
I'm attempting to run PHP on Microsoft IIS 6.0, and the PHP will
not execute.

For Example:

test.php:

<?
phpinfo();
?>

When I request http://localhost/test.php I get a blank page.
When I view the source, I get:

<?
phpinfo();
?>

Any ideas what I am doing wrong? Any resources that could guide me
through the install process? The .php extensions are setup correctly
(I believe) in IIS.

View Replies !
PHP Executing Twice
I am facing very strange problem When I submit any form using 'POST' method. my script executes twice. Is this a PHP bug or some thing else. I am using PHP4.3.1, MySQL 4.0.1, Apache2.x.x in Windows 2000 professional.

View Replies !
Executing JSP In PHP
I have a form processing script in php which submits data to email and a database, that works fine. However before it does that i need to create a secure hash from a jsp file.

Im at a loss as to how to do this. Would the best bet be to use SOAP or similar, and if so would anyone be able to give me any pointers, i haven't indulged in web services as yet.

View Replies !
Executing Js From Php
I'm using CURL to navigate to pages on another website. There are links on the website which I need to navigate to that are created by submitting javascript, ie:
<a href="javascript:blah">. Is it possible to use curl to execute these links and return the resulting page?

View Replies !
Not Executing (sometimes)
I run a message board site that has been having technical problems lately. Today I upgraded my version of php via an apache build in cpanel (now on php 5.0.x - but that doesn't seem to matter).

When I access .php files that don't rely on a database, they run. However, all the .php files that use my MySQL database don't execute and prompt my browser to download. I should mention that I tried to upgrade MySQL today too. I was using 4.0 and upgraded to 4.1.

View Replies !
Executing MDL Programs Using PHP
Help to execute MDL Applications by making a call "mdl load <application name>" through PHP.

View Replies !
Executing An SSI Within A Php File.
I have the following line in an old shtml file:

<img src="http://www.domain.com/cgi-bin/logtrack/log.pl?ref=<!--#echo var="HTTP_REFERER"-->" width=1 height=1 border=0>

What this does is execute log.pl with the refererer to increment a logtracking program and find out what their referer is. How would I go about porting this to php?

View Replies !
Executing Scripts...
How do I execute one .php3 script from another. Passing one or two arguments, and then receiving the output? I have tried using the exec and passthru function, with no luck.

View Replies !
Executing Chunk Of SQL
I'm attempting to write an install script, I'm using the ADODB abstraction layer with my script, with that said here is my problem. I've got a large chunk of SQL that I need to execute through PHP, so I put it in a variable like so:

$db_sql = "
DROP TABLE IF EXISTS im_categories;
CREATE TABLE im_categories (
id tinyint(11) NOT NULL auto_increment,
name varchar(100) NOT NULL,
type varchar(100) NOT NULL,
template varchar(200) NOT NULL default 'default',
PRIMARY KEY (id)
) TYPE=MyISAM;";

Then I try to execute it using:

$result = $db->Execute($db_sql) or die(vpError() . $db->ErrorMsg());

I get the following error every single time and I have no idea what is causing it, the SQL data is from a phpMyAdmin export by the way. PHP Code:

View Replies !
Ajax Not Executing Php
When a user clicks a link I have it open up a file in a div using ajax.

my code is

<a href="#Find" onclick="javascript:jah('Find.html','content');">Find</a><br
/>

Where Find.html is an html file on the server. Now when I do this everything
works fine except php code is not being executed.

The jah code is

function jah(url,target) {
// native XMLHttpRequest object
document.getElementById(target).innerHTML = 'sending...'
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
req.onreadystatechange = function() {jahDone(target);};
req.open("GET", url, true);
req.send(null);
// IE/Windows ActiveX version
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = function() {jahDone(target);};
req.open("GET", url, true);
req.send();
}
}
}
function jahDone(target) {
// only if req is "loaded"
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
results = req.responseText;
document.getElementById(target).innerHTML = results;
} else {
document.getElementById(target).innerHTML="jah error:
" +
req.statusText;
}
}
}

View Replies !
Executing Applicaitons
is there any way to execute desktop applications under a web interface using php? I need to get a non-finite amount of users to be able to execute a learning course program and use it remotely using a web interface.

View Replies !
Executing A .bat File With PHP
I have a .bat file that copies certain files across a network and I needed a way to run this file using PHP.  I was looking at exec() but I was not sure exactly how to use it.  I was also using pstools but could not get them to work with PHP.  Can someone give me an example of how to do this or send me somewhere where I can read up on this?

View Replies !
Executing .sql File
how may I execute .sql file using php?

View Replies !
Executing A Variable?
If a variable stores a function, could I execute the function by typing the variable alone? Or maybe by echoing it?

<?php

/* Set variable */
$math = round(23.89);

/* Execute variable? */
$math;

/* Echo variable? */
echo $math;

?>

View Replies !
Executing A Program
I am trying to run a console application which needs to keep running even after the php script has finished executing. I also need the PID or some sort of handle I can use to kill the program at a later stage.

View Replies !
Executing Php As An Application
Does anyone know of a program out there that has php bundled into it? I have ran into a few php editors that actually execute php right there on the system with only a php.ini file. So, I know there are ways to do it..I just need a direction to look in.. Any ideas?

View Replies !
Executing A PHP Function
I have a function,

function output($output) {
echo $output;
}

I have a variable,
$myvar = 'This is my variable. The output is X'

How do I combine the two? I've tried:

$myvar = 'This is my variable. The output is' . output("this thing");

But no such luck.

View Replies !
Executing PHP In A Variable?
I'm doing a file include as:

<?php $content = file_get_contents(TEMPLATEPATH . '/somefile.php');
echo $content; ?>

In somefile.php, there is PHP code. How can I execute the code once
$content is displayed as above?

View Replies !
Executing PHP In PERL
Can PHP be executed within a web document created by a PERL CGI script? How does one accomplish this? Can anyone provide a checklist?

View Replies !
Executing A Query
let's say I have this query PHP Code:

SELECT data.*, art.*
FROM `comic_pages` data, `artwork_picture` art
WHERE data.art_id = art.uid

however both comic_pages and artwork_picture contains an 'uid' field, and I need both uids. I've made up this function, but I think it's kinda hacky (and slow, taking over 6x the speed of a normal mysqli_fetch_assoc in this case) PHP Code:

function db_multi_fetch_assoc ($result){
    if (!is_object ($result))return false;
    for ($x = 0;@mysqli_field_seek($result,$x);$x++){
        $field = mysqli_fetch_field ($result);
        $arr[$x] = $field->table.'.'.$field->name;
    }
    $data = mysqli_fetch_row ($result);
    
    for ($y=0;$y<$x;$y++)$out[$arr[$y]] = $data[$y];
    return $out;

View Replies !
Executing A Php File
I'm trying to execute a php script on my linux server whenever I view a different page. So far this is what put on that page: PHP Code:

<?php exec('php  /var/www/html/execute.php'); ?>

I am trying to be logical with how linux executes php and the path to the file I wish to execute. But this was a best guess. So far it isn't doing anything, but I'm also getting no errors in the logs.

View Replies !
Executing Javascript From Php
I'm running a popular PHP forum on my server and wish to add a little holiday cheer to it, via javascript encoded bats that fly around your mouse pointer. Silly, yes I know, but I figured it would help me become a better programmer if I could only figure out how to execute the JS from my index.php.

Can I simply cut and paste the javascript into the php somewhere and hope for the best, or is this going to be a difficult task?

And, I'm using the PHPBB to run my forum. Any help would be greatly appreciated. (warning, I am sorta new at programming php).

View Replies !
Don't Stop Executing Php
There is an php function, i saw it but i can't remember it's name. When you close the page, or stop loading page, php continue generating the page. What is the name of function :/? Do you know?

View Replies !
Executing PHP In Wikimedia
Does any one have idea regarding the equivallent code for Php script in wikimedia. Presently I have developed a small application in PHP. I shud place my application in wiki. I 'googled' and 'wikied' hard to know the procedure to place my PHP script in wiki But Unable to understand nothing.

View Replies !
Get Executing File
Is it possible for php to tell the path to the file (php path, not html) that is currently executing? What I mean is, if I include() a file and in that included() file I call $_SERVER["PATH_TRANSLATED"] I get the path to the file that the include() is called in, not the path of the included() file that calls $_SERVER["PATH_TRANSLATED"].

View Replies !
Executing PHP Code With PHP
I'm making a script that will allow me to have multiple layouts and have a layout selector for the end-user. I'm attempting this with SQL and the script works with plain html, however I want to have php in the layout code from mysql and have it work but it wont work. Is it possible to do what I want to do with MySQL? Here is my code:

<?php
if(@include("config.php"))
{
$sqlconnect = mysql_connect($mysqlhost, $mysqluser, $mysqlpass);
mysql_select_db($mysqldb, $sqlconnect);
$grabinfo = mysql_query("SELECT * FROM xaler_info");
$info = mysql_fetch_array($grabinfo);
extract($info);
if($_COOKIE[layout] == "")
{
$code = mysql_query("SELECT * FROM xaler_layouts WHERE name='$defaultloc'");
while($source = mysql_fetch_array($code))
..........................

View Replies !
Executing Php Statements
on my website(It is secure and only accessible to me) I have a form with a text area. I enter php statements there, such as last_modified() so I can see the result, than I click Execute. Here is where I am stuck. I need to take the post data from the textarea and execute it as php. Any idea how I can do this?

View Replies !
Executing From A Database
Store content (html and php) in a database, so far this hasn't been an issue. When I called the content from the database its displayed properly with the exception of php commands (specifically include() ).

Rather then executing the include statement its printed as HTML in the source code of the document. I found one post on a PHP User Group board but the solutions provided don't seem to really work.

I'm almost guessing that this is a security feature and although I'd prefer not to circumvent it, it would greatly help in what I'm trying to accomplish.

View Replies !
Som Crontabs Not Executing
i defined 5 entries to be triggered. 3 entries get triggered by crontab but two does not. no matter what i do they wont run.

scripts are fine the problem is that crontab system doesnt even try to run it - thats what admin determined from the log. the two that doesnt run are:

View Replies !
Second SSI Include Not Executing
I have two websites. The production website is on a virtual hosting environment. The development website is on a PC clone running Red Hat Linux 8.0. The development site has been up and running great for about 3 years. I posted on the Apache Web Server forum and got not answers.

The site uses .shtml SSI pages with cgi scripts and php code as includes. Muliple includes on the same .shtml page using exec cgi-bin work just fine. Code:

View Replies !
Updating Before Executing?
I'm setting up a database that right now has an id and then two fields, one of the fields I want to be constant. The second I'm trying to alter by using a drop down menu.

When I make a choice in the drop down and hit submit it changes the attribute later in the document, but it seems like it regenerates the first part of the document as if it was using the old attribute. Code:

View Replies !
Not Executing Code
Hey im currenty running a home server with the following

Microsoft XP Professional Using IIS5.1
and PHP 4.4.4

Ive created a page called info.php with the code

<?php
phpinfo();
?>

When i navgate to the page using http://localhost/info.php all i get is a blank white screen. When i right click and click on eiw source im still seeing

<?php
phpinfo();
?>

Does any1 have any suggestions on how i can sort out this problem.

View Replies !
Auto Executing PHP Code
Right now i am on a matrimonial site. i wanna do an auto match finder. ie; there may be many registrations in the site. i wanna findout all those matched profiles on a daily basis, say by 12 midnight each day. i wanna get that list as a mail even if i didn't checked the admin screens. ie; the script should execute on 12 midnight each day automatically. is there any way. can i do it using PHP.

View Replies !
Executing Cgi Scripts Within A PHP Document
Is there a way to execute a CGI script using an include like I do with the SSI includes. I want to just execute my weather cgi file like I do on my page at www.insidemath.com .... whoever can help please do so.

View Replies !
Executing A Shell Command
I try to use the backtick "`" to exacute a shell command from a PHP script. However, `touch file`; doesn't make the file. Neather does exec(), system(), etc. They all work when is used a different command, such as pwd, or ls. So what's a brotha gotta do to creat a file?

View Replies !
Executing Function At A Later Time
I'm making a game sort of thing in PHP and I was wondering if there was a way in PHP that I can pause the execution of a function after x seconds. I don't want the whole script to stop working though, so for example

// function 1

(pauses for 10 seconds) {
// function 2
}

// function 3

i want the script to execute like normal, but pause for 10 seconds before executing function 2, so it would execute function 1 and function 3 then 10 seconds later, execute function 2

this is exactly like the fork() statement found in MOO programming

go here to get a clearer definition.
ftp://ftp.research.att.com/dist/eostrom/MOO/html/ProgrammersManual_37.html#SEC37

is there a way to do this in PHP?

View Replies !
Executing Php From With A Perl Script
I know perl and can write the script. What I want to do is to be able to
grab a page, pass it to php if it has the php extension, get the
results(html) and then send it to the browser. Is it possible?

I saw this bit of code on a server that seems to execute php. Don't know
what it means, but it gave me the idea.

View Replies !
Executing Programs On A Server
i've written a c++ program that converts one file type to another via
two arguments (the input and output filenames).

i want to execute this on my server, using something like

exec("myprogram.exe $arg1 $arg2");

but then I realized my server is linux, and my program was compiled for
windows.

so I uploaded the .cpp instead, and now i'm trying to compile it doing
something like

exec("gccp hello.cpp");

which returns an exit code 127... not really sure what that means.

I'm guessing I probably don't have permission to be creating files on
my server...is there anyway I can change this permissions or anything?

View Replies !
Executing Code Within A Hyperlink
I am writing a photo gallery and suppose 8 photos are displayed. When the
user clicks on a button under the picture, I want it to add that picture
name to a "favorites" list within the session data, but NOT leave the page
the user is on. How could I do this?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved