Posts Tagged ‘PHP’

On Ubuntu 8.10, I ran into a bit of problem. The Apache web server was working fine, but the following commands:

sudo apt-get install php5 libapache-mod-php5
sudo /etc/init.d/apache2 restart

failed to work after creating a phpinfo.php file in the /var/www/ root folder. Firefox complained, “You have chosen to open phpinfo.php which is a: PHP file.” Apache was not using the PHP preprocessor for some reason. A bunch of forum posts and blogs said to edit either /etc/apache2/httpd.conf or /etc/apache2/apache2.conf in order to associate the PHP mime type with the file extension. That wouldn’t work because I had also installed phpmyadmin which has an apache.conf file that already has an AddType directive. So, after some digging around, it turns out the module wasn’t even being loaded, even though that’s what you’d expect the package manager to handle when you tell it to install the module. Any how, to fix the problem, just create symbolic links to the php5.load and php5.conf files in the /etc/apache2/mods-enabled/ folder.

sudo ln -s /etc/apache2/mods-available/php5.load /etc/apache2/mods-enabled/php5.load
sudo ln -s /etc/apache2/mods-available/php5.conf /etc/apache2/mods-enabled/php5.conf
sudo /etc/init.d/apache2 restart

Update: Debian-based installs of Apache2 have some handy command line utils for managing the web server. So to enable a mod, which automates the above, do this instead:

sudo a2enmod php5

a2dismod is the command for disabling a mod. For sites, there is also a2ensite and a2dissite.

As a few users of MyGoogleCal3 have already pointed out, the script no longer works properly. That’s the bad news. The good news is version 4 does work. In fact, with the latest changes Google made to their code, ALL the features that were broken in 3 appear to be working now—Agenda/Week view, the calendar navigation buttons, and IE is fixed. Please download and test out the latest version, and report any bugs in the comments and I’ll try to resolve them as time allows.

(more…)

MyGoogleCal2 no longer works 100% in Internet Explorer. A runtime error occurs when navigating month-to-month or when switching to Agenda mode. The workaround is to simply hide the navigation interface. Now, I don’t know if this bug was introduced when Google updated the code last month, or if it’s always been there and I just never noticed. In any case, the runtime error occurs when //"+a.host+"/calendar is replaced by //www.google.com/calendar. Given the poor debugging available in IE, I didn’t get very far with figuring out why IE breaks. I suspect that when IE makes an XmlHttpRequest, it’s double checking that the request URL matches up with the server host, or something to that effect. Since Google obfuscates the Javascript code, it’s just way too hard to try and fix it. Instead, I’ve opted to create a new version of MyGoogleCal that uses the original technique for IE but uses the technique from MyGoogleCal2 for all other browsers.

(more…)

One of my readers asked for a step-by-step set of instructions to install MyGoogleCal2.php. My original posts for restyling Google Calendar did assume a certain level of expertise. This should hopefully help those who are still confused.

(more…)