PHP iCalendar suddenly not working?

Anyone have any problems with PHP iCalendar recently? I now get this error if I’m viewing a single calendar on

Warning: Invalid argument supplied for foreach() in /home/.duncan/mbaizman/ on line 381

And if I try to view the weekly view (, I get the above error plus a bunch of:

Warning: Invalid argument supplied for foreach() in /home/.duncan/mbaizman/ on line 159

Any ideas? Did they just upgrade to a new version of PHP? Or is my calendar file corrupted somehow?

My PHPiCalendar installation is still working fine.

If you want useful replies, ask smart questions.

mbaizman, i am having the same problem. did you fix it? i am installing phpicalendar for the first time, using ics files created by sunbird.

I did indeed fix it. I was using multiple calendars, and one of the calendars had no events in it, so I deleted it. Also, I think one of the other calendar files had become corrupted somehow, so I copied and pasted about 75% of the events from one file into a new blank file.

You can open an .ics file in any text editor and see the dirty details of all your appointments, to-do items, etc. The specification is here: if you want to see how it works behind the scenes.

Since then, everything seems to be fine. I’m not sure exactly why it wasn’t working, but it seems okay now. Give these two things a show, and see what happens.

that was it, mbaizman! actually, it was something in one of the default phpicalendar calendars. i simply removed all the the default ics files (Home.ics, Work.ics, and US Holidays.ics) and now i am good to go.

could it have been the space in the file name of US Holidays.ics?

thanks for your prompt response and still checking this forum. you saved me a lot of time poking through some hairy php code.

I am having the same problem:

Warning: fopen(./calendars/stedsked.ics): failed to open stream: Permission denied in /home/.quicoovenheater/halsted/ on line 67

I checked the permissions on the .ics file and it is -rw-r----- which I suspect may be part of the problem. Deleting the file and re-publishing did not work, and I don’t know how to change permissions on a file via WebDAV (or if it is even possible).

Any help would be appreciated. Thanks.

Complex, glad you got it working!

Cygnoir, I’m not sure why your permissions are set the way they are, but I bet that is the root of your problem. Did you try to republish a fresh calendar with only 1 or 2 events?

I had no success using the php methods with iCal (it doesn’t want to put a “?” after “.php”), so i turned on WebDAV for my “calendars” folder and iCal worked fine. Now, I get the following error when i load PHPiCalendar in the browser:

There was an error!
Unable to open calendar.
The calendar “./calendars/BellSouth.ics” was being processed when this error occurred.
Please use the “Back” button to return.

Can anyone suggest a strategy? For those of you using iCal and iCalendar, what has worked for you?

Well, I’m not entirely sure what the problem might be, but I posted a (brief) tutorial with some links in the Apple iCal discussion group. Link:

See if that helps any. I know I’ve seen the error before, and it might have been a permissions thing.

Hey Dream Hosters, I would like to add a calendar to my site and maybe a couple others. Do you all recommend the iCalendar? Also, I’m such a PHP novice, I am having trouble even beginning to know where and how to install this into my scripts.

Any ideas?

Hi there. I’ve had decent luck with WebCalendar ( It may not be as pretty as Horde or PHPiCalendar, but it is easy to install and use, and easy to add and edit entries without having to setup DAV or any of the other tricks to make PHPiCalendar work.

Hey, the calendar looked good to me. I unpacked the files into my directory. Then directions seem to go off in a couple of directions. I tested the /install/index.php. Was able to change passwords and user name. I can’t get the mySQL to test and here is the error I received. Lost…

Connection Result:

Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) in /home/.okemo/sun0tzu/ on line 97

Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

Helping to build cooperation, coordination and community for Dulles Area Democrats.

David T. Pierpont
Director/Web Site Manager

You’ll need to set up a MySQL database for it (in the Goodies section), then follow the steps in Appendix A of the WebCalendar help for Administrators file to get the initial tables set up.

Or if you are feeling adventurous, you can try the current CVS build which can set up the tables itself if you already have the database set up.

I haven’t used webcalender or Horde but I can highly recommend PHPiCalendar for displaying .ics files. Compared to creating a MySQL database for Webcalendar, in my opinion setting up WebDAV is much easier! :slight_smile: It’s a one-click deal in the Control Panel, although setting up stuff in the Goodies tab is pretty darn easy these days. DreamHost has really come a long way. I’m pretty active on the PHPiCalendar forums also, and they have good documentation. Go to or feel free to send me a private message and I’ll give you a hand setting it up.

To clarify my own post slightly (maximum edit time expired - phooey), as of today, PHPiCalendar can only display calendars, and cannot create or edit them. This will soon be changed, but the new builds aren’t even in Sourceforge yet, so they’re not ready for production use. Calendars are *.ics files created with a calendar application that uses the standard iCalendar format here:

I reinstalled PHP iCalendar to test a theory.

I uploaded my .ics file via the admin interface in PHP iCalendar, and made sure it was chmodded 0755. I could view the calendar just fine, although some errors about template files printed at the top of the page.

So I decided to attempt to publish the .ics file with iCal using WebDAV. Although it published, it’s now chmodded 0640 … and since I’m using WebDAV on DreamHost, I do not have the ability to change the permission of the file.

From this, I have to assume that iCal is changing the permissions of the file when it publishes it via WebDAV, and PHP iCalendar simply will not display any .ics file with those permissions set.

Any ideas on what I can try next? Keep in mind that this was working perfectly for me for a long time in Panther. Only after I upgraded to Tiger did this break.


Still not working for me.

Does anyone running Tiger have this working on DreamHost?

I do have this working in Tiger. The file permissions are set by the dhapache user, which is what happens when you WebDAV-enable a directory. What exactly is the error message you’re getting in PHPiCalendar? You might also want to try posting to their forums heree: