Re: [PHP] exec() not exec-ing?
Jason Wong wrote... Try specifying the full path to the python binary and possibly the full path to ncMailer.py as well. Good suggestion! I switched everything over to absolute paths, as I should have done in the first place. Unfortunately, this didn't solve the problem. Still searching, gilrain -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] exec() not exec-ing?
On Saturday 04 January 2003 16:29, gilrain wrote: Try specifying the full path to the python binary and possibly the full path to ncMailer.py as well. Good suggestion! I switched everything over to absolute paths, as I should have done in the first place. Unfortunately, this didn't solve the problem. Does the webserver have permission to: (a) execute the python binary (b) access and read ncMailer.py -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* A man's house is his hassle. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] exec() not exec-ing?
Jason Wong wrote: Does the webserver have permission to: (a) execute the python binary (b) access and read ncMailer.py Thanks for all the help! I really appreciate it. :) Hm, I'm actually not sure if my host allows that. This could definitely be the problem. Is there a simple way to find out, other than asking? For now, my guess is I can only execute the file from my cgi-bin directory. Okay, we're a step closer to victory. I can run the script, via a web browser, through my cgi-bin. Unfortunately, this kind of defeats to purpose! This is no better than my original PHP script, since it too will hang the browser on long operations. I'm back to square one, if I can't run that script without the browser waiting on it to finish... Any ideas, given this new situation? gilrain -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] exec() not exec-ing?
I'm back to square one, if I can't run that script without the browser waiting on it to finish... For instance, is there a way for my PHP script to log into my shell account and *then* send the command? Since I can execute the script, but PHP can't, this would solve the problem -- if it's possible. gilrain -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] exec() not exec-ing?
Could you just get the php script to send the commands to schedule it as a task to run via cron etc in say 1 minute into the future... that command would be done quickly.. and the server could continue.. i did something similar when i used NT/ASP. But i'm just a php newbie so i could be lost.. cheers Brendon -Original Message- From: gilrain [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 04, 2003 8:04 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] exec() not exec-ing? I'm back to square one, if I can't run that script without the browser waiting on it to finish... For instance, is there a way for my PHP script to log into my shell account and *then* send the command? Since I can execute the script, but PHP can't, this would solve the problem -- if it's possible. gilrain -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] exec() not exec-ing?
Hi folks, On previous (good) advice given in my Timeout during SMTP operation. thread, I've offloaded some work in my function to an external Python script. The script works beautifully when I execute it myself, from the shell, but I can't get my PHP script to execute it for me. My new function is: // Sends e-mail to the specified list of member e-mail addresses. function ncSendMail($addresses, $subject, $body) { // Delete last mailing file. $ftp = ftp_connect(ftp.somewhere.net); ftp_login($ftp, someone, something); ftp_delete($ftp, www/ncmail/mailing.txt); ftp_quit($ftp); // Create new mailing file. $mailing = fopen(ftp://someone:[EMAIL PROTECTED]/www/ncmail/mailing.txt;, w); // Get the automail 'footer' from the 'automail' table and append it to the body. $body .= ncGetAutomail(footer); // Load addresses, comma seperated and terminated by a newline, into the mailing file. foreach($addresses as $address) { $string .= $address.,; } $string = substr($string, 0, strlen($string)-1); // Strip last comma. fwrite($mailing, $string.\n); // Write subject, then body, seperated by newlines, into the mailing file. fwrite($mailing, $subject.\n); fwrite($mailing, $body); // Close file, call script in background, return. fclose($mailing); exec(python ncMailer.py /dev/null ); return true; } The mailing file is written fine, and the Python script parses the file and e-mails fine, as long as I run it myself from the shell. However, the exec() call appears to do nothing at all, least of all run my script. I've tried a number of different things, but nothing seems to work. Any help would be greatly appreciated, gilrain -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] exec() not exec-ing?
On Saturday 04 January 2003 14:20, gilrain wrote: // Close file, call script in background, return. fclose($mailing); exec(python ncMailer.py /dev/null ); return true; } The mailing file is written fine, and the Python script parses the file and e-mails fine, as long as I run it myself from the shell. However, the exec() call appears to do nothing at all, least of all run my script. I've tried a number of different things, but nothing seems to work. Try specifying the full path to the python binary and possibly the full path to ncMailer.py as well. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The profession of book writing makes horse racing seem like a solid, stable business. -- John Steinbeck [Horse racing *is* a stable business ...] */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php