Ask coding questions

← Back to all posts
I am trying to run a PHP program, but when I run it it says cannot find index.php.
MeowStudio (0)

The index.php file is far down in Fourm/public/index.php is there anyway to tell repl to run that rather then looking for index.php on the root directory?

Comments
hotnewtop
19ecal (228)

Make a file named .replit in it put run="cd fourm/public; php -S 0.0.0.0:8000 -t .

19ecal (228)

Or put run="php -S 0.0.0.0:8000 -t ./fourm/public"
That will do the same thing

MeowStudio (0)

@19ecal
unable to read .replit:
unable to decode .replit: Near line 1 (last key parsed 'run'): unexpected EOF

MeowStudio (0)

@19ecal

unable to read .replit:
unable to decode .replit: Near line 1 (last key parsed 'php'): expected key separator '=', but got '-' instead

19ecal (228)

@MeowStudio Yes try putting run="php -S 0.0.0.0:8000 -t ./fourm/public"