开发者

From a MAMP dev env to XAMPP

开发者 https://www.devze.com 2023-02-04 04:46 出处:网络
I\'m taking over a codeigniter project that was originally developed in MAMP on OSX. My php dev environment is a XAMPP on Windows.Works great for all my other work and projects.However I copied this

I'm taking over a codeigniter project that was originally developed in MAMP on OSX.

My php dev environment is a XAMPP on Windows. Works great for all my other work and projects. However I copied this app I took over to my htdocs folder and it works but it causes lots of problems with rewriting URLS (for example ModRewrite isn't working when it is suppose to, see ModRewrite not working for codeigniter site).

Could these problems stem from the two dev environments? It works fine when on my host, but I need to make changes.

EDIT: Got it back on a MAMP environment, same exact p开发者_如何学JAVAroblem. Looking into config now.


ok, CodeIgniter specifc environment config issues...

system/application/config/config.php
system/application/config/database.php
./index.php

Things to check are 'base_url' in config.php

Also on this note, make sure in the code the previous author consistently used <?= base_url() ?> for loading assets(css,img,etc..) and other path dependant things.

example url to include a css file <= base_url() ?>css/cssfile.css would create the url http://your.local.host/css/cssfile.css

and <?= site_url('controller/function') ?> would create http://your.local.host/index.php/controller/function

make sure for anchor tags they used <?= site_url('uri/path') ?> for the href.


1 Check how sitepath is, eg. it was locahost/~user/ci and is localhost/ci

2 if is different Change both config.php and .htaccess

3 make sure that htaccess works. CHeck if module is there and check if allow .htaccess on httpd.conf

See what is different from Mamp to Xampp.

0

精彩评论

暂无评论...
验证码 换一张
取 消