Codeigniter 2.1.3 install issue after moving app and system folders - php

Ive decided to try a framework since my project is getting big and settled on Codeigniter 2.1.3. It works as expected with the default folder setup, but I am getting the CI 404 page after I move the Application and System folders up one level like:
/Application/
/System/
/www/index.php
I changed $system_path to '../system' and $application_folder to '../application' (I also tried absolute paths) like the documentation states. I have traced the issue in CodeIgniter.php to:
if (method_exists($CI, '_remap'))
and it seems this is returning false. I can do a print_r on $CI but I'm not sure what I am looking for or where to debug from here and I'm looking for guidance. I have no other experience with frameworks.
Also, it may be relevant that my server is setup with this app needing to be shared by two virtual hosts. folders setup like:
c:/server/web/domain1.com/www
c:/server/web/domain2.com/www
c:/server/web/myapp/www
so in each virtual host I have:
RewriteRule ^/myapp(.*)$ c:/server/web/myapp/www/$1
so that domain1.com/myapp and domain2.com/myapp both take you to myapp.
please let me know what other information if any I can provide
Thanks for reading and trying to help.

I figured it out. Novice framework user mistake. It was a problem with a path in a controller. I'm sorry for wasting anybody's time.

Related

Bolt CMS wrong paths on localhost xampp

I wanted to try out bold cms on my localhost.
I have installed bolt cms on localhost/test (subfolder)
The admin section works great, but when I try to visit the actual site all the paths are incorrectly. Bolts tries to load different css and js files like this:
/test/public/test/public/theme/base-2016/css/theme.css
While it should be
/test/public/theme/base-2016/css/theme.css
Im sure this is easy to fix but for some reason i cant find a fix for this
Thanks in advance!
You need to put Bolt's public folder in your test folder. And put Bolt's other files one level up.
This is described in the docs where you can also find answers to other web server questions regarding Bolt.

Laravel multisite with domain mapping

I'm attempting to create a multisite in Laravel, so one codebase but with several sites operating from it. Each site will have similar functionality, so can reuse code, but each site will use a different theme - which I imagine would be as simple as having different themes in the views folder and mapping them depending on the domain that the customer has come through.
I want to be able to access Site X from www.sitex.com, Site Y from www.sitey.com etc, while having only one laravel install and not resorting to any vhosts tomfoolery.
Would any of you be so kind as to advise me on a solution, or to point me in the right direction? I've had next to no luck finding anything so far!
Thanks
If your routing is not going to be too complex you could potentially get away with having numerous public folders
laravel
app
bootstrap
sitex.com
sitey.com
vendor
Then each of your site will be it's own virtualhost with no funky alias rules like so (for security, make sure there is no access to the laravel root dir):
DocumentRoot "/var/www/laravel/sitex.com"
Lastly, you would put a variable in bootstrap/paths.php where the public path will be
'public' => __DIR__.'/../'.preg_match('/\w+.com/',$_SERVER['SERVER_NAME']),
This should work for the majority of deployments even with subdomain routing because bootstrap gets initiated from the index.php file in each of the public folders. If you want to use artisan to load up the built in php server, you will need to provide --host or it will not work. There will be a few limitations on this set up that I have encountered so if someone else knows of a better way I would love to learn how myself.

Existing CodeIgniter application folder in new CodeIgniter installation

A project I am an app developer on has recently lost its web service developer, this has left me holding the bag with very little knowledge of what I am doing. I was given a repo with the 'application' folder from the CodeIgniter project and nothing else. I downloaded a new copy of CI, installed on server and began copying the existing stuff into the new install, I did this slowly so I could see what would inevitably break.
And break something has, when I direct to the folder that the install is in i.e www.example.com/dashboard CI does its thing and redirects me to the auth controller and login function and then promptly throws a 404.
My thinking is that the previous developer enabled one of the CI features that cleans up URLs, however, as I said my experience is extremely limited. I have checked the application/config folders as thoroughly as I can, set the base_url, set the database values but I am throughly out of ideas.
Any thoughts or suggestions would be a God send as this project is scheduled to close very soon.
run that file with this url
www.example.com/index.php/dashboard

Importing and accessing existing PHP application into XAMPP

I am new to PHP (have been a Java guy all my years :-) but understand the basics of it. For an existing application on which I need to fix some bugs, I need to import it into XAMPP.
I tried putting all the application folders (and files) into the htdocs folder of XAMPP. However, that does not work. The server does list the new project when I navigate to "http://localhost" but when I click on my project (that I copied), the index.php page fails to come up. It simply says page not found.
I would like to know a couple of things as listed below...
1) Is there something wrong I am doing for the project to be hosted on XAMPP?
2) One peculiar thing that I noticed was that when the application browses to http://localhost/MyProject/index.php , it gets redirected to http://www.localhost/index.php . Is there a URLRewriter (or kind) which is doing this? If yes, where I can find the same within my project?
3) How can I identify the framework that the existing code is using? I can see M-V-C named class.php files
Any pointers would be much helpful for me to start debugging and learning PHP.
Thanks!!

Address of yii applications

I a new in Ubuntu and PHP frameworks. I had read the book about Yii name "Agile web application development with yii and php 5".
And this is the part of text:
Yii comes with a simple requirement checking tool. To invoke
the tool and have it verify the requirements for your installation, simply point
your browser to:
http://yourhostname/path/to/yii/requirements/index.php
I installed yii in /var/www/html/yii directory.
When I trying to open http://localhost/var/www/html/yii/requirements/index.php I get error message: Oops! This link appears to be broken.
Thanks for any help!
It depends on what your Apache server's "webroot" (localhost) is.
If your webroot is /var/www/html then el chief's answer would work:
http://localhost/yii/requirements/index.php
But your webroot is /var/www then you need to include the html part too:
http://localhost/html/yii/requirements/index.php
Basically "localhost" = /some/path (your Apache webroot), and when you are writing your URL you can just substitute the two.
So if "localhost" = /var/www instead of writing http://var/www/index.php you just write http://localhost/index.php
I hope this helps you with a higher-level understanding of what is going on.
This might help somebody, even though the question is already answered, since I had come searching here, even though the underlying issue was different.
I made the dumb mistake of extracting the downloaded yii archive into the www directory and accessing it via the http://localhost/yii/ URL, but took a while to realise that the extracted directory has the build#-release#, and once renamed to just "yii", things worked. Like I said, the problem you faced was different, but symptom was somewhat similar.
it should be http://localhost/yii/requirements/index.php
Also be aware that this book, while helpful, seems to have been rushed to publication. There's many fixes to be found on the Yii forums. I suggest you keep a tab open whenever you come across something that doesn't work or doesn't seem "right" in the book.

Categories