Jump to content

PHP file read by webserver?


eduard
 Share

Recommended Posts

  • Replies 71
  • Created
  • Last Reply

Top Posters In This Topic

File -> Save
My PHP files work well when they are saved with a .php extension. Having never tried without one, however, I am not sure that the extension is necessary.In addition, I save my PHP files in a folder that lies along the same folder (directory) path as that returned by the PHP_SELF constant of the superglobal $_SERVER. I have not tried another location, so I do not know, if other possibilities exist.Roddy
Link to comment
Share on other sites

My PHP files work well when they are saved with a .php extension. Having never tried without one, however, I am not sure that the extension is necessary.In addition, I save my PHP files in a folder that lies along the same folder (directory) path as that returned by the PHP_SELF constant of the superglobal $_SERVER. I have not tried another location, so I do not know, if other possibilities exist.Roddy
Thanks!
Link to comment
Share on other sites

What does file mean and save (my english isn´t very good) :)
it's the menu options to use in whatever editor you are using to write your scripts/files in. It's pretty much a universal command/mouse clicks/etc amongst all applications (Mac or Windows). In other words, hit file from the top menu of the application window, and then select save. We know you've done this before, because you've manage to publish a website. No way to have done that without saving something somewhere, sometime.
Link to comment
Share on other sites

it's the menu options to use in whatever editor you are using to write your scripts/files in. It's pretty much a universal command/mouse clicks/etc amongst all applications (Mac or Windows). In other words, hit file from the top menu of the application window, and then select save. We know you've done this before, because you've manage to publish a website. No way to have done that without saving something somewhere, sometime.
Sorry, I was kidding!
Link to comment
Share on other sites

you really need to learn to read your own threads. This basic testing concept was already shared with you in another one of your threads:http://w3schools.invisionzone.com/index.php?showtopic=36063

In your web browser type in localhost. If an error page comes up you then need to start up MAMP this can be done by looking for MAMP in your applications.When the server is running MySQL and PHP should be running too as they are the M & P in MAMP. To test you can go to localhost/phpmyadmin in your browser. If MySQL is running no errors will come up. If you want to test your PHP setup, create a file called info.php (or anything *.php) and inside it write:
<?phpecho phpinfo();?>

Then go to localhost/filename.php and if PHP is working it should display your PHP settings.Hope that helps.

did you try that? Did it not work for you? This is why we are so often frustrated by your threads. It has nothing to do with your (lack of) experience, or that we're being mean. It's just your lack of motivation and being able to retain information already given to you, or that you don't try and look it up first, or that you keep asking the same thing's... It just seems to be the same pattern over and over. Not trying to be mean, it's just that you can't realistically rely on things being spelled out (let alone more than once) all the time. It takes a little work, a lot of trial and error, and a never ending supply of determination. Edited by thescientist
Link to comment
Share on other sites

you really need to learn to read your own threads. This basic testing concept was already shared with you in another one of your threads:http://w3schools.invisionzone.com/index.php?showtopic=36063did you try that? Did it not work for you? This is why we are so often frustrated by your threads. It has nothing to do with your (lack of) experience, or that we're being mean. It's just your lack of motivation and being able to retain information already given to you, or that you don't try and look it up first, or that you keep asking the same thing's... It just seems to be the same pattern over and over. Not trying to be mean, it's just that you can't realistically rely on things being spelled out (let alone more than once) all the time. It takes a little work, a lot of trial and error, and a never ending supply of determination.
I´ve tried in MAMP > preferences > apache But it doesn´t work.
Link to comment
Share on other sites

I´ve tried in MAMP > preferences > apache But it doesn´t work.
What? :)
In your web browser type in localhost. If an error page comes up you then need to start up MAMP this can be done by looking for MAMP in your applications.
In your browser (as in FireFox, IE, Opera, Chrome, Safari) type localhost and see what happens.
Link to comment
Share on other sites

tried what?the post showed you how to test documents once you found out where your webroot is. That URL in the Apache tab is just where you can set the path to your webroot, which is the same as typing in localhost into your web browser. You need to be more specific about what you tried other than opening a menu option. A couple things: * you may need to specify a port. The start stop tab might have one shown, in which case your browser URL may need to look like

http://localhost:8888/

* also in the the start/stop tab, there is an option to open the root directory in the browser automatically. You could try turning checking that. Then it should open that each time you run MAMP.* check these things, make sure there is an example .php page in the webroot folder from the Apache tab like ApocolypseX showed you, and come back with the status.

Edited by thescientist
Link to comment
Share on other sites

you really need to learn to read your own threads. This basic testing concept was already shared with you in another one of your threads:http://w3schools.invisionzone.com/index.php?showtopic=36063did you try that? Did it not work for you? This is why we are so often frustrated by your threads. It has nothing to do with your (lack of) experience, or that we're being mean. It's just your lack of motivation and being able to retain information already given to you, or that you don't try and look it up first, or that you keep asking the same thing's... It just seems to be the same pattern over and over. Not trying to be mean, it's just that you can't realistically rely on things being spelled out (let alone more than once) all the time. It takes a little work, a lot of trial and error, and a never ending supply of determination.
I didn´t like your reply! I am living for more than 2 years in Chile. I´ve aplied more than 600? times for work, but by much mistrust and much discrimination I didn´t get it (although i have enough skills!). My family supported me until now, but they are fed up to do this! Is it strange to try everything which I can, that there is a lot of pressure and because of that I make mistakes? Fortunately, I finally found something how to make money (database)! I hope you´ll support me until this is finished!
Link to comment
Share on other sites

you really need to learn to read your own threads. This basic testing concept was already shared with you in another one of your threads:http://w3schools.invisionzone.com/index.php?showtopic=36063did you try that? Did it not work for you? This is why we are so often frustrated by your threads. It has nothing to do with your (lack of) experience, or that we're being mean. It's just your lack of motivation and being able to retain information already given to you, or that you don't try and look it up first, or that you keep asking the same thing's... It just seems to be the same pattern over and over. Not trying to be mean, it's just that you can't realistically rely on things being spelled out (let alone more than once) all the time. It takes a little work, a lot of trial and error, and a never ending supply of determination.
Do you know how I call this: PREJUDIGE I hate prejudiges!
Link to comment
Share on other sites

Save in the the folder Apache uses for web site files, and then type in the URL filename. You may need to check your installation of MAMP to determine where to save files, but if your web root is c:\apache\htdocs and you save a file there called index.php, you can access it at http://localhost/index.php.

Link to comment
Share on other sites

Save in the the folder Apache uses for web site files, and then type in the URL filename. You may need to check your installation of MAMP to determine where to save files, but if your web root is c:\apache\htdocs and you save a file there called index.php, you can access it at http://localhost/index.php.
Sorry, I don´t understand it! I have a folder on my desktop with a PHP file. I´ve installed MAMP (Should I deinstall it?) I tried http://localhost; then I see a page of Apache.Please, can you tell me simple and clear how I can read PHP files?
Link to comment
Share on other sites

Sorry, I don´t understand it! I have a folder on my desktop with a PHP file. I´ve installed MAMP (Should I deinstall it?) I tried http://localhost; then I see a page of Apache.Please, can you tell me simple and clear how I can read PHP files?
where did you installed the apache? where you installed it there should be a folder named htdocs..as jsg reffered you above...there should be a file index.html..now put your php file into that folder..you can search in your pc by folder name htdocs..if you are realy unable to detect the location
Link to comment
Share on other sites

your mamp htdocs folder should i think be listed under applications as in '/applications/MAMP/htdocs/', create a folder within htdocs folder such as 'test' which when opened the address bar should show '/applications/MAMP/htdocs/test/', now place your created php files within this folder, and make sure mamp is running.in you browser type http:localhost/test/nameoffile.php where 'nameoffile.php' is the name of file in test folder, an it should find this file and display contents, if any.typical test script<?php echo "hello world"; ?>will, IF everything is setup correctly, show hello world.

Link to comment
Share on other sites

your mamp htdocs folder should i think be listed under applications as in '/applications/MAMP/htdocs/', create a folder within htdocs folder such as 'test' which when opened the address bar should show '/applications/MAMP/htdocs/test/', now place your created php files within this folder, and make sure mamp is running.in you browser type http:localhost/test/nameoffile.php where 'nameoffile.php' is the name of file in test folder, an it should find this file and display contents, if any.typical test script<?php echo "hello world"; ?>will, IF everything is setup correctly, show hello world.
Thanks very much!
Link to comment
Share on other sites

Save in the the folder Apache uses for web site files, and then type in the URL filename. You may need to check your installation of MAMP to determine where to save files, but if your web root is c:\apache\htdocs and you save a file there called index.php, you can access it at http://localhost/index.php.
I don´t understand it! Is it so difficult to explain to a simple computer user who is just a beginner in programming how things work???
Link to comment
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
 Share


×
×
  • Create New...