Welcome Guest, Not a member yet? Register   Sign In
Cannot serve site from localhost subfolder using spark?
#1

(This post was last modified: 10-11-2021, 06:35 AM by blaasvaer.)

I've placed a CI website in a subfolder on my localhost (/Applications/MAMP/htdocs/website). From the root of the folder I run:
Code:
$ php serve spark --port 8081
And get this:
Code:
CodeIgniter CLI Tool - Version 4.0.4 - Server-Time: 2021-10-11 08:18:10am

CodeIgniter development server started on http://localhost:8081
Press Control-C to stop.
[Mon Oct 11 15:18:10 2021] PHP 7.4.2 Development Server (http://localhost:8081) started

But http://localhost:8081 throws an Internal Server Error (500) ... I've tried to modify the .htaccess from suggestions around the web without any luck (yeah, sad it should take luck to fix stuff like this). Does anyone have any idea what could be the cause for this?

NOTE: I can run it through MAMP when going to http://localhost/website ... but I wanna switch to spark for local development.
Reply
#2

the short answer is that spark serve would be for playing from say your Desktop when perhaps you might be using sqlite database which doesn't require a database daemon

So one approach where you have several directories inside the main web server directory would be to use virtual host; you have to configure so its listening to public

i'm using apache where web root is at : /srv/http i've several web apps ,all contained within their own subdirectories. By proper set up I can get to individual landing page
of each using slightly different addresses such as : http://127.0.0.2/

So basically just use the web server to serve not spark
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB