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.





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 Complete Forum Thread with Replies

Related Forum Messages:
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 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 !
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 !
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 !
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 !
Using Server Program
Is there any way to use a program on the server to display data? For example, I want to use Crystal Reports on the Intranet server to display data. So when the user clicks a link on the web page Crystal Reports should open either as standalone or in the web browser. Is this possible?

View Replies !
Calling A Program To Run On A Server
I would like to know how I can call a program to run on the server from a web page. We are trying to create a notification program that can send emails and text messages to someone when a high priority call is created.

Once the high priority ticktet is created online, we want to send alerts every 5 minutes until someone accepts the call. We do not want the notification to be dependant on someone running a PHP script on the website because it will stop running if the browser is closed.

How can we have a PHP script on the website call a program on the server that can be run after the browser is closed? Does anyone know of any software that might already do what I described above?

View Replies !
Web Application In Client Server Program
i have a client server program in VC++,i want to provide this client -
server application on web.which program i should use whether PHP or i
can convert VC++ to active X control and then display in html?

View Replies !
Exec To Run Media Player On Server?
Is it possible to allow a web user (intranet) to launch Media Player on the
web server? I would like to use a web server as a media server and be able
to access and queue mp3 and wma files via a web page. Using IIS 6 and PHP5.

I have tried using the exec() command but MP does not launch and there is no
error reported in the browser.

View Replies !
Need To Run A Command Line Program All The Time On A Web Server
I have a command line program that I need to have run on the server non-stop. I can start it at the command line but it stops when my session closes. If I set it to run through cron, I am pretty sure it needs an interval.

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 !
Exec("ntpdate <server>") Doesn't Work
when I try to execute the obove mentioned to synchronise the servertime by a
php-script, it doesn't work. Other shell-commands work fine. Executing
ntpdate <server> directly in the shell works also well.
So why doesn't it work?

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 !
Printing Directly From PHP
Currently I work in a school and I wish to build a PHP/MySQL portal which allows teachers to enter student exam marks online through the portal.

The same site will provide reporting etc. and prints the result of each student on a separate page, which can then be sent by post.

In order to print the results I wish to create a print button (or something similar) which once pressed, extracts the individual student details from the Database and sends them directly to the printer without outputting anything on the screen. IS this possible with PHP?

View Replies !
Run Php Directly At Shell
how to config the linux to know the path of /usr/bin/php so no need to type
it before running a php script every time?

View Replies !
Streaming Content Directly?
Could someone tell me if there's a way to filter & stream the content of a different site directly to someone's browser (without redirecting the user to the other page)?

Right now, I'm accessing my friend's site, filtering the data, and putting his content on a part of my page. I'd like to know if there's a way to speed this up. Saving his files to my host and then sending the data out again is taking more processor power than I'd like to be using for this task.

View Replies !
Reload Image Directly
I am uploading a new image to my database. The upload works ok and the new image is stored ok on server. The problem is can I force a reload on cache to display the new image. If I reload the page it works fine but if i dont then the old image is displayed.is there a way to force a reload of image.

View Replies !
Printing Directly And Emailing
i have a registration web page....on the last page i give out all the information of the registration (student ID, course ID, Name etc etc...) now what i want to do is ....Email all that information to the email of the student (which he/she has provided earlier in the registration process) and also let them print out that information "with a printer friendly page".

View Replies !
Can Php Read .xls Files Directly?
I'd like to be able to read a microsoft spreadsheet with php. I know that php can read mysql, so I was thinking that maybe it could read excel spreadsheets as well.

Does anyone know if that can be done?

View Replies !
Number Rows Directly
I need to do something like this:

SELECT row_nr, * FROM asdf LIMIT 10

The column row_nr should be 1, 2, 3 ... 10, but row_nr is NOT a value in the table, I need it to be "generated" some way in the query. The reason is that I want to do something like INSERT INTO table SELECT row_nr, * FROM and so on, And I need every one of those queries to be numerated (in row_nr) starting from 1 and going to as many rows as the query results in. how to solve this one?

View Replies !
Send An Email Directly
I am wanting to know how to send an email directly from my website. I want it to send an email to a user through a socket connection without me needing my own SMTP server or me using a 3rd party SMTP server. It should work something like http://www.mustap.com/phpzone_post_95_sending-email-in-php-the-hac but it should be something I can put into a production function.

View Replies !
Array Directly Into A Table
I have been doing some thinking and am trying to find a shortcut. I have an array that I would like to add directly to my db. This array contains 122 - 125 string values. My data base will have 125 fields. Is there a way to insert the array into mysql without doing the obvious which would be to make a single insert query that would name all of the fields and then somehow make a foreach to loop through the individual elements of the array.

$fields = explode(" ", $record);
//separates each tab separated value in array $record and puts it in $fields

//Time to insert into database
$query = "INSERT INTO residential(//definitely do not want to declare 125 fields here) VALUES(//$fields array)";
$result = mysql_query($query); //Run the query.

View Replies !
Sending Attachments Directly From Form
I have a form with a normal upload type form item, now when this form is submitted I want to attach it to an E-Mail, and then send it out.

What do I do in the PHP form processing code to do this? Obviously I would use MIME mail, but what is the easiest way for me to do this.

Specifically this is for attaching a Resume to a job application that will be sent to an E-Mail address immediately. So the file types will be the normal, '.txt', '.doc' etc.

View Replies !
PHP To Reading Directly From ISAM Files
Are there any utilities that would allow me to use PHP to read directly from an ISAM file?

I have a customer who's application uses keyed ISAM files, but there is no ODBC driver available. We don't need to have writing capabilites, just reading.

There doesn't appear to be any native support within PHP, so I am hoping to find a utility that I could modify for my purpose.

The thought of writing something in PHP using direct file access commands (fopen,fread, etc) is a bit intimidating ! Perhaps someone knows of a "tutorial" on this ?

View Replies !
Cannot Access Session Variable Directly
Basically, a variable called $city_code is passed through the URL and picked up in the script. If that $city_code has not been set as a session variable, then I want to set it.

For some reason I cannot access that city_code directly. So, if the city_code is SIN, then I want to be able to access it as $_SESSION['sin']. However, I can only access it as $_SESSION[$city_code].

I have included 2 echo statements in the script to show where it went wrong. The echo $city_code returns SIN. However. the echo $_SESSION['sin'] just returns Notice: Undefined index: sin.

I should also point out that the script actually does what I want it to do, just that I cannot access the session variable directly. (say $city_code = 'sin') PHP Code:

View Replies !
Outputing Image Directly To Browser
can one "stream" image data to a browser?

I created an image using gd and when I do imagepng I just get the binary
data for the image written as text instead of the image itself. Now I'm
writing the file to a temp file and using html to load the temp but seems
like a waste of cycles and space ;/

Anyway around this?

View Replies !
How To Ouput PDF Directly To The Browser From PHP Script
I know how to ouput PDF directly to the browser from PHP script, but is there any way to
create a PDF file to the server harddisk from PHP?

View Replies !
Security Alert! The PHP CGI Cannot Be Accessed Directly.
I have installed php4.2.2 using the windows installer but i am having problem. I get the message:

Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.

View Replies !
Stream From FTP Directly To MySQL While Parsing CSV
I have some files that sit on a FTP server. These files contain data
stored in a tab-separated format. I need to download these files and
insert/update them in a MySQL database. My current basic strategy is to
do the following:

1) Login to the ftp server using the FTP library in PHP
2) Create a variable that acts like a file handle using Stream_Var in PEAR.
3) Use ftp_fget() to read a remote file into this variable (this is so I
don't have to write it to disk).
4) Parse that data now stored in memory using fgetcsv() (again treating
that variable as a file handle using Stream_Var). This produces an array.
4) Insert/Update the data in the array using DB in PEAR.

This all seems to work and it means I don't have to write anything to
disk. Everything is handled in memory so not temp files are needed. The
downside is that some of these files are very large so the program can
consume large amounts of memory. I want to see what I can do to reduce
this memory usage.

In a perfect world I don't need to keep the entire file in memory. As
soon as a single line is read via FTP I should be able to pass that line
off to the CSV parsing code and the MySQL insert/update should be able
to take place as each line is parsed by the CSV library. I.E. I should
have more than a buffer worth of data in memory at a time. A buffer
would need to be able to store at least a entire line but my memory
requirements would drop significantly.

My problem is that I can't seem to be able to figure out how to do this
with the current PHP libraries. It seems that most functions in PHP are
not designed around the idea of piping streams of information together.

The other restriction I have is that I am limited to just PHP 4.3. Any
ideas or is holding the entire file in memory the best way (other than
writing my own libraries).

View Replies !
Referencing Returned Objects Directly
Is it possible to directly reference an object that is returned by a
function in PHP?

ie this:
echo ReturnAnObject()->SomeMember;

instead of this:
var $Object = ReturnAnObject();
echo $Object->SomeMember;

'cus I can't work out the syntax if it is. :-(

View Replies !
Can You Upload Images Directly To MySQL?
Well i was just wondering if there was any way to actually upload the image to the database, and opposed to putting the image somewhere else and recording its url and other info in a table.

View Replies !
How To Print Directly From PHP Code Using CUPS?
How to print directly from PHP code using CUPS?

View Replies !
Index Directly To My Home Page
I am using Apache server and would like the index file to open my home page that is in another directory. Using Dreamweaver site but do not want this to be visible.

View Replies !
Include Code Directly From A Database
I searched through the forums and didn’t see a discussion of my question so here it goes.

Is it possible to use a php include() to insert code directly from a database? For example, if I have a file something.inc which contains the following:

<?php
…. Some php statements
?>

and have in my index.php file the statement Code:

View Replies !
Running A PHP Script Directly From The EditPlus Editor
I recently installed both the PHPDEV2 package on my Windows 98SE Pentium 2, and I started writing PHP programs using the EditPlus Editor.

Somewhere I read a comment about the possibility of running PHP scripts directly from the EditPlus Editor, but the writer (I forgot who it was) didn't tell how to do this.Can anybody help me with this? I hope this is not a trivial question, so that more people will profit from the answer(s)!

View Replies !
Access A Protected Page Directly, Without Logging In
On the first page a session variable ($_SESSION["admin"]) is created and set to true, if your login details are correct. On the pages being protected I then check to see if this session variable is true, and this works fine.

The problems arise when I try to access a protected page directly, without logging in (impersonating an intruder). The code I'm using to check is just below, and further down is the error message. I don't get it really. I'm not sending any headers before checking the session variable. PHP Code:

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 !
Can I Put A Mysql Query Result Directly Into A Multidimensional Array?
I have two joined tables:

Departments - which contains the department description and a key
Positions - which contains position data

What I'm attempting to achieve is to display the department title in one table cell and then list all the positions associated with that department in the cell under neither the title. I need to generate a table two column table with as many rows as required, depending on the number of departments, which is dynamic.

Do this I'm trying to turn the result of my SQL query into multidimensional array e.g. dept = VioP positions = "designer", "engineer" etc, which I can do then use to generate the table.

I've done a search on the forum and looked around the manual and I'm stumped on how to achieve this, a point in the right direction would be greatly appreciated. The query I'm using is below. PHP Code:

View Replies !
Emails Get Sent Directly Into Customer's Bulk Or Spam Folders?
I use PHP and send emails like confirmations and notifications. But I found that most of our emails get sent directly into customer's bulk or spam folders. What can I do prevent emails from going in there?

View Replies !
Output An Image Directly At A Particular Position In The Browser Window
Is it possible to dynamically create an image (jpeg/gif/png) and output
it directly at a particular coordinate position in the in browser
window using PHP GD functions and HTML (if necessary)?

View Replies !
Pass Form Data Directly To A Function Rather Than Just A Page.
I trying to make my code cleaner for this user management script I made so that it will be easier to add new features and was wondering whether or not their is a cc

View Replies !
Sessions - Stop People From Directly Accessing The Edit Page.
i saw there was another thread about sessions, but i thought it would be best not to hijack his thread. Anyway, I have a password for my site, which passes the user onto another page to edit the content, but i need some help with sessions so that i can stop people from directly accessing the edit page. But all the examples i have seen dont go this far with the sessions, and i dont know where to go from here.

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 !
Allow Users To Edit Their Layouts By Directly Editing The HTML Of Their Profile/blog
So my site is a social site like myspace/livejournal etc. That means there are lots of feilds for users to input data. I use bbcode for blog posting and strip html from text feilds. The thing is, like myspace and livejournal, i will allow users to edit their layouts by directly editing the HTML of their profile/blog. My question is, is there a way to do this safeley?

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 !

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