Solved

Apache - PHP and Capcha Problem

Posted on 2013-11-26
15
408 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
 
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
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…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now