I have this codeigniter project that was developed and tested on xampp, when the customer took xampp wouldn't work on his laptop, so he downloaded the appserv and wants to use it instead of the xampp, the home page of the login page of the system is displayed fine but he vannot log in, I changed the database sittings in the database.php file in the codeigniter project, and also removed the comment before rewrite role in the httpd.conf but yet its not working
any help please
set the CI environment to development in your index.php and error_reporting to E_ALL and see what's going wrong. If it's the database, or sessions, browser may have not accepting cookies etc.
Ok, you have probably a base path issue. check $config["base_path"] in application/config/config.php and set it to the directory name relative to web server root.
Like XAMMP has usually
c:\xampp\htdocs\
and the project url might be
c:\xampp\htdocs\projects\project_a
then your base_path would be
$config["base_path"] = "procjects\project_a";
In database.php, please make sure that you have to enter the password as you setup while installing appserv.copy the password that you entered in it
$config['hostname'] = 'localhost';
$config['username'] = 'root';
$config['password'] = 'your_password';
$config['database'] = 'your_database';
$config['dbdriver'] = 'mysqli';
$config['dbprefix'] = '';
$config['pconnect'] = FALSE;
$config['db_debug'] = TRUE;
$config['cache_on'] = FALSE;
$config['cachedir'] = '';
$config['char_set'] = 'utf8';
$config['dbcollat'] = 'utf8_general_ci';
replace "your_password" with copied password from the above and check it.
otherwise, On the left end of the taskbar, select the Start icon and search for "Reset MySQL Root Password" click on it to open.
In the command window, Please enter the NEW_PASSWORD and Replace it in your database.php
Related
I want to configure my database on CI but I have a problem
How can i fix it?
I'm using CI 2.x
And
phpMyAdmin-4.6.6-english
As I can check your using wrong database settings in your database.php file.
If your php version is equals to php 5.5 or above you have to use
$db['default']['dbdriver'] = 'mysqli';
instead of
$db['default']['dbdriver'] = 'mysql';
and also put your database username and password in setting to avoid this error.
I recommend you to use codeigniter 3 the latest version .
I downloaded a Joomla installation from a server and want to run it locally from xampp. I installed the database and modified the configuration.php to match my local settings.
Now when I call the local URL, it tells me that the connection to localhost was interrupted (ERR_CONNECTION_RESET). It finds the local database because when I change the database name in the config file, it tells me it cant find the database.
Do I have to make changes in the database as well, or maybe at some other place to run it locally?
Thanks!
Check the following things when you are migrating Joomla sites.
It seems DB unable to connect you must check DB name and user details.
Make sure configuration.php is writable.
public $dbtype = 'mysqli'; //which dB type you are using
public $host = 'localhost'; // normally keep as it is
public $user = 'user name'; // DB user name
public $password = 'password'; // DB password
public $db = 'db name';//DB name
public $log_path = '/joomla/logs';//log path your local path
public $tmp_path = '/joomla/tmp'; //temp path if its not correct you can't install plugins.
I am unable to install new components, module, on my live site using Joomla.
I got to know from another post that the problem might be in configuration file which in my case i have:
public $log_path = 'C:\\xampp\\htdocs\\pastrimi/logs';
public $tmp_path = 'C:\\xampp\\htdocs\\pastrimi/tmp';
and I also tried this way with no luck unfortunately:
public $log_path = './logs';
public $tmp_path = './tmp';
and I made the permission to 777 for both folders
how would I make this showing on joomla system information writable these two folders?
You have a set already below path this is called global path.
1) First try with this details.
public $log_path = './logs';
public $tmp_path = './tmp';
If you still got the error then follow the second step
2) Open cpanel and goes to file manager
Left side you will see like below if your directory path in root
/home/Directoryname/public_html/logs
/home/Directoryname/public_html/tmp
If your directory in subdomain then use
/home/Directoryname/public_html/sub domain name/logs
/home/Directoryname/public_html/sub domain name/tmp
I set up a codeigniter project on my wamp www folder
The assets of my project is in 'assets' folder which is in the same folder as the application folder.
However when I access my localhost, the css,images and js which are in the asset folder is unable to load.
When I type localhost/assets instead, I can access them.
I set http.conf in the apache folder to set to "Allow from all" as well.
when i access the url from the developer tools for chrome, I have characters within the url like this
%3C?=%20base_url()%20?%3Eassets/img/a.jpg
Any idea what is wrong here?
It seams that the function base_url() is not executed and just printed in your view.
Try to enclose the function in a php block and echo it out with the path to the asset.
<?php
echo base_url() . 'assets/img/a.jpg';
?>
Or as stealthyninja mentioned in the comment, the short-open-tag you used is interpreted as text.
You can enable it in the php.ini with
short_open_tag=On
When you can't modify the php.ini, you can enable it in the codeigniter config.php with
$config['rewrite_short_tags'] = TRUE;
Now the short open tags are interpreted right
<?= base_url() . 'assets/img/a.jpg' ?>
check you config.php file:
$config['rewrite_short_tags'] = TRUE;
or try this :
<?php echo base_url()?>assets/img/a.jpg
Is it possible to programmatically dispatch websites in Magento? Currently, I have a directory in the root of my site called /websites. In this directory I have subdirectories for each website, for example, site_a, site_b, site_c. Then each site subdirectory has a .htaccess and index.php with appropriate run code, for example:
$mageFilename = '../../app/Mage.php';
require_once $mageFilename;
Mage::run("site_b", "website");
in the index.php in /websites/site_b. While this works, I do wish to avoid doing file management in the filesystem. Anyone can give any recommendation on the best way to do this? Perhaps a script in /websites that stands in place of the individual site sub directories. Any help appreciated.
You have access to the $_SERVER variables in php and you can use these to determine the Mage::run("whatever", "website"); call, e.g.:
$whatever=$_SERVER['condition/url/whatever'];
// or use some cookies
if (isset($_COOKIE['dev'])) $whatever=$_COOKIE['dev'];
switch($whatever)
{ case "example.com":
case "www.example.com":
$_SERVER['MAGE_RUN_CODE'] = "example";
$_SERVER['MAGE_RUN_TYPE'] = "website";
break;
case "dev":
case "test.com":
$_SERVER['MAGE_RUN_CODE'] = "test";
$_SERVER['MAGE_RUN_TYPE'] = "website";
default:
$_SERVER['MAGE_RUN_CODE'] = "live";
$_SERVER['MAGE_RUN_TYPE'] = "website";
}
Mage::run($_SERVER['MAGE_RUN_CODE'], $_SERVER['MAGE_RUN_TYPE']);
In this way you only need one code base plus correctly configured settings in Magento backend to route to your different stores.
You can handle all in .htaccess file
mine looks like this:
#SetEnvIf Host www\.lenjerii\.com MAGE_RUN_CODE=base
#SetEnvIf Host www\.lenjerii\.com MAGE_RUN_TYPE=website
#SetEnvIf Host ^lenjerii\.com MAGE_RUN_CODE=base
#SetEnvIf Host ^lenjerii\.com MAGE_RUN_TYPE=website
#SetEnvIf Host www\.wildfashion\.ro MAGE_RUN_CODE=wildfashion
#SetEnvIf Host www\.wildfashion\.ro MAGE_RUN_TYPE=website
#SetEnvIf Host ^wildfashion\.ro MAGE_RUN_CODE=wildfashion
#SetEnvIf Host ^wildfashion\.ro MAGE_RUN_TYPE=website
This solution eliminate any other folders for your additional websites.
if I understand you correctly, what you need are some symbolic link: in each subdirectory, make symbolic link to the original installation. IE: ln -s ../app/ ./app.
Check out this tutorial