Jump to main content Jump to doc navigation

For development you need a web server and an IDE. Any hosting with SFTP access works — shared, VPS or cloud. For a uniform setup across all course participants, the examples use a free MODXCloud account and the 30-day PhpStorm trial.

Register and configure MODXCloud

Register, create a cloud: Clouds → Add new cloud, plan Development, Complete Cloud Creation.

Wait about 5 minutes for the cloud to start. A notification appears at the top of the screen, and the cloud shows up in the list. Open it: at the very bottom is the SFTP access block — it holds the credentials.

That is the whole hosting setup. Site credentials arrive in a notification:

Setting PhpStorm

Download and install PhpStorm; the trial lasts 30 days without functional limits — enough to finish the course and decide on a purchase. The IDE will prompt you if it needs Java.

Create a new project named Sendex.

Theme, fonts and panel layout are a matter of taste — keep the defaults unless you have a preference.

Now connect the server — this is the central step of the whole course setup. In the menu: Tools → Deployment → Configuration, add a new server and enter the MODXCloud data:

Tick the checkbox in the upper left corner of the window to make this server the default for the project. Then press Apply and Test SFTP connection:

A success message means the connection works. From now on the project works with the server files: open the Remote host tab on the right — the site sits in the www directory; create a Sendex directory there.

Now map the local project to the remote Sendex directory — same Deployment settings, Mapping tab:

Create a test.php file in the project to verify the setup:

<?php
// Load MODX
define('MODX_API_MODE', true);
require '../index.php';

// Enable error handling
$modx->getService('error','error.modError');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');

echo '<pre>';
print_r($modx->config);

Synchronize the project with the server via the context menu, then open the file in the browser: c2263.paas2.ams.modxcloud.com/Sendex/test.php

It is convenient to turn on automatic synchronization so files upload on Ctrl+S:

The file already works with the MODX kernel — and it lives in the project, not on the server.

One snag: the editor flags undefined variable ‘modx’:

PhpStorm does not know MODX out of the box. Download the latest MODX Revolution from the official site, unpack it anywhere and attach it to the project via the context menu External Libraries in the project files window. The IDE indexes the files and starts resolving variables and their methods:

After saving, all errors disappear except the missing index.php — it is on the server, not in the project; ignore it. Method completion works, and Ctrl+B navigates to a method definition.

Conclusion

The workplace is ready: hosting, project, IDE and file synchronization.

Next lesson: clone ModExtra3 from the repository and explore its structure.

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

  • modmore
  • STERC
  • Digital Penguin
  • Jens Wittmann – Gestaltung & Entwicklung
  • CrewMark
  • Fabian Christen
  • Sepia River Studios
  • Dannevang Digital
  • Alex
  • A. Moreno
  • Chris Fickling
  • Stéphane Jäggi
  • Murray Wood
  • Anton Tarasov
  • JT Skaggs
  • deJaya
  • Lefthandmedia
  • eydolan
  • Following Sea
  • Guido Gallenkamp
  • YJ
  • Raffy
  • Snow Creative
  • Nick Clark
  • Guest
  • Helen
  • krisznet
  • Yanni
  • Richard

Budget

$194 per month—let's make that $500!

Learn more