Solved

Apache - PHP and Capcha Problem

Posted on 2013-11-26
15
415 Views
Last Modified: 2013-11-26
Hi

I used to have this page - http://www.petenetlive.com/Captcha/captcha-page.php
handle access from my webmail form.

Recently I moved from a hosted server to my own, at this point I noticed that the capcha image was not displaying - Its been a few years since I installd that and Id forgotton how I set it up so I tried another one http://www.petenetlive.com/_capcha/index.php

same problem.

I've installed php on my Web Server  - What else do I need to do?

other php pages work like this.

help?
0
Comment
Question by:Pete Long
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 2
15 Comments
 
LVL 11

Assisted Solution

by:mcnute
mcnute earned 50 total points
ID: 39678955
It's probably only a matter to have the right path in your src attribute of your image.

So the first question is, if the php file you're calling to generate the captcha is in the /_capcha Folder?

Where is this file located? Then adapt the src attribute accordingly.
0
 
LVL 1

Expert Comment

by:gwnet
ID: 39678999
Hi
Please share your code captcha.php or check log Apache.

Probably you have a different version of PHP on this server and script (captcha.php) throw some errors, warning, ...
0
 
LVL 11

Expert Comment

by:mcnute
ID: 39679095
add this on top of your index.php / capcha-page.php
and see the output:

<?php

error_reporting(E_ALL);

?>

Open in new window

0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 57

Author Comment

by:Pete Long
ID: 39679111
>>So the first question is, if the php file you're calling to generate the captcha is in the /_capcha Folder?

Yes

>>Probably you have a different version of PHP on this server and script (captcha.php) throw some errors, warning, ...

server has php5

[root@pnl-server1 ~]# httpd -v
Server version: Apache/2.2.15 (Unix)
Server built:   Aug 13 2013 17:29:28
[root@pnl-server1 ~]# httpd -M
Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_file_module (shared)
 authn_alias_module (shared)
 authn_anon_module (shared)
 authn_dbm_module (shared)
 authn_default_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 authz_owner_module (shared)
 authz_groupfile_module (shared)
 authz_dbm_module (shared)
 authz_default_module (shared)
 ldap_module (shared)
 authnz_ldap_module (shared)
 include_module (shared)
 log_config_module (shared)
 logio_module (shared)
 env_module (shared)
 ext_filter_module (shared)
 mime_magic_module (shared)
 expires_module (shared)
 deflate_module (shared)
 headers_module (shared)
 usertrack_module (shared)
 setenvif_module (shared)
 mime_module (shared)
 dav_module (shared)
 status_module (shared)
 autoindex_module (shared)
 info_module (shared)
 dav_fs_module (shared)
 vhost_alias_module (shared)
 negotiation_module (shared)
 dir_module (shared)
 actions_module (shared)
 speling_module (shared)
 userdir_module (shared)
 alias_module (shared)
 substitute_module (shared)
 rewrite_module (shared)
 proxy_module (shared)
 proxy_balancer_module (shared)
 proxy_ftp_module (shared)
 proxy_http_module (shared)
 proxy_ajp_module (shared)
 proxy_connect_module (shared)
 cache_module (shared)
 suexec_module (shared)
 disk_cache_module (shared)
 cgi_module (shared)
 version_module (shared)
 php5_module (shared)
Syntax OK

Open in new window

0
 
LVL 57

Author Comment

by:Pete Long
ID: 39679134
hi mcnute added that.  no change

http://www.petenetlive.com/Captcha/captcha-page.php
0
 
LVL 57

Author Comment

by:Pete Long
ID: 39679137
0
 
LVL 1

Expert Comment

by:gwnet
ID: 39679156
Not the server modules I meant.

php --version (5.1, 5.2, 5.3, 5.4, 5.5 ) :)

Log is based on the distributions in different locations, eg / var / log / apache or httpd / error_host.log

Add to http://www.petenetlive.com/Captcha/captcha-page.php
error_reporting(E_ALL);
- suggestion "by: mcnute" is OK or find log on your distribution server.
0
 
LVL 1

Accepted Solution

by:
gwnet earned 450 total points
ID: 39679188
'--without-gd'  you use gd to generate images in your script  ?

Maybe this is problem.

For RedHat - log is locate default in :
 /var/log/httpd/error_log
0
 
LVL 57

Author Comment

by:Pete Long
ID: 39679213
PHP Version 5.3.3

I've put
error_reporting(E_ALL);

on that page  - it displays the same.

Bear with me guys Im a firewall engineer :(

From the log

[Tue Nov 26 16:42:10 2013] [client 86.29.22.237] PHP Fatal error:  Call to undefined function imagecreate() in /var/www/html/Captcha/captcha.php on line 6, referer: http://www.petenetlive.com/Captcha/captcha-page.php
[Tue Nov 26 16:42:16 2013] [client 86.29.22.237] PHP Fatal error:  Call to undefined function imagecreate() in /var/www/html/Captcha/captcha.php on line 6, referer: http://www.petenetlive.com/Captcha/captcha-page.php
0
 
LVL 57

Author Comment

by:Pete Long
ID: 39679217
>>'--without-gd'  you use gd to generate images in your script  ?

OK I see where you got that from? How Do I enable or install it?
0
 
LVL 1

Expert Comment

by:gwnet
ID: 39679231
yum install php5-gd
0
 
LVL 57

Author Comment

by:Pete Long
ID: 39679238
Booom Give that man a ceegar!

yum -y install php-gd

And now we have a capcha code!!!

Testing,,,,,,,,,,,,,,
0
 
LVL 1

Expert Comment

by:gwnet
ID: 39679244
and restart httpd

/etc/init.d/httpd restart

I go sleep By
0
 
LVL 1

Expert Comment

by:gwnet
ID: 39679247
great :)
0
 
LVL 57

Author Comment

by:Pete Long
ID: 39679259
Brilliant! I'm back up and running

{Learning more Linux Every Day!}

Thanks for your patience!!

Pete
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Send email using HTML and PHP in separate file 5 41
PHP SMTP authentication 6 28
HTTPS for signup & login - HTTP for all other pages 10 51
php hashing methods 3 16
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
What You Need to Know when Searching for a Webhost Provider
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question