0465.html 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Roll Your Own Self-Hosted PHP Sandbox Page</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Browser Based,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Web Based Tools,Debian,Homelab,Linux,PHP,PHP Based Application,PHPSandbox,Self-Hosted PHP Sandbox,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Roll Your Own Self-Hosted PHP Sandbox Page">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="05/04/2024 06:44:30 PM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Roll Your Own Self-Hosted PHP Sandbox Page</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is PHPSandbox?</h2>
  26. <p><em>A PHP-based sandboxing library with a full suite of configuration and validation options.</em> -<a href="https://github.com/Corveda/PHPSandbox" target="_blank">https://github.com/Corveda/PHPSandbox</a></p>
  27. <ol>
  28. <li>Log into the Debian device</li>
  29. <li>Run the following commands in a terminal:
  30. <div class="codeBlock"># update repositories<br />
  31. sudo apt update<br />
  32. # install any available software updates<br />
  33. sudo apt upgrade -y<br />
  34. # install some dependencies<br />
  35. sudo apt install git composer apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y<br />
  36. # install Apache HTTPD and PHP components<br />
  37. sudo apt install apache2 php7.3 libapache2-mod-php7.3 php-imagick php-gnupg php7.3-common php7.3-mysql php7.3-fpm php7.3-ldap php7.3-gd php7.3-imap php7.3-json php7.3-curl php7.3-zip php7.3-xml php7.3-mbstring php7.3-bz2 php7.3-intl php7.3-gmp php7.3-xsl -y<br />
  38. # change directory<br />
  39. cd /var/www<br />
  40. # clone php sandbox from github<br />
  41. sudo git clone https://github.com/Corveda/PHPSandbox.git<br />
  42. # rename PHPSandbox to phpsandbox<br />
  43. sudo mv ./PHPSandbox ./phpsandbox<br />
  44. # set the owner of the phpsandbox directory to www-data<br />
  45. sudo chown -R www-data:www-data /var/www/phpsandbox<br />
  46. # setup composer working directory<br />
  47. sudo mkdir /var/www/.composer<br />
  48. sudo chown -R www-data:www-data /var/www/.composer<br />
  49. # change directory<br />
  50. cd phpsandbox<br />
  51. # install dependencies with composer<br />
  52. sudo -u www-data composer install<br />
  53. # create and edit phpsandbox.conf<br />
  54. sudo nano /etc/apache2/sites-available/phpsandbox.conf</div>
  55. </li>
  56. <li>Paste the following into phpsandbox.conf
  57. <p>Alias /phpsandbox &quot;/var/www/phpsandbox/toolkit/&quot;<br />
  58. &lt;directory /var/www/phpsandbox/toolkit/&gt;<br />
  59. Options +FollowSymlinks<br />
  60. AllowOverride All<br />
  61. Require all granted<br />
  62. &lt;/directory&gt;</p>
  63. </li>
  64. <li>Press CTRL+O, Enter, CTRL+X to write the changes to phpsandbox.conf</li>
  65. <li>Continue with the following commands
  66. <div class="codeBlock"># enable the phpsandbox site<br />
  67. sudo a2ensite phpsandbox<br />
  68. # restart apache2<br />
  69. sudo systemctl restart apache2</div>
  70. </li>
  71. <li>Open a web browser and navigate to http://DNSorIP/phpsandbox</li>
  72. <li>Welcome to your very own self-hosted PHP Sandbox</li>
  73. </ol> </div>
  74. </div>
  75. </body>
  76. </html>