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.





PHP Running Exec() Windows Program Very Slow In Comparison To UNIX Equivalent Program


Does anyone have an explanation or solution for the following.
I have a PHP script that uses exec() to call a program to do certain
calculations.

The UNIX version of this program I call runs in about 4 to 5 seconds.
When I run the same PHP script using exec() to call the Windows equivalent
of this same program on my Windows desktop, it takes about 32 seconds....




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Does Anyone Know Of Any Program That Would Be To Windows What CRON Is To Unix.
Does anyone know of any program that would be to Windows what CRON is to Unix.

I Run Apache on XP with PHP 4--and am hoping that I can find something like described above.

View Replies !
Exec() - Running An External Program From Inside PHP.
I'm having difficulties running an external program from inside PHP. I'm trying to create thumbnails using ImageMagick's convert utility using the following program: PHP Code:

View Replies !
Cannot Get The Program To Run At All Through Exec
I downloaded the program called Snapshotter which allows you to take screenshots of webpages through the command-line. Server is Win2k3/XP (live/local). I cannot get the program to run at all through exec

while the same directory/permissions for ffmpeg run fine. I cannot even get it to spit out the default output you get if you run it without arguments. exec("dir") works fine, but exec("c:lahSnapshotter") doesnt return anything. Registered the path in the PATH environment and still no luck, yet exec("c:lahffmpeg") works fine and returns data.

View Replies !
Exec Wont Run A Cpp Program
I'm trying to get Zonminder up and running on FC4 One of the asso programs is zmu.cpp - compiles fine. And runs from the command line IE. /u/l/b/zmu -help returns Usage. zmu -m 2 -z (real cmd) from cmd line does what it should do. However (in xx.php) exec ("/usr/local/bin/zmu -m 2 -z", $ret); doesn't.

From what I can tell it doesn't even enter the program. Permissions are 755. If I change the exec to ("ls") - works, date - works. I've compared "env" - nada. SafeMode = Off. Is there ?anything? else that might cause my problem?

View Replies !
Exec A Commandline Program
I made a topic about this before, but got one post helping, and nothing more, even though the post did not solve the problem. I need help uploading a file and sending it to a commandline windows executable. The program is called nconvert.exe, I will be uploading dds textures and converting them to bmp pictures, then immediately offering them back for download, not storing them on the server. The command to convert a file is this: nconvert -out bmp %1 %1 being the file passed to the executable. 

View Replies !
Running Program
I have a program called "rlx" that takes two arguments and writes a file. The command line could be "~/rlx file b" and it executes correctly from shell. What it does is to write a file to webserver/rlx/file.dat. The permission for the program rlx is 755, the permission for the dir rlx is 777, and the text output from the program after having run it is correct. (It displays the filename and other data). Code:

//Commandline tried are all these, just one of them in the real code of course:
$commandline = "/home/me/rlx/rlx file b";
$commandline = "/../../rlx/rlx file b";
// since above didnt work, i tried to copy the program file to the web directory, renaming it to rlx2 so it doesnt have the same name as dir
$commandline = "rlx2 file b";
$commandline = "/.rlx2 file b";

// one of following in the real code of course
exec($commandline);
system($commandline);
shell_exec($commandline);

View Replies !
Exec() Call To External Program
We are trying to use the exec() or system() calls in a php script. The program we are trying to call takes 1 parameter in the form of: email@domain.com[usercode]

There are no spaces in the parameter at all and we have tried placing quotes around just to see if it mattered. We have also modified the parameter just to send it hello. Here is what we get: With no parameters the php script executes the program where it displays the error message from the program stating that not enough parameters were supplied. We then add the word "hello" to the end after a space so the command looks like this: command "hello" and the program no longer executes at all. No matter what we do, if we supply an argument to the command the php code will not execute the program.

View Replies !
Php Exec To C Program That Writes File
I'm trying to use the exec() call in php to run a program that I've
written and compiled from C. This program attempts to create a new
file and write data into it.

If I simply run the program from the shell, it writes the file no
problem. If i run the program through an exec call in a php script,
however, the program executes but it seems to not have the correct
permissions to be able to write the file.


View Replies !
Use Exec To Run The Program Directly From The Server.
I have an image manipulation program that is run from commandline, I have never used exec before and I'm scared to becuase I don't want to mess up my server or anything.  Basically, I want people to be able to upload an image, then arrange for some manipulations to take place on the file in a temporary batch file, then use exec to run the program directly from the server.  The program is called nconvert.exe, and the main thing I want to do is convert DDS textures into BMP files, the command, from Windows "cmd" is:

nconvert -out bmp %1
%1 being the dds file to be manipulated.

How would I go about doing the exec part?  I know how to do the upload, but not the exec.

View Replies !
Check To See If A Program Is Running
Is there any specific way to check to see if a certain program is up and running? Like I want something to pop up only if program ****.exe is running.

View Replies !
PHP Exec Calls A C Program That Creates A File
I'm using exec to call a compiled C program that creates/writes to a
file...However this doesn't seem to be working....
I tried setting all the permissions to 777 but still nothing...?

View Replies !
Launching A Program With Exec & Pstools/psexec.exe
I am trying to launch a program with PHP code. I am running Apache on Windows XP SP2. Code:

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 !
Call Exec To Run An External Program Through A Form
I have problem with "Exec" function in PHP5. When I call Exec to run an external program through a form, it fails but when I run my PHP page by PHP interpreter like: PHP MyPHP.php it just works fine and external program executes successfully.

View Replies !
Securing Data Between PHP Script And Exec'd Compiled 'C' Program
I'm using RSA Securid Tokens, and I'm going to write a little 'C' program that takes as input the userid (i.e. "jsmith") and the number displayed on the token (i.e. "123456") and returns a result code indicating whether authentication is successful.

The compiled 'C' program will be called from a PHP script.

I know that if I pass the parameters on the command line, i.e.

authenticator jsmith 123456

the parameters are world-visible (via "ps -Af", for example) and this is an
information leak.

<BEGIN QUESTION>
How can I pass things securely between the PHP script and the exec'd program?
<END QUESTION>

One way I suppose I could always use is to create a file from the PHP script and then just pass the filename to the program (assuming permissions and UID/GID were all set up correctly).

But is there a more elegant way that doesn't create files, such as pipes or shared memory?

View Replies !
Execute A Windows Program From An Anchor Tag
I believe I am close but I have spent several hours investigating this and
can't understand why it won't work. I have tried exec, system, and settled
on popen from reading various notes on the subject. I am wanting to launch
a file editor when I click on a link. This is strictly an internal
application so I don't need to worry about escaping shell/args. This is
what seems as if it should work, however it doesn't. This is on XP, latest
Apache 1.3.29 and PHP. The logic makes it into the "if" test and the file
exists. Thanks.

if (chdir("C:Program FilesTextPad 4")) {
$cmd = "start "textpad.exe" x:webprogram.php";
pclose(popen($cmd, "r"));
}

View Replies !
Windows Program Command Exists
I can do this so easily in Unix: PHP Code:

$msg = exec('whatis convert 2>&1');
echo $msg;

However, in Windows using MS-DOS, I'm utterly lost. I am having to find out if ImageMagick is installed on a system for a function to operate (ImageMagick is required), and since this is a portable web application, you simply can't install ImageMagick everywhere you go.

Therefore I need to know if the system home has ImageMagick or not, and in Unix, I simply do a "whatis convert" and I can tell, but since MS-DOS has no equivalent to "whatis" I can't figure it out, and just running the "convert" command within a recursive function onto thousands of images is just not a good idea.

View Replies !
Problems Of PHP Script Running Perl Program With Spreadsheet::ParseExcel Module
My php script is to call perl scipt which makes use of
Spreadsheet::ParseExcel module to parse Excel file. I am able to launch
php script from command line so that perl script can run and properly
parse Excel file. However, when I put php script on server side and
then launch php through client request, perl program can't run.



View Replies !
Php Session Problems When Working With A Windows Client Program
I am currently involved in a project that involves a windows client
program written in delphi and a web application written in php. I
have made several php pages for the delphi program to do requests via
the http component from INDY. the problems I am having are:

1) the first request from delphi app to php web app is the
authenication. In which user sends username + password to the php app.
If authenication is valid, a session is started and the sid is
returned to the client. All subsequent requests from delphi app to
php web app will have this sid as one of the arguments in the POST
form request (this is one of the function in the INDY component for
delphi). Even the sid is passed to the subsequent pages, the session
global array is still undefined. However if I open up a web browser
and create my own string request to the login page then the next page,
the global array would be defined (using var_dump + echo to see the
array) what is the problem?

2) does the above problem has anything to do with the http referer
field?

3) this problem that I am having has been asked before on google
group, but somehow the person who asked it didnt' put down the
solution for it. (this only involves the web only) when I login on a
page and return with a session id, then I log out.. the user is
redirected to the login page again. However if the user login again
(with a different login account), he would be presented with the same
session ID as before. a different sesson id is presented only if the
user restart the browser. why is that happening?

View Replies !
How To Call *.exe Program From Php Program
I have a php program, and from that program I wanna call C program that counts number of visitors on my page.

This is a piece of my program:

View Replies !
Two Sessions: Session A By A Program Destroys Session B By A Program
I have two separate programs that I want to use together on a website
Program A starts first and calls session_start(). Program B is started by the user clicking on a link and it also calls session_start(). The session started by program B blows away the session started by program...

View Replies !
Sessions? External Program / External Program
I am trying ac ouple of days now to learn some things on SESSIONS,but I think I am not getting it very clearly. I have a PHP page tha contains a form.

Users enter data in the form, which are then written in a file (the file is created at the time a user enters some data) The file is then given as an input to an external program The external program runs and gives some results which are then stored in another file (that is created when the external program finishes) What I want to do is to somehow create these files and, when the user exits from the browser, then both files that refer to this user, will be deleted. Code:

View Replies !
Unix Time Comparison
I am trying to select records within a day interval. However the comparison of the timestamp seems not to work. uniquied is timestamp. Code:

View Replies !
Php Function Equivalent For UNIX 'pwd' Command
Is there a function, or any roundabout way to get the current directory
other than using an exec or system to just run pwd?

View Replies !
PHP Running Way To Slow T_T
About an hour ago my pages were taking around 0.01 seconds to load. Now those same pages are taking like 5.00 seconds to load. CPU usage is 1%

Why are they going so slow all of a sudden? Even pages that I have not edited at all whatsoever in any way are suddenly slow as poop when they used to be loading instantly an hour ago! Code:

View Replies !
Mysql Running Slow
I'm a php guy and db system issues are not my thing. My server (linux) is running mysql 4.0.15, and running SLOW, very slow. I did a search for the slow query log file that the docs mention but could not find it. I have started changing the file types to myisam from innoDB. I'm wondering if the system is screwed up becuase the size of ibdata1 (where innodb data is stored) is 1344274432 bytes (about 1.1 GB), but as I convert tables from innodb to myisam (lots of them with lots of data), the file size of ibdata1 is not going down.

View Replies !
Suddenly Started Running Slow!
So the other day, I was fiddling with the php.ini file on my web server trying to figure out why my 30mb file wasn't uploading, so I started changin some settings and then tried to upload my file again...

Out of nowhere, the php script started taking forever to execute!

you can see it here: ....

View Replies !
Site Running Slow Transferring To HTTPS
I have an intermittent issue with my site in that, at times, it runs really, really slow when it transfers from http to https. The server administrators says there's no problem their end so I'm kinda stumped, as it runs fine most of the time, then for a couple of hours on some evening or weekend, any request has about a 10% chance of getting onto the next (secure) page. The page takes forever and might eventually load after a few minutes. I'm not running any cron jobs at the time, I think I've ruled out network attacks. This happens with the public https pages. The password protected, back-end https pages seems slow, but still get there. So really what I'm asking is this: Are there any inherent pitfalls to look out for at that point of transferring from http to https?

View Replies !
Is It Possible To Authenticate Users Running Apache On MacOS X (with PHP 4) And An Active Directory On Windows 2000 Or Windows XP?
From a PHP webpage, is it possible to authenticate users running Apache on MacOS X (with PHP 4) and an active directory on Windows 2000 or Windows XP?

View Replies !
Running Scripts UNIX Or NT.
I have been trying to figure out why this particular script isnt working for me. I uploaded the script to my ISP provider and it works fine there. He is running Redhat/Apache/PHP4/Mysql

I am running on my test box NT4.0/Apache/PHP4/Mysql

I get the error messages below when I run the script at my test box, The script still works, but I dont get the messages when I run it from my ISP. Could my OS be the only problem?

Warning: Undefined variable: array in db/Db.php on line 49
Warning: Undefined variable: array in db/Db.php on line 49

View Replies !
PHP Used As A CGI Program
Manual for odbc_pconnect states: "Persistent connections have no effect if PHP is used as a CGI program." As I have just installed PHP on a PC with an Apache server, how does one tell if it is used as a CGI program, and if so, how does one confiure it not to be?

View Replies !
C Program And PHP
I have written this function in a C program, using Visual Studio. The
PHP script executes fine, but the output is not displayed. I have
been racking my brains for hours trying to figure this one out. The
output from the php program should print to a file called 'out.txt'.
The file is successfully created, but with no content. I am pretty
sure it's the way PHP returns the results. Does anyone have any
ideas? Any help would be most appreciated.

int passCode(void)
{
FILE *phpFile, *out;
size_t len;
char buffer[1000];

phpFile = popen("php -f testing1.php", "r");
if (phpFile)
{
out = fopen("out.txt", "w");
len = fread(buffer, 1, sizeof(buffer), phpFile);
fprintf(out, buffer);
fclose(out);

pclose(phpFile);

return 1;
}
else
{
return 0;
}
}

View Replies !
How To Use ? And : In A Program
in the program below, what is the meaning/use of
the question mark (?gcd) and the colon (:$a) after the return statement?

<?
$x=32;
$y=80;
function gcd($a, $b)
{ return ($b>0)?gcd($b,$a%$b):$a;}
$val=gcd($x, $y);
print "The greatest common denominator of $x and $y is $val";
?>

This recursive program is used to find the greatest common denominator of 2
numbers.

View Replies !
How To Program OOP
I use OOP for a PHP Application Framework I am programming. I have one base class which includes all the necessary functions and variables which all the other classes use. So what I originally did was that I made an instance of the base class and passed it to the other classes. Now someone insisted that this is not the way to do it.

so I used 'extends base' to make the base class available to the other classes. Afterwards it worked fine, but it didn't make the code smaller nor did it result in faster speed. I used the benchmarking script from PEAR. So I wonder whats the difference between those two solutions, both work fine. Are there some tools to analyse how much memory a script uses?

View Replies !
Run A Program.
I am using

system('GPA.exe ' . $filename);

to run a program GPA.exe

this program do the following things. ../GPA.exe filename.txt and will generate another file. HOWEVER, the problem is, there is no new file generated and I doesn't get an exception. I don't know why. Can somebody give me a clue?

View Replies !
Sig Program
I ran across a very cool little program today that I think I can reproduce for something I need on my site using PHP.

http://www.danasoft.com/customsig.php

How do they give the URL a .jpg extension and still be able to have it run a PHP script and send a JPG back to the browser?

View Replies !
Non-PHP-program To PHP/cgi
I read a POST-request from a Web-client over a socket and will pass this request to a PHP/cgi-Modul, to get PHP's generated HTML-stream. The request contains formular parameter and the data from an uploaded file. I copy the parameter-names and the values and pass them to PHP. This works fine, but I don't know how to tell PHP, it may read the data from the uploaded file.

View Replies !
PHP Program
I have a client that pretty much needs an admin program for their site. They are a local radio station. They want to be able to create forms within their website admin so they don't have to copy and paste code. They have no programming experience. NONE. They also want to be able to access their database to view content submitted. They send out birthday e-cards and all that junk. So does anyone know of a program that can do this?  They have a thing like this in iHTML, but it's gettin spammed all to hell and they want a more secure route.

View Replies !
Folder Zip - Execute Unix Zip Command Exec()
1.Any one knows How to Zip the folder using php.

2.How execute unix zip Command exec() function.

View Replies !
Connect To Unix And Running Commands
I'm currently in the process of creating a intranet site for my company and would like to know if it’s possible to have something like a status page where you can see the usage of our server (unix).

I can manually check the usage when logging onto the server using AIX (v4) with a username, password and using the command: topas this gives me the idle status which I need.

View Replies !
Is There A Way To Optimize My Program?
My Program is about parsing website through their url, My program is working properly but everytime it enters URL with so many sub URL (i mean thousand) my program seem to stop responding. Can you suggest something to this problem. somebody told me that i use the sleep() fucntion to not force my script to run successively, to give a pause to my program. Any thing more you can suggest? i'm not after the speed of execution but what im after is that he finish his job no matter how much time it takes....

View Replies !
What Program Do U Write Your Php In ?
what program do u write your php in ? i just use notepad are there programs that would speed it up and make things easier ?

View Replies !
Run Program Automatically
I want to create the option for my clients to create their own e-mail address. When I do this in Telnet, I have to run the command 'vadduser' It then asks me for a username, I want to assign this automatically. (1,2,3,4 etc etc)

It then asks me for a password, I want this to be something the user has already given in a form (before the script was run). It then has to be retyped. Those two things can be done automatically. It then asks if I want to assign a disk quota (YES) and then asks for the number of megabytes (1) That's it. Are there any examples available of how to do this?

View Replies !
Php Email Program
Does anyone know of a php or even cold fusion based script out there for
accessing email that can be customized? Right now I use SquirrelMail
which is great, however, you can't really customize it to tie in with
your web site. Is there something out there that is very flexible that
I could make fit right into my site which is pretty reliable in terms of
web email?

View Replies !
Should I Use A One Php Program Or Multiple
I have taken over a php web site. Once you login you are given six menu
choices. Each option is or can be independant of the others. They each
modify the same database but in different ways.

On clicking the menu buttons the program calls php functions to do the
action. Thus the user stays inside a large program.

I was expecting the menu to provide links rather than function calls.
1) Is there a reason to stay inside a large program through function
calls rather than linking to separate pages?

2) Am I correct that providing a <a href=... link would isolate the
functionality and call a new program?

The current program is spagettii code and somewhat buggy. There are
side effects that depend on what function was called before. I am
hoping that passing the hidden input parameters is all the connectivity
I need.

View Replies !
Chat Program
Is it possible to create a chat program by using PHP. Or is it only possible by JAVA?

View Replies !
Survey Program -
I want to migrate a survey program to web application and have selected
PHP to use a on the server end along with apache and firebird rdms. As
developing a web application is much different than a standard app I
have some questions:

1) The survey has 50 questions with answers being 1-10. Is it best to
store all 50 questions and corresponding answers in a javascript array
and then up all in a batch update? The downside to this approach is the
user could lose all responses to survey questions if the client computer
web browser crashed.

2) After authenticating the user, how do I keep track of the rating
session to guard it from hacking? Do I just store the username in a
javascript variable since there is really no constant connection to the
server?

View Replies !
PHP Program Packaging
I'm going to be doing a program for an elderly couple who owns a horse ranch, and wants some software to keep track of all their horses, owners, doctors, etc. I'm going to be writing the program in PHP using a MySQL database.

I set up one like this for my work and it runs off of Apache on our server. I need this program to be a stand-alone install, without installing MySQL, PHP, and Apache seperately. How could I go about integrating it all into one package?

View Replies !
Standalone Program
I'm going to be doing a program for an elderly couple who owns a horse ranch, and wants some software to keep track of all their horses, owners, doctors, etc. I'm going to be writing the program in PHP using a MySQL database.

I set up one like this for my work and it runs off of Apache on our server. I need this program to be a stand-alone install, without installing MySQL, PHP, and Apache seperately. How could I go about integrating it all into one package?

View Replies !
Program Flow
I had some bad experience with code organization and script
functionality in writing my php based applications. And as the applications
get bigger in scale it gets even worse. Therefore, I am trying to build a
general schema for data flow in a php/mysql application.

What I has in mind is to design a three major units. To handle the
input, processing and data access. Plus another unit to generate the output.

What I have now is one script that resolves the operation to be done
according to the parameters send to it and the call the processing unit to
do the rest of the job. However, as I add more functionality to the system
this dispatcher script gets bigger and bigger...

1. How can I arrange my program/data flow in an efficient and easily
maintainable way?

2. And how should I implement the output generation unit to be
completely seperate from the others (I have lots of forms and outputs I have
to show the user when necessary)?

View Replies !
Calling A C Program From Php.
I need to call a c program from a php. I also need to pass a string to it and have it return an array or string. I was thinking about calling it like its cgi script, but I'm not to sure how to do that. I haven't figured the variable passing because I'm just
trying to get it to run first. These are allthe things I tried. Code:

View Replies !

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