I'm would like to learn PHP because it's looks really interesting. However, I just don't understand how to set up PHP... I've been googling for quite some time now and I've read mutiple pages about this subject but I don't get the whole 'setting-up a server'-thing.
Therefore my question is this: how do I run a PHP script in my computer using apache server?
Just install XAMPP. It'll install PHP, MySQL and Apache so you can focus on learning PHP instead of figuring out how to configure it.
This is a video
how tos
from almost start
to finish
. From installing it; to how to use it. It will even get into databases e.g. MySQL
later on when you have the basics down. Give this a shot.
Well, you'll need a web host with PHP already installed. Most web hosts have PHP. Alternatively, you'll need to set up LAMP if you are running Linux or WAMP if you're running Windows. You can download either for free.
I was starting with this link https://netbeans.org/kb/docs/php/configure-php-environment-windows.html
On MacOS X it's pre-installed, just needs to be turned on.
On Linux it can be installed with two or three lines in a bash prompt.
Windows you should install VirtualBox and then a install a Linux server inside that. There are other ways, but this is the best one, because PHP doesn't quite work right running directly on Windows and many of the examples and tutorials explains how to use PHP will only work on Linux.
Finally another option is rent access off someone who offers cPanel hosting. It's not free but this will give you a fully functional production server that you can run actual websites on.