Navigate/Search

Archive for the 'Web Development' Category

Cannot load the MySQL connection and phpMyAdmin

Monday, March 2nd, 2009

phpMyAdmin requires MySQL (duh) and the mycrypt PHP extension.  You can follow the link below for Windows (up to Vista) but the key things to look for are:

  1. Copy ‘libmysql.dll’ to the ‘bin’ directory of the Apache installation.
  2. Copy ‘libmcrypt.dll’ to the ‘bin’ directory of the Apache installation.

Both of these files should be in the PHP installation directory.

Additional Notes

DO NOT under ANY CIRCUMSTANCE copy DLLs to the Windows system directories.  It is not advised, recommended nor permitted under good software practices.

Additional Links

Configuring PHP with MySQL for Apache 2 or IIS in Windows

EDIT:

OK, so I got phpMyAdmin up and running and noticed because I chose the UTF-8 (multilingual) install I needed the ‘mbstring’ extension installed.

Another note of possible concern (but can be safely ignored) is a message similar to:

Your PHP MySQL library version 5.0.51a differs from your MySQL server version 5.1.31.

You can actually solve this problem by using the ‘libMySQL.dll’ from the MySQL ‘bin’ directory.

PHP Namespaces – Use not Import, huh?

Wednesday, February 11th, 2009

Not sure how pertinent this is (update) as I’ve never ran across any of these “gotchas.” All it really talks about is a bit of syntax and the fact ‘import’ was changed to ‘use.’  *shrugs*

I ran across it while trying to remember what the name of namespaces were in PHP — yeah, I know, crazy.  Did I mention my memory is kaput?

See my massive about page to see what I mean.  And believe every word of it.

Useful PHP class for debug output

Wednesday, February 11th, 2009

JASLabs has a useful little class for iterating object properties, as well as all GET and POST variables.  The comments yield another useful tidbit.

If you are using Firefox, LiveHTTPHeaders is a useful tool. It’ll show you your GET and POST, as well as all HTTP request/response headers, for every request your browser makes.

Using this, you can also sneak debugging output into your headers (thereby preventing it from affecting your HTML rendering) by doing something like this:

$key = "MyObject";
$message = serialize(get_object_vars($myobj));
header("X-Debug-$key: $message");

jQuery DOM manipulation and effects

Wednesday, February 11th, 2009

10 Smart JavaScript Techniques for Manipulating Content

jQuery Simple Menu with Slide in Effect

Wednesday, February 11th, 2009

I put this here because it was probably the least amount of code I’ve seen deployed for some of these menus.  Granted it requires jQuery, the Interface Elements plug-in and the hoverIntent plug-in.  *shrugs*

jQuery simple menu with slide-in effect

OK, the above link is still valid but I linked to the wrong one (and subsequently explained the wrong one). I knew something was up when I started blogging about how compact this example was and then I had to read 3 or 4 pages of code along with grabbing 3 separate downloads.

ImageFlow script causes a 503 error – here’s the fix?

Tuesday, February 10th, 2009

And now I’m battling a 503 error due to mod_security.

mod_security: Access denied with code 503. Error normalising REQUEST_URI: Invalid character detected

This link from the Menalto Gallery forums was dead-on my exact problem (experience-wise) and then it derailed into something totally unrelated.  This link from the LiteSpeed Support Forums I thought would be of help in regards to making sure PHP had enough memory and it had enough time to execute.

I’m still struggling trying to figure out what part of the “reflectionN.php” causes problems.

Here’s one straight from the boards of my host, DreamHost.

It’s actually the one that got me thinking.  I re-examined the support documentation and the examples and finally found the problem.

Well, sort of…

If I use:

reflectionGET: '&height=20%'

…nothing appears at all on my Linux host —– Windows host is fine.

If I use:

reflectionGET: '&height=20'

…it starts working, but not in a way I can figure out.  Plus it seems to greatly affect the height and position of the image.

I looked in the code and saw that the part that handles the “height” value is setup to strip a percent symbol (%) if it comes with one, but the other ‘reflectionGET’ values do not strip the percent symbol.

So for whatever reason that particular aspect is wonky.

  • fade_start
  • fade_end
  • height

Those are the values that behave differently and erratically between my Windows and Linux hosts.

Escaping PHP to Markup and a thought

Sunday, February 8th, 2009

An example of escaping in and out of PHP in an HTML document.

<?php if (1 === 2) : ?>
<!-- if/Markup -->
<p>One</p>
<?php elseif (2 === 1) : ?>
<!-- elseif/Markup -->
<p>Two</p>
<?php else : ?>
<!-- else/Markup -->
<p>I have no clue!</p>
<?php endif; ?>

On that same note I believe you should parse all HTML documents that contain PHP as PHP — with some caution of course. Target specific directories for this behavior. Even better would be to handle it via mod_rewrite — that is, for example, interpret:

/index.htm

…as:

/index.php?category=news&default=true&frontPage=true

This opens up many possibilities without having to apply additional overhead to the PHP engine.

Random code-by’s, code blitherings and whatnot

Sunday, February 8th, 2009

I wasn’t sure what to call this one but this site has a random array of varied goodies in CSS, PHP, HTTP and IE-specific problems.

3 Lava Lamp CSS/JavaScript (menu) implementations

Saturday, February 7th, 2009

Don’t ask me which one came first, just know that I found them in this order:

  1. LavaLamp for jQuery lovers!
  2. YUI Lava Lamp Menu
  3. CSS+Javascript[sic] power. Fancy menu

And I’ve no clue how I found #3 after #2 considering it was directly linked from #1.  Catch all that?

Just a personal preference, I don’t directly link commercial stuff unless I am getting affiliate kickbacks.

So, here’s another, um, link?

http://www.robbie-white.com/design/rapidweaver/lava/index.html