Jump to content

Hey everybody,

 

I recently got a homework from school which needs to be written in PHP. I was told I should use Xampp to host my files and I installed it on my computer. What do I do from now? I need to be able to run my files but I just don't know what to do.  I know very little on the subject and I will probably have other questions later on

Link to comment
https://linustechtips.com/topic/385803-school-homework-questions/
Share on other sites

Link to post
Share on other sites

Well, our teacher didn't come to half the lessons this year and we had just barely begun PHP. He said that If we want an excellent mark you have to do this thing you have no idea how to do so I am sitting here googling and trying to do it :/

 

Sounds to me like grounds for a formal complaint and an extension. Did you pay for the course?

The single biggest problem in communication is the illusion that it has taken place.

Link to post
Share on other sites

well, i've only used xampp to create a secure server, but i assume it should be similar, check in the config file where is the server taking the files from (or configure the address yourself) and place the files. 

when you boot the server (with the default config file) and go to 127.0.0.1 you should load some webpage.

 

again, i have not tried php, i don't have xampp installed on this computer so i'm just working on theory, i have not checked any of this

The best way to measure the quality of a piece of code is "Oh F*** "s per line

Link to post
Share on other sites

You can download Xampp from here. If you have a secondary hard drive, I would advise installing it to that drive because it means that things can be read and written without admin access, and when you open a file in your text editor, change it, then go to save it and realise that you don't have admin access, it gets old fast.

Once it's installed, open the xampp control panel and start Apache. If you have skype installed, it might fail to start - if that's the case, Open skype, then go to options (Ctrl+,), then go to advanced->connection. Uncheck "Use port 80 and 443 for additional incoming connections". Save it, then try to launch apache again.

Once apache's running, open your browser and go to http://localhost/. You should get a page which looks something like

_AM.png

If you don't, it's not working, and you will need to do some troubleshooting.

If it is, open windows explorer and go to {Your Xampp Install Dir}\htdocs, and any files you save in there will be served by the web server. For example, htdocs\dir\2ndDir\myFile.php can be accessed from http://localhost/dir/2ndDir/myFile.php. Note that file names are case sensitive.

 

If you're only planning to access the web server from your computer, I would also suggest that you add a firewall rule to block inbound communications to httpd.exe, and/or look up how to use the config files to block access to any IP other than 127.0.0.1 (otherwise, anyone in the same local network (but not the internet unless your router is misconfigured) can access the web server by going to http://192.168.{your.ip}/)

HTTP/2 203

Link to post
Share on other sites

Hey everybody,

 

I recently got a homework from school which needs to be written in PHP. I was told I should use Xampp to host my files and I installed it on my computer. What do I do from now? I need to be able to run my files but I just don't know what to do.  I know very little on the subject and I will probably have other questions later on

what does the assessment actually say you need to create or do?

 

 

So they didn't teach you how to do the assignment? What kind of class is this?

 

MY lecturer lead some strikes that concluded in him being given an offer he could refuse. This meant for the first semester I no lecturer it then took until 1/3 into the 2nd semester before i got given "catch up" lessons out of my normal time table to be taught it.

 

by the time i was given the actual assessment i had half a semester to do 2 semesters worth of work ;) I have until Friday to finish writing that c# program i've been posting about lol 

 

TL;DR don't under estimate how much colleges get away with.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to post
Share on other sites

Sounds to me like grounds for a formal complaint and an extension. Did you pay for the course?

That's just my highschool teacher and we can't do anything about it :/

 

If you're only planning to access the web server from your computer, I would also suggest that you add a firewall rule to block inbound communications to httpd.exe, and/or look up how to use the config files to block access to any IP other than 127.0.0.1 (otherwise, anyone in the same local network (but not the internet unless your router is misconfigured) can access the web server by going to http://192.168.{your.ip}/)

Thanks, I got it working. Would there be a way to let other machines that are not on my home network access the files securely? The same way as I port forward for a game server for example?

Link to post
Share on other sites

That's just my highschool teacher and we can't do anything about it :/

 

Thanks, I got it working. Would there be a way to let other machines that are not on my home network access the files securely? The same way as I port forward for a game server for example?

You can allow computers from outside your network to access your web server by forwarding a port (DON'T FORWARD 80 - PICK A RANDOM LARGE NUMBER (for security reasons)), then in xampp, click config on the apache line, and edit httpd.conf. Fairly near the top of the file, there should be a line that says Listen 80. Under that, add a line saying Listen {the port that you forwarded}. Save the file, then restart apache. If you go to http://{your external ip}:{the forwarded port} (eg. http://127.0.0.1:7896)in your browser, it should show you the xampp page.

You can now access any file that is stored in /htdocs. For security reasons, you might want to restrict the files that the world can access to only a specific directory within htdocs (you might also be able to route it to, say, your documents folder, but do so with caution because anyone on the web could in theory access it). To do that, add the following to httpd.conf:

<VirtualHost *:{the port you forwarded}>  DocumentRoot {the full path to the intended destination folder, eg C:\Program Files\xampp\htdocs\public}</VirtualHost>

You probably also want to password protect the site so you can't access anything without entering the password. I don't know enough about doing that to be able to tell you what to do, but to research it you should look up htpasswd.

HTTP/2 203

Link to post
Share on other sites

That's just my highschool teacher and we can't do anything about it :/

 

Of course you can; you can complain to the head for example or seek the board that they have to answer to. My point is that someone has to regulate them.

The single biggest problem in communication is the illusion that it has taken place.

Link to post
Share on other sites

Of course you can; you can complain to the head for example or seek the board that they have to answer to. My point is that someone has to regulate them.

The whole school knows about this and noone seem to care. We complained to the head and our class teacher, they didn't do much. Even more my school is "special" in a way and all the administration is kind of weird and we regularly have problems. In my country problems with teachers aren't taken into account very seriously.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×