Re: [PHP] Log Lib Recommendation
John Comerford wrote: Hi Folks, Could someone recommend a good library for error logging. What I am looking for is something that handles: 1) Error Log written to a DB (mysql) 2) Logging of PHP errors 3) Logging of MySQL errors 4) Logging of Custom errors/events 5) A log viewer would be nice but not really essential. See http://www.php.net/set_error_handler Once you've got that set up, you can do whatever you like. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] install problems
jekillen wrote: Hello; Well, this one I cannot seem to figure out: I installed Apache 1.3.37 with ./configure --enable-module=so --enable-module=rewrite --enable-shared=max Then tried to install php 5.2.1 --with-apxs=/usr/local/apache/bin etc etc libphp5.so is no where to be found. It sure is not in apache/libexec Did you run 'make' ? Running configure doesn't create this file, 'make' does. A rather obvious question but I couldn't see whether you ran it or not. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: install problems
On Mar 18, 2007, at 7:51 PM, Haydar TUNA wrote: Hello, This is php.install question but I can help you. Two weeks ago, I faced same problem with Apache 2.2.4 and PHP 5.2.1 in Redhat Linux AS 4 Update 3 operating system. I tried to install apache and php together but I faced to same problem. I tried to install PHP 5.1.6 and Apache 2.2.4, my problem could be solved.:) Thanks, I still do have the 5.1.2 tarball. I will try that and see if it makes a dif. I thought of stealing the file that is missing from another installation that is very similar but decided against it because it was based on a different version of php (5.2.1). And this file is in /usr/local/libexec instead of /usr/local/apache/libexec (That actually be part of my problem; I.E. when I installed Apache I did not give ./configure a prefix because the install instructions said the default was /usr/local/apache. And httpd.conf is expecting to find the stuff in /usr/local/libexec.) Thanks again trying again, Jeff K -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] crc32() and hash('crc32') Differ
Hi, I'm curious why I'm getting two different digests of the same message using crc32() and hash('crc32'). I've tried both hash('crc32') and hash('crc32b'), and neither match my crc32(). Some example code: echo join("\n", array_map(create_function('$vals', 'return join(" => ", $vals);'), array_values($data))); ?> Output: -1938594527 => 2356372769 => 8c736521 => 1000110001110011011001010011 -1513816503 => 2781150793 => a5c4fe49 => 1010010111000100111001001001 +0560296844 => 0560296844 => 2165738c => 0011011001010111001110001100 Not only do none of these match, but when I try with a message that I intend to validate and am given a CRC32 to check against, the given CRC32 hash does not match any of these three. Granted, the message I'm trying to validate could in fact be invalid, but regardless there's still the discrepancy between crc32() and hash('crc32'). Is this expected behavior? Thanks, Morgan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: install problems
Hello, This is php.install question but I can help you. Two weeks ago, I faced same problem with Apache 2.2.4 and PHP 5.2.1 in Redhat Linux AS 4 Update 3 operating system. I tried to install apache and php together but I faced to same problem. I tried to install PHP 5.1.6 and Apache 2.2.4, my problem could be solved.:) -- Haydar TUNA Republic Of Turkey - Ministry of National Education Education Technology Department Ankara / TURKEY Web: http://www.haydartuna.net "jekillen" <[EMAIL PROTECTED]>, haber iletisinde sunlari yazdi:[EMAIL PROTECTED] > Hello; > Well, this one I cannot seem to figure out: > I installed Apache 1.3.37 with > ./configure --enable-module=so --enable-module=rewrite --enable-shared=max > Then tried to install > php 5.2.1 --with-apxs=/usr/local/apache/bin etc etc > > libphp5.so is no where to be found. It sure is not > in apache/libexec > > I saved the ./configure options in a file and had > configure read from it. All seemed to go ok, > no errors, bailouts. I can send that file if anyone > thinks it may have the answer. > > The problem showed up when I tried to start apache and > it would not start because it could not find libphp5.so > > OS: Freebsd 6.2 > (I know there is the ports system, I have install all of this successfully > on > two other machines doing just untar, configure, make, make install. I had > reasons for not dealing with ports) > Any clues? > Thanks in advance > Jeff K -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Log Lib Recommendation
Hello John Comerford, log4php,you can find it on apache.org Best regards, === At 2007-03-19, 08:22:13 you wrote: === >Hi Folks, > >Could someone recommend a good library for error logging. What I am >looking for is something that handles: > >1) Error Log written to a DB (mysql) >2) Logging of PHP errors >3) Logging of MySQL errors >4) Logging of Custom errors/events >5) A log viewer would be nice but not really essential. > >I have done some searches but it's kinda hard to see the wood for the >trees... > >Thanks, > JC > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > = = = = = = = = = = = = = = = = = = = = Nicholas Yim [EMAIL PROTECTED] 2007-03-19 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PECL help
Never mind... should be temp_dir, not temp-dir... to make you all read that long message for such a silly mistake! On 3/18/07, Mike Payson <[EMAIL PROTECTED]> wrote: I'm trying to install the extension runkit on my shared server. I successfully installed a local copy of PEAR via the instructions at http://pear.php.net/manual/en/installation.shared.php . Here is the resulting configuration: Configuration (channel pear.php.net): = Auto-discover new Channels auto_discover Default Channeldefault_channel pear.php.net HTTP Proxy Server Address http_proxy PEAR server [DEPRECATED] master_serverpear.php.net Default Channel Mirror preferred_mirror pear.php.net Remote Configuration File remote_config PEAR executables directory bin_dir /home/maximumr/pear/pear PEAR documentation directory doc_dir /home/maximumr/pear/pear/docs PHP extension directoryext_dir /home/maximumr/pear/pear/ext PEAR directory php_dir /home/maximumr/pear/pear/php PEAR Installer cache directory cache_dir /home/maximumr/pear/pear/cache PEAR data directorydata_dir /home/maximumr/pear/pear/data PEAR Installer downloaddownload_dir /tmp/pear/cache directory PHP CLI/CGI binary php_bin /usr/local/bin/php php.ini location php_ini PEAR Installer temp directory temp_dir /tmp/pear/temp PEAR test directorytest_dir /home/maximumr/pear/pear/tests Cache TimeToLive cache_ttl3600 Preferred Package Statepreferred_state stable Unix file mask umask22 Debug Log Levelverbose 1 PEAR password (for password maintainers) Signature Handling Program sig_bin /usr/bin/gpg Signature Key Directorysig_keydir /usr/local/etc/pearkeys Signature Key Id sig_keyid Package Signature Type sig_type gpg PEAR username (for username maintainers) User Configuration FileFilename /home/maximumr/.pearrc System Configuration File Filename /usr/local/etc/pear.conf However when I try to install runit, I get an error: bash-3.00$ pecl install runkit-beta downloading runkit-0.9.tgz ... Could not download from " http://pecl.php.net/get/runkit-0.9.tgz";, cannot download "pecl/runkit" (could not open /tmp/pear/cache/runkit-0.9.tgz for writing) Error: cannot download "pecl/runkit" The directory /tmp/pear is owned by root, so I can't make changes to it. If I try to change the temp-dir to something that works, I get another error: bash-3.00$ pear config-set temp-dir ~/tmp config-set (temp-dir, /home/maximumr/tmp, user) failed, channel pear.php.net How can I make this work?
[PHP] PECL help
I'm trying to install the extension runkit on my shared server. I successfully installed a local copy of PEAR via the instructions at http://pear.php.net/manual/en/installation.shared.php. Here is the resulting configuration: Configuration (channel pear.php.net): = Auto-discover new Channels auto_discover Default Channeldefault_channel pear.php.net HTTP Proxy Server Address http_proxy PEAR server [DEPRECATED] master_serverpear.php.net Default Channel Mirror preferred_mirror pear.php.net Remote Configuration File remote_config PEAR executables directory bin_dir /home/maximumr/pear/pear PEAR documentation directory doc_dir /home/maximumr/pear/pear/docs PHP extension directoryext_dir /home/maximumr/pear/pear/ext PEAR directory php_dir /home/maximumr/pear/pear/php PEAR Installer cache directory cache_dir /home/maximumr/pear/pear/cache PEAR data directorydata_dir /home/maximumr/pear/pear/data PEAR Installer downloaddownload_dir /tmp/pear/cache directory PHP CLI/CGI binary php_bin /usr/local/bin/php php.ini location php_ini PEAR Installer temp directory temp_dir /tmp/pear/temp PEAR test directorytest_dir /home/maximumr/pear/pear/tests Cache TimeToLive cache_ttl3600 Preferred Package Statepreferred_state stable Unix file mask umask22 Debug Log Levelverbose 1 PEAR password (for password maintainers) Signature Handling Program sig_bin /usr/bin/gpg Signature Key Directorysig_keydir /usr/local/etc/pearkeys Signature Key Id sig_keyid Package Signature Type sig_type gpg PEAR username (for username maintainers) User Configuration FileFilename /home/maximumr/.pearrc System Configuration File Filename /usr/local/etc/pear.conf However when I try to install runit, I get an error: bash-3.00$ pecl install runkit-beta downloading runkit-0.9.tgz ... Could not download from "http://pecl.php.net/get/runkit-0.9.tgz";, cannot download "pecl/runkit" (could not open /tmp/pear/cache/runkit-0.9.tgz for writing) Error: cannot download "pecl/runkit" The directory /tmp/pear is owned by root, so I can't make changes to it. If I try to change the temp-dir to something that works, I get another error: bash-3.00$ pear config-set temp-dir ~/tmp config-set (temp-dir, /home/maximumr/tmp, user) failed, channel pear.php.net How can I make this work?
[PHP] Log Lib Recommendation
Hi Folks, Could someone recommend a good library for error logging. What I am looking for is something that handles: 1) Error Log written to a DB (mysql) 2) Logging of PHP errors 3) Logging of MySQL errors 4) Logging of Custom errors/events 5) A log viewer would be nice but not really essential. I have done some searches but it's kinda hard to see the wood for the trees... Thanks, JC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] install problems
Hello; Well, this one I cannot seem to figure out: I installed Apache 1.3.37 with ./configure --enable-module=so --enable-module=rewrite --enable-shared=max Then tried to install php 5.2.1 --with-apxs=/usr/local/apache/bin etc etc libphp5.so is no where to be found. It sure is not in apache/libexec I saved the ./configure options in a file and had configure read from it. All seemed to go ok, no errors, bailouts. I can send that file if anyone thinks it may have the answer. The problem showed up when I tried to start apache and it would not start because it could not find libphp5.so OS: Freebsd 6.2 (I know there is the ports system, I have install all of this successfully on two other machines doing just untar, configure, make, make install. I had reasons for not dealing with ports) Any clues? Thanks in advance Jeff K -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preventing unwanted chars from outputting
On Sunday 18 March 2007 2:17 pm, Robert Cummings wrote: > On Sun, 2007-03-18 at 13:58 -0500, Larry Garfield wrote: > > On Sunday 18 March 2007 5:57 am, Don Don wrote: > > > Hi all, > > > my program outputs some characters along with text from the database, > > > these texts contain chars like ‘ ’. How can i get rid of theses > > > chars and display their meaning instead ? I am thinking > > > htmlspecialchars or html entities will do the job will it ? > > > > > > > > > Cheers > > > > It sounds like you're running into character encoding issues. They suck. > > :-) See here for details: > > > > http://www.garfieldtech.com/blog/stupid-quotes > > http://www.garfieldtech.com/blog/more-on-stupid-quotes > > http://www.garfieldtech.com/blog/unicode-8-vs-16 > > I found the following to be quite informative: > > http://www.joelonsoftware.com/articles/Unicode.html I do like Joel's style... :-) -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] glob(path_pattern, GLOB_ONLYDIR)
It doesn't on my Linux system glob("../path/*"); shows files and dirs; foo.ext and dirs Exactly the same as glob("../path/*.*"); I thought using just plain "*" would ignore files; but, it doesn't. Jochem Maas wrote: Al wrote: I thought the "." had meaning since the manual user notes used it it means a literal dot, many people assume that glob expressions use the same syntax as regular expressions but this is not the case. Definitely, my php is version 4.4.4; it's on a virtual host. I found the glob file for the GNU C Library and GLOB_ONLYDIR doesn't seem to be defined correctly, the file appears to rather old. I used the numerical value "8196" and it works fine. I'm a little reluctant to use the numerical value as I want my code to be generally universal. Maybe the numerical value is safer anyhow. What do you think? you might consider something like this: if (!defined('GLOB_ONLYDIR')) define('GLOB_ONLYDIR', 8196); I doubt that the numeric value will ever change btw. I can alternatively just filter out the files in a second step. that seems like a lesser solution. Al. Jim Lucas wrote: Al wrote: I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4. I only want the dirs. This works; sort of: print_r(glob('../*',)); //It lists all the files AND directories. Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK, I can delete the files remember this is linux you are talking about, not windows. A '*' means anything, including a '.' This fails: print_r(glob('../*', GLOB_ONLYDIR)); well, double check your php version, because this should be built in whit the version that you are running. And I get: "Warning: glob() expects parameter 2 to be long, string given in foo" I can't find anything in the manual or when Googling. Anyone can explain this for me? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preventing unwanted chars from outputting
On Sun, 2007-03-18 at 13:58 -0500, Larry Garfield wrote: > On Sunday 18 March 2007 5:57 am, Don Don wrote: > > Hi all, > > my program outputs some characters along with text from the database, > > these texts contain chars like ‘ ’. How can i get rid of theses chars > > and display their meaning instead ? I am thinking htmlspecialchars or html > > entities will do the job will it ? > > > > > > Cheers > > It sounds like you're running into character encoding issues. They suck. :-) > > See here for details: > > http://www.garfieldtech.com/blog/stupid-quotes > http://www.garfieldtech.com/blog/more-on-stupid-quotes > http://www.garfieldtech.com/blog/unicode-8-vs-16 I found the following to be quite informative: http://www.joelonsoftware.com/articles/Unicode.html Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preventing unwanted chars from outputting
On Sunday 18 March 2007 5:57 am, Don Don wrote: > Hi all, > my program outputs some characters along with text from the database, > these texts contain chars like â â. How can i get rid of theses chars > and display their meaning instead ? I am thinking htmlspecialchars or html > entities will do the job will it ? > > > Cheers It sounds like you're running into character encoding issues. They suck. :-) See here for details: http://www.garfieldtech.com/blog/stupid-quotes http://www.garfieldtech.com/blog/more-on-stupid-quotes http://www.garfieldtech.com/blog/unicode-8-vs-16 -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] glob(path_pattern, GLOB_ONLYDIR)
That nailed my problem. GLOB_ONLYDIR is a defined constant. It echos as 8192. I inadvertently treated it as a string with quotes, which I didn't include in my original post. I had forgotten that most function flags are simply constants which can be tested for and printed, etc. Many thanks Jim Lucas wrote: Al wrote: I thought the "." had meaning since the manual user notes used it Definitely, my php is version 4.4.4; it's on a virtual host. I found the glob file for the GNU C Library and GLOB_ONLYDIR doesn't seem to be defined correctly, the file appears to rather old. echo GLOB_ONLYDIR; does this work? I used the numerical value "8196" and it works fine. I'm a little reluctant to use the numerical value as I want my code to be generally universal. Maybe the numerical value is safer anyhow. What do you think? I can alternatively just filter out the files in a second step. Al. Jim Lucas wrote: Al wrote: I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4. I only want the dirs. This works; sort of: print_r(glob('../*',)); //It lists all the files AND directories. Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK, I can delete the files remember this is linux you are talking about, not windows. A '*' means anything, including a '.' This fails: print_r(glob('../*', GLOB_ONLYDIR)); well, double check your php version, because this should be built in whit the version that you are running. And I get: "Warning: glob() expects parameter 2 to be long, string given in foo" I can't find anything in the manual or when Googling. Anyone can explain this for me? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Preventing unwanted chars from outputting
Hello, What is your database program? If your database program is MySQL, what is your default charset of database? These questions are more importont to solve your problem.:) -- Haydar TUNA Republic Of Turkey - Ministry of National Education Education Technology Department Ankara / TURKEY Web: http://www.haydartuna.net "Don Don" <[EMAIL PROTECTED]>, haber iletisinde sunlari yazdi:[EMAIL PROTECTED] > Hi all, > my program outputs some characters along with text from the database, > these texts contain chars like â?~ â?T. How can i get rid of theses chars > and display their meaning instead ? I am thinking htmlspecialchars or > html entities will do the job will it ? > > > Cheers > > > - > Food fight? Enjoy some healthy debate > in the Yahoo! Answers Food & Drink Q&A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] glob(path_pattern, GLOB_ONLYDIR)
Al wrote: > I thought the "." had meaning since the manual user notes used it it means a literal dot, many people assume that glob expressions use the same syntax as regular expressions but this is not the case. > > Definitely, my php is version 4.4.4; it's on a virtual host. > > I found the glob file for the GNU C Library and GLOB_ONLYDIR doesn't > seem to be defined correctly, the file appears to rather old. > > I used the numerical value "8196" and it works fine. I'm a little > reluctant to use the numerical value as I want my code to be generally > universal. Maybe the numerical value is safer anyhow. What do you think? you might consider something like this: if (!defined('GLOB_ONLYDIR')) define('GLOB_ONLYDIR', 8196); I doubt that the numeric value will ever change btw. > > I can alternatively just filter out the files in a second step. that seems like a lesser solution. > > Al. > > > > Jim Lucas wrote: >> Al wrote: >>> I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4. I only >>> want the dirs. >>> >>> This works; sort of: >>> print_r(glob('../*',)); //It lists all the files AND directories. >>> Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK, >>> I can delete the files >> remember this is linux you are talking about, not windows. >> >> A '*' means anything, including a '.' >> >> >>> >>> This fails: >>> print_r(glob('../*', GLOB_ONLYDIR)); >> well, double check your php version, because this should be built in >> whit the version that you are running. >> >>> >>> And I get: "Warning: glob() expects parameter 2 to be long, string >>> given in foo" >>> >>> I can't find anything in the manual or when Googling. >>> >>> Anyone can explain this for me? >>> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] glob(path_pattern, GLOB_ONLYDIR)
Al wrote: I thought the "." had meaning since the manual user notes used it Definitely, my php is version 4.4.4; it's on a virtual host. I found the glob file for the GNU C Library and GLOB_ONLYDIR doesn't seem to be defined correctly, the file appears to rather old. echo GLOB_ONLYDIR; does this work? I used the numerical value "8196" and it works fine. I'm a little reluctant to use the numerical value as I want my code to be generally universal. Maybe the numerical value is safer anyhow. What do you think? I can alternatively just filter out the files in a second step. Al. Jim Lucas wrote: Al wrote: I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4. I only want the dirs. This works; sort of: print_r(glob('../*',)); //It lists all the files AND directories. Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK, I can delete the files remember this is linux you are talking about, not windows. A '*' means anything, including a '.' This fails: print_r(glob('../*', GLOB_ONLYDIR)); well, double check your php version, because this should be built in whit the version that you are running. And I get: "Warning: glob() expects parameter 2 to be long, string given in foo" I can't find anything in the manual or when Googling. Anyone can explain this for me? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] glob(path_pattern, GLOB_ONLYDIR)
I thought the "." had meaning since the manual user notes used it Definitely, my php is version 4.4.4; it's on a virtual host. I found the glob file for the GNU C Library and GLOB_ONLYDIR doesn't seem to be defined correctly, the file appears to rather old. I used the numerical value "8196" and it works fine. I'm a little reluctant to use the numerical value as I want my code to be generally universal. Maybe the numerical value is safer anyhow. What do you think? I can alternatively just filter out the files in a second step. Al. Jim Lucas wrote: Al wrote: I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4. I only want the dirs. This works; sort of: print_r(glob('../*',)); //It lists all the files AND directories. Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK, I can delete the files remember this is linux you are talking about, not windows. A '*' means anything, including a '.' This fails: print_r(glob('../*', GLOB_ONLYDIR)); well, double check your php version, because this should be built in whit the version that you are running. And I get: "Warning: glob() expects parameter 2 to be long, string given in foo" I can't find anything in the manual or when Googling. Anyone can explain this for me? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpPgAdmin - prior version available?
On 3/18/07, Bob Hartung <[EMAIL PROTECTED]> wrote: Hi all, I have been struggling with phpPgAdmin 4.1 - login failures. There does not yet seem to be a fix. Where can I find a prior version for FC6 - rpm, tar.gz etc. Thanks, Bob Try this one, http://ftp.uni-koeln.de/mirrors/fedora/linux/extras/6/ppc/phpPgAdmin-4.0.1-7.fc6.noarch.rpm phpPgAdmin 4.0.1 Tijnema -- 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] phpPgAdmin - prior version available?
Hi all, I have been struggling with phpPgAdmin 4.1 - login failures. There does not yet seem to be a fix. Where can I find a prior version for FC6 - rpm, tar.gz etc. Thanks, Bob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Getting last record ID created from DB
- Original Message - From: I guess maybe most databases support the notion of "auto number" in some form. I haven't used MSSQL recently, but I think their solution is a GUID. You can set an auto-increment attribute on any integer data type. They also have GUIDs, which they recomend using if you plan on using replication, as any autonumeric sequence is local to each database and there will be repetitions over multiple servers, something GUIDs won't. Satyam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Getting last record ID created from DB
> markw@mohawksoft.com wrote: >>> On Sat, 2007-03-17 at 12:19 -0400, Mark wrote: >> There in lies the biggest problem with LAMP, and that's MySQL. The >> architecture of your methodology *only* works with MySQL, and not more >> capable databases like Oracle, DB2, or even PostgreSQL. > I too thought the same thing, but was corrected when I starting working > on a redesign for the billing system for the company that I am working > for. They use PostgreSQL and we do have a auto incremented unique id > field. It isn't call AUTO_INCREMENT, but rather a sequence value. It > is a value that is controlled by the default value entry. > > It then runs this: > nextval('customers_customer_id_seq'::regclass) > > and uses this as the value of the id field for the newly inserted row. Yea, I've been using PG for over 10 years now. Sequences are awesome, but there have an "auto number" column type as well. It simply creates a sequence but it's there. I guess maybe most databases support the notion of "auto number" in some form. I haven't used MSSQL recently, but I think their solution is a GUID. > > Then instead of running a command like SELECT LAST_INSERT_ID(); you have > to do some other stuff like this: > > $SQL = "SELECT currval('{$table}_{$column}_seq');"; Again, this is absolutely wrong unless it is wrapped in a transaction. You will need a "begin" and a "commit" in an MVCC type system. If you don't wrap it in a transaction you don't know who got the last "nextval" of the sequence. Also, in PostgreSQL, the pre-cache sequence values for performance. So sequences are not always sequential. (pseudo code) begin; insert ... values (...); select currval('sequence_name'); commit; or $foo = select nextval('user_id_sequence'); insert into users(user_id, ...) values ($foo, ...) (Without a transaction) Sequences are far more flexible than auto number, don't you think? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: install php 5.2.1 with checkinstall
In case you want a full ./configure line... #!/bin/bash ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --with-config-file-path=/etc \ --enable-track-vars \ --enable-ftp \ --enable-sysvsem \ --enable-sysvshm \ --enable-sockets \ --enable-gd-native-ttf \ --enable-memory-limit \ --enable-trans-sid \ --enable-magic-quotes \ --enable-exif \ --enable-inline-optimization \ --enable-dbase \ --enable-mbstring \ --enable-embedded-mysqli \ --with-mysqli \ --with-gettext \ --with-gd \ --with-calendar=shared \ --with-apxs2=`which apxs2` \ --with-imap \ --with-ncurses \ --with-zlib-dir=/usr \ --with-jpeg-dir=/usr \ --with-png-dir=/usr \ --with-xpm-dir=/usr \ --with-openssl=/usr \ --with-freetype-dir=/usr/include \ --with-mysql=/usr \ --with-kerberos \ --with-imap-ssl # # --with-ldap \ # --with-ttf=/usr/X11R6 \ # --with-mm=/usr/mm-1.1.3 \ # --with-pgsql=/usr/local/pgsql \ # --with-pdflib=/usr/local \ # make echo -n "Remember to back up /etc/apache/httpd.conf first" exit # make install -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Ubuntu 6.10) Linux 2.6.20.3 ^ ^ 19:57:01 up 6:15 0 users load average: 1.10 1.05 1.01 news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: install php 5.2.1 with checkinstall
> # rpm -ivh php-5.2.1-1.i386.rpm > file /etc/pear.conf from install of php-5.2.1-1 conflicts with file > from package php-pear-1.4.9-4 > file /usr/share/pear/.channels/pear.php.net.reg from install of > php-5.2.1-1 conflicts with file from package php-pear-1.4.9-4 > file /usr/share/pear/.depdb from install of php-5.2.1-1 conflicts > with file from package php-pear-1.4.9-4 I suggest you use `rpm -r` to remove the original php package in your linux. -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Ubuntu 6.10) Linux 2.6.20.3 ^ ^ 19:00:01 up 5:18 0 users load average: 1.00 1.00 1.00 news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Preventing unwanted chars from outputting
Hi all, my program outputs some characters along with text from the database, these texts contain chars like â â. How can i get rid of theses chars and display their meaning instead ? I am thinking htmlspecialchars or html entities will do the job will it ? Cheers - Food fight? Enjoy some healthy debate in the Yahoo! Answers Food & Drink Q&A.
[PHP] install php 5.2.1 with checkinstall
Hello, I have php 5.1.6 ,the latest available with yum and i wanted to upgrade to 5.2.1 I have downloade 5.2.1 run ./configure,make and the checkinstall. When i wanted to install the newly created rpm i got the following errors: # rpm -ivh php-5.2.1-1.i386.rpm Preparing...### [100%] file /etc/pear.conf from install of php-5.2.1-1 conflicts with file from package php-pear-1.4.9-4 file /usr/share/pear/.channels/pear.php.net.reg from install of php-5.2.1-1 conflicts with file from package php-pear-1.4.9-4 file /usr/share/pear/.depdb from install of php-5.2.1-1 conflicts with file from package php-pear-1.4.9-4 file /usr/share/pear/.registry/archive_tar.reg from install of php-5.2.1-1 conflicts with file from package php-pear-1.4.9-4 file /usr/share/pear/.registry/console_getopt.reg from install of php-5.2.1-1 conflicts with file from package php-pear-1.4.9-4 file /usr/share/pear/.registry/pear.reg from install of php-5.2.1-1 conflicts with file from package php-pear-1.4.9-4 file /usr/bin/php from install of php-5.2.1-1 conflicts with file from package php-cli-5.1.6-3.4.fc6 file /usr/share/man/man1/php.1.gz from install of php-5.2.1-1 conflicts with file from package php-cli-5.1.6-3.4.fc6 Is it safe to use the --force option? just in case this is the output of rpm -qa | grep php on my machine(i thought it would be useful) rpm -qa | grep php php-5.1.6-3.4.fc6 php-pear-Date-1.4.7-1.fc6 php-cli-5.1.6-3.4.fc6 php-mbstring-5.1.6-3.4.fc6 php-pear-DB-1.7.6-7.fc6 php-common-5.1.6-3.4.fc6 php-pear-1.4.9-4 php-mysql-5.1.6-3.4.fc6 php-pear-DB-DataObject-1.8.5-2.fc6 php-pear-Validate-0.7.0-1.fc6 php-pear-MDB2-2.4.0-1.fc6 php-pdo-5.1.6-3.4.fc6 So as you can see php,php-cli,php-mbstring and php-mysql are the same version : 5.1.6 If i install JUST php 5.2.1 wouldn't that break the dependencies with the other packages? Thanks. Bored stiff? Loosen up... Download and play hundreds of games for free on Yahoo! Games. http://games.yahoo.com/games/front -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] works at command line but not in apache
Tijnema ! wrote: On 3/18/07, rwhartung <[EMAIL PROTECTED]> wrote: Thanks, but I have these changes in and it still will not connect: file: pg_hba.conf: # IPv4 local connections: hostall all 127.0.0.1/32 ident sameuser postgrsql.conf: listen_addresses = 'localhost' port = 5432 It is my understanding that the current version 8.1+ now uses the generalized 'listen_addresses' in postgresql.conf instead of any tcp* = 'true' statements in this file. I also am assuming that the postgresql.conf file being read is that in the /var/lib/pgsql/data directory. I am connecting to localhost, need to make sure I can configure for tcpip, and am trying to login as a local user with a user account on the machine. Other ideas? I am not having much luck finding more in the docs. TIA Bob So, you want it to run through TCP/IP, then you need to add the host=localhost and port=5432 items to your pg_connect string $db = pg_connect('dbname=bpsimple user=minitwr password=RWHart') ; becomes: $db = pg_connect('host=localhost port=5432 dbname=bpsimple user=minitwr password=RWHart') ; if you think it is the pg_connect() call that is causing problems, then do this. It is crude way to debug, but it will work. $db = pg_connect('host=localhost port=5432 dbname=bpsimple user=minitwr password=RWHart') or die('error' . pg_last_error()); if the pg_connect is causing the error, then this should give you a clue as to where the problem it. Tijnema ! wrote: > On 3/17/07, rwhartung <[EMAIL PROTECTED]> wrote: >> Hi, >> I have this short php script: [op;ening removed. >> >> >> $db = pg_connect('dbname=bpsimple user=minitwr password=RWHart') ; > >> print $db . "" . "\n" ; >> if ($db) >> { >>print 'Connection attempt succeeded.' . "" . "\n" ; >> } else >> { >>print 'Connection attempt failed.'. "" . "\n" ; >> } >> >> $query = 'SELECT fname, lname FROM customer' ; >> $result = pg_query($db, $query) ; >> while($myrow = pg_fetch_assoc($result) ) >> { >>print $myrow['fname'] . " " . $myrow['lname'] . "\n" ; >> } >> >> This works fine as a PHP script from the command line, but wrapped up in >> tags it refuses to connect with the database from within >> apache. All connections are local host. PHP otherwise works fine on >> the apache server and the code is identical on both the CL script and >> the test.php web page. Ideas? Where to start looking? >> >> TIA >> >> Bob > > One of the comments in the PHP Manual says this: > > If you use pg_connect('host=localhost port=5432 user=my_username > password=my_password dbname=my_dbname') and you get the following > error: > "Warning: pg_connect(): Unable to connect to PostgreSQL server: could > not connect to server: Connection refused Is the server running on > host localhost and accepting TCP/IP connections on port 5432?" > then you should try to leave the host= and port= parts out of the > connection string. This sounds strange, but this is an "option" of > Postgre. If you have not activated the TCP/IP port in postgresql.conf > then postgresql doesn't accept any incoming requests from an TCP/IP > port. If you use host= in your connection string you are going to > connect to Postgre via TCP/IP, so that's not going to work. If you > leave the host= part out of your connection string you connect to > Postgre via the Unix domain sockets, which is faster and more secure, > but you can't connect with the database via any other PC as the > localhost. > > I think that's what your problem is also, but not sure about it. > (using MySQL mostly) > > Tijnema >> >> -- >> 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] glob(path_pattern, GLOB_ONLYDIR)
Al wrote: I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4. I only want the dirs. This works; sort of: print_r(glob('../*',)); //It lists all the files AND directories. Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK, I can delete the files remember this is linux you are talking about, not windows. A '*' means anything, including a '.' This fails: print_r(glob('../*', GLOB_ONLYDIR)); well, double check your php version, because this should be built in whit the version that you are running. And I get: "Warning: glob() expects parameter 2 to be long, string given in foo" I can't find anything in the manual or when Googling. Anyone can explain this for me? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] works at command line but not in apache
On 3/18/07, rwhartung <[EMAIL PROTECTED]> wrote: Thanks, but I have these changes in and it still will not connect: file: pg_hba.conf: # IPv4 local connections: hostall all 127.0.0.1/32 ident sameuser postgrsql.conf: listen_addresses = 'localhost' port = 5432 It is my understanding that the current version 8.1+ now uses the generalized 'listen_addresses' in postgresql.conf instead of any tcp* = 'true' statements in this file. I also am assuming that the postgresql.conf file being read is that in the /var/lib/pgsql/data directory. I am connecting to localhost, need to make sure I can configure for tcpip, and am trying to login as a local user with a user account on the machine. Other ideas? I am not having much luck finding more in the docs. TIA Bob So, you want it to run through TCP/IP, then you need to add the host=localhost and port=5432 items to your pg_connect string $db = pg_connect('dbname=bpsimple user=minitwr password=RWHart') ; becomes: $db = pg_connect('host=localhost port=5432 dbname=bpsimple user=minitwr password=RWHart') ; Tijnema ! wrote: > On 3/17/07, rwhartung <[EMAIL PROTECTED]> wrote: >> Hi, >> I have this short php script: [op;ening removed. >> >> >> $db = pg_connect('dbname=bpsimple user=minitwr password=RWHart') ; > >> print $db . "" . "\n" ; >> if ($db) >> { >>print 'Connection attempt succeeded.' . "" . "\n" ; >> } else >> { >>print 'Connection attempt failed.'. "" . "\n" ; >> } >> >> $query = 'SELECT fname, lname FROM customer' ; >> $result = pg_query($db, $query) ; >> while($myrow = pg_fetch_assoc($result) ) >> { >>print $myrow['fname'] . " " . $myrow['lname'] . "\n" ; >> } >> >> This works fine as a PHP script from the command line, but wrapped up in >> tags it refuses to connect with the database from within >> apache. All connections are local host. PHP otherwise works fine on >> the apache server and the code is identical on both the CL script and >> the test.php web page. Ideas? Where to start looking? >> >> TIA >> >> Bob > > One of the comments in the PHP Manual says this: > > If you use pg_connect('host=localhost port=5432 user=my_username > password=my_password dbname=my_dbname') and you get the following > error: > "Warning: pg_connect(): Unable to connect to PostgreSQL server: could > not connect to server: Connection refused Is the server running on > host localhost and accepting TCP/IP connections on port 5432?" > then you should try to leave the host= and port= parts out of the > connection string. This sounds strange, but this is an "option" of > Postgre. If you have not activated the TCP/IP port in postgresql.conf > then postgresql doesn't accept any incoming requests from an TCP/IP > port. If you use host= in your connection string you are going to > connect to Postgre via TCP/IP, so that's not going to work. If you > leave the host= part out of your connection string you connect to > Postgre via the Unix domain sockets, which is faster and more secure, > but you can't connect with the database via any other PC as the > localhost. > > I think that's what your problem is also, but not sure about it. > (using MySQL mostly) > > Tijnema >> >> -- >> 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] works at command line but not in apache
rwhartung wrote: Hi, I have this short php script: [op;ening removed. $db = pg_connect('dbname=bpsimple user=minitwr password=RWHart') ; print $db . "" . "\n" ; if ($db) { print 'Connection attempt succeeded.' . "" . "\n" ; } else { print 'Connection attempt failed.'. "" . "\n" ; } $query = 'SELECT fname, lname FROM customer' ; $result = pg_query($db, $query) ; while($myrow = pg_fetch_assoc($result) ) { print $myrow['fname'] . " " . $myrow['lname'] . "\n" ; } This works fine as a PHP script from the command line, but wrapped up in tags it refuses to connect with the database from within apache. All connections are local host. PHP otherwise works fine on the apache server and the code is identical on both the CL script and the test.php web page. Ideas? Where to start looking? TIA Bob well, how about showing us the code that doesn't work also, I know you said it was the same, but what you have here is an incomplete script. Show us the entire script that you are using from the cli and the web. Also, give us the error, if any, that you are getting from the web script. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Getting last record ID created from DB
markw@mohawksoft.com wrote: On Sat, 2007-03-17 at 12:19 -0400, Mark wrote: Robert Cummings wrote: On Sat, 2007-03-17 at 09:43 -0500, Myron Turner wrote: Colin Guthrie wrote: Philip Thompson wrote: For auto increment values, you don't have to specify the id. For example: INSERT INTO t_users (f_name, l_name, e_mail, b_date, pic) VALUES ('$f_name', '$l_name', '$e_mail', '$b_date', null); Then to find the latest entry: SELECT user_id FROM t_users ORDER BY user_id DESC limit 1; This is not the cleanest way and some databases do not actually increment auto id fields (e.g. they could fill in the blanks from previous deletes etc.). Much better is to use the function in the MySQL API to get the insert id or if you really must use SQL, just run "SELECT LAST_INSERT_ID();" which does much the same thing. Col My own knowledge of mysql is about 5 years old and never really used. But I was recently asked to do something that required some mysql (noting too much, fortunately for me), so I've been doing some reading and am interested in questions that come up on the list. An earlier post called attention to a concurrency problem. Wouldn't getting the last inserted ID from LAST_INSERT_ID() suffer from the same limitations as any of the other solutions which do a select to get the last ID? No, it's a MySQL specific feature that is atomic with the insert and so you are guaranteed that the the returned ID is the exact automatic ID associated with the most recent INSERT for the connection handle. Unfortunately auto increment is MySQL specific and so it isn't transferrable to other database engines. The problem is if the ID returned is not somehow linked to the transaction which inserted the row. If you have an insert followed by a select to retrieve the ID, in the interrum, another user may be created by another process and you will retrieve the wrong ID. I don't believe this is an issue for MySQL. The last inserted ID isn't stored for the database table, it's stored for the connection to the database. As such there's no race condition unless the developer does something silly, like issue another insert over the same connection before requesting the previous last inserted id. Just to be sure though the following is from the MySQL online documentation: For LAST_INSERT_ID(), the most recently generated ID is maintained in the server on a per-connection basis. It is not changed by another client. It is not even changed if you update another AUTO_INCREMENT column with a non-magic value (that is, a value that is not NULL and not 0). Using LAST_INSERT_ID() and AUTO_INCREMENT columns simultaneously from multiple clients is perfectly valid. Each client will receive the last inserted ID for the last statement that client executed. http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html Cheers, Rob. -- There in lies the biggest problem with LAMP, and that's MySQL. The architecture of your methodology *only* works with MySQL, and not more capable databases like Oracle, DB2, or even PostgreSQL. I too thought the same thing, but was corrected when I starting working on a redesign for the billing system for the company that I am working for. They use PostgreSQL and we do have a auto incremented unique id field. It isn't call AUTO_INCREMENT, but rather a sequence value. It is a value that is controlled by the default value entry. It then runs this: nextval('customers_customer_id_seq'::regclass) and uses this as the value of the id field for the newly inserted row. Then instead of running a command like SELECT LAST_INSERT_ID(); you have to do some other stuff like this: $SQL = "SELECT currval('{$table}_{$column}_seq');"; If you rely on oddities of a particular system, then you are doomed to be stuck with it or pay the price of redesign when you need a more capable system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php