Image headers with PHP

If you ever need to send an image file with PHP from the web server to the web browser you need to add an additional header using the header() function so the browser knows it’s an image and not regular HTML. This post looks at the headers you need to use.

Categories PHP

vmware-config.pl 6.0.0-45731 failed on openSUSE 10.3

After I unwittingly upgraded from openSUSE 10.2 to openSUSE 10.3 last week, the Linux kernel upgraded from 2.6.18.2-34 to 2.6.22.5-18. I run VMWare Workstation on this desktop machine, and each time the kernel is updated VMWare must be reconfigured and the kernel modules recompiled.

I was running VMWare Workstation 6.0.0-45731, but when I tried to run vmware-config.pl I got the following error messages:

Would you like to skip networking setup and keep your old settings as they are?
(yes/no) [yes]

Extracting the sources of the vmnet module.

Building the vmnet module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config1/vmnet-only'
make -C /lib/modules/2.6.22.5-18-default/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-2.6.22.5-18-obj/x86_64/default'
make -C ../../../linux-2.6.22.5-18 O=../linux-2.6.22.5-18-obj/x86_64/default modules
CC [M]/tmp/vmware-config1/vmnet-only/driver.o
CC [M]/tmp/vmware-config1/vmnet-only/hub.o
CC [M]/tmp/vmware-config1/vmnet-only/userif.o
/tmp/vmware-config1/vmnet-only/userif.c: In function ‘VNetCopyDatagramToUser’:
/tmp/vmware-config1/vmnet-only/userif.c:630: error: ‘const struct sk_buff’ has no member named ‘h’
/tmp/vmware-config1/vmnet-only/userif.c:630: error: ‘const struct sk_buff’ has no member named ‘nh’
/tmp/vmware-config1/vmnet-only/userif.c:636: error: ‘const struct sk_buff’ has no member named ‘h’
make[4]: *** [/tmp/vmware-config1/vmnet-only/userif.o] Error 1
make[3]: *** [_module_/tmp/vmware-config1/vmnet-only] Error 2
make[2]: *** [modules] Error 2
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.22.5-18-obj/x86_64/default'
make: *** [vmnet.ko] Error 2
make: Leaving directory `/tmp/vmware-config1/vmnet-only'
Unable to build the vmnet module.

For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/download/modules/modules.html" and
"http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html".

Execution aborted.

I was a bit mystified about what to do, and doing some searches on Google didn’t really turn up anything useful. A quick look at the VMWare website showed there was an updated version of VMWare Workstation available (6.0.1-55017), so I downloaded that and installed it.

I was then able to run vmware-config.pl with no issues. I guess there were some issues with the newer kernel that the older version of VMWare Workstation wasn’t able to deal with, but which had been addressed in the newer version of Workstation.

Get a list of all available constants with PHP

PHP has the function get_defined_constants() which allows you to get a list of all the available constants in an array. This post looks at how to use the get_defined_constants() function and example output from it.

Categories PHP

Inadvertent upgrade from openSUSE 10.2 to openSUSE 10.3

I had installed openSUSE 10.2 on my primary desktop machine (which has a dual core 64 bit AMD processor) in December 2006, but there never seemed to be any updates available in the little Yast Online Update taskbar applet which is supposed to alert you to updates and security patches etc. I found this a …

Read more

How to disable Javascript in Mozilla Firefox

Forms on websites are typically validated using Javascript on the client side to prevent additional round trips to the server if a form hasn’t been completed correctly, and are then also validated on the server side. When testing a website you need to be able to test both so need to disable Javascript in your web browser to test the server side validation. This post looks at how to disable Javascript in the Mozilla Firefox web browser. The specific version the screenshots come from are Firefox 3 but it should be the same for earlier versions.