Posts Tagged ‘fix’

Fix the Gallery 2.3.x “This GD version is too old” error

July 13th, 2015 No comments

For any one out there running Gallery 2.3.x (a web based photo album), this posting gives you a fix for the problem with he GD plugin.

The problem


Gallery 2.x is a web based photo album, written in PHP. As such, you can create albums and upload photos into these albums. Gallery then takes care of creating thumbnails and intermediate sized versions of your photos. For this purpose, Gallery needs some graphics toolkit, like GD or NetPBM.
GD is the most widely used toolkit, as it usually comes bundled with PHP. However, Gallery fails to properly detect the version of GD available on the system.

The GD config fails with this message:

GD Version: 2.1.0 (bundled) Required:2.0
This GD version is too old and is not supported by this module! Please upgrade your PHP installation to include the latest GD version.


It seems weird: the GD version bundled with PHP (2.1.0) meets and even exceeds the required version. Yet Gallery fails to properly detect this, and hence refuses to activate the GD plugin.


The solution


In your Gallery installation, make the following change on line 286 from …/modules/gd/classes/GdToolkitHelper.class:

Change this:

 if (preg_match('/^>?2\.0/', $gdVersion)) 

into this:

 if (preg_match('/^>?2\.[0-9]/', $gdVersion)) 


So, just change the .0 to .[0-9], and save the file. Afterwards, in Gallery, you can activate the GD plugin, and it should work.

Categories: fix, Gallery, GD, PHP Views: 1,394

Fix the random mac address on your Android phone

December 13th, 2013 No comments


The problem

Lately, I noticed that my el-cheapo-Chinese-Ebay-phone (Star B943) got a different IP address every time I re-enabled the Wifi connection. It never did this before (it always reused the same address, as I set the lease duration to 1 week on my server). I don’t know how or why this behaviour started, but I certainly didn’t like it. After examining the dhcp.leases file on my DHCP server, I was in for a big surprise: it appeared that my phone simply changed its own MAC address every single time, which immediately explains why the DCHP server handed out a new lease every time !

Googling the Interwebz learned me that a lot of Android users were(are) facing the same problem. Luckily, I also found a solution to the problem (muchas gracias to Damian Parsons at ). This solution only works on a rooted phone.


How to fix it:


  • If you don’t have it already, install a root file explorer (like Total Commander) on your phone
  • Make sure to allow root privileges every time your root file explorer requests it.
  • Navigate to /data/nvram/APCFG/APRDEB
  • Copy the file named WIFI to your SD card
  • Somehow copy this file to your computer (USB transfer, email, . . .)
  • Install a hex editor (Hxd is a good one)
  • Open the previously copied WIFI file in HxD. It should look similar to the following image:

  • The MAC address starts at row 1, column 4 and it ends at row 1, column 9.
  • In my case, the colums 4 till 9 were all zeroes, which explains the problem. When the mac address handed to the kernel at boot is empty, the kernel will start generating random mac addresses.
  • Now, input your desired WLAN MAC Address in the colums 4 till 9 (see next image):

  • You did not use the same MAC address I used in this example, right ? 😉
  • Save the file, but preferably under a different name, or otherwise backup the original WIFI file before editing.
  • Copy this new file back to the SD card of your phone.
  • Navigate back to /data/nvram/APCFG/APRDEB
  • Overwrite the previously existing WIFI file with your modified WIFI (renaming it back to WIFI if necessary).
  • Possibly check the file permissions and change them to the same as the original WIFI file if required.
  • Reboot your phone.
  • Now check the mac address of the wifi card: it should the same as the one you entered in the WIFI file.
  • Enable/disable the wifi connection several times to verify the mac address does not change any more.

The above fix worked for me, on a Star B94m (B943), running stock Android 4.2.1 JB (rooted). Let me know if it also works for you.

Categories: Android, fix, mac address, random, Star B943, wifi Views: 3,011