Welcome Guest, Not a member yet? Register   Sign In
No response when adding database into autoload.php
#1

[eluser]maomaode[/eluser]
Hi,

I have only one controller, called blog.php, and i have a
function index() {
echo "hello";
}
And from the browser, it showed up, no problem at all,

But,

When I adding 'database' into the array of libraries of the autoload.php, There's no response!

I turned on the log, and there's nothing wrong there, Strange!

I'm running this on my laptop,
using Windows Vista, Apache2.0.59 PHP 5.2.3 Mysql Version is 5.0.45

It worked before, but after i reinstalled the vista, everything seems all broken Sad

Any problem with this combination?

Thanks in advance
#2

[eluser]Eric Barnes[/eluser]
My guess would be to double check your database connection values and make sure it is getting the connection.
#3

[eluser]Michael Wales[/eluser]
By no response - do you mean you are getting a blank page?

Blank pages almost always mean a syntax error.
#4

[eluser]maomaode[/eluser]
The database connection is OK, and the database is started, i can use the mysql client connect to the database.

Yes, I guess it must be the syntax error in the code, but there's no error reported in the log, strange.
#5

[eluser]maomaode[/eluser]
Is there a way to run the unit test for the framework?

From the autoload.php , it said:

Quote:| These are the classes located in the system/libraries folder
| or in your system/application/libraries folder.
|

But there's no Database.php, in the libraries folder, I guess, it must use the one under the database folder
#6

[eluser]Michael Wales[/eluser]
DB.php should be in \system\database\

When you remove the 'database' from your autload - does everything work?
#7

[eluser]maomaode[/eluser]
Yes, If I remove the database from the libraries array, everything just work fine, i can see 'hello' in the page returned,

I tried add other lib like xmlrpc, it works just fine, so i guess it's just the database itself.
#8

[eluser]maomaode[/eluser]
I remember that before reinstall vista it's ok, the problem happen after that,

I guess i just missed some dll?
#9

[eluser]maomaode[/eluser]
OK, I've solved the problem, the problem is that, the libmysql.dll have to copied to the system32 folder, mysql version is 5.0.45, I guess this is kind of sucks, but, you have to DO that, it's probably the license problem if you have to work with mysql 5.0.45 and PHP 5.2.3.

AND remember to restart the apache2, otherwise it'll take effect!

I just forgot that, after I reinstall the Vista Sad
#10

[eluser]maomaode[/eluser]
Just a suggestion here for CI,

I think CI should detect this failure, and have the message logged, notify the users, something wrong with the db connection.

Actually I found the solution from using the cakePHP, it give me the message like this:

Quote:Call to undefined function mysql_connect() in dbo_mysql.php on line 100

And after googling the message, i found that I missed the dll




Theme © iAndrew 2016 - Forum software by © MyBB