Deploying Codeigniter 4 Website on LAN server |
I developed Codeigniter 4 website on my laptop running Mint Linux with LAMP.
I have another PC in the home network dedicated as an ubuntu 20.04 LTS server with LAMP installed. On deploying the Codeigniter 4 website onto the Ubuntu server 20.04 LTS, and calling the ip address of it, i only get "index.php" displayed on the browser How do i need to configure the Ubuntu server other than using virtual host configurations? In the Mint Linux laptop, i can configure "httpd.conf" to point to the website, but in the 20.04 server, i only have "apache2.conf", and am not sure if and how to configure Kindly help (07-29-2021, 05:56 AM)Chroma Wrote: The most likely reason is that you are missing the .htaccess file.i have added .htaccess and now i got this message systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'bootstrap.php'; $app = require realpath($bootstrap) ?: $bootstrap; /* *--------------------------------------------------------------- * LAUNCH THE APPLICATION *--------------------------------------------------------------- * Now that everything is setup, it's time to actually fire * up the engines and make this app do its thang. */ $app->run();
That looks like the end part of the index.php file.
Have you made any changes to the index.php file that would break the PHP? such as a punctuation character? On my system running 4.1.3, that is part of line 27, so it seems that up until line 27 all was fine, then it had a problem. Can you check that and if it all looks good, show the full index.php file here.
from what i understand apache2.conf for ubuntu is the "equivalent" for httpd.conf which i have on Arch and you have on Mint
Also on your ubuntu see if you have this file: /etc/apache2/sites-enabled/000-default.conf One weird thing with Ubuntu is you have to run : sudo a2ensite <VirtualHostFilename> Did you have to do that on Mint ? There are a few tutorials out there for Ubuntu but you should be able to compare apache2.conf settings against httpd.conf settings since in essence they are the same thing So you should see something like [in apache2.conf: Code: <IfModule dir_module> here i added index.php after index.html
Have you confirmed if you have properly installed the PHP module in your Apache? This is because instead of parsing the index.php as a PHP file, your server instead parses it as a normal text file resulting in just rendering the contents.
Make sure you have the following similar lines in your apache2.conf Code: # Taken from my dev httpd.conf
07-31-2021, 02:07 AM
(This post was last modified: 07-31-2021, 02:09 AM by captain-sensible. Edit Reason: addition )
hes got Linux on both boxes and that looks like your on Windows Paul . but your right I'm on Arch and in httpd.conf
the lines i added were: Code: LoadModule rewrite_module modules/mod_rewrite.so Another thing to check is : libapache2-mod-php you can check that with : Code: apt-cache policy libapache2-mod-php Code: sudo a2enmod php it might be worth you having a look at : https://linuxhint.com/install_apache_web_server_ubuntu/ (07-30-2021, 02:29 AM)Chroma Wrote: That looks like the end part of the index.php file. Hello, I have checked. I did make some change but it was on line 20 on "FCPATH......" and it did work on the development machine, but not on the ubuntu server here is the index.php PHP Code: <?php (07-31-2021, 02:07 AM)captain-sensible Wrote: hes got Linux on both boxes and that looks like your on Windows Paul . but your right I'm on Arch and in httpd.conf (07-30-2021, 11:24 AM)paulbalandan Wrote: Have you confirmed if you have properly installed the PHP module in your Apache? This is because instead of parsing the index.php as a PHP file, your server instead parses it as a normal text file resulting in just rendering the contents. @ paulbalandan will check on apache2.conf |
Welcome Guest, Not a member yet? Register Sign In |