Solved

Apache - PHP and Capcha Problem

Posted on 2013-11-26
15
410 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
  • 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

777 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