CodeIgniter Forums
How to install codeigniter and view at a temporary URL. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: How to install codeigniter and view at a temporary URL. (/thread-78666.html)



How to install codeigniter and view at a temporary URL. - dfavacho - 02-22-2021

Hi guys, how are you? I would like to take a doubt with you. I'm new to codeigniter and I'm doing a testing environment to use codeigniter. I currently use the CWP (Control Web Panel) to organize my test environment. I create the hosting account normally and would like to use the temporary url that it creates, for example teste.ddns.net/~client1. When downloading the latest version of codeigniter I put the content of public in my client's /home/client1/public_html folder. The rest of the directories are located in the root folder of the client /home/client1/codeigniter. I checked the permissions and owners of the file and they are ok. But typing the url http://teste.ddns.net/~cliente1 gives the message 500 Internal Server Error. Is it possible to function CI4 in this temporary url? I appreciate the help.


RE: How to install codeigniter and view at a temporary URL. - John_Betong - 02-22-2021

Try the following and if the file name is not rendered then temporarily rename .htaccess file. If the file name is rendered then gradually move the test down the file until the 500 error appears again.

File: index.PHP

Code:
<?php 
echo __file__; die;



RE: How to install codeigniter and view at a temporary URL. - dfavacho - 02-22-2021

Hi John_Betong, I put what you told me but the error message didn’t change Sad. Apparently codeigniter is not recognizing the url http://teste.ddns.net/~client1 as the main one on the site. about something but to no avail. I appreciate your help.


RE: How to install codeigniter and view at a temporary URL. - iRedds - 02-22-2021

Look at the application and web server logs.


RE: How to install codeigniter and view at a temporary URL. - InsiteFX - 02-22-2021

Try copying all of the public folder files into the public_html folder

On my website it is named public_html I rename public folder to public_html
and then just ftp all files to the root and it runs right off.


RE: How to install codeigniter and view at a temporary URL. - John_Betong - 02-23-2021

(02-22-2021, 06:48 PM)dfavacho Wrote: Hi John_Betong, I put what you told me but the error message didn’t change Sad. Apparently codeigniter is not recognizing the url http://teste.ddns.net/~client1 as the main one on the site. about something but to no avail. I appreciate your help.

It is essential to get index.php to render the file name before modifying anything else.

it is not CodeIgniter that fails to recognize the URL, it is Apache2.

This Apache2 500 error must be solved before trying any CodeIgniter modifications.


RE: How to install codeigniter and view at a temporary URL. - paulbalandan - 02-23-2021

Since you have put the contents of public into home/client1/public_html, you have 2 options here.

1. Copy all other files into home/client1. Do not put inside codeigniter folder.

or

2. Copy all other files into home/client1/codeigniter1. Update the paths in app/Config/Paths.php to point to the new paths.


RE: How to install codeigniter and view at a temporary URL. - dfavacho - 02-24-2021

Hi guys, I found out where the error was. I believe that when using the temporary URL in the CWP it does not allow you to use the options in the .htaccess: Options All -Indexes and Options + FollowSymlinks. Just comment these lines and the codeigniter works. Thanks to all for your help.


RE: How to install codeigniter and view at a temporary URL. - John_Betong - 02-24-2021

As mentioned in a previous post that .htaccess file should have been temporarily renamed to test to see if Apache2 was rendering index.php. If rendered OK then proceed with further tests.

I believe .htaccess is mostly essential for "Pretty Urls". If there is no .htaccess file then CodeIgniter uses the following default method:

//app/config/App.php
Code:
/**
* --------------------------------------------------------------------------
* Index File
* --------------------------------------------------------------------------
*
* Typically this will be your index.php file, unless you've renamed it to
* something else. If you are using mod_rewrite to remove the page set this
* variable so that it is blank.
*
* @var string
*/
public $indexPage = ''; // 'index.php';