sodcalculator

10 Tech How-To

Install X-Cart on CentOS, Ubuntu, or Debian

Guide 10-41399 · Updated · Step by step

You can install X-Cart on CentOS, Ubuntu, or Debian, but it is a PHP web application rather than a package you install with one universal command. Set up a compatible web server, PHP environment, and database first, then deploy the X-Cart release files and complete the web installer; check that release’s requirements before choosing versions.

What X-Cart needs before installation

X-Cart is e-commerce software that runs on a web server. A typical self-managed installation uses Linux, a web server such as Apache or Nginx, PHP with the required extensions, and a supported database. The exact requirements depend on the X-Cart edition and release, so there is no safe, release-independent PHP version or dependency list to copy into a command.

Start with the documentation for the specific X-Cart release you intend to install. Verify its supported operating systems, PHP version, PHP extensions, database type and version, web-server configuration, and any required PHP settings. A server can have a recent PHP version and still be incompatible if that version is outside the release’s supported range.

  • Use a fresh or otherwise controlled server, and know whether you have root or sudo access.
  • Choose a domain or subdomain and configure DNS to point to the server.
  • Plan a database and a database user with access only to that database where possible.
  • Obtain the X-Cart files through the official distribution route for your license or account.
  • Arrange HTTPS and a backup plan before putting a store into service.

Install system packages on each distribution

Update package metadata and apply appropriate system updates before installing server components. On Ubuntu and Debian, package management commonly uses APT; on CentOS, it uses the distribution’s RPM-based package manager. Package names and available PHP versions vary by operating-system release and enabled repositories. Do not assume that a package command copied from another distribution will work unchanged.

Install a web server, the PHP runtime and extensions listed for your X-Cart release, and a supported database server or database service. If the release requires a PHP extension, verify that it is enabled for the same PHP installation used by the web server, not just the command-line PHP executable. After installation, check service status and configure the services to start automatically using the tools provided by your distribution.

CentOS needs particular care because the name covers different generations and compatible successors, with different package-management tools and lifecycle status. Confirm that your exact operating-system release is supported and still receives security updates. Ubuntu and Debian also have multiple releases, and their repositories may provide different PHP versions. If the required PHP version is not available in the default repositories, use a supported operating-system/repository combination or a hosting environment that provides the required stack; avoid adding an untrusted repository simply to obtain a version number.

Configure the web server and database

Create a virtual host or server block for the store’s domain. Configure its document root to the location and public directory specified by the X-Cart installation instructions. The web server should serve public application files while keeping configuration files, backups, and other private data inaccessible from the internet. Follow the release’s documented rewrite rules and front-controller configuration rather than guessing at a generic rule.

Create a database and a dedicated database account, then record the database name, username, password, host, and any required port or connection settings. These values are entered during setup. A database host is often local on a single-server installation, but managed databases and separate application/database servers use different connection details. Do not expose the database service publicly unless the deployment specifically requires it and network access is appropriately restricted.

Set file ownership and permissions so the web-server account can access the files it needs, and only the necessary directories are writable. Avoid making the entire application tree world-writable. X-Cart may require particular directories to be writable during installation or for runtime functions; consult the release’s instructions and tighten temporary permissions after setup if they permit it.

Deploy X-Cart and run its installer

  1. Download or obtain the installation archive for the correct X-Cart release from the authorized source. Confirm that the archive is complete and follow any supplied verification instructions.
  2. Upload the files to the server using a secure transfer method, or download them on the server only from the official source. Extract them into the intended application directory.
  3. Set the document root, ownership, permissions, and web-server configuration as required by that release. Check that the configured PHP handler is the one with the required extensions.
  4. Visit the store’s domain over HTTPS, or use the documented installer URL. Follow the on-screen setup prompts, providing the database connection details and the requested store and administrator information.
  5. When setup completes, test the storefront and administration area. Remove or disable installation files and setup access if the release’s instructions require it, and make sure sensitive files cannot be downloaded.

The exact installation screens and file layout can change between releases. If the official documentation specifies a command-line installer or a different deployment sequence, follow that release-specific procedure instead of applying an older tutorial.

Security and maintenance after setup

Installation is not the end of the work. Enable HTTPS with a valid certificate, use a unique administrator password, and keep the operating system, web server, PHP packages, database, and X-Cart release maintained. Restrict administrative access where practical, and do not leave database credentials or backups in publicly served directories.

Back up the database and application data regularly, and store copies away from the server so a server failure does not destroy every copy. Test that backups can be restored. Before updating X-Cart or changing PHP versions, read the relevant upgrade notes and make a separate backup; a software update can require code, database, or configuration changes.

Common installation problems

  • Unsupported PHP version: Compare the PHP version used by the web server with the release requirements. The command-line version may differ; check both.
  • Missing PHP extension: Install the exact required extension package for the active PHP version, enable it if necessary, and restart or reload the relevant service.
  • Database connection failure: Recheck the database name, user permissions, password, host, port, and whether the database service accepts connections from the application.
  • Blank page or server error: Review the web-server and PHP error logs. Check file permissions and configuration, and avoid displaying detailed errors to public visitors on a production store.
  • Rewrite or routing errors: Confirm that the correct virtual host is active and that the documented rewrite configuration is enabled for the chosen web server.

When troubleshooting, change one thing at a time and keep a record of the change. Avoid posting configuration files or logs publicly without removing passwords, tokens, and other sensitive details.

Frequently Asked Questions

Can I install X-Cart with one command on CentOS, Ubuntu, or Debian?
No single command covers every X-Cart release and all three distributions. The operating system, repositories, PHP requirements, and installation files differ. Install the documented prerequisites for your exact release, then follow its deployment steps.

Does X-Cart work with every PHP version?
No. Use a PHP version supported by the specific X-Cart release, along with its required extensions and settings. A newer version is not automatically compatible.

Can I install X-Cart on a shared hosting account?
Possibly, if the host supports the release’s PHP, extensions, database, file permissions, and web-server requirements and permits the needed installation steps. Ask the host to confirm those details before uploading the store.

Which is better for X-Cart: Apache or Nginx?
Either may be suitable if the X-Cart release supports it and it is configured correctly. Follow the official configuration for your chosen server; rewrite rules and PHP handling are not interchangeable without adjustment.

Why does the installer say it cannot connect to the database?
Check the database service, credentials, host and port, and the database user’s permissions. For a remote database, also check network access and the service’s connection configuration.

Is installing X-Cart the same as making the store secure?
No. Installation creates the application environment, but you must also configure HTTPS, protect administrator access, maintain updates, restrict file permissions, and keep tested backups.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →