[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Apache - PHP and Capcha Problem

Posted on 2013-11-26
15
Medium Priority
?
428 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 200 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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
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 1800 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

650 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