Documentation: General Docs Product documentation, plugin reference, and online help
README.md
Installation
Note that this package does not include the
scss
source files used for the theme. Please purchase the original Full HTML version to customize your own copy.
This will guide you through the basic installation of SmartAdmin PHP v4. Some of the guide below may not apply to this copy of SmartAdmin PHP. If you find any issues or want to request a feature, visit us at our Support Forum.
Server Requirements
Before you install SmartAdmin, it's important to check that your server meets the requirements. To run SmartAdmin, you will need:
- Apache (with mod_rewrite enabled)
- PHP 7.1+ with the following extensions:
dom
,gd
,json
,zip
,mbstring
,openssl
,pdo_mysql
,mcrypt
- MySQL 5.6+ or MariaDB 10.0.5+
- SSH (command-line) access to run Composer
At this stage, it's not possible to install SmartAdmin by downloading a ZIP file and uploading the files to your web server. This is because SmartAdmin uses a dependency-management system called Composer which needs to run on the command line. This doesn't necessarily mean you need a VPS. Some shared hosts give you SSH access, through which you should be able to install Composer and SmartAdmin just fine. For other hosts without SSH, you can try workarounds such as Pockethold.
Installing
SmartAdmin uses Composer to manage its dependencies and extensions. Before installing SmartAdmin, you will need to install Composer on your machine. Afterwards, run this command within the root folder where composer.json
is located:
composer install
While this command is running, you can configure your web server. You will need to make sure your webroot is set to /path/to/your/smartadmin/public
, and set up URL Rewriting as per the instructions below.
When everything is ready, navigate to your site in a web browser and follow the instructions to complete the installation.
Configuration
Make sure you store sensitive and private information in a secure location and not accessible publicly. DO NOT include the config file in your repository.
SmartAdmin PHP uses the package vlucas/phpdotenv to store sensitive and private information like database credentials. The package includes an .env
file that you can modify as needed.
If you wish not to use .env
, feel free to comment in root.php:19-20
and modify the constants as needed.
// load configuration
// $dotenv = Dotenv\Dotenv::create(ROOT_PATH, '.env');
// $dotenv->load();
// set the constant DB_HOST for example.
define('DB_HOST', 'localhost');
URL Rewriting
Required for some features like the built-in REST API server.
Apache
SmartAdmin includes a .htaccess
file in the public
directory – make sure it has been uploaded correctly. If you're using shared hosting, confirm with your provider that mod_rewrite
is enabled and .htaccess
files are allowed. If you're managing your own server, you may need to add the following to your site configuration:
DocumentRoot "/path/to/your/smartadmin/public"
<Directory "/path/to/your/smartadmin/public">
AllowOverride All
</Directory>
Customizing Paths
By default SmartAdmin's directory structure includes a public
directory which contains only publicly-accessible files. This is a security best-practice, ensuring that all sensitive source code files are completely inaccessible from the web root.
However, if you wish to host SmartAdmin in a subdirectory (like yoursite.com/smartadmin
), or if your host doesn't give you control over your webroot (you're stuck with something like public_html
or htdocs
), you can set up SmartAdmin without the public
directory by following the steps below.
- Move all the files inside the
public
directory (including.htaccess
) into the directory you want to serve SmartAdmin from - Uncomment
.htaccess:125-128
to protect sensitive resources. -
Edit
const.php
and update thePUBLIC_PATH
constant:define('PUBLIC_PATH', __DIR__); // ...
-
Edit
init.php
,init.utils.php
and any other files that's requiringconst.php
and use the appropriate path:require_once 'const.php'; // ...
Database
SmartAdmin PHP includes Database functionality using the package lodev09/php-models to abstract your data. An SQL file is included within this package. It is located in the db
folder.
Follow the installation below to get started.
Importing data
Provided that you met the MySQL server requirements, follow these steps:
-
Login to
mysql
client and create the database.CREATE DATABASE smartadmin_db;
-
Import the sql file.
mysql -u root -p smartadmin_db < db/smartadmin_db.sql
-
Configure the database credentials in the
.env
file.DB_HOST=localhost DB_USER=root DB_PASSWORD=YOUR_PASSWORD DB_NAME=smartadmin_db
File Structure
This package comes with a flexible file structure that can be easily used for small to large scope projects. This section will explain app's file structure and how to adapt it to your project.
- README.md
- CHANGELOG.md
- screenshot.png
- screens.png
- smartadmin-php
- db
- lib
- api
- app
- common
- components
- models
- func.php
- public
- .htaccess
- api
- assets
- docs
- includes
- (public files)
- utils
- (util files)
- .env
- composer.json
- composer.lock
- config.php
- debug.php
- root.php
- const.php
- test.php
- README.md
Credits
This is the SmartAdmin PHP port of the original SmartAdmin - Responsive WebApp HTML 5 template. See Package introduction for more information.
Authored by @lodev09.
Product Support Customer support for SmartAdmin for PHP
All support questions related to HTML and/or CSS will be honored. Issues that are encountered on the Seed versions of specific flavors of SmartAdmin are covered by their respective authors, but will be limited to HTML and/or CSS issues. If you need assistance with a technical issue that is currently not covered by the FAQ, you will need to have purchased a Full license of that flavor and contact the respective author for further assistance. The Full version links will be added to the Flavors page once they are made available.