Viola Posted January 4, 2010 Share Posted January 4, 2010 Hi I have a website that uses PEAR CAPTCHA. Recently, I got a new dedicated server, with Plesk and the CAPTCHA images no longer work. The server has PHP installed and also has PEAR installed. Please can you help me -- perhaps by suggesting a few things that I can check to troubleshoot this issue? Thanks in advance for your help. Viola Quote Link to comment Share on other sites More sharing options...
corbin Posted January 5, 2010 Share Posted January 5, 2010 You'll need to figure out what library PHP was using to generate the CAPTCHAs. I would assume that it's GD. Anyway, you'll need to enable (or install) the php_gd extension. Get in a shell as a root user (or use sudo) and do something like: apt-get install php-gd Or yum install php-gd (Depending on your distro) Quote Link to comment Share on other sites More sharing options...
Viola Posted January 5, 2010 Author Share Posted January 5, 2010 Hi Corbin Thanks for replying. I already have php-gd installed (php-gd.i386). Any more ideas? Viola Quote Link to comment Share on other sites More sharing options...
corbin Posted January 5, 2010 Share Posted January 5, 2010 Have you checked the error log or turned error reporting on? I figured it was GD, but I guess not, so finding the error reported will be a bit faster than guessing. My second guess though, is that TTF support isn't in PHP on your box. Quote Link to comment Share on other sites More sharing options...
trq Posted January 5, 2010 Share Posted January 5, 2010 Have you actually installed pear's captcha library? Quote Link to comment Share on other sites More sharing options...
Viola Posted January 5, 2010 Author Share Posted January 5, 2010 Corbin -- Error logging is turned on, but I'm not sure where to look to find the log. Thorpe -- the CAPTCHA worked fine until the server was upgraded. The website has a PEAR directory that contains CAPTCHA. The server has PHP and PEAR installed. I think that I need to somehow link them together (perhaps some sort of paths definition or something?). Quote Link to comment Share on other sites More sharing options...
corbin Posted January 5, 2010 Share Posted January 5, 2010 http://pear.php.net/manual/en/installation.php PEAR is not installed by default, so I bet when the server was upgraded, PEAR is no longer installed. Don't know why I didn't think of that >.<. The error log is in different places for different systems. I'm sure it would be in the Apache log, but no idea where that is either on your system. You could try looking in /var/log/ for Apache looking files. Quote Link to comment Share on other sites More sharing options...
trq Posted January 5, 2010 Share Posted January 5, 2010 The website has a PEAR directory that contains CAPTCHA. The server has PHP and PEAR installed. I think that I need to somehow link them together (perhaps some sort of paths definition or something?). You need to put the directory containing the PEAR directory within your include_path (within your php.ini). eg; If pear is within /usr/share/php/pear you need to add /usr/share/php to your include_path directive (if its not already set). Quote Link to comment Share on other sites More sharing options...
Viola Posted January 5, 2010 Author Share Posted January 5, 2010 My server is with GoDaddy and I asked their support. They said that PEAR is installed. Doing find, finds a PEAR installation in /usr/share/pear. Typing "pear" on the command line causes a list of pear commands to be listed. I did yum list php-gd and found that php-gd.i386 is installed. Thorpe -- thanks. I've already done this. I've tried setting the path to /usr/share and I've tried /usr/share/pear. Quote Link to comment Share on other sites More sharing options...
corbin Posted January 5, 2010 Share Posted January 5, 2010 I suggest finding the error log then... You could enable error output in PHP (add to the top of the page): error_reporting(E_ALL); ini_set('display_errors', '1'); Or, you could find the error log: find . -name error_log Or: find . -name httpd.conf (or maybe apache.conf) Then: grep ^ErrorLog <file returned from find> Quote Link to comment Share on other sites More sharing options...
Viola Posted January 5, 2010 Author Share Posted January 5, 2010 Hi Thanks for the suggestions. I found the error log under /var/log/httpd/error_log, but it didn't seem to have any relevant errors in it (the only error said [error] (9)Bad file descriptor: apr_socket_accept: (client socket)) -- not sure what this is, but it doesn't look relevant -- please say if you think otherwise). I also added error reporting to a test page: <?php error_reporting(E_ALL); ini_set('display_errors', '1'); require_once 'System.php'; var_dump(class_exists('System')); ?> The errors I got are: Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in /earlier_parts_of_path/httpdocs/System.php on line 26 Fatal error: require_once() [function.require]: Failed opening required 'PEAR.php' (include_path='.:/usr/share/pear/') in /earlier_parts_of_path/httpdocs/System.php on line 26 This seems to indicate that my include_path is wrong. However, I have tried: /usr/share /usr/share/pear /usr/share/pear/ I don't think that I should have to include my httpdocs path in the include_path directive, should I? However ... Another thing that I have noticed is that I do not have go-pear (used find . -name go-pear). I haven't yet found an explanation of what exactly this does. Looking at what I can find, it seems to be related to using PEAR as part of a website. Do you think that this may have anything to do with it? Viola Quote Link to comment Share on other sites More sharing options...
trq Posted January 5, 2010 Share Posted January 5, 2010 Another thing that I have noticed is that I do not have go-pear (used find . -name go-pear). I haven't yet found an explanation of what exactly this does. Looking at what I can find, it seems to be related to using PEAR as part of a website. Do you think that this may have anything to do with it? go-pear is a batch file used to install pear on windows machines. It is not required at runtime. Quote Link to comment Share on other sites More sharing options...
corbin Posted January 6, 2010 Share Posted January 6, 2010 Does the Apache user have read access to /usr/share/pear? Quote Link to comment Share on other sites More sharing options...
Viola Posted January 6, 2010 Author Share Posted January 6, 2010 Yes, the pear directory allows read access. I assume that this means that apache can read. /usr/share/pear is drwxr-xr-x /usr/share/pear/PEAR is drwxr-xr-x /usr/share/pear/PEAR.php is -rwxr--r-- Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.