PHP work on Glitch?


#1

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?


#2

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


#3

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


#4

@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


#5

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/


#6

@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…


#7

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


#8

Thank You. That worked now.