When I try to run my Codeigniter application using "php Sparkserve" I get this message "Cannot open input file: spark"
P粉362071992
2023-08-31 15:04:47
<p>I am tasked with maintaining an application developed using Codeigniter 3 and php 5 and noticed that I have never used Codeigniter before. </p>
<p>When I try to run the server in a local command prompt using the <code>php Sparkserve</code> line, I get the following result: </p>
<p><code>Unable to open input file: spark</code></p>
<p>BTW, I use Xampp and php 8</p>
<p>These are all the folders for the application: </p>
<p>Treefolder image of website without Spark files</p>
<p>As you can see, there is no file named "spark", which may be why the server is not running as expected. However, I was told that the site was running fine when it went live. </p>
<p>I still haven't modified anything in the code because I don't want to mess anything up since I know the app is fully functional when online. </p>
<p>What should I do to run it on my computer? </p>
php Sparkserve
Only works with CodeIgniter 4. For CodeIgniter 3, you can use thephp -S localhost:8080
directory (usually the root folder of your project). 8080 is the port, you can replace it with any available port if needed.command line in the
index.phpYou will also need to edit the
application/config/config.php
file so that$config['base_url']="http://localhost:8080/"
code>. But for peace of mind, and to avoid having to edit your environment when changing it (eg: staging, production), it's better to use environment variables (Set environment variables using CodeIgniter 3).hope it helps you.