php-general Digest 5 Jan 2004 05:10:48 -0000 Issue 2512 Topics (messages 173707 through 173726):
cache_limiter & cache_expire 173707 by: Eli Hen 173708 by: Eli Hen 173716 by: Marek Kilimajer Re: finding phpize 173709 by: Brian V Bonini PHP, Server-Side? 173710 by: Tarrant Costelloe 173711 by: Larry Brown 173712 by: Tarrant Costelloe Re: upload file size 173713 by: niclas meyer Include performance questions 173714 by: Carey Baird 173719 by: Carey Baird 173725 by: Justin French php files not looking right 173715 by: John 173717 by: Marek Kilimajer 173718 by: John Nichel Re: Piping email 173720 by: David T-G Data Format Errors using MAIL() 173721 by: Monty PHP Accelerator Support? 173722 by: mastershay 173723 by: Larry Brown Readfile, DAP and 3 questions 173724 by: Ryan A Re: Security access control by ASP in a php application 173726 by: YC Nyon 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] ----------------------------------------------------------------------
--- Begin Message ---Hello All, I would like to do that the session will expire after X minutes, and the page at the client will expire after Y minutes. How can I do that? I understand that session_cache_limiter() function determines who can cache the page: - pulic: proxies and clients. - private: clients. - nocache: no-one. But session_cache_expire() function sets expire on what? the session timeout or the page cache timeout? -thanks, Eli
--- End Message ---
--- Begin Message ---Hello All, I would like to do that the session will expire after X minutes, and the page at the client will expire after Y minutes. How can I do that? I understand that session_cache_limiter() function determines who can cache the page: - pulic: proxies and clients. - private: clients. - nocache: no-one. But session_cache_expire() function sets expire on what? the session timeout or the page cache timeout? -thanks, Eli
--- End Message ---
--- Begin Message --- Eli Hen wrote:Hello All,
I would like to do that the session will expire after X minutes, and the page at the client will expire after Y minutes. How can I do that?
I understand that session_cache_limiter() function determines who can cache the page: - pulic: proxies and clients. - private: clients. - nocache: no-one. But session_cache_expire() function sets expire on what? the session timeout or the page cache timeout?
session_cache_expire() function sets expire on the client side. Session lifetime on the server is set by session.gc_maxlifetime setting, you can use ini_set() to change it. But you have to use your own directory to store session files, use ini_set('session.save_path', '/your/session/dir');
--- End Message ---
--- Begin Message ---On Sat, 2004-01-03 at 21:59, Ryan A wrote: > Hi guys, > I am trying to install Turck MMCache on our server but have no idea about > linux...I have gone through all the steps a fellow list user (R'twick) gave > me to install this, up till > > $PHP_PREFIX/bin/phpize > > when I type that it says: no file or directory by that name > > so after searching on the web for the correct command I did this: > find / -name phpize -print > > and even that came up blank.... Try one of these: $ find / -name "php*" $ which phpize As root: $ updatedb;locate phpize -- Brian GnuPG -> KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys Key Server: pgp.mit.edu ====================================================================== gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC GnuPG: http://gnupg.org http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC Linux Registered User #339825 at http://counter.li.orgsignature.asc
Description: This is a digitally signed message part
--- End Message ---
--- Begin Message ---php-general, I was wondering if it is possible with PHP to create a snippet of code which could execute on one server but be stored of a different server? Basic premise is to sell a product written in PHP which people could include on their site but not be able to edit or see the code, maybe by using some kind of include(), url() or snippet method? In Fellowship, Tarrant
--- End Message ---
--- Begin Message ---You can create a soap server. I have one set up, the client side runs a function which is translated into xml sent to the other server (in my case over ssl) the other server translates to php, executes the function and returns the results. You create the actual code for the function on the server and give the client details on what the function does and what data it requires. If you build both it is very easy. The client has no other options but to run the function name while supplying the data. ex. server... function pullLatestReport($login,$password,$howfarback) { check db for authentication... if auth correct to run this function run do queries nec. for request return result. else return error } As you can see the server has total control over what gets executed, soap is designed to be platform independant. .net, java etc. can be used as the client. Of course that is only a added benefit since you are making both ends. I use nusoap which is all php and isn't too hard to figure out. Larry. -----Original Message----- From: Tarrant Costelloe [mailto:[EMAIL PROTECTED] Sent: Sunday, January 04, 2004 11:31 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP, Server-Side? php-general, I was wondering if it is possible with PHP to create a snippet of code which could execute on one server but be stored of a different server? Basic premise is to sell a product written in PHP which people could include on their site but not be able to edit or see the code, maybe by using some kind of include(), url() or snippet method? In Fellowship, Tarrant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---Brilliant, just what I was looking for! Thank You Larry. In Fellowship, Tarrant -----Original Message----- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: 04 January 2004 16:58 To: Tarrant Costelloe; PHP List Subject: RE: [PHP] PHP, Server-Side? You can create a soap server. I have one set up, the client side runs a function which is translated into xml sent to the other server (in my case over ssl) the other server translates to php, executes the function and returns the results. You create the actual code for the function on the server and give the client details on what the function does and what data it requires. If you build both it is very easy. The client has no other options but to run the function name while supplying the data. ex. server... function pullLatestReport($login,$password,$howfarback) { check db for authentication... if auth correct to run this function run do queries nec. for request return result. else return error } As you can see the server has total control over what gets executed, soap is designed to be platform independant. .net, java etc. can be used as the client. Of course that is only a added benefit since you are making both ends. I use nusoap which is all php and isn't too hard to figure out. Larry. -----Original Message----- From: Tarrant Costelloe [mailto:[EMAIL PROTECTED] Sent: Sunday, January 04, 2004 11:31 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP, Server-Side? php-general, I was wondering if it is possible with PHP to create a snippet of code which could execute on one server but be stored of a different server? Basic premise is to sell a product written in PHP which people could include on their site but not be able to edit or see the code, maybe by using some kind of include(), url() or snippet method? In Fellowship, Tarrant -- 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
--- End Message ---
--- Begin Message ---wich kind of files are we talking about? pictures or others? "Gerard Samuel" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > On Friday 14 November 2003 12:48 pm, joe wrote: > > is there a way to check the file size > > without fully uploading the file? > > > > No there isnt, well at least not via php...
--- End Message ---
--- Begin Message ---Hey, I am creating a complete PHP driven site for the first time and I am finding my files growing bigger and bigger. Each page of my site includes the main function library, which itself includes an html library. The file for the page itself contains functions that only that page requires. My question is if it is better, performance wise, to split all the functions into separate files (e.g. login_funcs.php, output_funcs.php) or if it is better to keep all functions in one file. Would there be any performance issues with including a file, which includes a file, which includes a file etc.? Would there be any performance issues with including large files? Also, I am struggling to structure my code well. I would be grateful if anyone could point me in the direction of good resources for creating php projects or creating web projects in general. Many thanks Carey --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 30/12/2003
--- End Message ---
--- Begin Message ---(sorry if this message is repeated, I got an email saying it wasn't delivered) Hey, I am creating a complete PHP driven site for the first time and I am finding my files growing bigger and bigger. Each page of my site includes the main function library, which itself includes an html library. The file for the page itself contains functions that only that page requires. My question is if it is better, performance wise, to split all the functions into separate files (e.g. login_funcs.php, output_funcs.php) or if it is better to keep all functions in one file. Would there be any performance issues with including a file, which includes a file, which includes a file etc.? Would there be any performance issues with including large files? Also, I am struggling to structure my code well. I would be grateful if anyone could point me in the direction of good resources for creating php projects or creating web projects in general. Many thanks Carey --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 30/12/2003
--- End Message ---
--- Begin Message --- On Monday, January 5, 2004, at 07:05 AM, Carey Baird wrote:
(sorry if this message is repeated, I got an email saying it wasn't delivered)
Hey,
I am creating a complete PHP driven site for the first time and I am finding
my files growing bigger and bigger. Each page of my site includes the main
function library, which itself includes an html library.
The file for the page itself contains functions that only that page requires.
My question is if it is better, performance wise, to split all the functions
into separate files (e.g. login_funcs.php, output_funcs.php) or if it is
better to keep all functions in one file.
Would there be any performance issues with including a file, which includes
a file, which includes a file etc.? Would there be any performance issues
with including large files?
Also, I am struggling to structure my code well. I would be grateful if
anyone could point me in the direction of good resources for creating php
projects or creating web projects in general.
I've settled on a system which works well for me. Over time, you'll find one for you.
Every 'page' has this basic structure:
--- <?include('inc/header.inc');?> [pre-html output code goes here] <?include('inc/header.html.inc');?> <div id='content'> [unique page content goes here] </div> <?include('inc/footer.html.inc');?> ---
header.inc in turn includes my function libraries, config files, and anything site-specific in terms of arrays or functions.
any calculations and code (eg form validation, header() redirects, cookies, etc) that needs to be done before the HTML is output is done, then header.html.inc starts the HTML with a DOCTYPE, <head>, and everything else on the page down to the main content div (the start of unique content).
after the unique content, footer.html.inc includes any other html, closes off the body and html tags, runs any post-HTML functions, etc.
in other words, each script will only have two unique areas of code or HTML... everything else is in include files, which means I can make all global changes in just a few places. this is the best separation of global and local code I have found so far (that suits me).
as such, there's possibly 8-15 include() calls for each page request... i haven't noticed any performance hit, but you could easily run a test with a bunch of nested includes of simple code, versus a flat file with all the relevant code.
personally, I'd prefer human productivity (logical separation of functions and includes) over saving a few ms of processor time on all but the most heavily busy sites.
justin french
--- End Message ---
--- Begin Message ---hi, i must have downloaded my php files in binary format or something, but now, instead of readable carriage returns after each line of code, theres a 'box' and then no carriage return. so the whole file is on one line. then other files have an extra carriage return between lines. could i remove these with php and regular expressions?? if so, what should i be searching for, for the 'boxes' if not, can word or wordpad, or anything else do it. i could go through every file and delete the box and add a carriage return, but that would take ages
--- End Message ---
--- Begin Message --- 1. Use an editor that can work with unix newlines, most developer editors can.
2. Use some tool that can convert between various newlines - search the web. Command line utility todos/fromdos is one, but it might be available only on unices.
John wrote:hi,
i must have downloaded my php files in binary format or something, but now, instead of readable carriage returns after each line of code, theres a 'box' and then no carriage return. so the whole file is on one line. then other files have an extra carriage return between lines. could i remove these with php and regular expressions?? if so, what should i be searching for, for the 'boxes'
if not, can word or wordpad, or anything else do it. i could go through every file and delete the box and add a carriage return, but that would take ages
--- End Message ---
--- Begin Message --- John wrote:
hi,
i must have downloaded my php files in binary format or something, but now, instead of readable carriage returns after each line of code, theres a 'box' and then no carriage return. so the whole file is on one line. then other files have an extra carriage return between lines. could i remove these with php and regular expressions?? if so, what should i be searching for, for the 'boxes'
if not, can word or wordpad, or anything else do it. i could go through every file and delete the box and add a carriage return, but that would take ages
Download something like UltraEdit. It can work with (and convert between) file formats from Mac, *nix, and Windoze.
-- By-Tor.com It's all about the Rush http://www.by-tor.com
--- End Message ---
--- Begin Message ---Adrian -- You have started a new thread by taking an existing message and replying to it while merely changing the Subject: line. That is bad, because it breaks threading. Whenever you reply to a message, your mail client generates a "References:" header that tells all recipients to which posting(s) your posting refers. A mail client uses this information to build a "thread tree" of the postings so that it is easy to see just how they relate to each other. With your posting style you successfully torpedoed this useful feature; your posting shows up within an existing thread even though it is completely unrelated. Always do a fresh post when you want to start a new thread. That means that you do not select any sort of "Reply" when you start your message. You can save the list address in your address book (or equivalent) for convenience. ...and then Adrian Teasdale said... % % Is it possible to pipe email directly to PHP like it's possible to do Yes. % with perl? I need to do this using Exim which I'm also unfamiliar with % so if anyone has done this I'd appreciate knowing how! :) It's the same thing as for piping email to anything. I don't know exim from anything else, but I'd use the .forward file no matter what MTA is installed. % % Thanks % % Ade HTH & HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!pgp00000.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---While I found a lot of posts about this problem, I haven't been able to find a solution. So if I missed it, please forgive me, I did spend a few hours trying to find the answer. THE PROBLEM: When a user signs up on a website, an e-mail is automatically sent to them with their password. This worked fine until we upgraded our server to RedHat Linux ES 3.0 using Apache 2.0.46, PHP 4.3.2, MySQL 3.23.58, and Sendmail 8.12.10. Now what happens is that the e-mail is never sent and the following appears in our system logs for each message attempted: ----------- sendmail[4920]: i050MrEq004920: from=apache, size=141, class=0, nrcpts=1, msgid=<[EMAIL PROTECTED]>, [EMAIL PROTECTED] sendmail[4920]: i050MrEq004920: [EMAIL PROTECTED], ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30141, relay=[127.0.0.1] [127.0.0.1], dsn=5.6.0, stat=Data format error sendmail[4920]: i050MrEq004920: i050MrEr004920: DSN: Data format error sendmail[4922]: i050Mr1J004922: <[EMAIL PROTECTED]>... >apache<@myserver.com. sendmail[4920]: i050MrEr004920: to=apache, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31165, relay=[127.0.0.1], dsn=5.3.0, stat=User unknown sendmail[4922]: i050Mr1J004922: from=<>, size=1165, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1] sendmail[4920]: i050MrEr004920: i050MrEs004920: return to sender: User unknown sendmail[4922]: i050Mr1L004922: <[EMAIL PROTECTED]>... >postmaster<@myserver.com. sendmail[4920]: i050MrEs004920: to=postmaster, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=32189, relay=[127.0.0.1] [127.0.0.1], dsn=5.3.0, stat=User unknown sendmail[4922]: i050Mr1L004922: from=<>, size=2189, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1] sendmail[4920]: i050MrEr004920: Losing ./qfi050MrEr004920: savemail panic sendmail[4920]: i050MrEr004920: SYSERR(apache): savemail: cannot save rejected email anywhere ----------- I have NO idea or clue where to start looking or what is causing the problem. If anyone else has had this problem and fixed it, I'd really appreciate hearing from you! Thanks - Monty
--- End Message ---
--- Begin Message --- Hello, I have spent hours searching the web for any kind of support regarding Ioncube's PHP Accelerator. We are interested in using it in conjuction with some Cyrus servers and Squirrel Mail, but cannot seem to find any kind of support whatsoever. The number of users is planned to be in the thousands, so any kind of help would be much appreciated.
Thanks.
--- End Message ---
--- Begin Message ---I use the accelerator, but I don't have a lot of users. I use it to protect confidential information in the event the web server screws up and starts displaying my scripts instead of parsing them etc. It works smooth as silk for me though. I just can't tell you anything about high volume performance. Larry -----Original Message----- From: mastershay [mailto:[EMAIL PROTECTED] Sent: Sunday, January 04, 2004 7:05 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP Accelerator Support? Hello, I have spent hours searching the web for any kind of support regarding Ioncube's PHP Accelerator. We are interested in using it in conjuction with some Cyrus servers and Squirrel Mail, but cannot seem to find any kind of support whatsoever. The number of users is planned to be in the thousands, so any kind of help would be much appreciated. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---Hi, I have just started using PHP's file operators...and as you can guess need a little help I am using the example from the online manual: http://de3.php.net/manual/en/function.readfile.php to read a file that is in a .htaccess protected folder and pop a download box to the client. Surprisingly, after screwing around with the example code for 2 mins I got it working on IE and NN. Opera have always had one problem...instead of outputting somefile.zip it saves it as myPHPfileName.php and this is what it passes on to Download Accelerator Plus (DAP) 1. I am sure I am not the only one who noticed this...so...how did you tackle it? 2. Which is better for large files (5-8mb), readfile or fpassthru or.....etc ? 3. and last question is, in this line: header( "Content-Description: File Transfert"); why do you have the "t" at the end of "Tranfer" ??? Thanks in advance. (Below is the code that I am using.) Cheers, -Ryan P.S, I know there are security issues when using readfile and fpassthru and will take some precautions later but for this example I left it open. * * * * Code * * * * <?php $the_filename="KeyMaker203.zip"; $filename=$the_filename; // the name the file will have on client computer $file_to_download="/home/public_html/testing/KeyMaker203.zip"; $user_agent = strtolower ($_SERVER["HTTP_USER_AGENT"]); header( "Content-type: application/force-download" ); if ((is_integer (strpos($user_agent, "msie"))) && (is_integer (strpos($user_agent, "win")))) {header( "Content-Disposition: filename=".$filename); }else{header( "Content-Disposition: attachment; filename=".$filename); } header( "Content-Description: File Transfert"); @readfile($file_to_download); ?>
--- End Message ---
--- Begin Message ---I am working on a project where the main module (including the security access/login) is developed using ASP. My module which is in PHP has to read the security permissions set by ASP (via cookies) to enable users to use it. How do I go about that? or any other better solutions. Nyon
--- End Message ---