Wednesday 16 September 2009

How do you stop QCODO load blank pages?

I've just been doing work on a PHP web project that uses QCODO. So my client could see changes I have made I setup an installation on a server of mine. So I used the latest XAMPP to get a web server, db and php running. Secured the default security holes using the security page and then copied the source to the web root ht docs folder.

Now for a number of hours, and much hair pulling (and believe me there isn't much hair there to begin with!) Every time I tried to load a page that utilised QCODO it just loaded a blank HTML page. Not very helpful!

Firstly, I found that you can get some more useful debug info (well I say useful, let's just say some debug info) when you comment out the ob_start('__ob_callback'); line (just prefix it with //) in the qcodo.inc.php file. You can find this file under your qcodo installation folder in includes/qcodo/_core. Rerun you pages and you now get some errors relating to a date function. Thanks to some other bloggers and forum writers out there this seems purely down to the version of PHP you are running against. Of course when I set my server up I was using the latest version of XAMPP which was budled with PHP 5.3 on my devbox I used XAMPP 1.7.0 which was using PHP 5.2.8 - and this version worked.

So for me the solution at the moment was to install a compatible version of PHP. It would appear QCODO is not currently worked on, and there is another project about called QCUBED which has taken on this work - but have yet to try. I will write anoter entry on here if I ever get the time!!

How do you get phpmyadmin to work after you have changed or given mysql a password?

I have recently install XAMPP on my machine which made installing Apache, MySQL and PHP a doddle. I have to confess I wouldn't of had a clue how to install these components individually and whilst I'm sure I could have located and installed them, XAMPP makes this damn easy!

Whilst XAMPP is a great tool it is for development purposes by default and openly warns you that there are some big security holes left open on installation - so don't use, certainly out of the box, as a production environment.

One of the open features of the installation is the MySQL is installed with a blank root password. Using the latest version of XAMPP there is a fantastic web page found using the security link on the \localhost\xamp page that allows you to secure folders and set a mysql root password. On an older version this assistant is not available, so me being me I setup a root password for mySQL just for neatness on my development box. Alas, after doing so the phpmyadmin page no longer longer loads because it cannot connect to the database - doh. Ok, so all you need to do to solve this is locate the config.inc.php file in the phpmyadmin folder under the xampp install folder and open the file up in a text editor. Have a look for ['Servers'][$i]['user'] = 'root' and there will also be a statement that follows that is for ['password'] = '' obviously from here you can update the password and reload your admin.

I will add, and I have to admit being unable to remember at this second, you may need to restart Apache after making this change. I would make the change, retry the page - if you retry the page and you are sure you have entered the correct credentials and it still fails then give it a restart!

How do you get past "Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item."?

I had copied a file to my test server Windows 2003 and tried to run it and repeatedly got "Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.". I tried moving it to different locations but still no, it would not budge. I was actually connected as Administrator so permisissions should not have been a problem.

The solution,,, all I needed to do in this case was look at the file properties and noticed a security section on the general tab. Windows had identified the file coming from another machine and had blocked access to it - and of assuming you happy with the file's source and safety there is an 'Unblock' button. Click this and you are back in business!!