Demo
The word density helper opens with a list of given URLs:
New URLs can be added with the "Add New URL" button:
Clicking on the URL opens the list of word-density tests run to-date:
When clicking on the test, the word-density results are listed:
- Open the terminal and navigate to the project folder.
- Install Composer. Follow the instruction at Download Composer.
- Test PHP version is 8.2 or higher
php -v
- See that Composer is really there and working.
php composer.phar
- Run Composer:
php composer.phar install
php composer.phar update
- Check that everything was installed correctly. Review the list of installed packages with Composer Show:
php composer.phar show
Also for further reference, here's the composer-cheat-sheet by u/nicwortel https://cheat-sheets.nicwortel.nl/composer-cheat-sheet.pdf
cp vendor/pith/framework/mig .
- Copy
env.dist.php
toenv.php
- Add your own settings.
- Test that doctrine migrations will work.
php mig
- Look at the list of migrations
php mig migrations:list
- Run all migrations
php mig migrations:migrate
- The list of migrations should all be green now
php mig migrations:list
- The database tables should all exist now.
Navigate to the public-local folder i.e:
cd public-local/
Tell PHP to run locally on port 8080, using serve.php
Ex:
php -S 127.0.0.1:8080 serve.php
Now open your web browser and open http://127.0.0.1:8080/
The project should be live and running now.
https://www.wikihow.com/Use-SSH
- Test PHP version is 8.2 or higher
php -v
Create a repositories/ folder outside the webroot.
i.e. Go to lowest folder:
cd ~
Look at folder. Look to see if the repositories/ folder already exists.
ls
ls -la
Create repositories/ folder
mkdir repositories
ls
Check that Git is already installed.
git --version
Clone
git clone https://github.com/ian-maurmann/demo-2023-08-29a.git
There should now be a demo-2023-08-29a/ folder inside of repositories/
ls
- Open the terminal and navigate to the project folder.
- Install Composer. Follow the instruction at Download Composer.
- Test that Composer is really there and working.
php composer.phar
- Run Composer:
php composer.phar install
php composer.phar update
- Check that everything was installed correctly. Review the list of installed packages with Composer Show:
php composer.phar show
cp vendor/pith/framework/mig .
Create a MySQL or MariaDB database on the server, or at a location that the server can remotely connect to.
Keep the new database info, and data user info on-hand for the next step.
- Copy
env.dist.php
toenv.php
cp env.dist.php env.php
- Add your own settings to env.php. To edit this you'll want to use Vim or else have FTP access. On Mac I use Cyberduck. Ex:
It should look something like:
/**
* Env Constants
*
* @noinspection PhpConstantNamingConventionInspection - Long constant names are ok here.
*/
// Turn on strict types
declare(strict_types=1);
// Define our Constants
const PITH_APP_DATABASE_DSN = 'mysql:host=127.0.0.1;dbname=XXXXXXXXXXXXXX';
const PITH_APP_DATABASE_USER_USERNAME = 'YYYYYYYYYYYYYYYYY';
const PITH_APP_DATABASE_USER_PASSWORD = 'ZZZZZZZZZZZZZZZZZ';
const PITH_DATABASE_MIGRATIONS_DATABASE_NAME = 'XXXXXXXXXXXXXX';
const PITH_DATABASE_MIGRATIONS_DATABASE_HOST = '127.0.0.1';
const PITH_DATABASE_MIGRATIONS_DATABASE_DRIVER = 'pdo_mysql';
const PITH_DEV_ACCESS_IP_ADDRESSES = ['127.0.0.1'];
const PITH_IMPRESSION_LOG_ENABLE = false;
const PITH_IMPRESSION_LOG_LOCATION = 'logs/impressions-log';
Where XXXXXXXXXXXXXX is the database's name or schema name, YYYYYYYYYYYYYYYYY is the database user name, and ZZZZZZZZZZZZZZZZZ is database user password.
- Test that doctrine migrations will work.
php mig
- Look at the list of migrations
php mig migrations:list
- (If your env.php isn't configured correctly above, you'll get an error like:
)
If your env.php is correct though, you should now see the list in yellow
- Run all migrations
php mig migrations:migrate
- The list of migrations should all be green now
php mig migrations:list
- The database tables should all exist now.
On the server, go into the web root folder and update (or create) the .htaccess file.
It should be something like:
# Hide folders
Options -Indexes
# Turn on the Rewrite Engine
RewriteEngine On
# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Rewrite non-existent files to index
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php [NC,L]
Where routes and non-existent files are being rewritten to the index.
Add / update the index.php file in the web root folder to this:
<?php
error_reporting(E_ALL);
ini_set('display_startup_errors', '1');
ini_set('display_errors', 1);
// Switch folders
chdir('../../repositories/demo-2023-08-29a/'); // <---- Change to correct folder
require 'public-web/index.php';
(If there's an index.html file, rename or delete it so that it doesn't take precedence over index.php)
The project should be live and running on the web server now.