From the category archives:

Nerd musings

VirtualHost overlap on port 80

by antbrown on September 23, 2009

This is the warning I was seeing when starting up apache

[warn] _default_ VirtualHost overlap on port 80, the first has precedence

You might be seeing something similar, however in most cases this is how to fix the warning:

Add this line of code to your configuration file (usually httpd.conf or httpd-vhosts.conf)

NameVirtualHost *:80

I kept getting the same warning whenever I (re)started Apache but it didn’t seem to hinder the operation of anything so I left it at that.

Now by adding this line of code everything works fine and Apache boots up nice and clean, just the way I like it.

This is almost exactly the same as the warning you get for virtualhost overlap on 443.




{ 1 comment }

DOMPDF with Zend Framework 1.9.x

by antbrown on September 11, 2009

If you’re getting these sort of errors when trying to use DOMPDF in Zend Framework 1.9.x …

Warning: include(DOMPDF.php) [function.include]: failed to open stream: No such file or directory in /home/myusername/library/Zend/Loader.php on line 83
Warning: include(DOMPDF.php) [function.include]: failed to open stream: No such file or directory in /home/myusername/library/Zend/Loader.php on line 83
Warning: include() [function.include]: Failed opening ‘DOMPDF.php’ for inclusion (include_path=’/home/myusername/application/models:/home/myusername/library:.:/usr/lib/php:/usr/local/lib/php’) in /home/myusername/library/Zend/Loader.php on line 83

And you’ve already tried the solution which has been written about a gajillion times:

require_once(“dompdf/dompdf_config.inc.php”);
spl_autoload_register(’DOMPDF_autoload’);
$dompdf = new DOMPDF();

Then I suggest you use the Zend_Loader_Autoloader::pushAutoloader() function, it’s really simple to use in the case of DOMPDF,

First we get the autoloader instance, then we push a new autoloader onto the stack giving the callback function as the first parameter and the namespace as the second. In the case of dompdf there is no namespace so just set it to an empty string.

Like so:

require_once(“dompdf/dompdf_config.inc.php”);
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->pushAutoloader(’DOMPDF_autoload’, ‘’);

Note that we have to include the dompdf config file so the autoloader knows about the dompdf autoload function.

{ 2 comments }

Zend Framework Blogs to Follow

September 7, 2009

There’s a bunch of resources available for Zend Framework, which makes it such a great platform to develop on, however some blogs stand out from the rest.
Here’s some of the ones I follow and get the most out of:

Matthew Weier O’Phinney: http://weierophinney.net/matthew/plugin/tag/zend+framework
DASPRiD’s: http://www.dasprids.de/
Steven Macintyre: http://steven.macintyre.name/category/technology/zend-framework/
Ralph Schindler: http://ralphschindler.com/
Rob Allen: http://akrabat.com/

Enjoy

Read the full article →

Zend Framework Set Application Environment without editing index.php

September 7, 2009

Instead of manually changing the line in index.php to ‘development’ or ‘production’ every time you upload, or commit your changes to repository you can easily set the APPLICATION_ENV using Apache on your local development machine, and leave index.php to default to ‘production’ meaning you no longer have to modify index.php
I use MAMP Pro for local [...]

Read the full article →

svn: Could not use external editor to fetch log message

September 5, 2009

If you get this message when trying to do something in SubVersion, like a “svn commit”

svn: Commit failed (details follow):
svn: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using the –message (-m) or –file (-F) options
svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set, [...]

Read the full article →

Rewrite Regular Files in Zend Framework- Error when using .htaccess

September 4, 2009

This was rather silly of me,
I was trying to add this line to my .htaccess:

RewriteRule ^free/download\.php /free/download/pdf [NC,L]

Not realizing that the Rewrite Conditions were completely negating my Rule.
The following will not Rewrite the URL if the Requested Filename is a regular file (example download.php)

RewriteCond %{REQUEST_FILENAME} !-f

The solution of course is to use the Zend Router [...]

Read the full article →

Zend Studio Switching Workspace closes Zend Studio

September 4, 2009

This was driving me nuts…
I kept getting “out of memory” errors in Zend Studio from having too many projects open at a time, I tried setting the maximum allowed memory to 2048MB which really… I mean really… should be heaps… but apparently not.
So I decided to branch off the big projects into their own Workspace

Go [...]

Read the full article →

.htaccess: DeflateCompressionLevel not allowed here

September 4, 2009

I was trying to optimize the output of content on one of the sites I’m working on using mod_deflate but got the following error:

.htaccess: DeflateCompressionLevel not allowed here

The problem comes about when you add the mod_deflate to .htaccess and not in the VirtualHost or Server Config, if you check the Apache documentation page you’ll find [...]

Read the full article →

Fixing the Zend Studio for Eclipse Build Issues

February 25, 2009

Do you ever get:
Problem Occurred Building PHP Projects
Reason: Path must include project and resource name: /config.php
To get rid of this error on startup:
If you have a license for 6.1, Download the latest version of Zend Studio from http://www.zend.com/studio
If, like me, you only have a license for 6.0.x, Download the 6.02 release candidate, rename your [...]

Read the full article →

Yummy Tips!

February 25, 2009

This is some Yummy tips for web developers, or people that have a few websites and use Yummy FTP to upload files.

Under Preferences -> Advanced Settings, set the “Mac browser Home folder” for each website. Un-check the “Use setting from preferences” option. It saves a lot of time when you set the local/remote home folders [...]

Read the full article →