codeigniter

Several time ago, i build my own app or web app with code igniter. There is no error when i build and test my app on server or call it with http://localhost/myapp.

Different case in implementation. I found problem after installed new client and call this web app from client browser. Commonly you can call your web app with http://ip address/myapp. But in my case there is nothing happen after it.

investigate start.

XAMPP or another server emulator check

In older version XAMPP you must edit your configuration for server. This necessary do before your client can load your project.

  1. Open the httpd.conf file in the C: \ xampp \ apache \ conf folder, edit the file using notepad or notepad ++ to make it easier.
  2. Look for the LoadModule text vhost_alias_module modules / mod_vhost_alias.so and remove the # sign in front of it.
  3. Look for the Include text “conf / extra / httpd-vhosts.conf” if in front of it there is a sign # remove the sign.
    Next we need to manage who can access XAMPP on the server computer, the steps are as follows.
  • Open the httpd-xampp.conf file in C: \ xampp \ apache \ conf \ extra.
  • At the bottom there are posts like the following

Order deny,allow  
Deny from all  
Allow from ::1 127.0.0.0/8 \  
fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \  
fe80::/10 169.254.0.0/16  
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var  
</locationmatch> 

to add a computer with a specific IP address such as 192.168.1.3 can be done by adding the text as follows.

Allow from 192.168.1.3 
Allow from 192.168.1.4

<locationmatch i:=”” licenses=”” phpmyadmin=”” security=”” server-info=”” server-status=”” webalizer=”” xampp=””>  
Order deny,allow  
Deny from all 
Allow from ::1 127.0.0.0/8 \  
fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \  
fe80::/10 169.254.0.0/16  
Allow from 192.168.1.3
Allow from 192.168.1.4  
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var  
</locationmatch> 

To give access to all users in the network can change the code “order deny, allow and Deny from all” to “Allow from all”.

    Restart XAMPP

if your XAMPP is update version do this for your code igniter app

in new version of XAMPP do not change httpd conf. Change this configuration not affected with your app. This happen with my web app to. In my case not XAMPP configuration affected error.

Deep investigate see in configuration in your code igniter file. You can found it in application folder inside config. same thing you can edit with notepad++. Check your code

$config[‘base_url’] = “http://localhost/myapp

Well, the application doesn’t work because the application running on the client side is always redirected to localhost even though there is no problem when running the application on the server.

we need to set it in the url base to:

$config[‘base_url’] = “http://&#8221;.$_SERVER[‘HTTP_HOST’];
$config[‘base_url’] .= preg_replace(‘@/[email protected]’,”,dirname($_SERVER[‘SCRIPT_NAME’])).’/’;

0/5 (0 Reviews)

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.