Getting Started on Square Cloud with PHP
Learn how to get started on Square Cloud with PHP
๐ Introduction
- Before you begin, make sure you have PHP on your system. If you donโt have them yet, you can download them from the official PHP website.
- Next, you will need to create an account on Square Cloud, which can be done through the login page. You can use either your email or Discord, or both, to create an account.
- Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs here.
โ๏ธ Creating the squarecloud config file
Learn about: how to make the configuration file for Square Cloud.
The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things.
๐ Required Files
- index.php (Example of main file).
composer.json
(*Optional dependency file).- squarecloud.app (a file containing your Square Cloud configuration).
โถ๏ธ Start Application
-
If the
START
field is not defined in the configuration file, a local PHP server will be started using thephp -S 0.0.0.0:80
command. If theSTART
field is defined in the configuration file, the value in theSTART
field will be executed directly. For more information on configuration file parameters, visit configuration parameters. -
If the
composer.json
file exists, all dependencies will be installed using thephp composer.phar install
command.
๐ฅ๏ธ Preparing Project for Upload
Before you can host your project on Square Cloud, ensure your project files are correctly configured for hosting.
If your project includes a composer.json
file, Square Cloud will automatically install dependencies using Composer. However, if your project also has Node dependencies (i.e., a package.json
file), you should specify the installation process in the START
field of your squarecloud.app
file. For example:
START=npm install && php .....
squarecloud.app/.config
) file must be located in the root of the zip file. Otherwise, Square Cloud will not be able to find it during deployment.๐ค Uploading Project to Square Cloud
After preparing your project files, you can now upload them to Square Cloud and host your project.
Access the Square Cloud Dashboard and upload your project files.
If you continue to experience any issues, please donโt hesitate to contact our support team.