[PHP] Files created by PHP/Apache
Hi! I've got a problem with preconfigured server (Apache 1.3/MySQL 3/PHP 4): Files and directories created by a PHP script are always owned by the apache user and apache group. But the script itself is inside of a virtualhost which has another user and group (web2 / ftponly)! So in fact the script has to run with the rights of the user web2?? Perhaps it does, but files/dirs are create with owner apache. I want the files, created by the script, to be owned by web2. The important part (I think ;-) of httpd.conf looks like: -snip- User apache Group apache NameVirtualHost xxx.xxx.xxx.xxx:80 php_admin_flag safe_mode On php_admin_value safe_mode_exec_dir /var/www/empty ServerName xxx.yyy.xxx ServerAlias xxx.zzz.yyy DocumentRoot /var/www/web2/html User web2 Group ftponly ScriptAlias /cgi-bin/ /var/www/web2/html/cgi-bin/ php_admin_value open_basedir /var/www/web2/ php_admin_value upload_tmp_dir /var/www/web2/phptmp/ -snap- Hint: /var/www/web2 is the homedirectory of web2, he has all rights there. Can anybody help me? What do I have to change? Joachim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Files created by PHP/Apache
Cpt John W. Holmes wrote: >> So in fact the script has to run with the rights of the user web2?? > Perhaps >> it does, but files/dirs are create with owner apache. > > PHP runs as a module inside of apache, so any files it creates are owned > by the Apache user. That's the way it works. > > If you run PHP as a CGI, this does not happen. Or use FTP to make files. And there is no other way? No way to configure it? Or, are there any hacks/patches, workarounds? This way, it seems to me like security hole, because I have to use 0777 while creating, then everybody could do everything with the files. Well, there is the open_basedir setting, put then, what's about other user doing other things (not PHP)? No way? Joachim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Files created by PHP/Apache
Curt Zirzow wrote: >> This way, it seems to me like security hole, because I have to >> use 0777 while creating, then everybody could do everything with >> the files. Well, there is the open_basedir setting, put then, >> what's about other user doing other things (not PHP)? >> > > Yes that is a big security hole. There are some hosting solutions, > I cant really help you there, but this concept I think should work > would be: > [...] > user/group: $virtualuser/apache Hmm, well. It may be "more" secure, but there is still the problem, that every $virtualuser can access the files. You still have to hope that there is now "bad" $virtualuser. Anyway, thanks :-)! Joachim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Files created by PHP/Apache
Curt Zirzow wrote: > * Thus wrote Joachim ([EMAIL PROTECTED]): >> > Yes that is a big security hole. There are some hosting solutions, >> > I cant really help you there, but this concept I think should work >> > would be: >> > [...] >> > user/group: $virtualuser/apache >> >> Hmm, well. It may be "more" secure, but there is still the problem, that >> every $virtualuser can access the files. You still have to hope that >> there is now "bad" $virtualuser. > > perhaps a little more detail on how things would be set up: > > Folder strucure user/group permissions > /www/virtual1-domain.com/www/ virtual1/apache0770 > /www/virtual2-domain.com/www/ virtual2/apache0770 > > thus virtual1 cant touch virtual2's files and vice versa. Oh, yes, thanks you opened my eyes! :-) Joachim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Randomizing 3 different numbers.
Sorry for top-posting, gotta configure my mail client better later. Small error here: }while( ($three == $one) && ($three == $two) ); Change to: }while( ($three == $one) || ($three == $two) ); -Original Message- From: Ray Hunter [mailto:[EMAIL PROTECTED] Sent: den 27 oktober 2003 15:56 To: [EMAIL PROTECTED] Subject: Re: [PHP] Randomizing 3 different numbers. Before you add a number to a string make sure that the number is not in any of the other ones if they exist. Use a do-while loop on it... $one = rand( 1,20 ); do { $two = rand( 1, 20 ); }while( $two == $one ); do { $three = rand( 1, 20 ); }while( ($three == $one) && ($three == $two) ); echo "One: $one\n"; echo "Two: $two\n"; echo "Three: $three\n"; HTH -- Ray On Mon, 2003-10-27 at 05:26, Ian Gray wrote: > I am tring to output 3 different random numbers between 1 > and 20 into 3 different strings. Using Rand() for each > string isn't sufficient as I may get the same number > repeated for one of the other strings- eg 1,1,3 or 5,3,3 . > It's important that I get three different numbers outputted > into for example $one, $two, $three. > > Can anyone help? > > Ian > > = > > - > Ian A. Gray > Manchester, UK > Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44 (0) 7900 996 328 > Business Enquiries: +44(0)870 770 8832 > E-mail: [EMAIL PROTECTED]: www.baritone.uk.com (Performance) www.vocalstudio.co.uk (Vocal Tuition)www.selectperformers.com (Web design for professional musicians) > - -- 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] Multisorting an array
I have an array with the following structure: Array ( [0] => Array ( [name] => images [type] => dir ) [1] => Array ( [name] => includes [type] => dir ) [2] => Array ( [name] => index.php [type] => file ) [3] => Array ( [name] => index.tpl.php [type] => file ) [4] => Array ( [name] => lib [type] => dir ) } I want to array_multisort this array so it becomes sorted by type first, and then by name. What are the arguments for the function in this case? Joachim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array declarations
Is there any speed difference at all from the following two code blocks (miniscule or not)? If so, which is faster? $cfg["db"]["host"] = ""; $cfg["db"]["user"] = ""; $cfg["db"]["pass"] = "zzzz"; or $cfg["db"] = array("host"=>"", "user"=>"", "pass"=>""); Joachim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] open_basedir Option
How do I set the php.ini setting open_basedir on a per-directory basis? Ideally, I would like to set it using .htaccess files... Joachim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Adding slashes
PHP seems to automatically be escaping quotes on my $_POST variables. Am I talking rubbish, or is this some setting? It is annoying me greatly. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] string manipulation
This is the best method echo substr(strrchr($string, $char), 1); On 21 February 2003 at 00:13:02, Gregory Heinrichs wrote: > little help please, looking for correct functions to use to search for the > last occurrence of a character in a string and truncate everything in > front of it including the searched for character.< -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to "Include" a php source file ?
include() include_once() require() require_once() Look those functions up in the PHP docs. On 23 February 2003 at 21:32:46, Rohin Gosling wrote: > First up, I sent this same message a few hours ago, but I do not see it in > the news group, and neither does it appear in my sent messages folder. > Therefore I am presuming that it never made it to the news group. How ever, > if it did get to the news group and I am just unable to see it, then just > ignore this message and hopefully my first attempt to post this question > will show up latter. I did receive a warning message saying that the message > may not appear strait away. So I'm not quite sure what's it going on here. > Anyway, back to my question. Hopefully it will make it into the news group > this time ! > Is it possible to "include" a *.php source file from inside another php > source file, an a fashion similar to that of using the include directive in > C or C++ ? > Or alternatively, is there a way to call a php script stored in another file > from inside a php script. > Rohin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] save all vars in a url to a var?
For a list of common system variables, refer to: http://cs-people.bu.edu/stevec/cs101/02s/php5_system.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code optimization: single vs. double quotes?
That style is also the one I use. It works well, it is clean, and it is straightforward. Joachim Richard Baskett wrote: on 10/24/03 0:47, Nathan Taylor at [EMAIL PROTECTED] wrote: I am a recent fan of the single-quotes. I used to use double only but when some gurus told me the disadvantages I converted my entire project over to single quotes. Single quotes are ideal because as far coding goes it greatly decreases the time of development when you don't have to worry about dropping in the escape character on your HTML values, etc. Granted, single quotes can be a nuisance in some instances (like when you need a new line character) but of course there is a way around. I simply define a constant and call that at the end of every line in order to substitute for the new line character. Horizontal Tab - define("T", chr(9)); New Line - define("NL", chr(10)); Cheers, Nathan - Original Message - From: Robert Cummings To: Shawn McKenzie Cc: PHP-General Sent: Thursday, October 23, 2003 10:30 PM Subject: Re: [PHP] Code optimization: single vs. double quotes? On Thu, 2003-10-23 at 20:43, Shawn McKenzie wrote: I came across this post and was hoping to get a gurus opinion on the validity. TIA -Shawn I remember reading somewhere re: PHP coding that it is a better coding practice to use single quotes as much as possible vs. using double quotes in scripts. When using double quotes, you are forcing PHP to look for variables within them, even though there may not be any, thus slowing execution time... For example it is better to code: Code: echo ' '; vs. Code: echo " "; Better is a very subjective question; however, style 1 will run faster since it won't look for variable interpolation. Personally I always use style 1 unless I specifically need variable interpolation or one of the special characters such as a newline. Also when doing HTML the double quotes fit nicely in the the single quote paradigm. On the other hand when I do SQL queries, I often allow interpolation just because it is more readable and because I usually use single quotes to wrap strings in my queries. Now what is wrong with doing this? echo ' '."\r\n"; That way you can still use your single quotes and still being able to use the \r\n.. that does work doesn¹t it? Im pretty sure I have used it before.. Anyways I guess the point is that you are not forced to use double quotes for the full echo just so you can use the special newline characters.. Rick "Freedom and immorality can not co-exist because freedom requires personal responsibility." - Unknown -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Got myself confused
Jesus. How drunk were you when you concocted this mess? Joachim Tom Wollaston wrote: I have been trying to write some code for a simple menu system. The idea was that every item on a menu should be tied to anouther to give a menu structure. To do this I have tried to use the following code. Some of it I have added in to try and understand why its not really working. My first problem is that the function I use seems to omit the first result, even if I make the select compleatly unbounded. My second problem is that I do not seem to be able to figure out how to display the correct part of the array. Currently I have been using print_r which just displays a list. When I try to display what I want it doesn't do anything. I think I may have messed up the function codeing but I cannot see where I have gone wrong and I have been doing it all day (time now 1.02 in the morning). If anybody can help it would be appreciated. $link = @mysql_connect($DB_server, $DB_user, $DB_pwd) or die ("Could not connect"); @mysql_select_db($DB_user) or die ("Could not select database"); $null=getinfo('0'); for ($i=1; $i<=sizeof($null); $i++); { print_r($null); /* print $nul[$i]['name']; $j=$null[$i]['id']; /*$fisrt=getinfo["1"]; for ($k=1; $k<=sizeof($first); $k++); { echo $first[$k]['name']; $l=$first[$k]['id']; $second=getinfo['$m']; for ($m=1; $m<=sizeof($second); $m++); { echo $second[$m]['name']; } }*/ } ?> $n = 1; while ($row=mysql_fetch_array($result,MYSQL_ASSOC)) { foreach ($row as $colname => $value) { $array[$n][$colname] = $value; } $n++; } return $array; } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] References and memory efficiency
Hi there, I've been working on a database wrapper class for a while now, MySQL to be specific. Until now, I've simply had a fetch function that returned an array of all the rows that the database returned, only because I have gotten so tired of always writing the same while loop to iterate through all the rows. However, I have discovered that the method I'm using, passing around large multidimensional arrays of text by copy, is extremely memory inefficient, so I am working on a new method. Tell me if this is any better: Rather than using something like: $sql = 'SELECT text, date, etc FROM news WHERE blah=\'foo\''; if (!$myquery = $db->query($sql)) { echo 'uh oh'; } if (!$db->numrows($myquery)) { echo 'no rows found'; } $news = $db->fetchNews($myquery); I could do something like: $news = array(); $db->fetch($myquery, $news); Where fetch($query, &$array) is the header. In the second case, the fetch function would therefore write the rows directly to the array which was passed as a reference rather than returning a copy. Am I right in thinking that this is a better method? Should I shut up and do a while loop? Thanks, Joachim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Persisting MySQL connection accross scripts
With persistent connections, you actually have to have the mysql_pconnect statement in each script you want to use the connection in. The function will use an already-existing connection if one is available. If no existing connection could be found, it will initiate the link. The manual at php.net says this as well: "First, when connecting, the function would first try to find a (persistent) link that's already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection." Joachim Rich wrote: How can I establish a connection with a MySQL database and have it persist accross multiple script files? I've found the mysql_pconnect() function but this doesn't seem to do the job - which is fairly logical actually because the connection is stored in a variable: $connect = mysql_pconnect(); and that variable $connection won't be available in another script. I would have thought there would be a straightforward answer to this as it seems that its someting which must be done fairly regularly. The only workaround I can think of is sending the username, password and database name to every script. But how would you do this securely? When establishing the initial connection I got the username and password from a form which used the method="POST" method. But if I want to have a link to a script, say 'add_item.php', how can I do it securely? would not use the POST method. I could use forms for every link but this seems ridiculously over-complicated! Thanks in advance for any pointers! Richard. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] recursive acronym - PHP
Or LAME for "Lame Ain't an MP3 Encoder" Larry E . Ullman wrote: Why PHP is a recursive acronym?, I know that before was called Personal Home Page, I now is Hypertext PreProcessor, but why is recursive?, I person told me that it could be wroten as Pre Hypertxt Processor, thanks. PHP stands for "PHP: Hypertext Preprocessor". It's called a recursive acronym because it uses itself in its definition. Another example: GNU, for "GNU's Not Unix". Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: eliminating dupes from MySQL query results
Look into the DISTINCT keyword for MySQL. Robb Kerr wrote: It's not exactly a Php problem, but MySQL and Php seem to be so intertwined and this newsgroup has been so unbelievably helpful that I thought I'd post the question here. I've got a query which returns a group of records. the field which I want to display in a list contains many duplicates. I need to remove all duplicates so that each entry is only displayed once. Another query based upon a selection from this list will display all of the appropriate records. Can anybody help with the syntax? Do I need a loop or is there a MySQL command/function which I am overlooking? Thanx, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Dissecting an email address
Hi there, First, we have to realize that in an email there can be more than one period, but we only want to remove the top level domain. The solution? Remove the top level domain to begin with - You may be able to do that using explode() and the limit argument, but this was easier, in my opinion. Joachim Dave Carrera wrote: Hi All, How do you split an email address sent via form post text field. I.e.: split [EMAIL PROTECTED] into me@ hotmail .com It’s the domain bit I am interested in, not the username or tld. Any help is appreciated. Thank you in advance Yours Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.530 / Virus Database: 325 - Release Date: 22/10/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] recursive acronym - PHP
Perhaps it is time to break the record. Evan Nemerson wrote: How can you forget the Hurd??? http://www.gnu.org/software/hurd/hurd.html#name: "According to Thomas Bushnell, BSG, the primary architect of the Hurd: `Hurd' stands for `Hird of Unix-Replacing Daemons'. And, then, `Hird' stands for `Hurd of Interfaces Representing Depth'. We have here, to my knowledge, the first software to be named by a pair of mutually recursive acronyms." On Saturday 01 November 2003 11:23 am, [EMAIL PROTECTED] wrote: Why PHP is a recursive acronym?, I know that before was called Personal Home Page, I now is Hypertext PreProcessor, but why is recursive?, I person told me that it could be wroten as Pre Hypertxt Processor, thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] AW: [PHP-CVS-DAILY] cvs: php4 / NEWS
UNSUBSCRIBE -- PHP CVS 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]
[PHP-CVS] Mailinglist: -help
-Ursprungliche Nachricht- Von: changelog [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 17. Januar 2001 03:09 An: [EMAIL PROTECTED] Betreff: [PHP-CVS-DAILY] cvs: php4 / ChangeLog changelog Tue Jan 16 18:09:29 2001 EDT Modified files: /php4 ChangeLog Log: ChangeLog update Index: php4/ChangeLog diff -u php4/ChangeLog:1.590 php4/ChangeLog:1.591 --- php4/ChangeLog:1.590Mon Jan 15 18:09:12 2001 +++ php4/ChangeLog Tue Jan 16 18:09:11 2001 @@ -1,3 +1,43 @@ +2001-01-16 Jani Taskinen <[EMAIL PROTECTED]> + +* ext/gd/gd.c: Fixed bug #8733 + +2001-01-16 Rasmus Lerdorf <[EMAIL PROTECTED]> + +* ext/sockets/sockets.c: Kill some warnings + +2001-01-16 Mika Tuupola <[EMAIL PROTECTED]> + +* pear/Image/Remote.php: +Fixed the vim rules. + +2001-01-16 Sterling Hughes <[EMAIL PROTECTED]> + +* ext/sablot/php_sablot.h + ext/sablot/sablot.c: +Added the SABLOT_SET_ERROR() macro to set sablotron errors... + +2001-01-16 Ben Mansell <[EMAIL PROTECTED]> + +* sapi/isapi/php4isapi.c + README.Zeus:Added changes to environment variable manipulations, to support Zeus 3.3.8 +and increase compatibility between Zeus/IIS/Apache. Now, URLs like +http://foo.org/file.php/a/b/c/d work correctly. + +2001-01-16 Sascha Schumann <[EMAIL PROTECTED]> + +* ext/ircg/ircg.c: +Use the write buffer subsystem to accumulate network writes and to +increase the overall through-put. + +2001-01-16 Sean Grimes <[EMAIL PROTECTED]> + +* pear/XML/Render.php: +Added a method to call the HTML and PDF rendering modes(not implemented yet). +Added the parse function which should allow for finer XML parsing. +The XML file contents are now stored in a var available to the entire class. +Added a wrapper around setInputFile() and setInput() + 2001-01-15 Zeev Suraski <[EMAIL PROTECTED]> * sapi/isapi/stresstest/stresstest.dsp: Fix output dir -- PHP CVS 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]
[PHP] Cache Database-driven site
Hi all, i'm appreciating any comments on this idea: I'm about to create a completely database driven site (mySQL). Almost all of the output is generated from database data. A big part of the data is rather static of nature, eg. updated once a month. A smaller part is quite dynamic, e.g. content is added daily. Now the problem: My webhoster's database server (not the webserver!) is nearly breaking down in high-traffic-times. While static sites are performing fine, my site is almost down :-(( Here my idea: I thought of creating a cache-mechanism where each php-page checks for the existence of a static html-cache-page that holds its contents. When the page is there it is read and echoed out to the browser. If it isn't there, it shall be created automatically. To create the HTML-cache page i need to build the whole HTML-page content in memory, instead of echoing it back to the user's browser, and finally write it to disk. That means, i have to write all HTML in php-code. I can't just embed php-parts in html tags. I'm not sure, whether this is the right way to go, as i can see some major drawbacks of this approach, although my general php-architecture is template oriented, which would make the approach practical. I would really appreciate some comments on this. Thanks in advance, Joe -- PHP General 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]
[PHP] How to unsubscribe
How to unsubscribe? In typical lists, there is a small info how to unsubscribe. In the php-general list, this is not the case. Several effords failed. Who can unsubscribe "manually"? Best regards, Joachim [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General 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]
[PHP] imap_open
I tried to make the simple program Mailboxes\n"; $folders = imap_listmailbox($mbox, "{imap.liu.se:993}", "*"); if ($folders == false) { echo "Call failed\n"; } else { foreach ($folders as $val) { echo $val . "\n"; } } echo "Headers in INBOX\n"; $headers = imap_headers($mbox); if ($headers == false) { echo "Call failed\n"; } else { foreach ($headers as $val) { echo $val . "\n"; } } imap_close($mbox); ?> given at http://se2.php.net/manual/sv/function.imap-open.php, but imap_open is not found. I'm running PHP 4.3.10. What is wrong? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imap_open
What could be the cause of the error Warning: imap_open(): Couldn't open stream ? I have got the address and the port to the imap server right, but I think that the imap server requires some sort of secure login. Could this be the problem? If yes, how can it be solved? If no, what other causes could it be? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Warning: imap_open(): Couldn't open stream
What could be the cause of the error Warning: imap_open(): Couldn't open stream ? I have got the address and the port to the imap server right, but I think that the imap server requires some sort of secure login. Could this be the problem? If yes, how can it be solved? If no, what other causes could it be? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imap_open
"John Nichel" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > Joachim Person wrote: >> I tried to make the simple program >> >> > $mbox = imap_open("{imap.liu.se:993}", "joape382", "fil"); >> >> echo "Mailboxes\n"; >> $folders = imap_listmailbox($mbox, "{imap.liu.se:993}", "*"); >> >> if ($folders == false) { >>echo "Call failed\n"; >> } else { >>foreach ($folders as $val) { >>echo $val . "\n"; >>} >> } >> >> echo "Headers in INBOX\n"; >> $headers = imap_headers($mbox); >> >> if ($headers == false) { >>echo "Call failed\n"; >> } else { >>foreach ($headers as $val) { >>echo $val . "\n"; >>} >> } >> >> imap_close($mbox); >> ?> >> >> given at http://se2.php.net/manual/sv/function.imap-open.php, but >> imap_open is not found. I'm running PHP 4.3.10. What is wrong? > > Is IMAP support built into your install of PHP? It's not on by default. > > -- > John C. Nichel > ÜberGeek > KegWorks.com > 716.856.9675 > [EMAIL PROTECTED] Thank you for your answer, Yes, I have enabled it. (I guess you got a few e-mails... sorry about that) Regards, Joachim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imap_open
Thanks Viraj, Telneting gives an error like this (translated from Swedish language): Connecting to imap.liu.se...Couldn't connect to the host computer, using port 143: The connection failed. I guess I'm not getting any answer then. Regards, Joachim "viraj" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] did you tried telneting to host's 143 port? if you are getting a response from the IMAP server you better go through the php-imap requirements, it's here.. http://www.php.net/imap > ? I have got the address and the port to the imap server right, but I > think > that the imap server requires some sort of secure login. Could this be the it depends, http://www.php.net/manual/en/function.imap-open.php ~viraj. > problem? If yes, how can it be solved? If no, what other causes could it > be? > > -- > 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
Re: [PHP] imap_open
Just want to say that telnet imap.liu.se 993 works just fine (the port for secure communication). But then the command prompt starts to look strange. I cannot see when I'm typing (perhaps it has to do with the secure communication link?!). Where do I go from here? It still doesn't work with the php script. Regards, Joachim "viraj" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] did you tried telneting to host's 143 port? if you are getting a response from the IMAP server you better go through the php-imap requirements, it's here.. http://www.php.net/imap > ? I have got the address and the port to the imap server right, but I > think > that the imap server requires some sort of secure login. Could this be the it depends, http://www.php.net/manual/en/function.imap-open.php ~viraj. > problem? If yes, how can it be solved? If no, what other causes could it > be? > > -- > 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
Re: [PHP] imap_open
Further, when changing the imap_open line in the script to $mbox = imap_open("{imap.liu.se:993/imap/ssl}", "joape382", "fiol"); (I added the /imap/ssl part) I immediately got the following response: Warning: imap_open(): Couldn't open stream {imap.liu.se:993/imap/ssl} in c:\inetpub\wwwroot\TestGetMail.php on line 2 Mailboxes Warning: imap_listmailbox(): supplied argument is not a valid imap resource in c:\inetpub\wwwroot\TestGetMail.php on line 5 Call failed Headers in INBOX Warning: imap_headers(): supplied argument is not a valid imap resource in c:\inetpub\wwwroot\TestGetMail.php on line 16 Call failed Warning: imap_close(): supplied argument is not a valid imap resource in c:\inetpub\wwwroot\TestGetMail.php on line 26 Notice: (null)(): Can't open mailbox {imap.liu.se:993/imap/ssl}: invalid remote specification (errflg=2) in Unknown on line 0 When not having the /imap/ssl part I only get Warning: imap_open(): Couldn't open stream {imap.liu.se:993} in c:\inetpub\wwwroot\TestGetMail.php on line 2 Fatal error: Maximum execution time of 30 seconds exceeded in c:\inetpub\wwwroot\TestGetMail.php on line 2 Notice: (null)(): [CLOSED] IMAP connection broken (server response) (errflg=2) in Unknown on line 0 as a response after 30 seconds. Does this mean I have to include a certifcate of some kind in some way? If I need, how to do it? Regards, Joachim "viraj" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] did you tried telneting to host's 143 port? if you are getting a response from the IMAP server you better go through the php-imap requirements, it's here.. http://www.php.net/imap > ? I have got the address and the port to the imap server right, but I > think > that the imap server requires some sort of secure login. Could this be the it depends, http://www.php.net/manual/en/function.imap-open.php ~viraj. > problem? If yes, how can it be solved? If no, what other causes could it > be? > > -- > 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] imap + secure connection problems
I tried to make the simple program Mailboxes\n"; $folders = imap_listmailbox($mbox, "{imap.liu.se:993}", "*"); if ($folders == false) { echo "Call failed\n"; } else { foreach ($folders as $val) { echo $val . "\n"; } } echo "Headers in INBOX\n"; $headers = imap_headers($mbox); if ($headers == false) { echo "Call failed\n"; } else { foreach ($headers as $val) { echo $val . "\n"; } } imap_close($mbox); ?> given at http://se2.php.net/manual/sv/function.imap-open.php. I'm running PHP 4.3.10 and have enabled imap. But I can't connect to the server (even though it works using, for instance Outlook). When changing the imap_open line in the script to $mbox = imap_open("{imap.liu.se:993/imap/ssl}", "gurka222", "nada"); (I added the /imap/ssl part) I immediately got the following response: Warning: imap_open(): Couldn't open stream {imap.liu.se:993/imap/ssl} in c:\inetpub\wwwroot\TestGetMail.php on line 2 Mailboxes Warning: imap_listmailbox(): supplied argument is not a valid imap resource in c:\inetpub\wwwroot\TestGetMail.php on line 5 Call failed Headers in INBOX Warning: imap_headers(): supplied argument is not a valid imap resource in c:\inetpub\wwwroot\TestGetMail.php on line 16 Call failed Warning: imap_close(): supplied argument is not a valid imap resource in c:\inetpub\wwwroot\TestGetMail.php on line 26 Notice: (null)(): Can't open mailbox {imap.liu.se:993/imap/ssl}: invalid remote specification (errflg=2) in Unknown on line 0 When not having the /imap/ssl part I only get Warning: imap_open(): Couldn't open stream {imap.liu.se:993} in c:\inetpub\wwwroot\TestGetMail.php on line 2 Fatal error: Maximum execution time of 30 seconds exceeded in c:\inetpub\wwwroot\TestGetMail.php on line 2 Notice: (null)(): [CLOSED] IMAP connection broken (server response) (errflg=2) in Unknown on line 0 as a response after 30 seconds. Does this mean I have to include a certifcate of some kind in some way? If I need, how to do it? What could be wrong? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php