I would like to debug PHP file/s


(Emil) #1

I have 64 bits Parrot Security 4.1.
I need to debug some PHP files. If it is possible to do that using some tools under Parrot 4.1, please give me some instructions, what tools to install, to acheve my goal ?


(Matt) #2

If you use ‘atom’ there is a ‘php-debug’ package you could use https://atom.io/packages/php-debug.
Or try https://xdebug.org/ PHP extension.


(Emil) #3

I am an absolutely newbie, so I opened my PHP file using Geany, because there is a hint: “A fast and lightweight IDE” …
I have not installed Apache nor MySQL nor PHP yet.
Is there any tools recommended about ?


(Matt) #4

Everything you need should already be installed.

You also dont need an apache server to get started, php has its own web server. If you create all your files in one folder (call your home page index.php), navigate to that directory in your console and use
php -S <your local IP>:8000 (e.g. php -S 192.168.0.50:8000) to start the php server.
Then if you go to <your local IP>:8000 in your browser it will load you index.php. ez clap. The console you started PHP in will also log any errors for you, including stack trace.

For your database you will have to use mariadb not mysql. You can use service mariadb start to start mariadb. But i would get up and running with PHP before trying to access a database.


(Emil) #5

OMG! PHP-server really works inside console as you described and shows index.php with Mozilla Firefox …
Now, how to install Maria DB ?


(Matt) #6

It will already be installed. Use service mariadb start in console to start mariadb.


(Emil) #7

OMG!
Is there any command to start PHPmyAdmin ?


(Matt) #8

You will have to install it first.
sudo apt-get install phpmyadmin
Then read their documentation on how to use it https://docs.phpmyadmin.net/en/latest/


(Emil) #9

@KidKlown,
Thank you very much!


(Emil) #10

I have installed phpmyadmin.
I forgot the password I entered during installation, so now can not login into phpmyadmin.
May be I need to uninstall phpmyadmin and then install it again with password that will remember for use ?

I uninstalled phpmyadmin with a full removal of a database. Then I installed it again, entered the same password.
When I start the phpMyAdmin I enter Username: root and correct password, but phpMyAdmin does not accept it. ( May be the reason is because I don’t use Apache, I am using the server of PHP. )


(Matt) #11

Im not sure, i havent used phpmyadmin.
They probably have a getting started/ setup section in their documentation.