PHP work on Glitch?

Does PHP work on glitch? I have an index.php file and it just shows a directory of all files.

If I rename the index.php to index.html it shows what it is supposed to but doesnt run the php code.

Is PHP allowed or able to be used?

Not out of the box. If you remix from one of our starter projects then it’s possible. See https://glitch.com/edit/#!/php-poc, which uses the Slim framework, or https://glitch.com/edit/#!/lamp-poc

1 Like

Is it possible to make my project work with PHP? Is there some dependency I need to add?

@Gareth I need to use PHP. If I use the starter that works with php I need to import my github. I import github then it stops php from working. How can I import my github without stopping php and put the files in the root directory and not /reponame/file.php

When you import it replaces all the content in the project with the imported stuff, so it will be losing the needed files. So I suggest you do a wget like you did before, on top of a remix of the PHP base project. You can then use a mv command to move all the content within the repo name folder to the root directory, like mv /app/reponame/* /app/

@Gareth What is the directory I should move files to so they are not in a directory in the editor. I tried mv /files* /

But that doesnt seem to work…

The root directory of the file menu in the editor is the folder app.

1 Like

Thank You. That worked now.

i didnt understand this part…