[Chugalug] another LAMP problem

Randy Yates lpcustom at gmail.com
Sat Mar 16 17:13:30 UTC 2013


I'll throw in another useful PHP debugging utility: FirePHP.

Install it, install the firefox extension, make sure that firephp is
enabled in the appropriate places (see the documentation), include the
class files in your project, and log your variables like this:
Firephp::getInstance(true)->log($variable);
You'll get a pretty dump of the variable in the firebug/firephp console.
This is especially handy when doing some ajax requests on a php server.


On Sat, Mar 16, 2013 at 1:02 PM, Lisa Ridley <lhridley at gmail.com> wrote:

> Turn on Php error display ... At the beginning of your Php script insert
> ini_set('display_errors', true);
>
> WSOD almost always means a PHP error.  This will spur them to the screen.
>  Just make sure you remove it when you finish debugging.
>
> Lisa Ridley
> Sent from my iPhone 5
>
> On Mar 14, 2013, at 11:09 PM, Ed King <chevyiinova at bellsouth.net> wrote:
>
> while you're at it, run:       php -l filename.php
>
> aka phplint :)
>
>
>
> --- On *Thu, 3/14/13, William Wade <willm.wade at gmail.com>* wrote:
>
>
> From: William Wade <willm.wade at gmail.com>
> Subject: Re: [Chugalug] another LAMP problem
> To: "Chattanooga Unix Gnu Android Linux Users Group" <
> chugalug at chugalug.org>
> Date: Thursday, March 14, 2013, 10:03 PM
>
> Try running it at the command line. See what happens. It should still
> print out the stuff. This way you can take Apache out of the loop and test
> just PHP and code.
>
> $ php filename.php
>
> Wil
>
>
> On Thu, Mar 14, 2013 at 9:28 PM, Garrett Gaston <garrett85 at hotmail.com<http://mc/compose?to=garrett85@hotmail.com>
> > wrote:
>
> Thanks guys, I'll try some of this out. People from several different
> forums have replied back that my code worked fine on their system so I'M
> thinking that this isn't a syntax problem.
>
> Date: Thu, 14 Mar 2013 23:12:27 +0000
> From: cluon at geeklabs.com <http://mc/compose?to=cluon@geeklabs.com>
> To: chugalug at chugalug.org <http://mc/compose?to=chugalug@chugalug.org>
> Subject: Re: [Chugalug] another LAMP problem
>
>
> <?php
> $con=mysqli_connect("localhost","dbuser","dbpasswd","dbname");
> if (mysqli_connect_errno($con)) { echo "Failed to connect to MySQL: " . mysqli_connect_error() ; } ;
>
>
> $result = mysqli_query($con, "SELECT uniq,name FROM customers") ;
> if(!$result) {
>    echo "MySQL Error: " . mysqli_error($con) . "\n";
> } else {
>    while ( $row = mysqli_fetch_array($result,MYSQLI_ASSOC) ) {
>
>
>      print $row['uniq'] . ' ' . $row['name'] . " <br>\n" ;
>    } ;
> }
> ?>
>
> The slight variation above just worked on my system,
>
> I demand the brackets be in the format as above. Not on their own lines,
>
>
> but that's a personal religion thing. I can affirm that my beliefs work
> well for me when applied consistently.
>
>
>
> ============================================================
> Mike Harrison   bogon at geeklabs.com <http://mc/compose?to=bogon@geeklabs.com>  cell: 423.605.6943
>
>
>
> On Thu, 14 Mar 2013, Garrett Gaston wrote:
>
> > Having overcome my last LAMP problem I've hit another problem almost immediately. My apache server seems to be working just fine as does php, I'm able to execute phpinfo()
>
>
> > without a problem. I wrote a little php to query a few lines in a VERY simple MySQL database. When the page loads it's a blank web page, no errors and no results. There are two
> > entries in the table that I'M trying to query so I would expect to see two lines outputted as html. The code is below. Any ideas? Note that fname & lname are just variable I
>
>
> > retrieved from an html form via $_POST.
> >
> > // Create connection
> > $con=mysqli_connect("localhost","lrngsql","xyz","bank");
> >
> > // Check connection
>
>
> > if (mysqli_connect_errno($con))
> >   {
> >   echo "Failed to connect to MySQL: " . mysqli_connect_error();
> >   }
> >
> > $result = mysqli_query($con, "SELECT fname, lname FROM person");
>
>
> >
> > if(!$result)
> > {
> >     echo "MySQL Error: " . mysqli_error($con) . "\n";
> > }
> >
> > else
> > {
> >     while($row = mysqli_fetch_array($result))
> >     {
>
>
> >         echo $row['fname'] . " " . $row['lname'];
> >         echo "<br />";
> >     }
> > }
> >
> >
>
>
> _______________________________________________ Chugalug mailing list
> Chugalug at chugalug.org <http://mc/compose?to=Chugalug@chugalug.org>
> http://chugalug.org/cgi-bin/mailman/listinfo/chugalug
>
> _______________________________________________
> Chugalug mailing list
> Chugalug at chugalug.org <http://mc/compose?to=Chugalug@chugalug.org>
> http://chugalug.org/cgi-bin/mailman/listinfo/chugalug
>
>
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Chugalug mailing list
> Chugalug at chugalug.org <http://mc/compose?to=Chugalug@chugalug.org>
> http://chugalug.org/cgi-bin/mailman/listinfo/chugalug
>
> _______________________________________________
> Chugalug mailing list
> Chugalug at chugalug.org
> http://chugalug.org/cgi-bin/mailman/listinfo/chugalug
>
>
> _______________________________________________
> Chugalug mailing list
> Chugalug at chugalug.org
> http://chugalug.org/cgi-bin/mailman/listinfo/chugalug
>
>


-- 
Google reads my email!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://chugalug.org/pipermail/chugalug/attachments/20130316/53af74eb/attachment-0001.html>


More information about the Chugalug mailing list