Monday, September 17, 2012

checkdnsrr() PHP always return true or false, alternative with Windows

Have you had problem with the PHP function checkdnsrr() is always returning false?
Then you should first check if your php-version is >= 5.3.0 otherwise it wont function in Windows environment.

Have you had problems with checkdnsrr() is always returning true?
Then there may be other problems with windows not able to do the DNS-record check properly.

An alternative to checkdnsrr() with Windows built in function, "nslookup" and by wiriting this much self-explaining php-code:

    if(!empty($host)) {
        $recType="ns";
        exec("nslookup -type=$recType $host",$output);
        foreach($output as $line) {
            if(preg_match("/^$host/", $line)) {
                return true;
            }
        }
        return false;
    }
    return false;

Good luck!

Monday, September 10, 2012

Image slider, vSlider to Wordpress not function in IE or Chrome

Are you having problems with the image slider plugin vSlider 4.0 or another Wordpress image slider plugin? The problem I'll describe here is that the images won't be shown / displayed in Internet Explorer and Chrome but works fine in FireFox.

Then the problem can be that the plugin is configured with an "auto resize" setting. Try with unset this and see if the problem disappear.

Hope that will help you out here.

View cronjobs in ubuntu server

To see what cron jobs are running on your Ubuntu server or in terminal you can try with:
crontab -u [user] -l
"-u" parameter is the user cronjob.

To view what cronjob root has configured, you may use:
crontab -l
You can also view what cronjobs are set, daily, weekly, monthly and software specific jobs.
ls /etc/cron.daily/ -l
cat [filename]
To view the software specific  jobs you use the path, /etc/cron.d/