php-windows Digest 1 Aug 2001 14:03:33 -0000 Issue 679 Topics (messages 8604 through 8613): couple of questions about php and apache on win2k server 8604 by: Kash Re: Works through DOS, not through Apache 8605 by: Frank M. Kromann Re: Variable scope in loops 8606 by: Mike Flynn Need docs for building PHP4 in Win32 8607 by: Aaron COM with ISS and PHP 8608 by: Holm Puder Re: mail(); error 8609 by: Michael Rudel 8611 by: Joel Apache, PHP4.06, PHP_DOMXML.DLL 8610 by: Mads Østerby Attachment in mail(). 8612 by: arthur Problem installing PHP4 on Linux 8613 by: Kevin Sayre Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
On the apache site they very clearly say that Apache on windows is not as secure or reliable as the Linux versions. I was wondering if there are many security problems (in comparison with IIS... wha wha I know!) Also, if people have run into stability problems in windows with Apache. Also, I know that you can compile apache and php together in UNIX/Linux so that apache doesn't have to make external calls. Is this available at all for windows?? How about with nusphere's free product? Thanks for your help! K
Hi Shawn, If you run the script without supressiung the warnings you would perhaps see the reson :-) When running the script from the command line PHP hase the same access rights as the user executing the script. When executing through a request to a web server, PHP has the same access rights as the user running the web process. Check the access rights to the directory and files that you try to open. - Frank > Can anyone tell me why the following code won't work when I call it through > Apache, but it DOES work when I do it in a Command Prompt? > > It gives me 0 when I run it through Apache. I'm have PHP set up to run as > CGI. PHP 4.0.6 w/ latest 4.0.7-dev snapshot on top. > > What I'm going to end up doing is copying the files from an UNC path over to > the local server (running PHP), but I can't get anything to work with UNC > paths when called through Apache, not even a system call to "move". But > everything always works in a Command Prompt. If you can think of another > way I could do this on demand, I would greatly appreciate it, as this is > driving me crazy! > > <? > if ($dir = @opendir("//workstation//test")) { > while($file = readdir($dir)) { > if ($file !="." && $file !="..") > $arFiles[] = $file; > } > } > ?> > File_Array Count: <? $asize = sizeof($arFiles); > print $asize; ?> > > Thanks, > Shawn Sellars >
Hi Tom, First problem, is that the variable $incident_array isn't declared beforehand outside the loop. Do: var $incident_array = array(); before the loop. That way PHP doesn't assume that it's scoping is only for within the loop, since that's where the variable is created, not having been previously created. Also as a sidenote, I don't think you want to loop to $num_columns+1. Seems to me if there's 2 columns, say, you'll be doing.. 1, 2, 3.. which is 3 columns, which is more than the number of results. There are only $num_columns Give some of those a try.. -Mike At 02:41 PM 7/31/01 -0700, Tom Tsongas wrote: >Hi folks. > >I have an interesting problem with regards to variable scope in loops. >Now I understand how this operates in functions but its the first time I >have seen variable scope in a loop. > >Below is a code snippet of what I have: > >// execute SQL query >OCIExecute($sql_statement) or die("Couldn't execute statement."); > >// get number of columns for use later >$num_columns = OCINumCols($sql_statement); > >// format results by row >while (OCIFetch($sql_statement)) { > for ($i = 1; $i < $num_columns+1; $i++) { > // Create array to store fetch results > $incident_array[i] = OCIResult($sql_statement,$i); > //echo "<P>Incident array value $i: $incident_array[i]</P>"; > > } >} >// Output results of incident array >echo "<P>First array value: $incident_array[1]</P>"; > > >Now I 'expected' the echo statement to properly display the results of >the first array element but instead, the value is blank. Now when I >uncomment the echo statement WITHIN the for loop, it does display so I >know the values are being stored but apparantly the scope of the array >is within the loop and not outside. > >How can I make the array values accessible outside of the loop? I found >a 'global' statement in the documentation but it didn't seem to like >taking an array as a parameter. I had it looking something like this: > >global $incident_array[]; > >Any help would be appreciated. > >Tom Tsongas > > > >-- >PHP Windows Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -=- Mike Flynn - Burlington, VT -=- [EMAIL PROTECTED] http://www.mikeflynn.net/ * Give blood * Wouldn't the free market, in its true form, be anarchy?
I have looked thoroughly for *detailed* documentation on how to build PHP4 and extensions under Win32. Documentation is NOT included in the source distribution or anywhere I can find through the search engine at www.php.net . I understand that www.php4win.de is apparently the best resource at the moment, but it has been down the last several times I have checked over the past few days. I'm looking for suggestions elsewhere, so if you have them, please reply. A
Hi, I try to connect to a COM object. The creation of the objects works fine. The return value isn't NULL. If I call one of the public functions I get always an error message "Warning: Invoke() failed:" The code is like $obj = COM("TestCom.TestCtrl.1"); if ( $obj == NULL ) print ...... else $var = $obj->Start("File.txt"); ..... Thx Holm
Hi Chris, ... you need to specify your smtp-server in the php.ini. Hope this helps. Greetinx, Mike Michael Rudel - Web-Development, Systemadministration - Besuchen Sie uns am 20. und 21. August 2001 auf der online-marketing-düsseldorf in Halle 1 Stand E 16 _______________________________________________________________ Suchtreffer AG Bleicherstraße 20 D-78467 Konstanz Germany fon: +49-(0)7531-89207-17 fax: +49-(0)7531-89207-13 e-mail: mailto:[EMAIL PROTECTED] internet: http://www.suchtreffer.de _______________________________________________________________ > -----Original Message----- > From: Chris Burwell [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 01, 2001 2:57 AM > To: [EMAIL PROTECTED] > Subject: [PHP-WIN] mail(); error > > > when i try to send an e-mail using the mail(); function i get > the following > message: > > Warning: Failed to Connect in > d:\Server\apache\htdocs\dev\inc\functions.inc > on line 26 > > Line 26 of the functions.inc file reads like this: > > $mailsend = mail("$email", "$subject", "$body", "From: > $from\r\nContent-type:text/plain"); > > Can someone help me out? > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] >
Your SMTP server might not be on or working. For testing purpose, you could use your own SMTP server on your computer from postcastserver.com, download postcastserver (freewar) -- Joel Agnel [EMAIL PROTECTED] "Chris Burwell" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > when i try to send an e-mail using the mail(); function i get the following > message: > > Warning: Failed to Connect in d:\Server\apache\htdocs\dev\inc\functions.inc > on line 26 > > Line 26 of the functions.inc file reads like this: > > $mailsend = mail("$email", "$subject", "$body", "From: > $from\r\nContent-type:text/plain"); > > Can someone help me out? > >
Problem! Using Windows 98, Apache 1.3.14, PHP 4.06, and i works fine! Now I try to use the php_domxlm.dll ..... My PHP.ini in configured with: [php.ini] . . extension_dir=c:\WebServer\php\extensions extension=php_domxml.dll . . I get no errors on Apache/php server startup, and other .php files works fine execpt ones with XML/DOM functions! Look at this error: "Fatal error: Call to undefined function: xmldocfile() in c:\server\test.php on line 3" Line 3: <? $doc = xmldocfile( "employees.xml" ) ?> Why does PHP not know "xmldocfile()" .. And how do I make it work ? / Mads Østerby
I'm having a big problem with mail(). Í'm trying to add a attachment, but the only way I have found is using Mime. Does anybody know if there's a way to add a attach file and how can I do it??? If somebody knows and have an example, I would be really glad. Arthur Franco
Ok, here's a real stupid question, but I can't see what I did wrong. Basically, I'm trying to get PHP to run on a Red Hat Linux server, installed the RPM, verified that the httpd.conf file has the LoadModule for PHP in it, but still, it won't process the scripts, simply spits out the code. What'd I miss? Thanks. Kevin Sayre [EMAIL PROTECTED]