php-general Digest 19 Mar 2007 14:22:06 -0000 Issue 4685
Topics (messages 250792 through 250809):
Log Lib Recommendation
250792 by: John Comerford
250795 by: Nicholas Yim
250800 by: Chris
PECL help
250793 by: Mike Payson
250794 by: Mike Payson
Re: install problems
250796 by: Haydar TUNA
250798 by: jekillen
250799 by: Chris
crc32() and hash('crc32') Differ
250797 by: Morgan Doocy
Running PHP on a windows server-your views
250801 by: Angelo Zanetti
250803 by: Jochem Maas
Is there a open_basedir and curl followlocation bypass/fix?
250802 by: Mathijs
250804 by: Jochem Maas
250806 by: Mathijs
Re: some chinese barf
250805 by: Jochem Maas
php search engine
250807 by: Ross
PHP code only works on 1 server
250808 by: PHP
250809 by: Myron Turner
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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/
--- End Message ---
--- Begin Message ---
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 <not set>
Default Channel default_channel pear.php.net
HTTP Proxy Server Address http_proxy <not set>
PEAR server [DEPRECATED] master_server pear.php.net
Default Channel Mirror preferred_mirror pear.php.net
Remote Configuration File remote_config <not set>
PEAR executables directory bin_dir /home/maximumr/pear/pear
PEAR documentation directory doc_dir
/home/maximumr/pear/pear/docs
PHP extension directory ext_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 directory data_dir
/home/maximumr/pear/pear/data
PEAR Installer download download_dir /tmp/pear/cache
directory
PHP CLI/CGI binary php_bin /usr/local/bin/php
php.ini location php_ini <not set>
PEAR Installer temp directory temp_dir /tmp/pear/temp
PEAR test directory test_dir
/home/maximumr/pear/pear/tests
Cache TimeToLive cache_ttl 3600
Preferred Package State preferred_state stable
Unix file mask umask 22
Debug Log Level verbose 1
PEAR password (for password <not set>
maintainers)
Signature Handling Program sig_bin /usr/bin/gpg
Signature Key Directory sig_keydir /usr/local/etc/pearkeys
Signature Key Id sig_keyid <not set>
Package Signature Type sig_type gpg
PEAR username (for username <not set>
maintainers)
User Configuration File Filename /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?
--- End Message ---
--- Begin Message ---
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 <not set>
Default Channel default_channel pear.php.net
HTTP Proxy Server Address http_proxy <not set>
PEAR server [DEPRECATED] master_server pear.php.net
Default Channel Mirror preferred_mirror pear.php.net
Remote Configuration File remote_config <not set>
PEAR executables directory bin_dir /home/maximumr/pear/pear
PEAR documentation directory doc_dir
/home/maximumr/pear/pear/docs
PHP extension directory ext_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 directory data_dir
/home/maximumr/pear/pear/data
PEAR Installer download download_dir /tmp/pear/cache
directory
PHP CLI/CGI binary php_bin /usr/local/bin/php
php.ini location php_ini <not set>
PEAR Installer temp directory temp_dir /tmp/pear/temp
PEAR test directory test_dir
/home/maximumr/pear/pear/tests
Cache TimeToLive cache_ttl 3600
Preferred Package State preferred_state stable
Unix file mask umask 22
Debug Log Level verbose 1
PEAR password (for password <not set>
maintainers)
Signature Handling Program sig_bin /usr/bin/gpg
Signature Key Directory sig_keydir /usr/local/etc/pearkeys
Signature Key Id sig_keyid <not set>
Package Signature Type sig_type gpg
PEAR username (for username <not set>
maintainers)
User Configuration File Filename /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?
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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/
--- End Message ---
--- Begin Message ---
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:
<?php
$message = "foo";
$crc32 = crc32($message);
$hash_crc32 = hash('crc32', $message);
$hash_crc32b = hash('crc32b', $message);
$data = array (
array (
sprintf('%+011d', $crc32), // signed integer
sprintf('%010u', $crc32), // unsigned integer
dechex($crc32), // hexadecimal
sprintf('%032b', $crc32) // binary
),
array (
sprintf('%+011d', hexdec($hash_crc32)),
sprintf('%010u', hexdec($hash_crc32)),
$hash_crc32,
sprintf('%032b', hexdec($hash_crc32))
),
array (
sprintf('%+011d', hexdec($hash_crc32b)),
sprintf('%010u', hexdec($hash_crc32b)),
$hash_crc32b,
sprintf('%032b', hexdec($hash_crc32b))
)
);
echo join("\n", array_map(create_function('$vals', 'return join(" =>
", $vals);'), array_values($data)));
?>
Output:
-1938594527 => 2356372769 => 8c736521 => 10001100011100110110010100100001
-1513816503 => 2781150793 => a5c4fe49 => 10100101110001001111111001001001
+0560296844 => 0560296844 => 2165738c => 00100001011001010111001110001100
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
--- End Message ---
--- Begin Message ---
HI all.
I would like some honest answers and if you have any experience with
problems or no problems running PHP on a windows server.
Basically we are interested to know if there are any problems/security
issues/stability issues/performance issues or any other issues running a
production site (big live site) on a windows server.
Im assuming it will be running IIS.
The site is very important and any issues will hamper the functionality
and accessibility of the site.
All your responses will be greatly appreciated.
TIA
Angelo
--
--- End Message ---
--- Begin Message ---
Angelo Zanetti wrote:
> HI all.
>
> I would like some honest answers and if you have any experience with
> problems or no problems running PHP on a windows server.
>
> Basically we are interested to know if there are any problems/security
> issues/stability issues/performance issues or any other issues running a
> production site (big live site) on a windows server.
how big is big? serverfarm big? if it is that big then you have probably already
missed the boat - stability, security, performance & scalability should be
with in the realm of the known if your site is that high traffic. jmho.
>
> Im assuming it will be running IIS.
from memory I recall Zend going into partnership with M$ and they
were/are pushing the use of the FastCGI php SAPI in conjunction with IIS.
from what I gather this combo is stable and fast - you'd think Zend+M$ would
have
enough resources to make it work ... I have no experience (and don't intend
to get any ;-) with this setup but you can STW for more info on this and maybe
come to some kind of useful conclusion.
>
> The site is very important and any issues will hamper the functionality
> and accessibility of the site.
I have N*100 customers that say exactly the same thing about their own sites ;-)
>
> All your responses will be greatly appreciated.
>
> TIA
> Angelo
--- End Message ---
--- Begin Message ---
Hello there,
I Need a bypass to have followlocation working while open_basedir is in
affect.
I Don't see why we can't enable/disable this protection by our selfs
when needed.
Keep the protection enabled by default, and let the ppl disable it if
they realy want to.
Anyway, how can i bypass this the easy way.
Thx in advanced.
--- End Message ---
--- Begin Message ---
Mathijs wrote:
> Hello there,
>
> I Need a bypass to have followlocation working while open_basedir is in
> affect.
>
> I Don't see why we can't enable/disable this protection by our selfs
> when needed.
we can't see past the choices we don't understand though can we?
>
> Keep the protection enabled by default, and let the ppl disable it if
> they realy want to.
well you go and code the routines that make that work without completely
raping any form of security that is currently offered by open_basedir - put
another
way: if it was that easy someone would have done it by now.
>
> Anyway, how can i bypass this the easy way.
add the symlinked location to the the open_basedir directive??
>
> Thx in advanced.
>
--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
Mathijs wrote:
Hello there,
I Need a bypass to have followlocation working while open_basedir is in
affect.
I Don't see why we can't enable/disable this protection by our selfs
when needed.
we can't see past the choices we don't understand though can we?
Keep the protection enabled by default, and let the ppl disable it if
they realy want to.
well you go and code the routines that make that work without completely
raping any form of security that is currently offered by open_basedir - put
another
way: if it was that easy someone would have done it by now.
Anyway, how can i bypass this the easy way.
add the symlinked location to the the open_basedir directive??
Thx in advanced.
Well it is an HTTP site where the re-location come's from.
And it is very irritating when i need to do the header locations my self.
But if there is no setting i can change i think i need to do it my self.
a shame that this can't be fixed on an easy way.
Thx anyway :).
Regards,
Mathijs.
--- End Message ---
--- Begin Message ---
Tijnema ! wrote:
> On 3/15/07, Andrei <[EMAIL PROTECTED]> wrote:
>> LOL...
>> Why you even bother to read it?
>
> Because i hate SPAM !
wtf - how twisted is that logic?
by that logic I'd have to conclude that you regularly
gouge your own eyes out with a rusty spoon - based on the
assumption that you'd hate that too.
besides have you ever tasted SPAM? it's pretty cheap and nasty
but I don't think it's so bad that it warrants outright hatred -
any childhood SPAM trauma not withstanding.
--- End Message ---
--- Begin Message ---
Hi,
I am looking for a php search engine that provides a suggested words
(soundex?) when items are misspelt, the way google does.
I have used http://www.site-search-pro.com/ i n the past which is great but
as far as I know this feature is not included.
Ross
--- End Message ---
--- Begin Message ---
Dear All,
I wrote a simple PHP 404 handler (index.php)(see the code below) to catch
missing pages for instance. But it only works on 1 server and not the other.
This is the server where it works:
My Server:
http://www.orbitalnets.com/support/info.php
This is the server where it won't work (which is the server where it should
work):
Setarnet:
http://www.kabga.aw/info.php
Could it be the version difference? How should it be coded to work on all
php servers?
Here is the code of the index.php file.
<?php
$errormsg .= "<div align=\"center\"><a
href=\"http://www.kabga.aw/nl/index.php\"><img
src=\"images/body/logo-kabga.gif\" width=\"215\" height=\"49\"
border=\"0\"></a> </font></strong>";
$errormsg .= "<strong><font color=\"#333333\" size=\"-1\" face=\"Verdana,
Arial, Helvetica, sans-serif\"><br>";
$errormsg .= "404 File not found<br><br><br><br><a
href=\"mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a><br><br>";
$errormsg .= " Tel: +297 582-4455<br>Fax: +297 582-2018<br><br></div>";
$navsignthing = "$page";
$extension = "php";
if(file_exists("$navsignthing.$extension"))
{
include "$navsignthing.$extension";
}
elseif($navsignthing=="")
{
include "default.$extension";
}
else
{
echo "$errormsg";
}
?>
Please let me know,
Dwayne Heronimo
--- End Message ---
--- Begin Message ---
PHP wrote:
Dear All,
I wrote a simple PHP 404 handler (index.php)(see the code below) to catch
missing pages for instance. But it only works on 1 server and not the other.
This is the server where it works:
My Server:
http://www.orbitalnets.com/support/info.php
This is the server where it won't work (which is the server where it should
work):
Setarnet:
http://www.kabga.aw/info.php
Could it be the version difference? How should it be coded to work on all
php servers?
Here is the code of the index.php file.
<?php
$errormsg .= "<div align=\"center\"><a
href=\"http://www.kabga.aw/nl/index.php\"><img
src=\"images/body/logo-kabga.gif\" width=\"215\" height=\"49\"
border=\"0\"></a> </font></strong>";
$errormsg .= "<strong><font color=\"#333333\" size=\"-1\" face=\"Verdana,
Arial, Helvetica, sans-serif\"><br>";
$errormsg .= "404 File not found<br><br><br><br><a
href=\"mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a><br><br>";
$errormsg .= " Tel: +297 582-4455<br>Fax: +297 582-2018<br><br></div>";
$navsignthing = "$page";
$extension = "php";
if(file_exists("$navsignthing.$extension"))
{
include "$navsignthing.$extension";
}
elseif($navsignthing=="")
{
include "default.$extension";
}
else
{
echo "$errormsg";
}
?>
Please let me know,
Dwayne Heronimo
This isn't a php issue but an apache issue. Have you checked to make
sure that apache redirects the 404 to your custom error message?
http://httpd.apache.org/docs/2.2/mod/core.html#errordocument
--
_____________________
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/
--- End Message ---