When I previously talked about having PHP timezone problems in Debian Lenny, I thought that I might have to compile a custom version PHP without the patch which created this mess. Thankfully, I found another solution.
When I got a chance to examine the patch, I discovered that it actually loaded the PHP timezone database from the OS database in /usr/shared/zoneinfo. The user chroots on the shared LAMP server are stripped of (usually) unnecessary files such as the ones found in /usr/shared/zoneinfo. I copied those files into the chroot and the PHP timezone database worked again! There was much rejoicing!
I'm glad I found another way to fix this as I was not looking forward to maintaining a custom PHP package until the next Debian release, which would be at least a year away. No thanks, I have better things to do than compile PHP every time there is a security update.
Showing posts with label php. Show all posts
Showing posts with label php. Show all posts
Wednesday, September 30, 2009
Wednesday, September 16, 2009
PHP In Lenny
The Debian PHP maintainers included a patch in the package for Lenny which is causing me some grief. This guy is a lot less restrained in showing his annoyance. ^_^
The patch makes a default timezone "System/Localtime" which, when it is detected, forces PHP to use the OS configured timezone. That part is OK. The problem is the patch also prevents you from getting the real timezone from PHP. The PHP timezone always looks like the hard coded default.
Now this probably won't affect many PHP scripts but I'm not that lucky. A developer using the shared hosting server that I admin, unfortunately does need the the real timezone for his application. Marvelous!
The obvious solution is to compile the Debian PHP package without the patch and I plan to do that tomorrow. Oh Joy!
The patch makes a default timezone "System/Localtime" which, when it is detected, forces PHP to use the OS configured timezone. That part is OK. The problem is the patch also prevents you from getting the real timezone from PHP. The PHP timezone always looks like the hard coded default.
Now this probably won't affect many PHP scripts but I'm not that lucky. A developer using the shared hosting server that I admin, unfortunately does need the the real timezone for his application. Marvelous!
The obvious solution is to compile the Debian PHP package without the patch and I plan to do that tomorrow. Oh Joy!
Friday, February 27, 2009
Some Success
I created the test sites and the customer will try them over the weekend. The site using Symfony ran into a snag. Symfony doesn't automatically initialize that database which is common on other frameworks. It does generate an SQL script that you must execute on the server. Our service does not provide shell access so my plan was to use phpMyAdmin to upload the script and execute it. That idea ran aground when I did a test upload. I don't know why yet.
It might be a good thing if the upload idea doesn't work. I'm not happy with allowing users access to phpMyAdmin, so it would be good to have another plan. I'm thinking of writing a PHP script which will initialize the database. The script would available to the users if they cannot write one on their own. The main problem with this idea is that I am not very good with PHP, so it would take me too long to write even such a simple script.
It might be a good thing if the upload idea doesn't work. I'm not happy with allowing users access to phpMyAdmin, so it would be good to have another plan. I'm thinking of writing a PHP script which will initialize the database. The script would available to the users if they cannot write one on their own. The main problem with this idea is that I am not very good with PHP, so it would take me too long to write even such a simple script.
Thursday, January 29, 2009
Symfony
Since the end user will be developing his site in a PHP framework called Symfony, I wanted to test that it works with the setup on the LAMP server. Symfony has a tutorial which claims can be done in hour. It went well for a while until one change caused the application to throw exceptions. Now, what I should have done, was undo the change and just use what I had for my testing. Instead, I wasted considerably more than an hour to figure out what the problem was. I did solve it eventually, but the very next step failed again. By this time I had had enough and controlled the urge to fix the problem. I really don't have much love for PHP.
I did learn a little about Symfony and found that you need programming skills to get the most out it. I hope the end user knows what he is getting into. I've been told that he is just regular user. I hope he has more skills than that, otherwise using Symfony is going to be a very steep learning curve.
I did learn a little about Symfony and found that you need programming skills to get the most out it. I hope the end user knows what he is getting into. I've been told that he is just regular user. I hope he has more skills than that, otherwise using Symfony is going to be a very steep learning curve.
Monday, December 1, 2008
Man's Got To Know His Limitations
There was no way I was going to get the TomsGiftList project into a usable state any time soon. I decided to try and setup GiftWeb again and guess what? It worked! The reason for it breaking 18 months ago seems to have disappeared. I did not even have to change the include path for the ADODB library which I had the last time I tried GiftWeb.
I still don't like GiftWeb even though it saved the day. It is an old PHP application. When I tried the "recommended" PHP configuration for production use, GiftWeb crashed. This worries me a little. I hope that I have not exposed my server to an exploit. GiftWeb was the first and only PHP application that I ever played with, and the experience made me like Python even more. Of course at that time (2003) the Python web frameworks were a little less mature than they are now, so CGI was really the only option for writing Python web applications. No thanks.
I'm glad I was able to get the wish list back online. Nevertheless, it is only three weeks to Christmas so I don't how much help it will be to everyone.
(It was a toss up between Clint Eastwood and Kenny Rogers. :)
I still don't like GiftWeb even though it saved the day. It is an old PHP application. When I tried the "recommended" PHP configuration for production use, GiftWeb crashed. This worries me a little. I hope that I have not exposed my server to an exploit. GiftWeb was the first and only PHP application that I ever played with, and the experience made me like Python even more. Of course at that time (2003) the Python web frameworks were a little less mature than they are now, so CGI was really the only option for writing Python web applications. No thanks.
I'm glad I was able to get the wish list back online. Nevertheless, it is only three weeks to Christmas so I don't how much help it will be to everyone.
(It was a toss up between Clint Eastwood and Kenny Rogers. :)
Subscribe to:
Posts (Atom)
