PHP - create & deploy the project on MDB GO

How to deploy & host PHP app - tutorial & free hosting

This guide will take you step by step on how to create your project and deploy using MDB CLI.


Backend project - PHP

Initialize

Let's initialize npm project first:

        
            
              $ mdb blank init
        
        
    

Specify project name, choose between npm and yarn and create package.json file - you can also add other meta descriptions or accept default values.

project initalization

Open project in editor (i.e. VS Code), create index.php and create your app. You can use sample code:

        
            
         <?php echo("Hello PHP World"); ?>
                  
        
    

Publish

Once you finish building your project, use the following command to deploy it:

        
            
              $ mdb backend publish -p php7.4

        
        
    

Done! Your project will be ready. If you want to check project console use mdb logs command.

Video tutorial: