Joomla 1.5 PHP fatal error allowed memory size exhausted in libraries/joomla/error/exception.php [SOLUTION]

After a site move (from one webhosting to another) the site reported error 500 internal server error. When checking the logfile the file libraries/joomla/error/exception.php reported that allowed memor size was exhausted. I tried increasing it by adjusting the php.ini settings all the way up to 2 GB without resolving the problem. This is way more than Joomla should need.

The problem was that I had forgot to update the temp and log paths in Global settings to the ones on the new server. The path the site is running under can be found by the menu Help -> System info. Then I adjusted temp path and log path in Global settings and the problem was resolved.

If your site gives you error 500 internal server error, access your Joomla database using for example phpMyAdmin and delete all rows in the jos_session table.

Another solution if the problem is a corrupted database is to repair the database tables using phpMyAdmin.

In configuration.php, also try setting cache_handler=”file” instead of “memcache”.

Problem sending email on form submission in WordPress

Adding a form to your WordPress website is normally done by using a plugin for it, like Contact Form 7 for example. At some hosting providers, there can be a problem for the plugin to send emails to you when someone is posting through the form. To prevent spam through forms, many hosting providers disable the PHP mail function that is used in WordPress to send emails, causing for example form plugins not being able to send emails.

The solution is to set up WordPress to use SMTP, preferrably with authentication, to send the emails through a real email server. To do this you need a plugin like WP Mail SMTP. Set it up either with the hosting provider’s SMTP server or use the one you normally use for email.

PHP Parse error: syntax error, unexpected end of file in XXXXX.php

  • Check that you have spaces around curly braces, i.e. for example don’t use <?php}?> but instead use <?php } ?>
  • If your script has been running without problems on earlier versions of PHP but you are now running PHP 5.4 or later, replace all occurrences of <? with <?php

Joomla 3.4 too many redirects (303)

On a Joomla site currently in offline mode the front page gave us “too many redirects” error. It turned out the reason was the article connected to the home page menu item had been unpublished. By publishing the article the problem wsa solved.

Vivotek PT7137 rtsp stream to webpage using VLC plugin

One way of getting the video from Vivotek PT7137 to a webpage is by using the VLC plugin and connect the rtsp stream.

However, in current version of Chrome the VLC plugin is no longer supported. Instead it is suggested to use HTML5 to embed video, but rtsp is not supported in Chrome so it is kind of a dead end there for the moment. This solution works in for example Firefox.

In the webpage where you would like to add the stream:

<object classid=”clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921″ codebase=”http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab” id=”vlc”>
</object>
<embed type=”application/x-vlc-plugin” pluginspage=”http://www.videolan.org” autoplay=”yes” loop=”no” width=”600″ height=”340″ target=”rtsp://USERNAME:PASSWORD@IPADDRESS:554/live.sdp” />

Replace USERNAME, PASSWORD and IPADRESS with real values for your Vivotek PT7137 camera. It might be a good idea to create an account in the Vivotek PT7137 to use from the web as the username and password will be visible for anyone who inspects the webpage source code. That said, putting the root user account and password here would be considered stupid 🙂

Tip for Joomla users: If you include this code in a Joomla site, include {emailcloak=off} before the above, because the @-sign will trig Joomla email cloaking beliving it is an email address.

CSS background-position not working on Android Mozilla

In order to position a background image inside a div I tried to use the CSS3:

background-position: right 10px center;

The goal was to position the background image to the right of a div container, 10px from the right edge and vertically centered. This worked fine in most browsers. However, in the Android devices using the native Mozilla browser the background was positioned at 0,0 (i.e. left top).

The solution was to use:

background-position: right center;

and edit the background image where I added 10 px of extra transparent space into the image.

How to convert a SVG (scalable vector graphics) image to PNG

This method aims at Windows users but similar methods are probably also useable in other environments.

  1. Right click on the SVG image file and select Open with
  2. Select Internet Explorer
  3. In Internet Explorer right click on the image and select Save image as
  4. In the File Format box switch from Scalable Vector Graphics (*.svg) to PNG (*.png) 
  5. Click Save

For Ubuntu there is a simple solution described here -> http://www.upubuntu.com/2012/06/how-to-convert-svg-files-to-other-image.html

Cron scripts in /etc/cron.daily not running

If you put a script to be run by cron in cron.hourly, cron.daily, cron.weekly or cron.monthly but they won’t run, make sure that they:

  • Are chmod +x
  • Are owned by the correct user (like root:root)
  • Start with #!/bin/sh or the corresponding shell used to execute them
  • The filename doesn’t contain any dots, like a script name ending in .sh will not execute

You can also execute the command to verify that your script will be run:

run-parts –test /etc/cron.daily

My mobile phone has been stolen – how do I find it?

Track and find a stolen mobile phone is often done in vain. If you forgot it somewhere there is a chance to locate it, but if it was stolen for example by a pick pocket, they usually know to turn it off immediately and then wipe it before it has a chance to report it’s location. But it is worth a try.

Apart from that, call your provider to lock your SIM card and the phone IMEI numer (makes it unusable with other SIM cards). Change passwords for all the apps you had installed, like Facebook, email etc.

Android: Use Android Device Manager and login using the same Google account you used to initially set up the phone. Click on Locate device.

iPhone: Use iCloud and login using your Apple ID. Can be used to find your missing Mac, iPhone or iPad.

Windows phone: Use Microsoft and login using your Microsoft Account (former Windows Live ID). Go to Find my device.

Smooth scrolling not working for my website on IOS devices like iphone and ipad

On iPhone and iPad, i.e. IOS devices, in some cases the smooth, accelerated scrolling is not working. Instead the web page feels “lagging”, slow or stuttering and won’t continue to scroll in the smooth accelerated way you are used to.

To solve this, make sure to use overflow-y: scroll; (not auto) and apply  -webkit-overflow-scrolling: touch; to body and possibly other elements. If it is not enough to apply it to the body you might need to also apply it to your div:s, like the wrapper div and so on.

body {
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
}