Tutorial

How to install a PHP hotel booking script on your own hosting, step by step

Hosting requirements, database, upload, the wizard, your property and rates, Stripe in test mode and a first test booking: the whole install of Panda Resort, with screenshots.

By Pandao · Updated · 8 min read

A PHP hotel booking script runs on your own hosting, with no monthly fee and no commission, but it has to be installed. This tutorial goes through it with Panda Resort, our booking system for a single hotel: the hosting it needs, the database, the upload, the installation wizard, the first login that installs the booking engine, your property and rates, Stripe in test mode and a first test booking. Allow about ten minutes for the install itself and an hour to make the site yours. The screens are those of the product's documentation, taken on the live demo.

1. Check your hosting

Panda Resort runs on most shared hosts, VPS and managed servers. Before you buy a plan, or on the plan you already have, check these points; after the install, the Diagnostic screen of the administration checks every one of them on your server.

ComponentNeededAdvised
PHP8.2 to 8.5, with the curl, dom, fileinfo, gd, mbstring, openssl, pdo and pdo_mysql extensions8.3 or 8.4, plus intl for dates written in each language
DatabaseMySQL 5.7 or MariaDB 10.3, utf8mb4 character setMySQL 8 or MariaDB 10.6 and later
Web serverApache 2.4 with mod_rewrite and .htaccess files allowed, or IIS with URL Rewritenginx in front of Apache, as on Plesk and many cPanel hosts, works as it is
HTTPSFor online paymentsOn the whole site; most hosts give a free certificate
PHP memory128 MB256 MB
Automatic tasksA cron job every minute, or PHP-FPM for the fallback run by visitsA cron job (step 7)

Outgoing HTTPS calls must be allowed, to Stripe and PayPal, to the platforms whose calendars you connect, to the European Central Bank for exchange rates and to Google for reCAPTCHA; a host that blocks them only disables the feature concerned.

2. Download the package

After your purchase on CodeCanyon, open your account's Downloads page and download the main file. It holds two folders: documentation/ (open its index.html: the full documentation, with every screen) and upload/ (the website, ready to upload). The PHP libraries are already there, so you don't need Composer or a terminal.

3. Create a database

In your hosting panel (MySQL Databases in cPanel, Databases in Plesk), create an empty database with the utf8mb4 character set and a user who has every privilege on it. Keep its name, its user, its password and its host (often localhost) to hand for the wizard.

4. Upload the files

Upload the contents of the upload/ folder to the web root of your domain (often public_html/ or httpdocs/), or to a sub-folder such as public_html/booking/. The quickest way is to upload the zip with the file manager of your host, extract it there and move the contents of upload/ into place. With an FTP client, make sure hidden files are sent too: the .htaccess files matter.

5. Run the installation wizard

Open the address of your site: the wizard starts by itself. Give the title of the site, its public address (https://www.your-site.com, without a slash at the end), the email address that receives the notifications, the login and password of the administrator, then the details of the database. Click Install.

The installation wizard with its General and Database fields: site title, public address, email, administrator account, database name, host, user and password
The wizard writes the configuration file and installs Pandao CMS, the CMS Panda Resort runs on.

The wizard writes config/config.php and public/robots.txt: PHP must be allowed to write in config/ and public/ while it runs, which is the case on most hosts. Once the site is installed, the wizard locks itself; you can also delete the setup/ folder, a good habit on a live server.

6. Log in: the booking engine installs itself

Click Log in and sign in with the administrator account. At this first login, Panda Resort, shipped with the site, is enabled in a few seconds: its tables are created and the demo content is installed. A message confirms it on the dashboard and the Panda Resort menu appears.

The dashboard after the first login, with the message that Panda Resort is enabled
The first login enables Panda Resort and installs a complete demo hotel to make your own.

Your site isn't empty: it opens on a complete hotel website, in English and French, with a fictional boutique hotel, seven room types, their rates, offers, services, taxes and two activities. You'll replace its texts and photos with yours at step 8, which is far quicker than starting from a blank CMS.

7. Set up the automatic tasks

Some work happens in the background: a booking not paid in time is cancelled and its rooms put back on sale, guests are reminded to pay, platform calendars are read, exchange rates are updated. For these to run on time, your server runs bin/pandao cron every minute. Open Diagnostic › Advanced configuration: it shows the exact line for your server, with the path of its PHP. Paste it into the cron jobs of your hosting panel (Cron Jobs in cPanel, Scheduled Tasks in Plesk), or send it to your host.

The Diagnostic screen: the status of the synchronisation and the list of the automatic tasks with their last run
Diagnostic: who runs the tasks, when they last ran, and the cron line to copy.

Without a cron job, the site runs its tasks itself after a visit, at most every ten minutes, on hosts that use PHP-FPM. That's enough to try the product; add the cron job before you open the bookings, so that a quiet site doesn't run them late.

8. Make the demo property yours

Open Panda Resort › Catalogue › My property: its name and tagline, the text of the Rooms page, the facilities, the contact details (the email address receives the booking notifications; Find the address places the hotel on the map), check-in and check-out times, whether bookings are confirmed at once or on request, and the photos of your property.

The form of the property: title, subtitle, main text, facilities, contact details and photos
Panda Resort › Catalogue › My property: everything the Rooms page and the emails say about your property.

Then Catalogue › Rooms: edit the demo room types or add yours, each with the number of identical rooms you sell, their numbers or names, the maximum adults and children, a "price from" for the listing, and photos. Finally Pricing › Rates: the calendar shows prices, stay rules and closed rooms day by day. Create your seasons with their nightly rates, set what an extra adult or a child pays, and copy a season to next year when the time comes.

The rates calendar: each room type on its row, with the price of every night and the units open, over a month
Pricing › Rates: prices, stay rules and closed rooms, day by day.

The rest of the site is managed by Pandao CMS, from the same administration: the pages, menus and blog in Content, the languages and texts in Configuration, your logo and colours in Settings › Appearance, the SMTP server of your mailbox in Settings › Email settings.

9. Set how guests pay

In Extensions › Panda Resort › Settings › Payment, tick the methods you accept: at the hotel, card through Stripe, PayPal, bank transfer, cheque. Choose the amount asked when booking (the whole stay, a percentage, the first night or a fixed amount) and how long rooms are held during an online payment.

The Payment tab of the settings of Panda Resort: payment methods, amount asked when booking, time rooms are held and bank details
The Payment tab: methods, deposit, holding time and the details given to guests who pay by transfer.

For Stripe, copy the Publishable key and the Secret key from your Stripe account (Developers › API keys) into the tab, with Card (Stripe) ticked. Start with the test keys (pk_test_…, sk_test_…): payments can be tried without charging anything. The documentation also explains the Stripe webhook, which records a payment even when a guest closes the page too early, and the PayPal sandbox.

10. Take a test booking

Open your site as a guest: search dates and guests, pick a room and an offer, then fill in the details at the second step. The form lists the services and activities of the stay, a promo code field, and each payment method with what's paid now and what's paid at the hotel.

The payment options of the booking form, with the amounts due now and at the hotel
The second step of the booking: each payment method says what is paid now and what is paid at the hotel.

Choose the card payment: Stripe's secure page opens, and the test card 4242 4242 4242 4242, any future expiry date and any CVC complete it. Back on your site, the guest sees the page of their booking, which the confirmation email links to. On your side, Panda Resort › Bookings lists it with its status and payment, the booking sheet lets you record a payment, confirm or cancel, and the Planning shows the stay on the room it took.

The booking sheet in the administration: guest, stay, rooms, services, payments and the actions on the booking
The booking sheet: the stay, its payments and the actions on the booking.

Before you open the bookings

  • Languages. A new site opens in English and French with the language selector; keep one language, or add others, in Settings › General and Configuration › Languages.
  • Emails. Set the sender and the SMTP server of your mailbox in Settings › Email settings, then send yourself a test booking: guests must receive their confirmation.
  • Live keys. Replace the Stripe test keys with the live ones, and add the webhook in Stripe's live mode too.
  • Platform calendars. If your rooms are also on Airbnb or Booking.com, open Calendars from the Planning and connect each room's calendar, so that no night is sold twice.
  • Backups. Turn on your host's backups of the files and the database before the first real booking.

Several hotels? Same install, different product

Panda Resort is built for one property. Panda Multi Resorts installs the same way, on the same hosting, and runs several hotels on one website, each with its own owner account, rooms, rates and payment accounts. Our guide on building a multi-vendor hotel booking platform explains what changes.

Try it before you install

Every screen of this tutorial is open on the live demo, administration included: look at the Diagnostic, the property form and the rates calendar before you buy, then install on your own hosting in ten minutes.

Buy on CodeCanyon for $69 Try the live demo Open the admin demo

Admin demo: username admin, password admin123. The full documentation is online and in the package.

Products in this guide

More guides