Home  >  Q&A  >  body text

When I try to run my Codeigniter application using "php Sparkserve" I get this message "Cannot open input file: spark"

<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>
P粉362071992P粉362071992385 days ago553

reply all(1)I'll reply

  • P粉141035089

    P粉1410350892023-09-01 10:37:04

    php Sparkserve Only works with CodeIgniter 4. For CodeIgniter 3, you can use the php -S localhost:8080 command line in the index.php directory (usually the root folder of your project). 8080 is the port, you can replace it with any available port if needed.

    You 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.

    reply
    0
  • Cancelreply