phplib-users Mailing List for PHPLIB (Page 81)
Brought to you by:
nhruby,
richardarcher
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(106) |
Sep
(99) |
Oct
(44) |
Nov
(97) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(56) |
Feb
(81) |
Mar
(134) |
Apr
(69) |
May
(106) |
Jun
(122) |
Jul
(98) |
Aug
(52) |
Sep
(184) |
Oct
(219) |
Nov
(102) |
Dec
(106) |
2003 |
Jan
(88) |
Feb
(37) |
Mar
(46) |
Apr
(51) |
May
(30) |
Jun
(17) |
Jul
(45) |
Aug
(19) |
Sep
(5) |
Oct
(4) |
Nov
(12) |
Dec
(7) |
2004 |
Jan
(11) |
Feb
(7) |
Mar
|
Apr
(15) |
May
(17) |
Jun
(13) |
Jul
(5) |
Aug
|
Sep
(8) |
Oct
(6) |
Nov
(21) |
Dec
(13) |
2005 |
Jan
(4) |
Feb
(3) |
Mar
(7) |
Apr
(7) |
May
|
Jun
(11) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2006 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
(5) |
2007 |
Jan
(15) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
(3) |
Jul
(1) |
Aug
(19) |
Sep
(2) |
Oct
|
Nov
|
Dec
(6) |
2009 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
From: Deborah H. <de...@po...> - 2001-11-27 21:02:16
|
> Anyone have experience with using phplib on FreeBSD? How would one go about > getting it installed -- is there any way to do it through ports? Addtl setup > docs? As far as I know, there isn't a phplib port and no plans to create one. However, I use phplib (both 7.2d and the current version from CVS) on FreeBSD 4.3 and 4.4 at the moment, and have for some time. Just put the php directory from the distribution somewhere where apache's php include path can find it. I have virtual hosts set up, so I have a virtual host entry that includes: php_value include_path /usr/local/www/artists/templates:/usr/local/www/artists/code:/usr/local/www/php/phpunit:/usr/local/www/php/phplib-devel php_value auto_prepend_file prepend.php3 That is, I search this virtual host's templates and code directories, the phpunit directory and then the phplib directory. This lets me make tweaks to the phplib files by copying them into the virtual host's code dir and thus leave my distribution sharable and unchanged. Usually I end up with at least a copy of prepend.php3 and local.inc in the code directory. Hope that helps. -Deb -- Deborah Hooker, Principal Mnemosyne Consulting * 10676 W. Tufts Pl., Littleton, CO 80127 (720) 922-1673 * de...@mn... http://www.mnemosyne-consulting.com |
From: Layne W. <la...@of...> - 2001-11-27 19:57:02
|
> Anyone have experience with using phplib on FreeBSD? How > would one go about > getting it installed -- is there any way to do it through > ports? Addtl setup > docs? It's pure PHP - you can use PHPLib as is on Free-, Open-, Net-, i-BSD, Linux, Windows, MacOS X, etc. as is. Set the location in your include path or, if you're stubborn like me, include the library by specifying the full path to each file. Layne Weathers Ifworld Inc. |
From: Yanek K. <ya...@no...> - 2001-11-27 19:43:52
|
Anyone have experience with using phplib on FreeBSD? How would one go about getting it installed -- is there any way to do it through ports? Addtl setup docs? -Yanek. |
From: Lazaro F. <la...@mo...> - 2001-11-27 11:58:35
|
Hi I'm agree with Brian, I have been working with PHP for almost two years now, and actually I was not a new programmer (more than 10 years programming from C to VB), when I started PHP WEB Programming. Based on the experience very soon I realized that mixing PHP with HTML would be a nightmare to maintain, on the other hand we are a team, graphical designer (DW,Flash,etc), core programmer (PHP,SQL,JS,etc), and what we called a site assembler, who put together PHP core classes and functions, and HTML (templates and libs), to build PHP dinamic pages Every page we build is made of two main files .PHP, and .iHTML files, in turn every .PHP main file may include a lot of .INC files ( PHP files with classes and functions definitions ), so the same thing for the iHTML file that may be fill in with a lot of LBI files (HTML blocks) A page is built parsing templates and sub-templates ( HTML blocks ), the last ones are parsed alone and then parsed in as variables within main templates, this layout set the designer 100% percent free from PHP code , and the opposite to, the programmer even know how the DB results or external files information is rendered out i.e: Results from a DB search, are displayed using several blocks or HTML libs, parsed within an iHTML file that shows the page as a whole (header blocks,footers blocks, DB results blocks,etc) Two months ago a client asked us to change the whole look and feel of its new packed site, the task proves to be easy thanks to the site architecture, non PHP page was changed at all, only the iHTML and LBI files (with the HTML) were changed by the designer, better than that, the HTML files are 100% based on CSS files, so the style is separated from the HTML layout, changing the CSS definitions (only one file) the whole site (around 100 HTML files) had a new look and feel (colors,fonts,style,etc). Finally the Sites are almost 100% multi-lingual sites, so using templates also make easier to maintain the same HTML layout to be shown in any language Although developing sites this way involves a lot of extra work in the beginning and after, for us it was a matter of compromise between 'faster to develop' VS 'harder to maintain', as we get more and more client sites to maintain the maintenance time should be keep at a minimum. Lazaro ----- Original Message ----- From: Brian Popp <bp...@ct...> To: 'Menzi, Hans' <HM...@ec...> Cc: Phplib (E-mail) <Php...@li...> Sent: Monday, November 26, 2001 7:04 PM Subject: RE: [Phplib-users] Template: How to handle conditional html? > >>"I am just learning PHP and I would like to know what reasons you have > >>for that statement." > > There's been a lot of discussion about it here on this forum, but my primary > reason for saying that is just personal experience. I built a system when I > first started using PHP. It was fairly complicated(100+ pages) and to be > honest it has worked very well. In that system, almost all the PHP is being > generated dynamically in the PHP. Unfortunately, this system has been a > beast to maintain. When I need to make a very simple cosmetic change, I have > to dig through pages and pages of complicated PHP code. Likewise, when I > need to make a change, even a simple change, to my code, the PHP is > needlessly cluttered with lines and lines of echo/print statements. > > My new way, which works infinitely better, is to use templates almost > exclusively. I create two files for every page, one called xxxx.php and one > called xxxx.html. xxxx.php does all the thinking and xxxx.html just sits > there looking pretty. > > xxxx.php will normally look something like: > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > include "../globals.php"; > > my_page_open(); > include ABSOLUTE_ROOT . "header.php"; > > $t = new Template; > $t->set_file ( "main", "xxxx.html" ); > > $t->set_var ( "CURRENT_DATE", date ( 'm.d.y h:i:s' ) ); > ... > > $t->parse ( "out", "main" ); // (writes the xxxx.html file to the browser) > > include ABSOLUTE_ROOT . "footer.php"; > my_page_close(); > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > So if I decide I want to change the date format, it's fairly easy to find it > in the xxxx.php file. Or if I decide I want to make the date fluorescent > pink, I can just pull up the xxxx.html file in Dreamweaver and modify the > formatting on the {CURRENT_DATE} tag. This is admittedly a very simple > example; the real power of templates comes when you start working with > database data, etc. Give templates a try. Once you get comfortable with the > limitations (namely dynamic HTML), I think you'll love how much more > maintainable your code becomes. > > -----Original Message----- > From: Menzi, Hans [mailto:HM...@ec...] > Sent: Monday, November 26, 2001 10:24 AM > To: Brian Popp > Subject: RE: [Phplib-users] Template: How to handle conditional html? > > > "It's normally not a good idea to put HTML in your PHP" > > I am just learning PHP and I would like to know what reasons you have > for that statement. > > -Thanks > Hans Menzi > > > -----Original Message----- > From: Brian Popp [mailto:bp...@ct...] > Sent: Monday, November 26, 2001 11:03 AM > To: 'Peter Holm'; Phplib (E-mail) > Subject: RE: [Phplib-users] Template: How to handle conditional html? > > > True. It's normally not a good idea to put HTML in your PHP, but I think > there's a time and a place. With a very dymamic menu, for example, I'll > usually put a single tag {menu}, and then build the HTML like so: > > function addMenuItem ( $label, $link, $active=false ) > { > $html = "<td>"; > $html .= ($active ? "<B>" : "" ); > $html .= $label; > $html .= ($active ? "</B>" : "" ); > $html .= "</td>"; > > return $html; > } > > $html = addMenuItem ( "Home", "home/", $currentAction=="home" ); $html > .= addMenuItem ( "Links", "links/", $currentAction=="links" ); $html .= > addMenuItem ( "News", "news/", $currentAction=="news" ); > > $t->set_var ( "menu", $html ); > > (I find that if you use functions, the PHP stays very maintainable and > readable. ) > > > -----Original Message----- > From: Peter Holm [mailto:PH...@gm...] > Sent: Saturday, November 24, 2001 10:37 AM > To: Php...@li... > Subject: [Phplib-users] Template: How to handle conditional html? > > > Hi, > > maybe some of you came across this problem also: > > there are somtimes elements of a site, that should be shown only under > certain circumstances, e.g. you have a browsing page with "previous" and > "next" buttons but you don´t wnat the 'previous" button to be shown if > there is nothing before the actual shown item, vice versa you want to > hide the "next"-button, if there is nothing next to show. Maybe you have > different pictures for this situation and maybe, to make it even more > complicated, someone wants you to have a rollover only on the "active" > next/previuos buttons. > > OK, this would be easy usually with some if-statements in the code, but > when using templates, this breaks the sense of them somehow. If you use > something like {NEXT} in your template-file which contains the whole > html for that link ('a href' and img), there is nothing to see in the > template anymore (if someone is generating it with an graphic al tool). > > Otherwise it is not good to use some php-code in the template-file, so I > tend to the first solution, what makes some more work... > > Does anybody have any other ideas about that? > > Thanks for your attention, > Peter > > > Have a nice thread, > Peter > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > > > |
From: Frank B. <fb...@sy...> - 2001-11-26 21:03:07
|
Background: I recently wrote a script to convert my family research database to postgresql; and then wrote a php page to dynamically present this data instead of use the supplied tools which generate static html pages. Since the database contains private information about individuals, I have used phplib sess/auth to control access to the dynamically generated pages. The conversion process will be run run at seemingly random times (sometimes days, weeks or months apart) as my time and interest in this hobby varies. Questions: My database is only updated whenever I perform the conversion routine, so I was thinking it would be nice to allow user to cache pages between conversion runs. I can place the last-changed information somewhere each time the conversion script is run. Once I do that, can I control expiration of php page so that user can cache pages until next conversion process is run? Does anyone have some input as to how well this type of code might actually work in real-life situations? Frank |
From: Brian P. <bp...@ct...> - 2001-11-26 17:03:46
|
>>"I am just learning PHP and I would like to know what reasons you have >>for that statement." There's been a lot of discussion about it here on this forum, but my primary reason for saying that is just personal experience. I built a system when I first started using PHP. It was fairly complicated(100+ pages) and to be honest it has worked very well. In that system, almost all the PHP is being generated dynamically in the PHP. Unfortunately, this system has been a beast to maintain. When I need to make a very simple cosmetic change, I have to dig through pages and pages of complicated PHP code. Likewise, when I need to make a change, even a simple change, to my code, the PHP is needlessly cluttered with lines and lines of echo/print statements. My new way, which works infinitely better, is to use templates almost exclusively. I create two files for every page, one called xxxx.php and one called xxxx.html. xxxx.php does all the thinking and xxxx.html just sits there looking pretty. xxxx.php will normally look something like: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= include "../globals.php"; my_page_open(); include ABSOLUTE_ROOT . "header.php"; $t = new Template; $t->set_file ( "main", "xxxx.html" ); $t->set_var ( "CURRENT_DATE", date ( 'm.d.y h:i:s' ) ); ... $t->parse ( "out", "main" ); // (writes the xxxx.html file to the browser) include ABSOLUTE_ROOT . "footer.php"; my_page_close(); -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= So if I decide I want to change the date format, it's fairly easy to find it in the xxxx.php file. Or if I decide I want to make the date fluorescent pink, I can just pull up the xxxx.html file in Dreamweaver and modify the formatting on the {CURRENT_DATE} tag. This is admittedly a very simple example; the real power of templates comes when you start working with database data, etc. Give templates a try. Once you get comfortable with the limitations (namely dynamic HTML), I think you'll love how much more maintainable your code becomes. -----Original Message----- From: Menzi, Hans [mailto:HM...@ec...] Sent: Monday, November 26, 2001 10:24 AM To: Brian Popp Subject: RE: [Phplib-users] Template: How to handle conditional html? "It's normally not a good idea to put HTML in your PHP" I am just learning PHP and I would like to know what reasons you have for that statement. -Thanks Hans Menzi -----Original Message----- From: Brian Popp [mailto:bp...@ct...] Sent: Monday, November 26, 2001 11:03 AM To: 'Peter Holm'; Phplib (E-mail) Subject: RE: [Phplib-users] Template: How to handle conditional html? True. It's normally not a good idea to put HTML in your PHP, but I think there's a time and a place. With a very dymamic menu, for example, I'll usually put a single tag {menu}, and then build the HTML like so: function addMenuItem ( $label, $link, $active=false ) { $html = "<td>"; $html .= ($active ? "<B>" : "" ); $html .= $label; $html .= ($active ? "</B>" : "" ); $html .= "</td>"; return $html; } $html = addMenuItem ( "Home", "home/", $currentAction=="home" ); $html .= addMenuItem ( "Links", "links/", $currentAction=="links" ); $html .= addMenuItem ( "News", "news/", $currentAction=="news" ); $t->set_var ( "menu", $html ); (I find that if you use functions, the PHP stays very maintainable and readable. ) -----Original Message----- From: Peter Holm [mailto:PH...@gm...] Sent: Saturday, November 24, 2001 10:37 AM To: Php...@li... Subject: [Phplib-users] Template: How to handle conditional html? Hi, maybe some of you came across this problem also: there are somtimes elements of a site, that should be shown only under certain circumstances, e.g. you have a browsing page with "previous" and "next" buttons but you don´t wnat the 'previous" button to be shown if there is nothing before the actual shown item, vice versa you want to hide the "next"-button, if there is nothing next to show. Maybe you have different pictures for this situation and maybe, to make it even more complicated, someone wants you to have a rollover only on the "active" next/previuos buttons. OK, this would be easy usually with some if-statements in the code, but when using templates, this breaks the sense of them somehow. If you use something like {NEXT} in your template-file which contains the whole html for that link ('a href' and img), there is nothing to see in the template anymore (if someone is generating it with an graphic al tool). Otherwise it is not good to use some php-code in the template-file, so I tend to the first solution, what makes some more work... Does anybody have any other ideas about that? Thanks for your attention, Peter Have a nice thread, Peter _______________________________________________ Phplib-users mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phplib-users _______________________________________________ Phplib-users mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Brian P. <bp...@ct...> - 2001-11-26 16:03:03
|
True. It's normally not a good idea to put HTML in your PHP, but I = think there's a time and a place. With a very dymamic menu, for example, I'll usually put a single tag {menu}, and then build the HTML like so:=20 function addMenuItem ( $label, $link, $active=3Dfalse ) { $html =3D "<td>"; $html .=3D ($active ? "<B>" : "" ); $html .=3D $label; $html .=3D ($active ? "</B>" : "" ); $html .=3D "</td>"; return $html; } $html =3D addMenuItem ( "Home", "home/", $currentAction=3D=3D"home" ); $html .=3D addMenuItem ( "Links", "links/", $currentAction=3D=3D"links" = ); $html .=3D addMenuItem ( "News", "news/", $currentAction=3D=3D"news" ); $t->set_var ( "menu", $html ); (I find that if you use functions, the PHP stays very maintainable and readable. ) -----Original Message----- From: Peter Holm [mailto:PH...@gm...] Sent: Saturday, November 24, 2001 10:37 AM To: Php...@li... Subject: [Phplib-users] Template: How to handle conditional html? Hi, maybe some of you came across this problem also:=20 there are somtimes elements of a site, that should be shown only under certain circumstances, e.g. you have a browsing page with "previous" = and "next" buttons but you don=B4t wnat the 'previous" button to be shown = if there is nothing before the actual shown item, vice versa you want to hide the "next"-button, if there is nothing next to show. Maybe you = have different pictures for this situation and maybe, to make it even more complicated, someone wants you to have a rollover only on the "active" next/previuos buttons. OK, this would be easy usually with some if-statements in the code, but when using templates, this breaks the sense of them somehow. If you use something like {NEXT} in your template-file which contains the whole html for that link ('a href' and img), there is nothing to see in the template anymore (if someone is generating it with an graphic al tool). Otherwise it is not good to use some php-code in the template-file, so = I tend to the first solution, what makes some more work... Does anybody have any other ideas about that? Thanks for your attention, Peter Have a nice thread, Peter _______________________________________________ Phplib-users mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Peter H. <PH...@gm...> - 2001-11-24 16:36:57
|
Hi, maybe some of you came across this problem also:=20 there are somtimes elements of a site, that should be shown only under certain circumstances, e.g. you have a browsing page with "previous" and "next" buttons but you don=B4t wnat the 'previous" button to be shown if there is nothing before the actual shown item, vice versa you want to hide the "next"-button, if there is nothing next to show. Maybe you have different pictures for this situation and maybe, to make it even more complicated, someone wants you to have a rollover only on the "active" next/previuos buttons. OK, this would be easy usually with some if-statements in the code, but when using templates, this breaks the sense of them somehow. If you use something like {NEXT} in your template-file which contains the whole html for that link ('a href' and img), there is nothing to see in the template anymore (if someone is generating it with an graphic al tool). Otherwise it is not good to use some php-code in the template-file, so I tend to the first solution, what makes some more work... Does anybody have any other ideas about that? Thanks for your attention, Peter Have a nice thread, Peter |
From: Stephen W. <wo...@me...> - 2001-11-21 17:57:08
|
Frank Bax wrote: > I am running several virtual hosts, each with their own database. > I determined that my 32 connections was the pgsql "max_connections". I believe this is WHY the pconnects can not be reused. They can only be reused if it is connecting to the same database, with the same user/passwd, and there might be another condition that escapes me. So .... if process A pconnects to DB1 for this hit, then process A pconnects to DB2 for the next hit it can't use the DB1 handle so it pconnects to DB2, but never frees DB1 handle and if on a a third hit it wants DB3 it now has three handles tied up and if it recycles back to DB1 it may or may not be able to reuses the handle so it can grab yet another DB1 handle, etc. Now multiply that by the number of httpd processes and you run out of handles/connections very quickly. -Steve |
From: Stephen W. <wo...@me...> - 2001-11-21 17:43:18
|
Frank, The situation you describe below is exactly the same one I ran into with mysql/php/apache. IIRC the pconnect never get released when using mod_php because the process never dies. I was able to use up all my connections as the only user just doing testing. It would slow open up more and more connections and never release them. There may be more on this in the archives, but I'm not sure it was a couple years ago. Also as it turns out, because the way things work, you almost never re-use the pconnects which is why you use up all your connection handles. If they were being reused this would not be a problem. I tried to get this changed as the default in phplib, but it didn't happen. I believe that if you use the cgi version of php instead of the mod_php version that this is not a problem because the handle is freed when the cgi process dies. I would change from pconnect to connect and see if your problem goes away. I am almost certain it will and I don;t think you will suffer from any performance hit because as I mentioned above your pconnects are not being reused. -Steve Frank Bax wrote: > > I've looked into these suggestions and I find I have more to better > understand about apache-php-pgsql interaction. > > I am running several virtual hosts, each with their own database. > I determined that my 32 connections was the pgsql "max_connections". > > But perhaps the 'real' problem is somewhere else. When I run 'ps -ax', I > find that there are up-to 10 entries for each database. In the past, I > have noticed that this number climbs even if I am the only person accessing > a database via a single web-browser instance. Why isn't the existing > connection re-used? It must reuse these when I reach 10, because I don't > go over that number of connections. Also, is there a way to restrict this > number by either database or virtual host basis? The MaxRequestsPerChild > option mentioned is currently set to 30, so it doesn't appear to be the > controlling option here? > > Perhaps I will also run some tests to gauge the impact of switching from > pconnect to connect. > > Also, I wouldn't mind if some of the virtual hosts (one database each) were > restricted to a very few number of connections. But for some other > hosts/databases I am more concerned about performance. > > Frank > > At 05:46 PM 11/21/01 +0100, Matthias Mohr wrote: > >hello, > > > >if you really need the performance you gain using pconnect instead of connect > >(especially when your database is running on another host, than you > webserver) > >another approach could be setting the apache-config-value for > >MaxRequestsPerChild. > > > >AFAIR it defaults to 0 which means unlimited requests per child. if so apache > >would *never* free you pgsql-handles. if you put it to a value greater 0 > every > >apache child-process dies after an finite number of requests and frees you > >psql-connections (sucking up a bit performance you gained using pconnect, > >since the webserver-child-process has to be restarted). > > > >also: if you keep using pconnect(), you maybe have to raise the number of > >max-backends of your pgsql-postmaster. keep in mind that you can get > >number-of-apache-childs times number-of-databases times > >number-of-database-logins as the total number of simultanous > pgsql-connection. > > > >regards > >messju mohr > > > >On Wed, 21 Nov 2001, Stephen Woodbridge wrote: > > > >> I had a similar problem with mysql and apache. > >> > >> Apache does something weird when you pconnect where it never releases or > >> reuses your connections. > >> > >> I fixed this on my sysem by changing pconnect to connect. Find your call > >> to pg_pconnect and change it to pg_connect in phplib and see if it fixes > >> your problem. You may also need to restart pgsql to purge all the open > >> pconnections > >> > >> -Steve > >> > >> Frank Bax wrote: > >> > > >> > pgsql 7.1 - phplib 7.2d - OpenBSD 2.9 > >> > > >> > How do I fix this? > >> > > >> > Warning: Unable to connect to PostgreSQL server: Sorry, too many clients > >> > already in /var/www/php/class/phplib-7.2d/db_pgsql.inc on line 48 > >> > Database error: Link-ID == false, pconnect failed > >> > PostgreSQL Error: 0 () > >> > Session halted. > >> > > >> > _______________________________________________ > >> > Phplib-users mailing list > >> > Php...@li... > >> > https://lists.sourceforge.net/lists/listinfo/phplib-users > >> > >> _______________________________________________ > >> Phplib-users mailing list > >> Php...@li... > >> https://lists.sourceforge.net/lists/listinfo/phplib-users > >> > >> > > > >-- > > Matthias Mohr <m....@in...> (Software-Entwicklung) > > Internet Factory AG, Niederlassung Industriestr. 11, 26121 Oldenburg > > Tel: (+49) (0)441 - 77 92 10 Fax: (+49) (0)441 - 77 92 177 > > http://www.internet-factory.de > > > > > >_______________________________________________ > >Phplib-users mailing list > >Php...@li... > >https://lists.sourceforge.net/lists/listinfo/phplib-users > > > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Frank B. <fb...@sy...> - 2001-11-21 17:23:25
|
I've looked into these suggestions and I find I have more to better understand about apache-php-pgsql interaction. I am running several virtual hosts, each with their own database. I determined that my 32 connections was the pgsql "max_connections". But perhaps the 'real' problem is somewhere else. When I run 'ps -ax', I find that there are up-to 10 entries for each database. In the past, I have noticed that this number climbs even if I am the only person accessing a database via a single web-browser instance. Why isn't the existing connection re-used? It must reuse these when I reach 10, because I don't go over that number of connections. Also, is there a way to restrict this number by either database or virtual host basis? The MaxRequestsPerChild option mentioned is currently set to 30, so it doesn't appear to be the controlling option here? Perhaps I will also run some tests to gauge the impact of switching from pconnect to connect. Also, I wouldn't mind if some of the virtual hosts (one database each) were restricted to a very few number of connections. But for some other hosts/databases I am more concerned about performance. Frank At 05:46 PM 11/21/01 +0100, Matthias Mohr wrote: >hello, > >if you really need the performance you gain using pconnect instead of connect >(especially when your database is running on another host, than you webserver) >another approach could be setting the apache-config-value for >MaxRequestsPerChild. > >AFAIR it defaults to 0 which means unlimited requests per child. if so apache >would *never* free you pgsql-handles. if you put it to a value greater 0 every >apache child-process dies after an finite number of requests and frees you >psql-connections (sucking up a bit performance you gained using pconnect, >since the webserver-child-process has to be restarted). > >also: if you keep using pconnect(), you maybe have to raise the number of >max-backends of your pgsql-postmaster. keep in mind that you can get >number-of-apache-childs times number-of-databases times >number-of-database-logins as the total number of simultanous pgsql-connection. > >regards >messju mohr > >On Wed, 21 Nov 2001, Stephen Woodbridge wrote: > >> I had a similar problem with mysql and apache. >> >> Apache does something weird when you pconnect where it never releases or >> reuses your connections. >> >> I fixed this on my sysem by changing pconnect to connect. Find your call >> to pg_pconnect and change it to pg_connect in phplib and see if it fixes >> your problem. You may also need to restart pgsql to purge all the open >> pconnections >> >> -Steve >> >> Frank Bax wrote: >> > >> > pgsql 7.1 - phplib 7.2d - OpenBSD 2.9 >> > >> > How do I fix this? >> > >> > Warning: Unable to connect to PostgreSQL server: Sorry, too many clients >> > already in /var/www/php/class/phplib-7.2d/db_pgsql.inc on line 48 >> > Database error: Link-ID == false, pconnect failed >> > PostgreSQL Error: 0 () >> > Session halted. >> > >> > _______________________________________________ >> > Phplib-users mailing list >> > Php...@li... >> > https://lists.sourceforge.net/lists/listinfo/phplib-users >> >> _______________________________________________ >> Phplib-users mailing list >> Php...@li... >> https://lists.sourceforge.net/lists/listinfo/phplib-users >> >> > >-- > Matthias Mohr <m....@in...> (Software-Entwicklung) > Internet Factory AG, Niederlassung Industriestr. 11, 26121 Oldenburg > Tel: (+49) (0)441 - 77 92 10 Fax: (+49) (0)441 - 77 92 177 > http://www.internet-factory.de > > >_______________________________________________ >Phplib-users mailing list >Php...@li... >https://lists.sourceforge.net/lists/listinfo/phplib-users > |
From: Matthias M. <m....@in...> - 2001-11-21 16:46:16
|
hello, if you really need the performance you gain using pconnect instead of connect (especially when your database is running on another host, than you webserver) another approach could be setting the apache-config-value for MaxRequestsPerChild. AFAIR it defaults to 0 which means unlimited requests per child. if so apache would *never* free you pgsql-handles. if you put it to a value greater 0 every apache child-process dies after an finite number of requests and frees you psql-connections (sucking up a bit performance you gained using pconnect, since the webserver-child-process has to be restarted). also: if you keep using pconnect(), you maybe have to raise the number of max-backends of your pgsql-postmaster. keep in mind that you can get number-of-apache-childs times number-of-databases times number-of-database-logins as the total number of simultanous pgsql-connection. regards messju mohr On Wed, 21 Nov 2001, Stephen Woodbridge wrote: > I had a similar problem with mysql and apache. > > Apache does something weird when you pconnect where it never releases or > reuses your connections. > > I fixed this on my sysem by changing pconnect to connect. Find your call > to pg_pconnect and change it to pg_connect in phplib and see if it fixes > your problem. You may also need to restart pgsql to purge all the open > pconnections > > -Steve > > Frank Bax wrote: > > > > pgsql 7.1 - phplib 7.2d - OpenBSD 2.9 > > > > How do I fix this? > > > > Warning: Unable to connect to PostgreSQL server: Sorry, too many clients > > already in /var/www/php/class/phplib-7.2d/db_pgsql.inc on line 48 > > Database error: Link-ID == false, pconnect failed > > PostgreSQL Error: 0 () > > Session halted. > > > > _______________________________________________ > > Phplib-users mailing list > > Php...@li... > > https://lists.sourceforge.net/lists/listinfo/phplib-users > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > > -- Matthias Mohr <m....@in...> (Software-Entwicklung) Internet Factory AG, Niederlassung Industriestr. 11, 26121 Oldenburg Tel: (+49) (0)441 - 77 92 10 Fax: (+49) (0)441 - 77 92 177 http://www.internet-factory.de |
From: Stephen W. <wo...@me...> - 2001-11-21 16:24:51
|
I had a similar problem with mysql and apache. Apache does something weird when you pconnect where it never releases or reuses your connections. I fixed this on my sysem by changing pconnect to connect. Find your call to pg_pconnect and change it to pg_connect in phplib and see if it fixes your problem. You may also need to restart pgsql to purge all the open pconnections -Steve Frank Bax wrote: > > pgsql 7.1 - phplib 7.2d - OpenBSD 2.9 > > How do I fix this? > > Warning: Unable to connect to PostgreSQL server: Sorry, too many clients > already in /var/www/php/class/phplib-7.2d/db_pgsql.inc on line 48 > Database error: Link-ID == false, pconnect failed > PostgreSQL Error: 0 () > Session halted. > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Frank B. <fb...@sy...> - 2001-11-21 16:08:30
|
pgsql 7.1 - phplib 7.2d - OpenBSD 2.9 How do I fix this? Warning: Unable to connect to PostgreSQL server: Sorry, too many clients already in /var/www/php/class/phplib-7.2d/db_pgsql.inc on line 48 Database error: Link-ID == false, pconnect failed PostgreSQL Error: 0 () Session halted. |
From: Bob B. <bo...@iN...> - 2001-11-19 22:11:56
|
Nathan -- Thanks, I'm aware of what "exit;" does ... I put line 2 in place so that the cookie setting functions wouldn't complain and stop the script. After proving that the HTTP_POST_VARS indeed contained the expected values on the very first line of the "receiving" script, I commented out lines 1 and 2, which allowed line 4 to display the contents of the HTTP_POST_VARS ... and they were empty. As I said in my note, > If I comment out lines 1 and 2, the $HTTP_POST_VARS are > empty in line 4, as are all other variables. My problem is that after calling "page_open", all variables have disappeared. And that's the issue I need help with ... I've never seen this before, and as far as I can tell, the environmental variables on this server are identical to those on other servers where this code works correctly. Any suggestions at all will be greatly appreciated ... Bob. At 05:04 PM 11/19/2001 -0500, nathan r. hruby wrote: >On Mon, 19 Nov 2001, Bob Bowker wrote: > > > Hi -- > > > > I have phpLib 7.2d running on PHP 4.0.4pl1 on an Apache server. When I > > submit POSTed variables to a script, the $HTTP_POST_VARS are there at line > > 1 and "gone" at line 4. > > > > 1: echo "1 SOMETHING: " . $HTTP_POST_VARS["something"]; > > 2: exit; > > 3: page_open(array("sess" => "Poe_Session")); > > 4: echo "4 SOMETHING: " . $HTTP_POST_VARS["something"]; > > > > If I comment out lines 1 and 2, the $HTTP_POST_VARS are empty in line 4, as > > are all other variables. > > > > I've put a similar trap as line 1 of function start() within session.inc > > and they're empty by here as well. I have safe_mode turned off ... > > > > This one is driving me crazy -- any ideas where to look for the problem? > > > >exit(); === die(); > >Eg: you kill the current script (and presumably the variables in it) when >you call exit(). In theory lines 3 and 4 as stated above should never >actually execute. > >Why this would happen after commenting out lines 1 and 2 is beyond me, as >those lines alone should work. > >-n > >-- >-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- >nathan hruby / digital statement >na...@ds... >http://www.dstatement.com/ > >Public GPG key can be found at: >http://www.dstatement.com/nathan-gpg-key.txt >ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B >-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
From: nathan r. h. <na...@ds...> - 2001-11-19 22:04:00
|
On Mon, 19 Nov 2001, Bob Bowker wrote: > Hi -- > > I have phpLib 7.2d running on PHP 4.0.4pl1 on an Apache server. When I > submit POSTed variables to a script, the $HTTP_POST_VARS are there at line > 1 and "gone" at line 4. > > 1: echo "1 SOMETHING: " . $HTTP_POST_VARS["something"]; > 2: exit; > 3: page_open(array("sess" => "Poe_Session")); > 4: echo "4 SOMETHING: " . $HTTP_POST_VARS["something"]; > > If I comment out lines 1 and 2, the $HTTP_POST_VARS are empty in line 4, as > are all other variables. > > I've put a similar trap as line 1 of function start() within session.inc > and they're empty by here as well. I have safe_mode turned off ... > > This one is driving me crazy -- any ideas where to look for the problem? > exit(); === die(); Eg: you kill the current script (and presumably the variables in it) when you call exit(). In theory lines 3 and 4 as stated above should never actually execute. Why this would happen after commenting out lines 1 and 2 is beyond me, as those lines alone should work. -n -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement na...@ds... http://www.dstatement.com/ Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
From: Bob B. <bo...@iN...> - 2001-11-19 20:50:47
|
Hi -- I have phpLib 7.2d running on PHP 4.0.4pl1 on an Apache server. When I submit POSTed variables to a script, the $HTTP_POST_VARS are there at line 1 and "gone" at line 4. 1: echo "1 SOMETHING: " . $HTTP_POST_VARS["something"]; 2: exit; 3: page_open(array("sess" => "Poe_Session")); 4: echo "4 SOMETHING: " . $HTTP_POST_VARS["something"]; If I comment out lines 1 and 2, the $HTTP_POST_VARS are empty in line 4, as are all other variables. I've put a similar trap as line 1 of function start() within session.inc and they're empty by here as well. I have safe_mode turned off ... This one is driving me crazy -- any ideas where to look for the problem? Thanks in advance -- Bob. |
From: Brian P. <bp...@ct...> - 2001-11-19 16:36:53
|
As I understand it, you just need to add 'https' to the link. For example, <A HREF='https:// www.somewhere.com <http://www.somewhere.com> /securepage.php'>here</a> (assuming you have SSL setup correctly on the server). -----Original Message----- From: Sascha Ragtschaa [mailto:rag...@pe...] Sent: Monday, November 19, 2001 10:27 AM To: Php...@li... Subject: [Phplib-users] PHPlib and SSL... Hey, I currently have a small problem: I am running a Webpage, which now needs to have SSL on some parts (User = Change Profiles, Booking...). I am using PHPlib. How can I do it, that = on some pages I can activate the SSL mode and my url switches to https? Did anyone already have experience with such things? I don't need SSL = for the whole site, just different "secure" parts should be in SSL = mode... Thanks in advance, guys!! |
From: Sascha R. <rag...@pe...> - 2001-11-19 16:30:28
|
Hey, I currently have a small problem: I am running a Webpage, which now needs to have SSL on some parts (User = =3D Change Profiles, Booking...). I am using PHPlib. How can I do it, that = =3D on some pages I can activate the SSL mode and my url switches to https? Did anyone already have experience with such things? I don't need SSL = =3D for the whole site, just different "secure" parts should be in SSL =3D mode... Thanks in advance, guys!! |
From: Peter B. <re...@f2...> - 2001-11-19 10:56:51
|
At 09:56 PM 11/18/01 -0500, twidlar wrote: >Which is the best IDE to use (PHPed, PHPedit, PHPcoder) or alternatively, >what or the tradeoffs? Out of those three (assuming you are using the free version of PHPEd) PHPEdit is by far the best. I am using it all the time now, and while it is rather resource-hungry (this is on Win98) it does what is required. I haven't actually managed to get the debugger to work yet (apparently if you've already installed it with PHPEd or PHPCoder it's much harder to get working) but I know others have. Best of all, it's still under active development, and is free :-) HTH, Peter. -- Maple Design - http://www.mapledesign.co.uk |
From: twidlar <tw...@cr...> - 2001-11-19 02:53:51
|
> Thomas Widlar: > > > I am not at all new to programming, but I am just > > starting with PHP and web programming beyond simple > > HTML. > > > 2. I have obtained the Zend-IDE > > 'ZendIDEClient-TestDrive-1.1.0-Windows'. The Zend website > > says the ZendIDE is only for Win2000. I saw somewhere that > > the Zend-IDE is written in Java, which probably means it > > was developed from NetBeans, which does run in WinME. > > So, will the Zend-IDE work on my WinME PHPTriad setup? > > "Tarique Sani " wrote: > > Welcome! > > Forget ZendIDEClient! I never got it to work ... > > if you are using windows use PHPed, yes I know the > later versions are commercial but older versions are still available and > perfectly usable, you can also try PHPedit > > With PHPed thoug you would like to upgarde the debugger to a later > version. Thank you for putting me in this direction. I have downloaded PHPEdit-0.6 PHPEdSetup3x DbgSetup204pl2 DBGsetup-210 DBGsetup-210rc2 pr3setup (PHPCoder from phpide.com) Which is the best IDE to use (PHPed, PHPedit, PHPcoder) or alternatively, what or the tradeoffs? How is DBG installed? Must it be compiled or is there an executable? If compiled, can it be compiled using Cygwin? I've used Borland's IDE, Debug2000 on Unix, and Java's Forte. I'm at a loss of where to start with this. My setup: WinME, PHPTriad (Apache, PHP, MySQL). Document home: c:\apache\htdocs\ Thanks Tom Widlar > > ========================================================== > PHP Applications for E-Biz : http://www.sanisoft.com > > The Ultimate Ghazal Lexicon: http://www.aaina-e-ghazal.com > ========================================================== > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: nathan r. h. <na...@ds...> - 2001-11-16 13:21:17
|
The site needs a revamp, what's at phplib.sf.net is jsut a temporary thing until we can get something better. I worked on a slighlty revamed mockup yesterday, if I get the chance, I'll upload it somewhere and post the URL. And if any of y'all would like to do the site, please whip up a quick prototype and send it to this list, myself, or the -core list and we'll take a look. -n On Fri, 16 Nov 2001, Donncha O Caoimh wrote: > Is it just my browsers (Netscape, Mozilla/Galeon and Konqueror) or is > the phplib site a bit screwed? I presume most of the links should be > activated by Javascript but most of those links are broken and do > nothing. The only ones that work are normal html links. > > Please, if you're going to use Javascript at least make it so it > degrades gracefully! > > Donncha. > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement na...@ds... http://www.dstatement.com/ Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
From: Donncha O C. <don...@tr...> - 2001-11-16 10:52:38
|
Is it just my browsers (Netscape, Mozilla/Galeon and Konqueror) or is the phplib site a bit screwed? I presume most of the links should be activated by Javascript but most of those links are broken and do nothing. The only ones that work are normal html links. Please, if you're going to use Javascript at least make it so it degrades gracefully! Donncha. |
From: nathan r. h. <na...@ds...> - 2001-11-15 22:21:48
|
On Thu, 15 Nov 2001, Frank Bax wrote: > At 04:56 PM 11/15/01 -0500, nathan r. hruby wrote: > >On Thu, 15 Nov 2001, Frank Bax wrote: > >> I just had a look at this. It didn't take me long to find that phplib has > >> a fundamental problem. I only supports a single database per installation! > >> Excuse me if this has been observed before, but I just realised it; I > >> never went much beyond local.inc before today. > > > >Woah! It does, you just need multiple local.inc's and / or prepend.php3's > >So, it does, just not within the same instance. > > When I wrote it, I was thinking about accessing two different databases in > the same script. > > How does one support multiple local.inc and prepend.php files? > > Frank > This might do it, it might not. class foo { var db; function foo() { global $_PHPLIB include($PHPLIB[libdir]. "/DB_of_choice"); $var = new DB_SQL } } $foo->db->query("SELECT bar FROM baz WHERE baz.gnu='gnomovision'"); In theory the Object namespace in php is protected from from the global namespace so an include() statement in a instanced class should only affect the namespace inside that particular object, not gloablly, so *in theory* there shouldn't be any namespace collsions. <hedge> I may be grossly misinformed about the way namespaces work, if so, then please disreagrad and just know that mixing db's in a script is not a too teribliy good idea in terms of maintainibility </hedge> -n -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement na...@ds... http://www.dstatement.com/ Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
From: Frank B. <fb...@sy...> - 2001-11-15 22:12:04
|
At 04:56 PM 11/15/01 -0500, nathan r. hruby wrote: >On Thu, 15 Nov 2001, Frank Bax wrote: >> I just had a look at this. It didn't take me long to find that phplib has >> a fundamental problem. I only supports a single database per installation! >> Excuse me if this has been observed before, but I just realised it; I >> never went much beyond local.inc before today. > >Woah! It does, you just need multiple local.inc's and / or prepend.php3's >So, it does, just not within the same instance. When I wrote it, I was thinking about accessing two different databases in the same script. How does one support multiple local.inc and prepend.php files? Frank |