I recently designed several web-based software applications using PHP & MySQL. Some of the applications allow the user to upload photographs to the web server. However, it seems many times when I install one of these apps on a new server, I have trouble with the image upload feature. After several episodes of head-scratching, I’m posting everything I know about the subject here. Hopefully, it will server as a reminder to me and some assistance to others.
Most of the Linux servers I maintain are running Ubuntu 8.04, so the specific file locations will be geared toward that distribution.
- Make sure the php5-gd package is installed. That’s pretty basic but can be overlooked(I’m living proof of that). In Ubuntu 8.04 the command to install the appropriate package is:
sudo apt-get install php5-gd
- In php.ini (usually in /etc/php5/apache2 or somewhere close), check the following values:
memory_limit needs to be of sufficient size.
post_max_size needs to be of sufficient size.
file_uploads needs to be on
upload_max_filesize needs to be of sufficient size
- Make sure the default system temp directory (usually /tmp) is writable by everybody. This is usually the case by default, but I had this trouble on some physical servers that I had converted to OpenVZ containers.
Good luck! 🙂
About a week ago I pulled the plug on my EVNow.org website. I started the site a few years ago with big dreams of it becoming the place to go for news on alternative energy and electric cars. Unfortuately, one guy can only do so much in a 24-hour day. So EVNow is one hobby that had to go.
On the bright side, GreatCove.com is back on its feet. Last spring I had replaced the home page of the site with a message about going out of business. At the time I had taken a position with the Fulton County Government. I am still happily employed there, but I have begun to do some web programming on the side. No, I am not doing repair and networking, so don’t rush to the phone to call me concerning your virus infested home computer.
Yesterday I stumbled across an article on how to install the beta version of Google Chrome on my Ubuntu 9.10 desktop. The article mentioned using the command line, but I found just downloading the file, double-clicking to open it, and then clicking “Install” did the job just fine. Nice!
Before you plunk down serious cash on an enterprise virtualization solution, check out the free, open-source ProxMox VE. It is based on two mature open-source virtualization products, namely OpenVZ and KVM. I maintain two physical ProxMox VE servers running a total of eight virtual machine “guests”, including Ubuntu 8.04, Ubuntu 9.04, Windows 2003, and CentOS. So far, the expirience has been nothing but positive.
To download ProxMox VE, head over to the developers website at www.proxmox.com and find ProxMox VE on their product page. Or just go straight to pve.proxmox.com to get right into the good stuff.
There’s also a good review of ProxMox over at www.montanalinux.org.
I cringe when I hear of somebody buying a computer game. It’s like paying for the privilege of wasting time. I can’t be too critical, however; because a few years back I was an avid game player myself. At the height of my time-wasting addiction, I played Age of Empires II for as long as ten hours straight.
For those of you who are still into gaming, I can recommend a couple of very nice commercial-quality games available for free. They still waste your time, but not your money.
The first is Glest. It is a real-time strategy game with game play similar to the Age of Empires series. Like most modern RTS games, it uses a 3D rendering engine so you are free to change your point-of-view by rotating and zooming the display. The more recent versions have added the ability to play with others over the Internet. Nice!
Another good one is Battle for Wesnoth. This is a turn-based strategy game and there is a bit of a learning curve. If your experience is like mine, the effort will pay off with a LOT of wasted time and possibly a stubborn addition to the game. Like Glest, you can play against the computer or other humans. Since it is turn-based, Wesnoth can even be played like a board game by several time-wasting humans huddled around a single PC.
It seems like mail server software from the largest software company on earth would include an easy way to export email addresses for printing or use by other programs. Unless I’m missing something, that is not the case. It can be done, but it takes some work. Here is how I accomplish it:
- From within Outlook, click on File > Folder > New Folder
- Give it a name, such as BernardoIsCool
- Pull down the list of options beside “Folder Contains:” and select “Contact Items”
- Select Contacts as the location to place the folder, and click OK
- Click Tools > Address Book
- From within the address book, click Tools > Options
- Under “Keep personal addresses in:” choose the folder you created in Step 2
- Click OK
- Select all of the addresses in the address book. Because neither CTRL+A nor the edit menu will help you with this (What is up with that, Billy?), click on the topmost address and then use SHIFT+PAGE DOWN to select the rest.
- Right-click on one of the selected addresses and click “Add to contacts”
- Close the address book, and go to your Outlook Contacts. Select the newly created folder and you should see everybody in the global address book.
- Finally, use File > Import and Export tool to get the list of addresses into a CSV (comma-separated text file). You can then use Calc or Excel to get rid of the extra columns.
A few weeks ago, Google took the wraps off of a new web browser called “Chrome“. The browser enters into competition against a handful of entrenched foes, mostly notably Microsoft Internet Explorer and Mozilla Firefox. I took Google Chrome for a spin over the past few days and like what I see. The user interface is simpler than either IE or Firefox, and it appears to be the fastest of the three browsers as well.
Chrome is supposedly optimized to run web applications such as those provided by Google. Some even say it will eventually replace Windows as fewer applications are installed on computers and more of them hosted online.
What do you think? Is this a possibility?
As I previously mentioned, my Ubuntu web server seems to have a clock problem, presumably because it is running within VMWare. I found a simple way to keep the clock relatively accurate. This is probably not the best solution, but it works for me.
I created the following script within the directory /etc/cron.daily
ntpdate pool.ntp.org > /dev/null
Then I made it executable by issuing this command:
chmod +x filename.sh (change filename.sh to the name you gave to the script)
This syncronizes the system clock with an Internet time server every day. By the end of the day the time is off a minute or two, but accurate enough for my use.
As happy as I am with my Ubuntu-within-VMware-within-Ubuntu web server, it seems to have a problem with keeping correct time. For example, I am writing this post on June 6, 2008 at 10:19 pm. No doubt that time will not match the date and time stamp displayed by WordPress.
In some ways it isn’t a big problem. Aside from confusing my eGroupware calendar, the only place it shows up is on my blog and evnow posts. Where the problem could become more serious is if my blog posts begin to display timestamps that are during business hours of my place of employment. So, to set the record straight, I never write on my web sites during work hours. Now that I’m not trying to run a computer service business, I have enough time to write when I’m not at work.
It appears that the VMware web site contains an article about the problem but I’ve been too lazy to implement it. It seems part of the solution is to install VMware tools on the guest OS, and my first attempt to do so failed. Oh well.. I’ll get around to it eventually.
In the past two or three years, I’ve mentioned more than once that anti-virus software is a joke. That was probably a slight exaggeration, but the fact remains that anti-virus software does a horrible job protecting a computer from malicious software. Apparently I’m not completely crazy. John Stewart, the chief security officer at Cisco, says anti-virus software purchases are “completely wasted money“. Although I would not go that far, there is some truth to what he says.
When I was still doing work for residential customers, about three out of four service calls were to clean viruses. Most of those whose computers fell prey had already installed respected, up-to-date anti-virus software. Anti-virus vendors simply cannot keep up with the bad guys writing bad software. In my opinion, the only real anti-virus is some caution employed by the person using the computer.
The interesting part of John Stewart’s opinion is the idea of using a software “whitelist”, where only those programs you’ve explicitly allowed will be able to run on your network. It’s a new concept for me, but it seems like a workable one at least for the enterprise. Most larger businesses have a documented inventory of software in use on their network, so making a whitelist wouldn’t be too difficult. The only question is how updates would be handled. It seems you would have to modify the whitelist every time an update for Adobe Acrobat or Flash Player became available. Maybe the best way would be to make a vendor whitelist. Hmm….