DokuWiki

It's better when it's simple

User Tools

Site Tools


php_build-in_webserver

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
php_build-in_webserver [2018-01-08 14:06] jroeterdphp_build-in_webserver [2022-12-14 17:22] 2a10:3781:2b13:1:e105:4e0b:539b:45a4
Line 1: Line 1:
-====== PHP build-in webserver ======+====== PHP built-in webserver ======
  
-When installing DokuWiki as a desktop wiki on a Mac (and possible also other OS) only PHP is needed. You can use the build-in PHP webserver. See [[http://php.net/manual/en/features.commandline.webserver.php|PHP build-in webserver]] for more information. +When installing DokuWiki as a desktop wiki on a personal computer, only PHP is needed. You can use the built-in PHP webserver. It avoids the hassle of installing and configuring a web server. See [[http://php.net/manual/en/features.commandline.webserver.php|PHP built-in webserver]] for more information. 
  
-Your Mac comes with PHP included. As I am on OS X El Capitan my included PHP version is 5.5.38The newest OS X High Sierra comes with PHP 7.1+Installing PHP on windows is really easy thanks to [[https://windows.php.net/download|https://windows.php.net]]. Macos used to ship with PHP, but since macos 12 Monterey, you have to install PHP yourself ; however, this is an easy task thanks to [[https://brew.sh/|homebrew]]. On Gnu/Linux systems the package manager generally provides a recent enough version of PHP.
  
-Download DokuWiki and extract the files in a directory of your choosing. In this directory (containing the doku.php and index.php file) open a terminal and type in the following:+Once PHP is installed, [[http://download.dokuwiki.org/|download DokuWiki]] and extract the files in a directory of your choosing. In this directory (containing the doku.php and index.php file) open a terminal and type in the following:
  
-//php -S localhost:8000//+  php -S localhost:8000 index.php
  
-This will start the PHP webserver. Going to http://localhost:8000 will show you your DokuWiki start page. Run the install.php if it is a new installationterminal window will stay open while you are running the server. If you do not want that read further. +This will start the PHP webserver. For the first time, go to http://localhost:8000/install.php and fill in the form. Next time, just go directly to the wiki at http://localhost:8000/The terminal window will need to stay open while you are running the server. If you do not want that, there are easy ways around, depending on your OS. Read further.
  
-==== DokuWiki.app ==== +===== Further settings =====
-On a mac you can use Automator to create an APP file. Choose to create an application and choose to run a terminal command. Use the command mentioned above. When you safe Automator askes you where to store the .app file. You can safe it in you Applications folder. +
  
-When you start it the server will be started without a terminal windowTo close the webserver you need to kill it in the ActivityMonitor+The index.php script even handles URL rewriting. So you can set [[config:userewrite|userewrite]] option to 1This is optional but will give you nice URLs. Go to the admin page, then "Configuration settings", and in the "Advanced" group you'll find the "Use nice URLs" setting, set it to ".htaccess".
  
-==== Experiences ==== +===== Running DW without the terminal ===== 
-I am running a vanilla DokuWiki without any additional plugins with this install method for a couple of days now without any trouble. As mentioned on the PHP build-in webserver page this install is not usable for any production environment. But seems to me it is ok for a local desktop wiki. + 
 + 
 +On macos and Linux, you can close the terminal if you use this command : 
 + 
 +  nohup php -S localhost:8000 index.php &> /dev/null & 
 + 
 +If you want to stop the PHP webserver, open a terminal and run 
 +  pkill php 
 + 
 + 
 +-------------- 
 + 
 +  
 +On a mac you can use Automator to create an APP file. Choose to create an application and choose to run a terminal command. Use the command mentioned above. When you save Automator asks you where to store the .app file. You can save it in your Applications folder.  
 + 
 +Add ''&>/dev/null &'' to the terminal command if you do not want a spinning gear icon in the iconbar at the top of your screen.  
 + 
 +When you start it the server will be started without a terminal window. To close the webserver you need to kill the php process in the ActivityMonitor.  
 + 
 +===== Experiences ====
 + 
 +I am running a vanilla DokuWiki without any additional plugins with this install method for a couple of days now without any trouble. As mentioned on the PHP built-in webserver page this install is not usable for any production environment. But seems to me it is ok for a local desktop wiki. -- [[user>jroeterd]]
  

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki