Welcome Guest, Not a member yet? Register   Sign In
Renaming index.php problem
#1

(This post was last modified: 12-10-2022, 09:15 AM by dgvirtual.)

I run into a problem of renaming index.php to api.php, for though the app/Config.php file comment suggests that it can be renamed
PHP Code:
    * --------------------------------------------------------------------------
    Index File
    
* --------------------------------------------------------------------------
    *
    Typically this will be your index.php fileunless 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'; 
, changing the $indexPave variable to api.php and renaming the index.php file actually resulted in an error: 

Quote:Warning: require_once(/home/myuser/dev/mywebsite/backend/public/index.php): failed to open stream: No such file or directory in /home/myuser/dev/mywebsite/backend/vendor/codeigniter4/framework/system/Commands/Server/rewrite.php on line 46

Fatal error: require_once(): Failed opening required '/home/myuser/dev/mywebsite/backend/public/index.php' (include_path='.:/opt/lampp/lib/php') in /home/myuser/dev/mywebsite/backend/vendor/codeigniter4/framework/system/Commands/Server/rewrite.php on line 46
Well, to fix it I had to modify the system/Commands/Server/rewrite.php file by replacing the two occurences of index.php there with api.php; it works now, but changin CI core files is the wrong way to do things...

Should I consider the fact that index.php is hardcoded a bug and report it? Or am I missing some setting?
==

Donatas G.
Reply
#2

It might be a bug, but we won't fix it.

Your fix is no problem, because the file is used only when you use `spark serve`.
If you don't want it, please use Apache or Nginx instead of `spark serve`.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB