Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
PHP has had a built-in web sever since version 5.4.
PHP's web server provides a router script for use with server rewrites. Magento, like many other applications and frameworks, requires server rewrites. The router script either:
false
, which means the web server returns the file using file system lookupExample: requests to /static/frontend/Magento/blank/en_US/mage/calendar.css
should deliver the file if it exists, or execute /static.php
if not.
Without a router script, that is not possible via the php built-in server.
Magento's web-based Setup Wizard runs from the setup
subdirectory, which PHP's built-in web server cannot route. Therefore, you must install Magento using the command line. An example follows:
Notes:
http://127.0.0.1:8082/index.php/admin_1vpn01
.For more informations about the installation process using the CLI, you can consult the dedicated documentation that can found in the developer documentation.
Example usage: php -S 127.0.0.1:8082 -t ./pub/ ../phpserver/router.php
The $debug
option provides low-level logging for debugging purposes.
Forwarding rules:
favicon.ico
or for any path that starts with index.php
, get.php
, static.php
are processed normally.pub/errors/default
are rewritten as errors/default
. This is provided for compatibility with older versions.media
, opt
, or static
are tested; if the file exists, the file is served. If the file does not exist, static
files are forwarded to static.php
and media
files are forwarded to get.php
((How about opt
?))Then rewrite paths for pub/errors/default/
by removing the pub/
part. (was at least needed for older versions)
Request starting with media/
, opt/
, static/
test if the file exists. If Yes, then handle it, if not "forward" static
to static.php
and media
to get.php
If none of the rules matched, return 404. You may instead include the index.php, if 404 should be handled by Magento or you want urls without index.php/
.
When the installation is finished, you can access Magento as follows: