Need help with running iWebCal

I’m trying to get iWebCal running on my DreamHosts server, and it keeps giving me the following errors:

Warning: main(/dh/cgi-system/base/ failed to open stream: No such file or directory in /home/.damian/canterburynh/www/cvfd/login/iWebCal/ on line 194

Warning: main(): Failed opening ‘/dh/cgi-system/base/’ for inclusion (include_path=’.:/usr/local/lib/php’) in /home/.damian/canterburynh/www/cvfd/login/iWebCal/ on line 194

Fatal error: Cannot instantiate non-existent class: iwebcal in /home/.damian/canterburynh/www/cvfd/login/iWebCal/index.php on line 44

BUT, the exact same set of files uploaded to a DIFFERENT (non-dreamhost) server works fine:

Any clue what is going on at DreamHost. It seems I frequently have issues setting up PHP scripts at DH that I don’t have elsewhere. Am wondering why things “just work” elsewhere, but not at DH?

Any help/suggestions would be appreciated.

The place where I got the script is here:



That’s the problem.

Cause DH is one of the few web hosts I’ve found that properly configures their servers. Many web authors don’t understand this and their scripts can break on DH’s network.

For some reason, it’s looking for a file in /dh and you don’t have access to /dh, nor does that directory exist on the DH servers.

Most likely the reason it’s working everywhere is that when that / happens, it’s using an HTTP call on the current domain to look for the file if it fails to locate it on the file system. Unfortunately since allow_url_fopen is turned off, the include failes.

Another words; it’s a poorly written script.

You what know what else is bugging me. This;


I don’t see how it would even work if allow_url_fopen was turned of (assuming I was right initially about my guess).

It’s looking for within the directory dh/cgi-system/base, but your config file is in cvfd/login/iWebCal. Where’s the dh and cgi-system directory?!


Thanks for posting. I must confess, I’m a relative newbie with respect to PHP, so please bear with me.

There seems to be something about my server configuration that is causing problems, as another DH’er has been able to upload and get this to work fine on his DH site.

Your comments about the “fictitious paths” are interesting, but looking at the code, it seems that path was generated by the DH server itself (from a server variable). Here’s the lines from the script at line 194:

if (!isset($iWebCal_LOCAL_PATH))
include “${iWebCal_LOCAL_PATH}/base/”;

So perhaps I could get around this if I could give an explicit path to the requested file? Not sure what that is though. Will have to do some further looking.

What you’re seeing is the location of the PHP binary used for CGI applications:

kchrist@dreamhost:~>$ ls -l /dh/cgi-system/ total 1436 -rwxr-xr-x 1 root root 1465288 Jan 25 17:16 php.cgi See the knowledge base article on running PHP as a CGI as opposed to an Apache module for help fixing it. Hint: Look for the bits about $_SERVER[‘SCRIPT_NAME’].

Alternately, toggle your site to use PHP as an Apache module instead of CGI.

If you want useful replies, ask smart questions.

Thank you kchrist!

I will look in to this, as it would be more elegant than the solution I found, which was to indicate an explicit path (specific to that one domain/directory) instead of relying on the relative (relative to where the script is located) path generated by the server variable.

What I did works, but it would require remembering to change the path each time I wanted to use the script in a new location, or on a different DH domain.

Best wishes,