After demoing 0.7 at the Sourceforge (PHP 4.X) site, I tried to install 0.8 into PHP 5.X. After resolving some PHP5 issues and some Policy Targeted issues, I continue to receive (in ssl_error_log)
[Tue Jun 06 16:53:29 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant PHPKI_VERSION - assumed 'PHPKI_VERSION' in /var/www/html/phpki/config.php on line 2, referer: https://flood/phpki/
[Tue Jun 06 16:53:29 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant STORE_DIR - assumed 'STORE_DIR' in /var/www/html/phpki/config.php on line 3, referer: https://flood/phpki/
[Tue Jun 06 16:53:29 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant openssl_bin - assumed 'openssl_bin' in /var/www/phpki-store/config/config.php on line 75, referer: https://flood/phpki/
[Tue Jun 06 16:53:29 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: PHP_AUTH_USER in /var/www/html/phpki/include/common.php on line 8, referer: https://flood/phpki/
[Tue Jun 06 16:53:29 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: stage in /var/www/html/phpki/include/my_functions.php on line 66, referer: https://flood/phpki/
The PHP_AUTH_USER error is only present when not using basic authorization, so the secure.sh script and a little tweaking probably set that up correctly.
Are the other errors issues? And any hints to help out on resolving other issues prior to your next release?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A little more effort resolved most issues. I've thrown together a RPM for FC 5, which organizes the minor changes required for PHP5 and Policy Targeted. Below are some log files to illustrate the majority of notices being generated. Other than plug up the log files, they seem harmless.
When selecting "Generate Certificate"(/phpki/ca/) and proceeding to certificate issue, the following is output to these logfiles:
BEGIN /var/log/messages
Jun 7 10:25:02 flood kernel: audit(1149701102.518:381): avc: denied { search } for pid=5950 comm="openssl" name="pki" dev=sda3 ino=1437604 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:cert_t:s0 tclass=dir
Jun 7 10:25:02 flood kernel: audit(1149701102.902:382): avc: denied { search } for pid=5952 comm="openssl" name="pki" dev=sda3 ino=1437604 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:cert_t:s0 tclass=dir
Jun 7 10:25:02 flood kernel: audit(1149701102.970:383): avc: denied { search } for pid=5954 comm="openssl" name="pki" dev=sda3 ino=1437604 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:cert_t:s0 tclass=dir
Jun 7 10:25:02 flood kernel: audit(1149701102.970:384): avc: denied { search } for pid=5954 comm="openssl" name="pki" dev=sda3 ino=1437604 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:cert_t:s0 tclass=dir
Jun 7 10:25:03 flood kernel: audit(1149701102.998:385): avc: denied { search } for pid=5956 comm="openssl" name="pki" dev=sda3 ino=1437604 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:cert_t:s0 tclass=dir
END
BEGIN /var/log/httpd/ssl_error_log
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant PHPKI_VERSION - assumed 'PHPKI_VERSION' in /var/www/html/phpki/config.php on line 2, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant STORE_DIR - assumed 'STORE_DIR' in /var/www/html/phpki/config.php on line 3, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant DEMO - assumed 'DEMO' in /var/www/html/phpki/config.php on line 4, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /var/www/html/phpki/config.php on line 5, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant openssl_bin - assumed 'openssl_bin' in /var/www/phpki-store/config/config.php on line 75, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: form_stage in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: submit in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: country in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: province in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: locality in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: organization in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: unit in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: common_name in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: email in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: passwd in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: passwdv in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: expiry in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: keysize in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: cert_type in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant PHPKI_VERSION - assumed 'PHPKI_VERSION' in /var/www/html/phpki/config.php on line 2, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant STORE_DIR - assumed 'STORE_DIR' in /var/www/html/phpki/config.php on line 3, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant DEMO - assumed 'DEMO' in /var/www/html/phpki/config.php on line 4, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /var/www/html/phpki/config.php on line 5, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant openssl_bin - assumed 'openssl_bin' in /var/www/phpki-store/config/config.php on line 75, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: form_stage in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: submit in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: country in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: province in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: locality in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: organization in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: unit in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: common_name in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: email in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: passwd in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: passwdv in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: expiry in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: keysize in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: cert_type in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
END
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have yet to use the application with PHP5. Hopefully soon. On PHP4 Debian Sarge, I am not seeing these messages in the logs. If you discover the cause of the messages before I have the opportunity, please let me know.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Seems like PHP is dumping its logs in Apache's logfiles. You could try editing php.ini to force PHP to dump its logs in its own separate file:
log_errors = On
error_log = "/some/path/php.log"
That would clearly separate Apache logs from PHP, which is a Good Thing(tm).
See also php.ini's section about "Error handling and logging", which tells you how much logging you want PHP to do, among other nifty things. Your current configuration makes PHP log everything under Sol (down to notices, which aren't even errors).
There aren't any error in your log, only notices about non-initialized variables (a not-cool thing to do since PHP4, at least from PHP's point of view), or in this case not-initalized members of an array:
Undefined index: form_stage
for exemple, means that $foo["form_stage"] has been used (most probably in a test) before it has been created by a $foo["form_stage"]="bar"; or something like that.
PHP doesn't really care and considers $foo["form_stage"] as "false", but it still makes a notice in its log, because that's just not a clean thing to do. The code goes on its merry way, like it's supposed to do, and does not misbehave in any way.
If no message appears in Mr Roadcap's log, it's most probably because error_reporting in his php.ini has been set to E_ALL & ~E_NOTICE, meaning "every log level except notices". Incidentally, this is not an issue of PHP4 vs PHP5. Both act the same, only the default configuration could vary from one distro to the other: ie. Mandriva could enable every log while Debian could disable notices.
I myself try to initialize every variable before using it, but that's merely to get rid of these annoying 'notice' lines in my log, and absolutely not part of some 'True Way' of programming. I could set error_reporting to E_ALL & ~E_NOTICE and get rid of the problem completely without missing any warning or error report, but I'm just too lazy.
Hope that helps somehow.
N.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The "undefined constant" warnings are caused by a bug in the installation & setup script. The script fails to enclose the constants in quotes when it creates config.php. Simply edit your config.php and enclose the offending constants in single quotes. I will fix this in v0.82.
Most of the warnings appear to be coming from the gpvar() function, which attempts to retrieve and strip slashes from a specified GET or POST variable ($v). For security, POST variables override GET variables. If $v is not in GETs but is in POSTs, line 65 generates a warning. This should be harmless, but there is probably a cleaner way to do this.
function gpvar($v) {
global $HTTP_GET_VARS, $HTTP_POST_VARS;
$x = $HTTP_GET_VARS[$v];
if ($HTTP_POST_VARS[$v]) $x = $HTTP_POST_VARS[$v];
if (get_magic_quotes_gpc()) $x = stripslashes($x);
return $x;
}
Perhaps this version of the function will silence the warnings.
function gpvar($v) {
global $HTTP_GET_VARS, $HTTP_POST_VARS;
$x = "";
if ($HTTP_GET_VARS[$v]) $x = $HTTP_GET_VARS[$v];
if ($HTTP_POST_VARS[$v]) $x = $HTTP_POST_VARS[$v];
if (get_magic_quotes_gpc()) $x = stripslashes($x);
return $x;
}
My PHP skills were lacking to begin with, and have become terribly rusty since the advent of Ruby on Rails. Someone please let me know if I am wrong about whether this is harmless and/or offer a clean way to accomplish this function's task.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After demoing 0.7 at the Sourceforge (PHP 4.X) site, I tried to install 0.8 into PHP 5.X. After resolving some PHP5 issues and some Policy Targeted issues, I continue to receive (in ssl_error_log)
[Tue Jun 06 16:53:29 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant PHPKI_VERSION - assumed 'PHPKI_VERSION' in /var/www/html/phpki/config.php on line 2, referer: https://flood/phpki/
[Tue Jun 06 16:53:29 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant STORE_DIR - assumed 'STORE_DIR' in /var/www/html/phpki/config.php on line 3, referer: https://flood/phpki/
[Tue Jun 06 16:53:29 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant openssl_bin - assumed 'openssl_bin' in /var/www/phpki-store/config/config.php on line 75, referer: https://flood/phpki/
[Tue Jun 06 16:53:29 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: PHP_AUTH_USER in /var/www/html/phpki/include/common.php on line 8, referer: https://flood/phpki/
[Tue Jun 06 16:53:29 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: stage in /var/www/html/phpki/include/my_functions.php on line 66, referer: https://flood/phpki/
The PHP_AUTH_USER error is only present when not using basic authorization, so the secure.sh script and a little tweaking probably set that up correctly.
Are the other errors issues? And any hints to help out on resolving other issues prior to your next release?
A little more effort resolved most issues. I've thrown together a RPM for FC 5, which organizes the minor changes required for PHP5 and Policy Targeted. Below are some log files to illustrate the majority of notices being generated. Other than plug up the log files, they seem harmless.
When selecting "Generate Certificate"(/phpki/ca/) and proceeding to certificate issue, the following is output to these logfiles:
BEGIN /var/log/messages
Jun 7 10:25:02 flood kernel: audit(1149701102.518:381): avc: denied { search } for pid=5950 comm="openssl" name="pki" dev=sda3 ino=1437604 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:cert_t:s0 tclass=dir
Jun 7 10:25:02 flood kernel: audit(1149701102.902:382): avc: denied { search } for pid=5952 comm="openssl" name="pki" dev=sda3 ino=1437604 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:cert_t:s0 tclass=dir
Jun 7 10:25:02 flood kernel: audit(1149701102.970:383): avc: denied { search } for pid=5954 comm="openssl" name="pki" dev=sda3 ino=1437604 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:cert_t:s0 tclass=dir
Jun 7 10:25:02 flood kernel: audit(1149701102.970:384): avc: denied { search } for pid=5954 comm="openssl" name="pki" dev=sda3 ino=1437604 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:cert_t:s0 tclass=dir
Jun 7 10:25:03 flood kernel: audit(1149701102.998:385): avc: denied { search } for pid=5956 comm="openssl" name="pki" dev=sda3 ino=1437604 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:cert_t:s0 tclass=dir
END
BEGIN /var/log/httpd/ssl_error_log
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant PHPKI_VERSION - assumed 'PHPKI_VERSION' in /var/www/html/phpki/config.php on line 2, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant STORE_DIR - assumed 'STORE_DIR' in /var/www/html/phpki/config.php on line 3, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant DEMO - assumed 'DEMO' in /var/www/html/phpki/config.php on line 4, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /var/www/html/phpki/config.php on line 5, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant openssl_bin - assumed 'openssl_bin' in /var/www/phpki-store/config/config.php on line 75, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: form_stage in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: submit in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: country in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: province in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: locality in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: organization in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: unit in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: common_name in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: email in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: passwd in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: passwdv in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: expiry in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: keysize in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:24:59 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: cert_type in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant PHPKI_VERSION - assumed 'PHPKI_VERSION' in /var/www/html/phpki/config.php on line 2, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant STORE_DIR - assumed 'STORE_DIR' in /var/www/html/phpki/config.php on line 3, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant DEMO - assumed 'DEMO' in /var/www/html/phpki/config.php on line 4, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /var/www/html/phpki/config.php on line 5, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Use of undefined constant openssl_bin - assumed 'openssl_bin' in /var/www/phpki-store/config/config.php on line 75, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: form_stage in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: submit in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: country in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: province in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: locality in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: organization in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: unit in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: common_name in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: email in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: passwd in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: passwdv in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: expiry in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: keysize in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
[Wed Jun 07 10:25:02 2006] [error] [client 192.168.1.11] PHP Notice: Undefined index: cert_type in /var/www/html/phpki/include/my_functions.php on line 65, referer: https://flood/phpki/ca/request_cert.php
END
I have yet to use the application with PHP5. Hopefully soon. On PHP4 Debian Sarge, I am not seeing these messages in the logs. If you discover the cause of the messages before I have the opportunity, please let me know.
It's unclear to me whether or not the application appears to be working and/or these are warnings or errors.
Sorry, no PHP5 on my box yet.
Seems like PHP is dumping its logs in Apache's logfiles. You could try editing php.ini to force PHP to dump its logs in its own separate file:
log_errors = On
error_log = "/some/path/php.log"
That would clearly separate Apache logs from PHP, which is a Good Thing(tm).
See also php.ini's section about "Error handling and logging", which tells you how much logging you want PHP to do, among other nifty things. Your current configuration makes PHP log everything under Sol (down to notices, which aren't even errors).
There aren't any error in your log, only notices about non-initialized variables (a not-cool thing to do since PHP4, at least from PHP's point of view), or in this case not-initalized members of an array:
Undefined index: form_stage
for exemple, means that $foo["form_stage"] has been used (most probably in a test) before it has been created by a $foo["form_stage"]="bar"; or something like that.
PHP doesn't really care and considers $foo["form_stage"] as "false", but it still makes a notice in its log, because that's just not a clean thing to do. The code goes on its merry way, like it's supposed to do, and does not misbehave in any way.
If no message appears in Mr Roadcap's log, it's most probably because error_reporting in his php.ini has been set to E_ALL & ~E_NOTICE, meaning "every log level except notices". Incidentally, this is not an issue of PHP4 vs PHP5. Both act the same, only the default configuration could vary from one distro to the other: ie. Mandriva could enable every log while Debian could disable notices.
I myself try to initialize every variable before using it, but that's merely to get rid of these annoying 'notice' lines in my log, and absolutely not part of some 'True Way' of programming. I could set error_reporting to E_ALL & ~E_NOTICE and get rid of the problem completely without missing any warning or error report, but I'm just too lazy.
Hope that helps somehow.
N.
The "undefined constant" warnings are caused by a bug in the installation & setup script. The script fails to enclose the constants in quotes when it creates config.php. Simply edit your config.php and enclose the offending constants in single quotes. I will fix this in v0.82.
Most of the warnings appear to be coming from the gpvar() function, which attempts to retrieve and strip slashes from a specified GET or POST variable ($v). For security, POST variables override GET variables. If $v is not in GETs but is in POSTs, line 65 generates a warning. This should be harmless, but there is probably a cleaner way to do this.
function gpvar($v) {
global $HTTP_GET_VARS, $HTTP_POST_VARS;
$x = $HTTP_GET_VARS[$v];
if ($HTTP_POST_VARS[$v]) $x = $HTTP_POST_VARS[$v];
if (get_magic_quotes_gpc()) $x = stripslashes($x);
return $x;
}
Perhaps this version of the function will silence the warnings.
function gpvar($v) {
global $HTTP_GET_VARS, $HTTP_POST_VARS;
$x = "";
if ($HTTP_GET_VARS[$v]) $x = $HTTP_GET_VARS[$v];
if ($HTTP_POST_VARS[$v]) $x = $HTTP_POST_VARS[$v];
if (get_magic_quotes_gpc()) $x = stripslashes($x);
return $x;
}
My PHP skills were lacking to begin with, and have become terribly rusty since the advent of Ruby on Rails. Someone please let me know if I am wrong about whether this is harmless and/or offer a clean way to accomplish this function's task.