DEV Community

Cover image for UnsafePHPCodeTester
Charles Ndavu
Charles Ndavu

Posted on

UnsafePHPCodeTester

My mentor is a php nerd and has created some great staff over the years. I got chance to try his creation dubbed "unsafephpcodetester." I have been using it for a while and I thought why not share it with Dev community.

Let's get started

Introduction

The unsafephpcodester is an amatuer-ish tool intended for personal use only. I would not advice you to publish it in your public server, but your local server will do. You can improve it to suit your needs. It is purely experimental.

Installation

Note: you can just grab the index.php and process_code.php, and run it however you run your php filesprovided the two files remain in the same folder.

If your are running windows, place it in your wamp sever


C:\wamp\www\unsafephpcodetester

Enter fullscreen mode Exit fullscreen mode

If running ubuntu, you can follow the following 7 steps to access it.

1. Extract the unsafephpcodetester.zip to get a folder named unsafephpcodetester

2. Place the unsafephpcodetester folder in root directory of your server.

3. Set up your virtual hosts file so that it points to this new local website.

/etc/apache2/sistes-available/unsafephpcodetester.conf
Enter fullscreen mode Exit fullscreen mode

and

<VirtualHost \*:80>
ServerName unsafephpcodetester.com
ServerAlias www.unsafephpcodetester.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/unsafephpcodetester

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Enter fullscreen mode Exit fullscreen mode

4. Restart apache2 to update the changes by running the command

$sudo service apache2 restart
Enter fullscreen mode Exit fullscreen mode

5. Create a simlink to it, in the sites-enabled folder, using the command

\$sudo ln -s /etc/apache2/sistes available/unsafephpcodetester.conf /etc/apache2/sistes-enabled/unsafephpcodetester.conf
Enter fullscreen mode Exit fullscreen mode

6. Add the following two lines to /etc/hosts

127.0.0.1 unsafephpcodetester.com
127.0.0.1 www.unsafephpcodetester.com
Enter fullscreen mode Exit fullscreen mode

7. Then run the url in your browser

http://unsafephpcodetester.com
Enter fullscreen mode Exit fullscreen mode

Final out put

An image showing the output for Unsafephpcodetester

Get the files here; https://bitbucket.org/lawrencekm04/phpcodetester

Credit to @wezadata

Top comments (0)