Existing CodeIgniter application folder in new CodeIgniter installation - php

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

Related

How to use PHP framework in old core PHP project

I have an old core PHP existing project and I would like to keep the old code as it is but for any new files or updated use Laravel framework.
I can install and run Laravel framework but how do I manage my .htaccess file so that routing is done properly?
Any help would be appreciated.
Thank you
Rather than alter your htaccess configurations, to keep them entirley separate, I think I would dump your whole Legacy project into a new Services folder within your Laravel App. Then create a new Controller that points to it. It'd give you the opportunity to peal off sections of the Legacy project later, to refactor it into the new framework properly. And it'd give any new features for it access to Laravel's library.
If you have a standard PHP project where you go straight to the .php file. Just throw them in your public folder.
Which would look something like this on your local testing machine
localhost:8000/public/about.php
But once you launch the site, then it will be normal:
www.yoursite.com/about.php
I wouldn't recommend doing this. I would suggest migrating the project fully to the Laravel framework.
You could run into some issues with URL names, be very careful as your going to be possibly dealing with a lot of 500 errors.

Laravel 5.2 - How do I release my Web App to GitHub?

So I’ve just finished developing my Laravel 5.2 web application that uses AdminLTE. It is an Asset Management System with some budget and invoice functionality, which will assist me in making my full-time job as a Systems Manager easier.
It’s not the most complicated app, but I’m proud of it, so I want to share it on GitHub, so others might be able to make use of it, as well as having my code available for future when I start applying for development jobs.
Now I’ve tried my best Google skills, but I just cannot figure out how to go about sharing my code on GitHub. I've used Bitbucket during my development phases, as I wanted to keep it private.
If anyone can please direct in the right direction about what steps I should be taking now to actually share my app out there. Should I be looking at something like Packagist instead, as I’m sure I’m not supposed share Laravel along with my web app. Any help will be greatly appreciated.
This question is not about how to upload my project to GitHub, but specifically about what the correct procedure is for Laravel projects and how to share them for others to easily use.
You just need to create a project repo and upload all your project code there.
If you didn't modify any core file in vendor directory, then upload the all code except vendor directory.
once uploaded, add up some readme.md file to tell some guideline/instruction for installation the project.
make your repo public so other can access it

Codeigniter 2.1.3 install issue after moving app and system folders

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.

Using multiple php frameworks on one website

Our main website uses symfony 1, and by the time I started working on the code it seems impossible to upgrade (too much custom code from previous developer). Now we are adding a large addition to what the company offers. Instead of using a really old framework I wanted to use CodeIgniter, also since I'm very familiar with it. My real question:
What is a proper way of setting up a website to use multiple frameworks. The new features will be separate from the original website, but it will still need a few tables of the database.
I was going to have apache handle where the root directory was depending on the url and just do everything normally. The main website is example.com and the new feature will be abc.example.com
I'm really looking for people who have done this and some tips and warning they had.
PHP will run the framework based on which directory is loaded on the server. For instance, on most apache servers the root directory for example.com would be /www. Which means all of the code for Symphony would be in /www/*.
When you setup the path of your subdomain, just put it outside of the /www folder. Then, when you go to abc.example.com apache won't try to load the original site along with the Symphony framework.
I think it will be fine for both frameworks to share the same database tables. I'm not entirely sure how you plan for these two applications to work, but as long as you don't change the column names and types you should be okay.
If you don't want the applications to share the data in the original table, then look into using mysqldump or something of the like to copy the data over to a new table.

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!!

Categories