Error downloading a site made in Codeigniter to my localhost machine

Asked

Viewed 88 times

-1

I downloaded a website already made with the codeigniter framework on my machine, I put it on the localhost but it shows the error " "I think I need to define the database, if that’s it, how do I do it?

Is there any file like wordpress that has wp-config?

  • If it is only the database can configure in /application/config/database.php but this blank error must appear because of the configuration of your php.ini, a look at error_reporting and display_errors

1 answer

1

Since I didn’t say what the mistake is, just "", it’s hard to get it right. But come on, one time it works.

If the site needs to connect to a banco de dados, you need to have this one created on your machine¹, either in mysql, postgres, sqlite etc, and imagining that you are not able to access this site by your machine for this error, so to set the connection to this database, go to /application/config/ and change the file database.php on the following lines:

'hostname' => 'localhost',
'username' => 'usuario_dono_do_banco',
'password' => 'senha',
'database' => 'nome_do_banco',
'dbdriver' => 'mysqli',

In dbdriver leave as 'mysqli' if it is Mysql, and 'postgre' if it is Postgresql.

More questions about connecting to banco de dados can be cops here in the official documentation of ci.

Another important point to look at is if the site you have at hand, if in the root structure there is a file .htaccess, where often defines that the url can become shorter by using the mod_rewrite of apache. So, see this by running a file .php with the following line:

<?php print_r(apache_get_modules()); ?>

Consider checking if the module mod_rewrite appear in the listing. If it does not appear, in the terminal use the command sudo a2enmod rewrite if it’s linux/ubuntu or consider deleting the file .htaccess.

¹ If remote access to the existing bank is not possible.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.