Trying to learn something about PHP and php programming. There are a number of tutorials on the web but none say much, if anything, about how to submit php scripts to Firefox.
I wrote a basic 'hello world' script in php and tried to run it in the browser;
- Code: Select all
$ firefox localhost/sample.php
This triggers a 404 error in the browser.
- Code: Select all
$ firefox file:/home/lcl/sample.php
Firefox says "You have chosen to open a PHP script - what to do with it?"
Well I wanted Firefox to deal with it directly, so there is something I am not understanding obviously.
I had tried earlier to wrap the script in html but learned from the web that that is not possible without editing webserver files. There was also something about .htaccess if apache was the webserver.
It appears that nginx is the webserver for mageia now - always thought it was apache. Had a quick look at some of the nginx documentation but could not really follow it but tried hacking the nginx.conf file but even here I am unsure which one to edit, the /etc/nginx/nginx.conf or /etc/nginx/conf.d/default.conf. I tried both and also tried copying the edited default file to /etc/nginx/nginx.conf.
All I did was insert
- Code: Select all
location / {
root /home/lcl/;
}
at the end of the server stanza.
Typing localhost/sample.php in the address bar triggers a 404 error.
The reason I am pursuing this is because there are so many references to PHP in QA testing that I feel it is my duty to learn something about it and it has been suggested that I look at php-gd for some particular tests, but first things first. I have been coding for over 50 years but the only web programming I have ever done is to develop an index.html for a local home page when the WWW first opened its doors. Things have moved on since then.