I was unable to run this script on XAMPP for Windows ... when I tried to run the script it crashed Apache and I got an error saying "Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience."
Initial I thought it happened accidentally, but then I tried to run the script many times but always faced the same error.
Gilberto Albino - 2009-04-22 12:47:16 - In reply to message 1 from Khurram Noorani
I am sorry you are experienced this kind of trouble.
In fact, this problem doesn't relates to the code itself.
I am running this class on Xampp 1.7 and Windows XP,
as you can see here http://www.gilbertoalbino.com/print-on-xampp.JPG.
I Developed on Windows Vista with a manual installation of Apache, PHP and MySQL and tested on Ubuntu Linux.
This code is being used on a Linux Server here (http://himoveis.com/resultado.php?busca_simples=1&ordem=titulo&referencia=&chave=&categoria=1&estado=0&cidade=0&bairro=0&suites=0&dormitorios=0&banheiro=&garagem=&areautil=&areatotal=&areaterreno=&minimo=&maximo=&busca=Buscar+Im%C3%B3veis)
I can figure out some possible problems that could led you to this:
- PDO isn't installed correcty with MySQL driver
- Missing pieces of code if rewritten (If not, try using the original files on a database called "teste" first, later make the changes carefully)
- Have you changed the DSN configuration properly? Let's break it down into pieces:
defined('DSN') or define('DSN', 'mysql:host=localhost;dbname=teste');
(Did you put the right database name in dbname= ? )
defined('USUARIO') or define('USUARIO', 'root'); // The user
defined('SENHA') or define('SENHA', ''); // The password
- The charset of the .SQL file is in ANSI and the import of the phpmyadmin may break it in some cases.
To try a fix in case your PDO is correctly installed, delete the table you imported to mysql, if via phpmyadmin, and query it clicking on SQL Tab not via Import Tab, copy the content and paste inside the textarea.
Depending on your language, Apache may be running on a different charset, so open the file which contains the connection and find the line:
$this->conexao->query("SET NAMES utf8");
And comment it:
//$this->conexao->query("SET NAMES utf8");
It should solve your problem on XAMPP for windows.
You can contact me via Messenger contato at gilbertoalbino dot com.