Scripts to help web developers speed up their work...
Script name | macOS | Windows | Linux |
---|---|---|---|
phpsrv | Available | Available | Available |
npmgensh | Available | Not available | Not available |
This script will launch a small php/http server in the current working directory
You need to have PHP and a Web Browser installed:
Examples:
- Example Browser: Chrome
- Example Browser: Firefox
- PHP: Bundled in XAMPP
- PHP: Bundled in MAMP
- PHP: From PHP.net
1 Download and extract the script from your terminal
wget
unzip
2 Change permissions on the script to make it executable
chmod 754 phpsrv
3 Create a link to a directory in your Path
ln -s
1
2
3
Open a new terminal and type phpsrv
/Users/user/Desktop: phpsrv
- Windows 7 Home x64
- Windows 10 Pro x64
You need to have PHP and a Web Browser installed:
Examples:
- Example Browser: Chrome
- Example Browser: Firefox
- PHP: Bundled in XAMPP
- PHP: Bundled in MAMP
- PHP: Bundled in WAMP
- PHP: From PHP.net
Extract the script and add it to the Windows PATH
- 1 Click here to download file as zip (phpsrv.bat)
- 2 Extract phpsrv.zip to the root of your C: drive
- 3 Press "Win + R" on your keyboard to start Run
- 4 Type this command to open the configuration window
rundll32 sysdm.cpl,EditEnvironmentVariables
- 4 Click on Path in user defined variables and then edit
- 5 Append this to the end of the value-string and click save
;C:\$Bin
Open the script in your text editor and edit below:
set my_port=8000
set lan_int=Local Area Connection
set php_exe=C:\MAMP\bin\php\php7.2.10\php
set browser=C:\Program Files (x86)\Google\Chrome\Application\chrome
-
php_exe: Needs to point to your executable.
- This can be either MAMP, XAMPP or WAMPs php -
lan_int: Change to the name of your network adapter.
- Tip: In CMD you can type below command to reveal the name
netsh interface ip show addresses
- browser: Change to the path to your browser
- Tip is to use either Google Chrome or Mozilla Firefox
Open a new prompt (CMD) and type phpsrv
C:\htdocs>phpsrv
You need to have PHP a Web Browser and some tools installed:
Examples:
- Example Browser: Chrome
- Example Browser: Firefox
- PHP: Bundled in LAMP Ubuntu
- PHP: Bundled in LAMP CentOS6
- PHP: Bundled in LAMP CentOS7
- PHP: Bundled in HTTPSRV
- PHP: Bundled in XAMP
- PHP: From PHP.net
- Tool: wget
Ubuntu
sudo apt-get install wget
CentOS
yum install wget
1 Download you extract the script from your terminal
wget URL/phpsrv.sh
2 Change permissions on the script to make it executable
chmod 754 phpsrv.sh
3 Create a link to a directory in your Path
ln -s example example
1
2
3
Open a new terminal and type phpsrv
/home/user: phpsrv