paul bennett

PHP: include / require_once on Solaris

Posted on: June 6, 2008

Consider the following:

myscript.php
<?php
require_once('my-connection-settings.php');
// do some stuff
?

my-connection-settings.php
<?php
$settings = array('server' => 'locahost', 'user' => 'paul', 'password' => 'secret', 'database' => 'stuff');
require_once('connection.php');
?>

connection.php
<?php
$linkId = mysql_connect(/* db settings go here */);
?>

Seems perfectly reasonable. myscript pulls in the settings, which then pull in the database connection functions.

On Solaris, however, the first file is included fine, but the second fails. Silently.
As you can imagine, this leads to much unneeded debugging. Not to self:  you can’t debug something well if it isn’t actually broken.

A search at bugs.php.net doesn’t turn up anything, so it may be our server setup. If anyone is also using Solaris 10 and Containers and has this bug, please let me know.
Otherwise, you have been warned.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives

%d bloggers like this: