Calling PHP From A Windows Process
I'm calling PHP from a windowsprocess in a simple Webserver application. I'm using the createprocess Windows API command....
C:PhpPHP Filename.php
In this file I will open a TCP/IP connection to my SQL-server. When I do so, I always get the following error
mysql_connect(): Can't create TCP/IP socket (10106)
No I start a command shell and I call the same...
C:PhpPHP Filename.php
This will work without any error!!
Same effect I get from all TCP/IP Actions (FTP etc....)
Can somebody help me. Is it a PHP Setting, a server variable or a WindowsXP Access right problem?
View Complete Forum Thread with Replies
Related Forum Messages:
Want To Spawn Process From Windows PHP
I wanted to write some code purely on Linux, but unfortunately the document scanner drivers are non-existent for the high-end commercial document scanners. So, I had to port my Linux PHP project to Windows PHP (WAMP). There, I found a scanning tool (Kodak Image Scan - imgscan.ocx) that I can put on a VB form, tell it to scan some documents into a TIF file, and then shut down. I can run this VB app at command line just fine, but when I run it from either a popen(), system(), or exec() call, it won't detach from the PHP page. Instead, it just sits there. I can see the VB exe I made is being loaded properly in RAM, but unfortunately it sticks and won't unload on its own, nor will it tell the scanner to engage. I have to kill the VB exe and then the PHP page continues. What's the way to spawn a detached process from PHP on Windows?
View Replies !
Process Management In Windows
All I need to do is run a windows batch file from a small php program, and return the windows process id of the batch file. I have played around with proc_open() but that returns a resource id. Does anyone have a suggestion on what call I could use to get the windows process id returned within my program. I am using windows xp pro, and php 5/apache
View Replies !
Shell_exec Background Process *Windows*
I am trying to get a shell_exec command to run in the background. So far I have tried: $ret = shell_exec($ffmpegcmd1." >NUL 2>&1");$ret = shell_exec($ffmpegcmd1." >NUL 2>&1 &");$ret = shell_exec($ffmpegcmd1." >NUL"); without any luck.
View Replies !
Process ID
I am starting a process with the system command via a php page. I want to put a button on the same page which will let the user kill the process by clicking that button. To do this, I need to know the process ID. I could grep for it, but that also returns the grep command. How can I make PHP tell me the process ID of a process I started? It seems as if this would not be a problem but I guess I am missing something.
View Replies !
Getting Your Own Process ID
I am doing some work where I want to do locking, and prevent scripts from running in parallel. I see that I could use the semaphore mechanism, but I'd like for my code to be portable, and that extension is not enabled in many places. I need some way for a process to uniquely identify itself. It can then look at the storage container (flat file, DB, whatever is appropriate in context), check to see if the requested semaphore is available, and if it is, acquire it and then mark itself as the owner. It can then check that it did in fact get ownership (as opposed to another process which attempted to acquire it at the exact same moment) before proceeding. Code:
View Replies !
Process Name
How do you send a variable with a php process name? I have one script that different websites are running in the background. I want to be able to identify which website is running which process of the script. /usr/bin/php /home/thescript.php - domain1.com /usr/bin/php /home/thescript.php - domain2.com
View Replies !
Run Process In Background
I want to run process from my php script in background. I try different functions from functions list but all of them whaiting for process ending. How can I run `wget -b ...` and finish my script, but wget must still working? I use PHP5, Linux, Apache2.
View Replies !
Multithread A Process
can i use php to multithread mail() or something similar? in my company i need to send multiple copies of email to a few hundred ppl affilated and on my list. instead of calling mail over and over again i would like to thread this process. could someone point me to some documentation or perhaps an example of where to start with this?
View Replies !
Fetch & Process
I doing a straight forward webpage fetch and saving it to a file: CODE: $open = @fopen($url, "r"); $urlfile = @fread($open, 50000); @fclose($open); $page = split("",$urlfile); $datafile = fopen($tempfile, 'w'); foreach ($page as $line) { echo($line); fwrite($datafile,$line); } fclose($datafile); So I basically just write the fetched HTML line by line to a local file. The weird thing is I'm getting a bunch of ^M characters in the final file after every $line is written to the file.
View Replies !
PHP Process Problems
I'm having problems with php process in win2k. I have apache+php intalled on a win2k machine and after some use I can find 1,2 or 3 non-terminated process in the system. I try to kill them but I receive access denied (even logged as administrator :confused, and I have to reboot the machine. While I have 1 non-terminated process, I have no problems. But when it reaches 3 process php scripts doens't work anymore. If I try to load a page, it doesn't execute the scripts and the browser keeps waiting forever. What maybe the problem? Why can't I kill the process?
View Replies !
Process Form Twice
I have a basic form on one website. But the way it is setup is once the submit button is hit it takes them to a different site where the form is processed. Is what I need to do is have a way that once the submit button is hit I need to save the persons name only in a text file or something then have it go to the other page to be processed. Does that make sense. i know how to save the info from the form to a text file but don't know how to have it do both, save the name and then take the user to the other page where the registration form is processed.
View Replies !
Trouble With A Php Process
I have set up a form and when I click on submit I get the following error message: Warning: fopen(admin/data.dat): failed to open stream: No such file or directory in /home/mlkphoto/public_html/process.php on line 33 Warning: fwrite(): supplied argument is not a valid stream resource in /home/mlkphoto/public_html/process.php on line 37 Warning: Cannot modify header information - headers already sent by (output started at /home/mlkphoto/public_html/process.php:33) in /home/mlkphoto/public_html/process.php on line 39 What does this mean and how do I fix it? I do get the form information sent to my email so I know it's going through. I just can't get a "Thank you" page to come up and I get the error messages.
View Replies !
Process This Form
I want to have a form which has several rows for example: username1 firstname1 surname1 username2 firstname2 surname2 username3 firstname3 surname3 username4 firstname4 surname4 What I want to do is when this data is typed into the form to save it in a MYSQL db. The problem isn't with the saving, it's with the form itself. What is the best way to process this? I can't really name the various fields "username1" and "username2" because I would then need to replicate these as variables and this form generated could have an number of rows so hard coding the form field names with numbers makes it hard. Is there any way I can do this?? How have other people tackled this sort of thing in the past?
View Replies !
PHP Load Process
I've tried searching around for information on how PHP parses and renders itself. Basically, I'm writing a bunch of scripts that rely on a core file. The core itself is quite large (around 20k), but the scripts that reference it don't often utilise the entire contents of the core. Inside the core are functions that are never called *inside* the core, and a bunch of constants and globals that I call from the referencing scripts. So I guess in a nutshell, I want to know if when I call require, does PHP read the *entire* file? Or does it only read the bits it needs? I realise that last sentence makes me sound like I have trouble putting legos together, but I would just like to know how PHP goes about it duty.
View Replies !
Hanging Php Process
I am running a php site on a shared host environment. They have 20 max concurrent process limitation. Recently, I am having issue of some phpcgi process just hanging there and my site run out of process quota. the time limitation in php.ini is 180 seconds. However,those php just doesn't quit after 180 seconds, I check ps result. seems all those process just consume 0 seconds of CPU which explains why it didn't get termiated? It just didn't finish properly. what kind of things will cause process stay there? if I didn't close mysql connection,not free up result, will that cause it?
View Replies !
Image Process
I start learining php this week , and I am wondering if anybody knows if we can access to a picture's pixel using php.
View Replies !
Process A BIG String
i need to process every character in a file, so i open the file read in buffers of about 8192bytes and process each buffer, then i write the output to another file. the problem is that with large files(>8Mb) i get a script error(Fatal error: Maximum execution time of 30 seconds exceeded ). i acess every character in the buffer with $chr=ord($bufferIn{$i}); (where $i=0...8192) seems like all he time the script consumes is in the for loop and the chr/ord functions. can i do something to speed things up? is there any other way of acessing a single characher except $bufferIn{$i} ?
View Replies !
Mysql Process Cpu 106%?
Im in real trouble here I have a new social networking site similar to myspace, I just opened it to the public today and it has only around 80 users so far and with like 20 online i get this mysql process cpu 106%.
View Replies !
Background Process
I would like to create a script that acts like a background process. Basically once every hour, it will access a website, gather data from it, and write that data to a file on a remote server. The PHP code would be running on this same server. Is this type of non user activated, constantly running code possible?
View Replies !
Forking A Process
What i should i use to create a script that does two things at the same time ie while sorting/execeuting a process, how can i show another screen with valid data on it?
View Replies !
In-process Display
Is there an easy way to do either of the following in php? display basic content while the php script is running through a extended loop, then when the loop completes, replace the basic content with final content; or have two pages, one with the basic content that checks with the longer running script and redirects to it when the latter is complete.
View Replies !
Code Process
This is sort of a general question, as I'm not 100% sure of the answer. Exactly in what process/order does the php code in a script get processed? I ask this as I have a simply gaming site, and things have been going until just recently, the cause being. I have user playing that is on dial up. Since this user is on dialup, he is constantly either timing out, or getting dropped/losing his internet connection. And the result is that I am getting sql errors on queries that can't process because the code didn't complete before he was dropped.
View Replies !
Control Process
i'm looking for a way to: 1. start a new process (exec(), proc_open(), popen(), whatever()) 2. sleep(some_secs); 3. if the process is still running, kill it. 4. otherwise, go to 1. any ideas on this?
View Replies !
Cannot Process Forms
I have installed PHP several times using tutorials and information from a book, but each time I am able to use basic functions, such as date(), but when it comes to processing forms it shows up nothing. I know it can't be my programming as i have copied the book word for word and even use the example from their website. All i am trying to do is send information from a HTML form to a PHP page which will then display what was entered into the form. The code i have used on the PHP page is shown below: Code:
View Replies !
Understanding The Process
I need to understand the process before I start coding. I have a database that contains the following: Item Number date Account Number Quantity Total value only if you combine the Item Number date and Account number will it be unique. What I need to do is the following I need to extract all the data for a curtain Account number or a range of account numbers for a curtain date range, I need to add up all the quantities from all the date ranges for the individual Item numbers per account numbers. The add the quantities from the range if account numbers for the individual Item numbers.
View Replies !
Kill A Process
I run an Internet TV station, and im using a piece of software on the server to stream content to the shoutcast server. This all works fine. But what is getting at me is the fact that if i want to kill the process so i can broadcast from my local machine i have to log in via ssh and kill them manually. I already know the php commands to kill a process and also to list the running processes, but i was wondering if it was possible to get the php code to store the PID of the program upon starting so that when the "kill" button is pressed, it reads the string from the database/text file etc. and kills that process only.
View Replies !
Payment Process Through Nobel Pay
I am in photo business site. is their any one done any credit card payment process through nobelpay(one of the payment process like paypal, surepay etc..) in php. If any one have come across this payment process in php. please tell me how to implement the credit card payment process in php using nobelpay payment.
View Replies !
Does PHP Process Requests Sequentially On One CPU?
With ASP.NET I've found that request are processed sequentially, one at a time, at least on a server with one CPU. If one request blocks for some reason, maybe on a long database query, then all users must wait until it completes, for their request to process. This leaves me wondering about PHP running on IIS and Window. Does this hold true for PHP also? What about PHP on Unix? Does this allow true simultaneous processing of all requests when the server has a single CPU?
View Replies !
Oracle + PHP + Long Process
Oracle 10g RAC on Linux, with an end-user interface via Apache/PHP/AdoDB on a separate Linux box. I need to create a PHP web interface to allow an end-user to run a PL/SQL stored proc that will do a force refresh of a series of materialized views following the loading (through another PHP interface) of additional flat file data into the underlying tables. I want to allow multiple data uploads and then do a single refresh, so I won't be able to use fast refresh or other internal database trigger mechanisms. My real problem is that the time taken to execute the stored proc is likely to considerably exceed the max script execution time for PHP, and I don't want the end-user interface to just sit there bubbling away waiting for the Oracle processes to return a response anyway. I am considering creating a "master" PL/SQL stored procedure which would use the Oracle DBMS_SCHEDULER package to run a nearly-immediate job as a "background" (to the PHP interface) process. Is this the way to go, or are there other better solutions that I am overlooking?
View Replies !
Process Control Problem
I need to process some computation but i do not want the user wait the end of the computation but instead i would send the user a "wait refreshing page". When the computation is finished i would replace the refreshing page with the new page containing the results. So i need 2 processes one that would make the waiting page and one that would do computation and make the results page. I read in the php manual that handling processes within a web server environment could raise problems. Is there a simple and a clear manner to solve this problem?
View Replies !
Process Form With Both Javascript And PHP
PHP/Javascript. I have a simple form I want to validate the fields with javascript and then run the PHP script. All the scripts are in one page. I want PHP to control where the next page is. It works fine without the javascript but when I add the javascript the page doesn't do anything besides the validation. Thanks for your help... Chong ----login.html-------------------------------- <?php ob_start(); session_start(); require('datasource.html'); switch ($_POST['process']) { case 'Login': $_SESSION['login'] = $_POST['login']; $sql = "SELECT first_name, last_name, security_access, expire, passwd_date FROM sy_user WHERE login = '".$_SESSION['login']."' AND password = '".substr(sha1($_POST['password']), 0, 10)."'"; $result = mysql_query($sql); if (mysql_num_rows($result) < 1) { $msg = "Invalid login and password!"; } else { $row = mysql_fetch_assoc($result); $_SESSION['first_name'] = $row['first_name']; $_SESSION['last_name'] = $row['last_name']; $_SESSION['security_access'] = $row['security_access']; $passwd_date = $row['passwd_date']; $expire = $row['expire']; if ($passwd_date + $expire < date('Y-m-j')) { header('location: expired.html'); } else { header('location: main.html'); } } } ?> <SCRIPT LANGUAGE="JavaScript"> function checkrequired(form) { for(f=0;f<form.length;f++) { if(form[f].name.substring(4,length)=="reqd") { if(form[f].value){continue} else {
View Replies !
Starting A Process On The Server
after putting my self through hell trying to call an executable with Java. (which I was doing correctly according to the specs, but there is something f$#%ed up with the implementation of Runtime.exec() on this OS--Linux for those of you who are wondering, when I recomiled everything on NT it runs as expected, which is unfortunate) Anyway, I was just curious, since I haven't really taken PHP very far, and haven't played with it since PHP3, what would one do to call an executable on the server file system? with arguments?
View Replies !
Security With Checkout Process
for the checkout process of an online store...i'm wondering what to do about passing sensitive information between pages. i was thinking of having a 3 step checkout process... if i have a page where they enter their address and phone number and such...is it relatively safe to post that info to another page using a form? is there anything i should be watching for?
View Replies !
PhpCB Batch Process ?
If I have a series of php files under C:INETPUBPROJECT with quite a few SUBDIRECTORIES also (i.e. a standard PHPNuke install), is there a way to have phpCB "batch" process all of the files ? This is the command line that I would be using: phpCB -space-after-start-bracket -space-before-end-bracket -space-after-if - space-after-switch -space-after-while -space-before-start-angle-bracket -spa ce-after-end-angle-bracket -one-true-brace-function-declaration -glue-ampers core -indent-with-tab -force-large-php-code-tag -extra-padding-for-case-stat ement -force-true-false-null-contant-lowercase --comment-rendering-style PHPDoc --padding-char-count 1
View Replies !
Php Software Design Process
Would anyone out there like to explain their web based software design process? I'm analyzing our current methods vs. other more productive ways to handle project management, source code versioning, sftp, ssh, debugging, testing, customer - programmer relationship (ex: new features/requests), and development ide. I'm looking for more efficient ways to produce reliable code, version it, test it, track bugs, and implement. Things I'm looking for are the actual individual processes it takes to get this job done. Not looking for arguments on the best cvs or ide... just a good process to follow in general. Something like.. should you test on an independent development machine or your local workstation to combat concurrent programming falacies? This isn't my first rodeo so I'm not looking for simple answers unless they truly are simple...
View Replies !
Apache Doesn't Process PHP Pages
installed Apache & PHP 4 under Linux via RPM packages Html pages work, not php's (every php script is displayed on the browser as text file) I check'd all the modules directives in httpd.conf, as explained on php.net, but things don't work In my error_log file, there is no trace of php having been installed Anybody has a hint or a link to something ?
View Replies !
Exec Background Process
I want have PHP call another process (another PHP script at the moment but it may end up being a binary) in the background and not wait for process to complete, but rather instantly jump the the next line of code. I've tried things like: exec("./script.php &"); // script.php has executable permissions set exec("at -f ./script.php now"); // and #!/usr/bin/php at the top of the code Neither seem to work. They both execute script.php, but both hang around until script.php has completed.
View Replies !
XP Exec Background Process
I was trying to exec a background process on XP using PHP CLI, but could not get it to work. Suppose the command I want to spawn off is "cmd". On *nix, it is as easy as putting ampersand "&" at the end of the command. I tried the following on XP without working. exec("cmd"); exec("cmd >NUL"); exec("cmd /c cmd"); exec("start /b cmd"); I tried many combination, but on each one, PHP waits for cmd to exit before continuing. Doing this in Windows script host (cscript) is simple: Set objShell = CreateObject("WScript.Shell") objShell.Run "cmd", 0, False The "False" parameter causes the Run method to continue immediately without waiting for the command to finish. So I could make my PHP file exec a VBS file that does the actual background execution of my command. PHP exec documentation says it will not wait if output of the command is redirected somewhere, but this didn't seem to work for me. If anyone has experience in doing something like this on Windows XP SP2,
View Replies !
Process ARRAYS Of Checkboxes
I am OK using php to process ARRAYS of checkboxes BUT how on earth can you process multiple checkboxes with the SAME name WITHOUT using arrays ? For example ... <input name = "check" type = "checkbox" value = "'value1'"/> <input name = "check" type = "checkbox" value = "'value2'"/> <input name = "check" type = "checkbox" value = "'value3'"/> as opposed to ... <input name = "check[]" type = "checkbox" value = "'value1'"/> <input name = "check[]" type = "checkbox" value = "'value2'"/> <input name = "check[]" type = "checkbox" value = "'value3'"/> The problem is that you cannot use checkbox arrays (of the form check[]) in javascript. There seems to a conflict of interest here ?
View Replies !
Help With PHP Process Control Functions
I have written a script that basically sends an email (using sockets). I want this script to be able to run multiple copies of itself so that it doesn't have to wait for one mail sending to finish before starting on the next. I understand that I need to use the PHP pcntl_ family of functions to control the processes, but am not sure where to start. There aren't many helpful articles on the internet about this topic! Any example code or help would be greatly appreciated.
View Replies !
Display If $process Is Running
How can I display if a process is running... For example, I'd trying to write a snippet of PHP code that will check if a process is running and display a message on the resulting webpage depending on whether it's running or not: Code:
View Replies !
PHP Access Process Information
how when open task manager you can see how long a process has been running? He wants that info on a webpage. I've googled around a bit but can't find anything even remotely related to it, so I'm hoping someone else has done something like this before.
View Replies !
Continuously Running Process
Would it be a high load on a server to have a php process run from the executable, continuously looking for existence of files in a folder and processing them if they are there? Just an endless loop that checks for the existence of the files. If they are there, do something with them, if not keep looping? It is not a web accessible application but something for server admin.
View Replies !
How Do You Process If You Have Forms In Your Script ?
How do you process if you have forms in your script ? I have form 1 and form 2 in my scripts and their method are both 'POST', my logic is to go back to the same script whenever I click the submit button from my form 1, my problem is whenever I click the select botton and goes back to the same script it does not recognise the other buttons from Form 2. How do I process 2 forms ?
View Replies !
|