Skip to content
Getting started4 min read

Uploading a PHP site to hosting, step by step

Short answer

To upload a PHP site, zip its files, upload the archive to public_html with cPanel's File Manager and extract it. If the site uses a database, create a database and user in MySQL Database Wizard, import the .sql file in phpMyAdmin, put the database details in the config file with localhost as the host, then choose the PHP version the code needs.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. What did you receive? Identify the files
  2. What you need
  3. Step by step
  4. Troubleshooting
  5. On ArabyHost

Many business owners receive their site from a freelancer as a ZIP file, buy a ready-made script, or ask an AI tool to write one, and then don’t know what to do with it. This guide starts from the files in front of you and explains what each part is before telling you where it goes.

What did you receive? Identify the files

Open the folder on your computer and look for these signs:

What you see What it is What to do with it
Files ending in .php, such as index.php The site’s pages and code Upload to public_html
A file ending in .sql or .sql.gz A copy of the database Import it in phpMyAdmin
config.php, .env or wp-config.php The settings file with database details Edit it with the new database details
An install folder or install.php An installer Open it in the browser once, then delete it
composer.json and a vendor folder PHP libraries the site needs If vendor is missing, you need Composer
A public folder containing index.php A framework project such as Laravel Needs extra steps; see deploying Laravel without SSH

If there is no .sql file but the site needs a database, ask the developer for it, or look for an installer that creates the tables.

What you need

  • All the site files, including hidden ones such as .htaccess.
  • The database file, if there is one.
  • The PHP version the site needs. Ask the developer, or read the README or the script’s page.
  • A domain pointing to your hosting, as in connecting a domain to hosting.

Step by step

1. Zip the files

Select all the files inside the site folder (not the folder itself) and compress them into a ZIP, so that index.php is at the top level when extracted. One file uploads faster and more reliably than thousands of small ones.

2. Upload and extract

Open cPanel, go to Files » File Manager and open public_html. Click Upload, upload the ZIP, then go back, right-click it and choose Extract. Delete the ZIP afterwards. File Manager’s tools are explained in the File Manager guide.

3. Create the database

In Databases » MySQL Database Wizard:

  1. Name the database, for example shop.
  2. Create a user with a strong password; the password generator helps.
  3. Give the user ALL PRIVILEGES.

cPanel puts your account name in front of the names, so they become something like cpuser_shop. Write down the full names. Details in creating a MySQL database.

4. Import the database file

Open Databases » phpMyAdmin, select the new database in the left panel, click Import, choose the .sql file and click Import at the bottom. Success shows as a green message and a list of tables in the database. If the file is too big, see phpMyAdmin import too large.

5. Edit the config file

Open the config file in File Manager with Edit and change the four values. The format varies by script but looks something like this:

$db_host = 'localhost';
$db_name = 'cpuser_shop';
$db_user = 'cpuser_shopuser';
$db_pass = 'the-new-password';

On cPanel the host is almost always localhost. If the file also holds the site URL (such as site_url or APP_URL), set it to your domain with https://.

6. Choose the PHP version

Under Software » Select PHP Version or MultiPHP Manager (depending on the server), choose the version the site needs and enable the extensions it uses, such as mysqli, pdo_mysql and mbstring. Old scripts may not run on PHP 8; in that case they need an update from their developer. Details in choosing a PHP version.

7. Test

Open the site, log in to its admin area and try a form or a purchase. If there is an installer, finish it and then delete the install folder.

Troubleshooting

  • HTTP 500 or a blank page: open the error_log file in the site folder. The usual causes are a PHP version that doesn’t suit the code, a missing PHP extension, or an .htaccess line the server rejects. See HTTP 500.
  • “Error establishing a database connection” or a similar message: the database or user name is missing the prefix, or the password is wrong. See database connection error.
  • A list of files appears instead of the site: index.php isn’t directly inside public_html.
  • Arabic text shows as symbols: the database or import encoding isn’t utf8mb4. Re-import with the right character set.
  • “Permission denied”: set folders to 755 and files to 644.

On ArabyHost

Every ArabyHost plan runs PHP 8.1 to 8.3 with MySQL/MariaDB and phpMyAdmin, and cPanel opens with one click from the Araby Panel. The LiteSpeed web server reads .htaccess rules the way Apache does. If your project needs Composer, SSH or Git, the AI and Developer plans provide them inside an isolated CageFS environment; technical details are on the developers page. If an error appears, the Araby AI assistant reads the error log and explains the cause, and developers will find the full walkthrough in deploying a PHP site with a database. Prices in your currency are on the pricing page.

FAQ

Can I upload a PHP site to free hosting?

Some free hosts support PHP and MySQL with strict resource limits, and may block email or add ads. They are fine for testing; a site for real customers needs paid hosting with backups and SSL.

Which file holds the database details?

It depends on the script: wp-config.php in WordPress, .env in Laravel, and in many scripts config.php or a file inside a config folder. Look for a file containing words such as DB_NAME, DB_HOST or database.

The script has an install.php file. What do I do with it?

Many ready-made scripts include an installer you open in the browser, such as example.com/install, which asks for the database details and creates the tables itself. When it finishes, delete the install file or folder as the script's instructions say.

Do I need SSH to upload a PHP site?

No. File Manager and phpMyAdmin are enough for most sites. SSH helps with projects that need Composer or commands like php artisan, and it is available on developer plans.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.