CodeIgniter and normal website - php

I have a web hosting which hold a website I run.
I'm learning CodeIgniter so I would like to upload it a file in that web hosting and run some test and learn, CodeIgniter just for test, and keep using the website normally for users.
Is there any related or known issues or problem by running both ? I don't want the website to get frozen or act weird wit this.

Install codeigniter in it's own folder in a subdirectory instead of in the web root directory.
You will have to modify your config:
Installing a CodeIgniter application in a subfolder

Create a New Folder for your CodeIgniter Learning and Upload all CI files there including System folder and other.
If you Upload the the files with current website files folder it may create some issue.

Related

How to configure codeigniter with site files in xampp?

I've recently taken over a project from another developer, let's call it EBAY. I'm struggling to get their live site up and running on my local server for testing and debugging. They've built a web app using CodeIgniter. In their file manager on cPanel they've placed the ci folder at the root, not in the public_html folder.
I've copied their public_html files and their ci folder into my xampp's htdocs folder. The issue is that the site only loads when the ci folder is placed WITHIN the folder for EBAY. Oherwise when I load the localhost site it gives an error message that it cannot find the codeigniter folder inside EBAY folder.
How is this? How can the application run with the ci folder at the root on the live site, but when I have migrated it to the htdocs of xampp it is expecting the ci folder to be inside the EBAY folder?
This kind of configuration is quite common nowadays, and if you look at Linux or Pear you'll discover that PHP files sometimes are completely in other directories than the webserver.
The ideas behind this are pretty simple but effective:
Any files can't be reached from the network / internet.
So they can't be altered, downloaded or even just viewed.
PHP (or other) Libraries are clearly separated from individual code and can't be easily mixed up or accidentally be deleted.
Access rights are easier to control and perhaps even that differently than the files in the webfolder.
Ok, so far an explanation. Now about your issue with it:
You've currently a webfolder htdocs in Xampp and in general you can use a subfolder as the webfolder and in htdocs directly you place the project files that are not public. You've to adjust then where the domain is pointing (docroot and/or virtual hosts).

How to edit php files after building angular app

I want to deploy my angular app on 000webhost. I used ng build to build my project and I uploaded my dist files to the file manager of the webhost. However, my website contains php files with credentials and urls linking to folders in the project such as :
baseUrl:string = "http://localhost/lfsa-db/php";
return this.httpClient.post(this.baseUrl + '/register.php', { first_name,last_name,father_name})
My dist files are all .js with the index.html. How can I edit these lines of code ? They were in a .php file before building the project.
Navigate to where your files are stored, make changes to those files and re compile your app / refresh the page. When you upload your files to 000webhost you should be able to make changes to them. If you can't, make changes to your angular app locally and re upload the files.
Hope this answers your question.
This is just my personal preference but I would use a git hub repo and deploy that. Using github will allow you to make commits to your branches and your web app will pull from the git hub, easy way to make changes after deploying.
When using webhosting software linking to a github gives you more control, at least in my opinion.

How do I view the files on my server?

I am developing a web application using Laravel. I am using Laravel Forge with a Linode server and GitHub. My site is live at the moment. Whenever I change the code, I commit the changes using GitHub for Windows and then deploy the website on Laravel Forge.
One part of my application allows a user to upload a file. This works grand. I can upload a file and then download it from another computer on the website. However, I am not sure how to view the files on my server. They are not appearing on GitHub, and I cannot see anywhere on Laravel Forge to locate these files.
Anyone have any ideas?
The files are definitely there as I said, I can download and view the files once they are uploaded. I am storing them in a files folder in my public directory.
I guess your problem is that the versioner(Git) is ignoring your files.
Verify that where your files are stored and that the .gitignore files in each folder do not ignore them
*
/ Storage_path
Storage_file.extension
*.extension
Modify your corresponding .gitignore files and then commit everything

How to upload Yii project on hosting sites?

I want to upload my Yii project on hosting sites but it seems that Yii framework is not working right in local computer. My directory structure is like this:
xampp/
htdocs/
passcollege/
webroot/
application
framework
I placed my Yii project in application folder and Yii libraries on framework folder its all working fine in my pc but when I uploaded it they (hosting site) give me a directory /home/user/public_html.
I placed the passcollege folder from my machine to their (hosting site) public_html folder, but when I accessed my site I need to manually select folders to reach Yii frameworks index.php.
You shouldn't store the framework in the web root. For the Yii application to show automatically you need to put the index.php file in the /home/user/public_html folder. I'd suggest a directory structure like this on your host:
/home/user/public_html
{contents of application folder}
/home/user/framework/
This is the same directory for Yii to find assuming you have it set up as the default.

PHP - First Time Installation of Laravel 4 on VPS

Hey so I am completely new to Laravel 4 and have some basic questions regarding my first time installation that I was unable to find answers to anywhere else on-line. I am planning of hosting a standard website with a fully dynamic web back end and a RESTful API using the framework. I have been following this installation guide and am essentially at the part where I type laravel new projectDir and it creates a new instance of Laravel in the provided directory.
Now my main public directory is public_html, is it recommended to install Laravel 4 directly into that directory. So is something like laravel new public_html recommended? I have found many other questions here that seem to suggest that this is not the safest solution. Should I make a separate directory inside public_html, is it necessary for what I am planning on doing with laravel?
Also, I would like to keep my URL's as neat as possible and would like them primarily to be www.domain-name.com/pagename for the website. Will creating a directory inside of public_html disable me from doing so?
Lastly I had some issues with routing my URL's when I tried to install a different framework on this server. Are there any server/Apache settings that would impact how URL's are routed with laravel that I should disable/enable before I install Laravel into a directory?
you would not put the base Laravel folder in public_html.
In a Laravel directory structure, which gets created when you do the laravel new command, there is a directory called public. This is what you map your web root to. So on my vps, I have a folder called /var/site/mywebapp which was created by the command:
laravel new mywebapp
In nginx (which I much prefer over Apache), I map my server root to:
/var/sites/mywebapp/public
In the public folder is an index.php that Laravel uses to run your whole app/site. The rest of the framework is outside of the web root and is not accessible by HTTP.
As for your URL issues, consult the documentation for how to properly configure your mod_rewrite (assuming Apache).
Also, Dayle Rees, a prominent member of the Laravel community (and core contributor), has a github of sample web server configs here:
https://github.com/daylerees/laravel-website-configs
When you install Laravel it will create a public folder, along with app, bootstrap and vendor folders.
The public folder is essentially your public_html folder where you want your host/apache to point to when viewing the root of your website. So mydomain.com should land directly within the public folder.
You can rename the public folder to public_html just be sure to also update bootstrap/paths.php paths value
'public' => __DIR__.'/../public',
// change to
'public' => __DIR__.'/../public_html',
Laravel will create a .htaccess file for you, which will grab URLs and redirect them to public/index.php which will process Laravel accordingly.
So to answer the question, you install Laravel one folder back from public_html and then you can rename public to public_html if your host requires.

Categories