Welcome! Log In Create A New Profile

Advanced

How to get Mysql error messages when using Perl

Posted by dougconran 
How to get Mysql error messages when using Perl
September 30, 2011 10:18AM
Hi all,

My first post on this forum as I've only just started using Nginx. First impressions are that it is FAST and a lot simpler to set up than Apache but not as easy as Litespeed (which has a GUI frontend). I'm considering switching from Litespeed because the 64bit version is paid-for and I only want it for a backup site.

My server hosts 2 domains running a number of Perl applications plus Wordpress using PHP-FPM. All the apps use Mysql.

After a fairly steep learning curve (even if it is easier than Apache!) I've got everything working except that I cannot get any logging messages from Perl, particularly Mysql warnings/errors.

Although Litespeed also uses Perl FCGI it manages to log all Mysql messages to it's log file. Can anyone suggest how I can achieve the same for Nginx.

I should say that the cgi wrapper I'm using for Perl can be found at http://www.ruby-forum.com/topic/145858.

TIA

Doug
Re: How to get Mysql error messages when using Perl
September 30, 2011 12:23PM
OK - I can now answer my own question

All I needed to do was to add an additional line at the top of the main subroutine in cgiwrap-fcgi.pl as follows:-

open STDERR, ">>/usr/local/nginx/logs/error.log" or die "Cannot redirect stderr";

Doug
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 172
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready