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
Solved

Apache - PHP and Capcha Problem

Posted on 2013-11-26
15
412 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
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.

 
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

Suggested Solutions

Title # Comments Views Activity
Decrypt string by php 7 47
Need to remove %20 from url in get 17 36
Echo Multiple values from multiple records 19 40
Checking https returns 301 21 21
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

856 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