LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 03-20-2014, 12:48 PM   #16
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343

Quote:
bathory: I changed the location to /tmp/php.log and restarted httpd. Still no file written.
Huh. Are you sure you're editing the correct php.ini? Run:
Code:
php -i|grep php.ini
to find its location

Also check if you have libpng installed and that php supports png:
Code:
rpm -qa|grep png
php -i|grep -i png
 
Old 03-20-2014, 01:44 PM   #17
billquinn
Member
 
Registered: May 2005
Posts: 40

Original Poster
Rep: Reputation: 1
Yes, the mystery deepens!

(1) It's getting so that I can't even run a simple command without getting strange results. I ran php -i|grep php.ini both as root and as me:

Code:
[root@localhost1 log]# php -i|grep php.ini
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
Code:
[kmorgan@localhost1 tmp]$ php -i|grep php.ini
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in Unknown on line 0
It looks like I was modifying the correct file. But what is this business about timezones?

(2) Here's the output to the rpm:

Code:
[root@localhost1 log]# rpm -qa | grep png
dvipng-1.11-3.2.el6.i686
libpng-1.2.49-1.el6_2.i686
(3) And last but not least (this is incredible):

Code:
[root@localhost1 log]# php -i|grep -i png
Configure Command =>  './configure'  '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' '--target=i686-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-sqlite' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--enable-force-cgi-redirect' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-mbstring=shared' '--enable-mbregex' '--with-gd=shared' '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/lib/mysql/mysql_config' '--enable-dom=shared' '--with-pgsql=shared' '--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-fastcgi' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr/lib/mysql/mysql_config' '--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--with-sqlite3=shared,/usr' '--enable-json=shared' '--enable-zip=shared' '--without-readline' '--with-libedit' '--with-pspell=shared' '--enable-phar=shared' '--with-tidy=shared,/usr' '--enable-sysvmsg=shared' '--enable-sysvshm=shared' '--enable-sysvsem=shared' '--enable-posix=shared' '--with-unixODBC=shared,/usr' '--enable-fileinfo=shared' '--enable-intl=shared' '--with-icu-dir=/usr' '--with-enchant=shared,/usr' '--with-recode=shared,/usr'
PNG Support => enabled
libPNG Version => 1.2.49
LS_COLORS => rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
SERVER["LS_COLORS"] => rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
[root@localhost1 log]#
 
Old 03-20-2014, 02:31 PM   #18
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
1.
Quote:
It looks like I was modifying the correct file. But what is this business about timezones?
Don't bother. If you want to get rid of the warning use
Code:
date.timezone = GMT
Replace GMT with your timezone (e.g. America/Los_Angeles, Europe/Paris etc)

2. Everything looks correct. What happens if you run the script from CLI:
Code:
php /var/www/html/BibleWebSite/show-captcha.php
 
Old 03-20-2014, 02:49 PM   #19
billquinn
Member
 
Registered: May 2005
Posts: 40

Original Poster
Rep: Reputation: 1
Now we've finally got some error messages! If there's a way to attach files, I can attach any you'd like to see.

Code:
[kmorgan@localhost1 tmp]$ php /var/www/html/BibleWebSite/show-captcha.php
Enter fgcontactform Enter class phpmailer Enter captcha creator PHP Warning:  session_start(): open(/var/lib/php/session/sess_13s1dal7ak4eqoup3t7tt75qc2, O_RDWR) failed: Permission denied (13) in /var/www/html/BibleWebSite/show-captcha.php on line 13
PHP Warning:  session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/html/BibleWebSite/fgcontactform.php:3) in /var/www/html/BibleWebSite/show-captcha.php on line 13
PHP Warning:  session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/BibleWebSite/fgcontactform.php:3) in /var/www/html/BibleWebSite/show-captcha.php on line 13
PHP Warning:  Cannot modify header information - headers already sent by (output started at /var/www/html/BibleWebSite/fgcontactform.php:3) in /var/www/html/BibleWebSite/show-captcha.php on line 33
PHP Warning:  Cannot modify header information - headers already sent by (output started at /var/www/html/BibleWebSite/fgcontactform.php:3) in /var/www/html/BibleWebSite/show-captcha.php on line 34
PHP Notice:  Undefined index: SERVER_NAME in /var/www/html/BibleWebSite/captcha-creator.php on line 273
PHP Notice:  Undefined index: REMOTE_ADDR in /var/www/html/BibleWebSite/captcha-creator.php on line 273
PHP Notice:  Undefined index: SERVER_NAME in /var/www/html/BibleWebSite/captcha-creator.php on line 273
PHP Notice:  Undefined index: REMOTE_ADDR in /var/www/html/BibleWebSite/captcha-creator.php on line 273
PHP Warning:  imagettfbbox(): Could not find/open font in /var/www/html/BibleWebSite/captcha-creator.php on line 156
PHP Warning:  imagecreate(): Invalid image dimensions in /var/www/html/BibleWebSite/captcha-creator.php on line 192
PHP Warning:  imagecolorallocate() expects parameter 1 to be resource, boolean given in /var/www/html/BibleWebSite/captcha-creator.php on line 193
PHP Warning:  imagecolortransparent() expects parameter 1 to be resource, boolean given in /var/www/html/BibleWebSite/captcha-creator.php on line 194
PHP Warning:  imagecolorallocate() expects parameter 1 to be resource, boolean given in /var/www/html/BibleWebSite/captcha-creator.php on line 197
PHP Warning:  imagettftext() expects parameter 1 to be resource, boolean given in /var/www/html/BibleWebSite/captcha-creator.php on line 206
PHP Notice:  Undefined property: FGCaptchaCreator::$logger in /var/www/html/BibleWebSite/captcha-creator.php on line 208
PHP Fatal error:  Call to a member function LogError() on a non-object in /var/www/html/BibleWebSite/captcha-creator.php on line 208
PHP Warning:  Unknown: open(/var/lib/php/session/sess_13s1dal7ak4eqoup3t7tt75qc2, O_RDWR) failed: Permission denied (13) in Unknown on line 0
PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0
The one "fatal" error refers to line 208 in captcha-creator.php. Here's that line and its context:

Code:
$x = $left < 0? abs($left):0;
if(!imagettftext($image_char, $font_size, $angle, $left, $top,
        $textcolor, $this->font_file , mb_substr($code, $i, 1,'UTF-8')))
{
     $this->logger->LogError("imagettftext failed");
}

Last edited by billquinn; 03-20-2014 at 02:54 PM.
 
Old 03-20-2014, 03:14 PM   #20
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
Enter fgcontactform Enter class phpmailer Enter captcha creator PHP Warning: session_start(): open(/var/lib/php/session/sess_13s1dal7ak4eqoup3t7tt75qc2, O_RDWR) failed: Permission denied (13) in /var/www/html/BibleWebSite/show-captcha.php on line 13
Try to change the save_path to some place writable by apache user:
Code:
session.save_path = "/tmp"
Also check if it's SELinux that is causing these errors
 
Old 03-20-2014, 03:45 PM   #21
billquinn
Member
 
Registered: May 2005
Posts: 40

Original Poster
Rep: Reputation: 1
First, I never have SELinux enabled. The save path used to be:

session.save_path = "/var/lib/php/session"

I changed it as you said to:

session.save_path = "/tmp"

I restarted httpd and then issued the php command again:

php /var/www/html/BibleWebSite/show-captcha.php

This is now the output:

Code:
[kmorgan@localhost1 tmp]$ 
[kmorgan@localhost1 tmp]$ php /var/www/html/BibleWebSite/show-captcha.php
Enter fgcontactform Enter class phpmailer Enter captcha creator PHP Warning:  session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/html/BibleWebSite/fgcontactform.php:3) in /var/www/html/BibleWebSite/show-captcha.php on line 13
PHP Warning:  session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/BibleWebSite/fgcontactform.php:3) in /var/www/html/BibleWebSite/show-captcha.php on line 13
PHP Warning:  Cannot modify header information - headers already sent by (output started at /var/www/html/BibleWebSite/fgcontactform.php:3) in /var/www/html/BibleWebSite/show-captcha.php on line 33
PHP Warning:  Cannot modify header information - headers already sent by (output started at /var/www/html/BibleWebSite/fgcontactform.php:3) in /var/www/html/BibleWebSite/show-captcha.php on line 34
PHP Notice:  Undefined index: SERVER_NAME in /var/www/html/BibleWebSite/captcha-creator.php on line 273
PHP Notice:  Undefined index: REMOTE_ADDR in /var/www/html/BibleWebSite/captcha-creator.php on line 273
PHP Notice:  Undefined index: SERVER_NAME in /var/www/html/BibleWebSite/captcha-creator.php on line 273
PHP Notice:  Undefined index: REMOTE_ADDR in /var/www/html/BibleWebSite/captcha-creator.php on line 273
PHP Warning:  imagettfbbox(): Could not find/open font in /var/www/html/BibleWebSite/captcha-creator.php on line 156
PHP Warning:  imagecreate(): Invalid image dimensions in /var/www/html/BibleWebSite/captcha-creator.php on line 192
PHP Warning:  imagecolorallocate() expects parameter 1 to be resource, boolean given in /var/www/html/BibleWebSite/captcha-creator.php on line 193
PHP Warning:  imagecolortransparent() expects parameter 1 to be resource, boolean given in /var/www/html/BibleWebSite/captcha-creator.php on line 194
PHP Warning:  imagecolorallocate() expects parameter 1 to be resource, boolean given in /var/www/html/BibleWebSite/captcha-creator.php on line 197
PHP Warning:  imagettftext() expects parameter 1 to be resource, boolean given in /var/www/html/BibleWebSite/captcha-creator.php on line 206
PHP Notice:  Undefined property: FGCaptchaCreator::$logger in /var/www/html/BibleWebSite/captcha-creator.php on line 208
PHP Fatal error:  Call to a member function LogError() on a non-object in /var/www/html/BibleWebSite/captcha-creator.php on line 208
[kmorgan@localhost1 tmp]$
 
Old 03-20-2014, 07:28 PM   #22
billquinn
Member
 
Registered: May 2005
Posts: 40

Original Poster
Rep: Reputation: 1
Progress!!

I was looking over the output to

php /var/www/html/BibleWebSite/show-captcha.php

in my previous post #21. A lot of times the first "error" in a program generates many of the subsequent errors. So I took a look at item one in the output:

"Enter fgcontactform Enter class phpmailer Enter captcha creator PHP Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/html/BibleWebSite/fgcontactform.php:3) in /var/www/html/BibleWebSite/show-captcha.php on line 13"

The three "Enter" statements were debugging echo comments that I put as the first line in all the php functions except show-captcha.php. So just to see if it had any effect, I took them all out, and ran the php command again. The new set of "errors" is this:

Code:
[kmorgan@localhost1 ~]$ php /var/www/html/BibleWebSite/show-captcha.php
PHP Notice:  Undefined index: SERVER_NAME in /var/www/html/BibleWebSite/captcha-creator.php on line 271
PHP Notice:  Undefined index: REMOTE_ADDR in /var/www/html/BibleWebSite/captcha-creator.php on line 271
PHP Notice:  Undefined index: SERVER_NAME in /var/www/html/BibleWebSite/captcha-creator.php on line 271
PHP Notice:  Undefined index: REMOTE_ADDR in /var/www/html/BibleWebSite/captcha-creator.php on line 271
PHP Warning:  imagettfbbox(): Could not find/open font in /var/www/html/BibleWebSite/captcha-creator.php on line 154
PHP Warning:  imagecreate(): Invalid image dimensions in /var/www/html/BibleWebSite/captcha-creator.php on line 190
PHP Warning:  imagecolorallocate() expects parameter 1 to be resource, boolean given in /var/www/html/BibleWebSite/captcha-creator.php on line 191
PHP Warning:  imagecolortransparent() expects parameter 1 to be resource, boolean given in /var/www/html/BibleWebSite/captcha-creator.php on line 192
PHP Warning:  imagecolorallocate() expects parameter 1 to be resource, boolean given in /var/www/html/BibleWebSite/captcha-creator.php on line 195
PHP Warning:  imagettftext() expects parameter 1 to be resource, boolean given in /var/www/html/BibleWebSite/captcha-creator.php on line 204
PHP Notice:  Undefined property: FGCaptchaCreator::$logger in /var/www/html/BibleWebSite/captcha-creator.php on line 206
PHP Fatal error:  Call to a member function LogError() on a non-object in /var/www/html/BibleWebSite/captcha-creator.php on line 206
[kmorgan@localhost1 ~]$
But most remarkable, the captcha now is displayed!!!!!

However, we're not quite home free yet: the validation of my entry of the captcha letters and numbers does not work: the page always claims a mismatch, even though I enter the right code. Every line in the output references captcha-creator.php. Is there a way I can attach that file?

Last edited by billquinn; 03-20-2014 at 07:41 PM.
 
Old 03-21-2014, 04:25 AM   #23
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
1. If you want to attach a file, use the clip button (need to give the file a .txt extension)

2. FYI I found the software you're trying to install, and copy it over to my webserver. It worked out of the box, so I guess you've somehow messed something. For example I see in show-captcha.php
Quote:
require_once("./include/fgcontactform.php");
require_once("./include/captcha-creator.php");
while from your 1st post, you call directly these files without the include subdir...
I suggest you to reinstall the software and see what you get.
 
Old 03-21-2014, 08:01 AM   #24
billquinn
Member
 
Registered: May 2005
Posts: 40

Original Poster
Rep: Reputation: 1
I removed the include subdirectory name because I put all the files from the download into the sole directory of the Web site: /var/www/html/BibleWebSite. That way I didn't have to modify my header and footer files for use on contactform.php and thank-you.php.

By the way, I though it might be helpful to show all the php packages installed on my system:

Code:
[kmorgan@localhost1 ~]$ rpm -qa | grep php
php-xml-5.3.3-27.el6_5.i686
php-mysql-5.3.3-27.el6_5.i686
php-common-5.3.3-27.el6_5.i686
php-pear-1.9.4-4.el6.noarch
php-5.3.3-27.el6_5.i686
php-mbstring-5.3.3-27.el6_5.i686
php-gd-5.3.3-27.el6_5.i686
php-pdo-5.3.3-27.el6_5.i686
php-cli-5.3.3-27.el6_5.i686
[kmorgan@localhost1 ~]$
I'm surprised the software worked out of the box for you. I had to install php-mbstring-5.3.3-27.el6_5.i686. Of course, you might have already had that on your system. The biggest problem, however, was that one of the functions in fgcontactform.php was deprecated and had to be changed:

Code:
// deprecated - eregi() - altered March 14, 2014
// return eregi("^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$", $email);  (original code)
// return preg_match("^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$", $email); (next attempt)
return preg_match("/^([*+!.&#$\'\\%\/0-9a-z^_`{}=?~:-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,4})$/i", $email);
eregi was changed to preg_match. Also the original string parameter didn't seem to work. So very curious that the software worked on your system. The mysteries multiply!

Just to confirm, here's what I downloaded:

http://<br /> http://www.html-form-g...orm.html<br />

I really appreciate your perseverance.

P.S. For some strange reason the URL didn't post right.

It's html-form-guide slash contact-form slash creating-a-contact-form.html.

Last edited by billquinn; 03-21-2014 at 09:02 AM.
 
Old 03-21-2014, 09:19 AM   #25
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
removed the include subdirectory name because I put all the files from the download into the sole directory of the Web site: /var/www/html/BibleWebSite. That way I didn't have to modify my header and footer files for use on contactform.php and thank-you.php.
...
The biggest problem, however, was that one of the functions in fgcontactform.php was deprecated and had to be changed:
So it's you that have messed with the form code. I think that it's better to reinstall the form from scratch.
I've downloaded and tested the 2nd zip archive from here, so you may try that and see if it works.

Last edited by bathory; 03-21-2014 at 09:23 AM.
 
Old 03-21-2014, 01:48 PM   #26
billquinn
Member
 
Registered: May 2005
Posts: 40

Original Poster
Rep: Reputation: 1
"So it's you that have messed with the form code." Not quite. The only changes I made on my own were removing the ./include and ./scripts so I could have all the files in the same directory as the Web site itself (/var/www/html/BibleWebSite). The rest of the changes were suggested by several people from another forum. I brought my still-unsolved problem over to LinuxQuestions because those on the other forum dropped out for one reason or another.

Anyway, that's history. I backed up all the files I (we) had been working on. Then I downloaded the 2nd zip from the form-guide Web site, as you did. I set it up with the subdirectories suggested by that Web site:

/var/www/html/BibleWebSite/contact
/var/www/html/BibleWebSite/contact/include
/var/www/html/BibleWebSite/contact/scripts

Going to

/var/www/html/BibleWebSite/contact/contactform.php

in Firefox, the captcha was displayed. However, we are still at the same point we were with my original files: even when I enter the correct letters and numbers, the validation does not work.

Also, at the beginning of my ill-fated attempt to put a contact page on my Web site when I downloaded MY zip, I set it up with the subdirectories strictly according to the instructions. The captcha did NOT display. I think that it is all the work suggested both on this forum by you and the previous forum that made the captcha display with the NEW zip. If I moved all the files from the NEW zip to the same directory (BibleWebSite)--and removed the ./include and ./scripts--the captcha would continue to be displayed but validating the entry would still not work, though I haven't actually tried it.
 
Old 03-21-2014, 05:56 PM   #27
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
in Firefox, the captcha was displayed. However, we are still at the same point we were with my original files: even when I enter the correct letters and numbers, the validation does not work.
I'm afraid that we still need a way to look at the logs produced by php. Undo the previous logging changes in php.ini and use just
Code:
error_reporting = E_ALL
display_errors = On
to see if it can display whatever errors on screen.

Also remove .php (and .html if you don;t need it) from the "Includes" directive because it's possible that apache gets confused:
Code:
AddType application/x-httpd-php .php
AddType text/html .shtml
AddOutputFilter INCLUDES .html .shtml
 
Old 03-22-2014, 10:37 AM   #28
billquinn
Member
 
Registered: May 2005
Posts: 40

Original Poster
Rep: Reputation: 1
bathory--

(1) I'm still using the newly downloaded zipped files that you downloaded and suggested that I download and install with the subdirectories as per the directions.

(2) I made sure these two lines are in /etc/php.ini

error_reporting = E_ALL
display_errors = On

(3) I made the following the entirety of .htaccess:

AddType application/x-httpd-php .php
AddType text/html .shtml
AddOutputFilter INCLUDES .html .shtml

I did not make any changes to /etc/httpd/conf/httpd.conf. However, I believe .htaccess supersedes httpd.conf if there is a conflict. Is this correct?

(4) I restarted the daemon. (I'm beginning to think this description is well-chosen, at least for httpd! )

(5) Then I ran the page localhost/BibleWebSite/contact/contactform.php.

Result: Yes, "display_errors = On" did print out an error message on the contact page itself--right under the input button below the captcha image. And...I'm embarrassed to say that this very same error message had previously been printing out a number of times back on March 20 and 21 in--

/var/log/htttpd/error_log

Somehow it slipped through the cracks, and a failed to notice it. So here's the error message:

[Sat Mar 22 10:20:14 2014] [error] [client ::1] PHP Notice: Undefined index: fca1e169591cdd4139293d8a7f4f0779 in /var/www/html/BibleWebSite/contact/include/captcha-creator.php on line 120, referer: http://localhost/BibleWebSite/contact/contactform.php

Last edited by billquinn; 03-22-2014 at 10:42 AM.
 
Old 03-22-2014, 01:22 PM   #29
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
I did not make any changes to /etc/httpd/conf/httpd.conf. However, I believe .htaccess supersedes httpd.conf if there is a conflict. Is this correct?
Yes, but are you sure .htaccess is read by apache? You need a
Code:
AllowOverride All
in httpd.conf in the <Directory /var/www/html>...</Directory> section

Quote:
[Sat Mar 22 10:20:14 2014] [error] [client ::1] PHP Notice: Undefined index: fca1e169591cdd4139293d8a7f4f0779 in /var/www/html/BibleWebSite/contact/include/captcha-creator.php on line 120, referer: http://localhost/BibleWebSite/contact/contactform.php
This is not actually an error. You see it because of E_ALL logging option. Anyways it can be suppressed using isset

I cannot think of something else that prevents the captcha validation. Perhaps, as a last resort, you should compare your VPS apache configuration with that of your home apache.
 
Old 03-23-2014, 02:34 PM   #30
billquinn
Member
 
Registered: May 2005
Posts: 40

Original Poster
Rep: Reputation: 1
Bathory, after your last post (#29), I just waited a day and did nothing. However, yesterday evening I tried entering the captcha letters and numbers again, and amazingly it went through, and the "thank-you" page came up!!! I can't explain it. The validation had not worked when I posted #28 where I mentioned that the "display_errors" displayed the error, which you said was not really an error. Before trying it last night, I had made no changes whatsoever. The only thing I can think of was that I misread the captcha (but seven or eight cpatchas in a row?).

I went back to the modified php files that are in BibleWebSite, and it worked again. I'm just astonished.

One more question, though I think I know the answer. The email sent is not received. Is that because on my local computer I do not have a DNS server installed and running?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] using ssh on remote computer to connect to home computer behind two routers Volofrog Linux - Networking 8 12-25-2012 04:02 PM
[SOLVED] invoke php from a self made webpage on my home computer Pedroski Linux - Software 18 07-16-2012 03:16 AM
Why apache save php files to local computer when script run if php5 module disabled ? mesuutt Linux - Server 7 12-13-2011 09:22 AM
[SOLVED] PHP not working properly with Apache home server Shreeve Linux - Software 4 10-19-2011 04:24 PM
PHP home Edition Apache won't start poeta_boy General 1 11-24-2003 04:02 PM


All times are GMT -5. The time now is 02:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration