Jump to content

Apache server by MAMP and using local host (php)?


eduard

Recommended Posts

Why is the Apache server by MAMP often not function (the light is red not green!) (because I have a poor internet connection?) and Can´t I use my local host to read my .php files?

Link to comment
Share on other sites

internet connection has nothing to do running php on your local server, because it is local on your apple PC, not the internet, you could disconnect the line to internet and it will still run.
Ok, but what could the reason be then the Apache server doesn´t function?
Link to comment
Share on other sites

you should try the documentation first. Usually they all have an FAQ section for stuff like this, to assist in troubleshooting. I'm not sure how good your english is, but you should read through this.http://documentation.mamp.info/en

Link to comment
Share on other sites

http://www.mamp.info/en/documentation/faq.htmllook at these first, don't change anything, just report back what these setting are.Where can I change the ports for Apache and MySQL?Where should I store my HTML and PHP pages?I should concentrate on finding the port settings, and where htdocs location is set, apparently Apache is pre installed on some apple machines, and this may be causing the conflict, when you said you are connecting to Apache, it maybe this pre installed Apache page you are connecting to, and by changing the port this may fix the problem.
Link to comment
Share on other sites

http://www.mamp.info/en/documentation/faq.htmllook at these first, don't change anything, just report back what these setting are.Where can I change the ports for Apache and MySQL?Where should I store my HTML and PHP pages?I should concentrate on finding the port settings, and where htdocs location is set, apparently Apache is pre installed on some apple machines, and this may be causing the conflict, when you said you are connecting to Apache, it maybe this pre installed Apache page you are connecting to, and by changing the port this may fix the problem.
- First, I also think the latest you mentioned is the case: my local host is Apache.- The ports are: 8888 (Apache) 8889 (MySQL)- I´ve stored my php files in a folder (test) (like you said!) stored in folder htldocs of MAMP in the Applications- The light of the Apache server is red! (not working!)- I use the wordprocessor TextWrangler, but I don´t know how to save the file as .php?
Link to comment
Share on other sites

- First, I also think the latest you mentioned is the case: my local host is Apache.- The ports are: 8888 (Apache) 8889 (MySQL)- I´ve stored my php files in a folder (test) (like you said!) stored in folder htldocs of MAMP in the Applications- The light of the Apache server is red! (not working!)- I use the wordprocessor TextWrangler, but I don´t know how to save the file as .php?
did you make sure MAMP is running, and that you've hit Start Servers? You need to figure out why they're not running. Look in the documents, read it. Search through their forums. Try posting over there.we've already told you how to save a file. Hit File, then select save, and the save your file, i.e. myfile.php. I would recommend making sure UTF-8 is set as the encoding type. (this option will be in the save file dialog)
Link to comment
Share on other sites

did you make sure MAMP is running, and that you've hit Start Servers? You need to figure out why they're not running. Look in the documents, read it. Search through their forums. Try posting over there.we've already told you how to save a file. Hit File, then select save, and the save your file, i.e. myfile.php. I would recommend making sure UTF-8 is set and the encoding type. (this option will be in the save file dialog)
What did I write in my topic: ´the light of the Apache server is red! But, why? (I don´t know!) The second thing you wrote I tried, but still is the file´s name grey (and not black!), so I can´t open it!
Link to comment
Share on other sites

What did I write in my topic: ´the light of the Apache server is red! But, why? (I don´t know!) The second thing you wrote I tried, but still is the file´s name grey (and not black!), so I can´t open it!
If you don't know, you need to find out. What steps have you tried?About the text color, I'm not sure what you mean. Maybe you need to associate the file type with an application to open it. If you right click on the file, you should have the option to open with. From there you can choose an application, "TextWrangler" and have it always choose to open with the program. That should have it automatically open php files with TextWrangler when you double click on them.
Link to comment
Share on other sites

i never use macintosh..assuming that its act quite same as in windows...when apache failed to start it shows some mesages in black screan..where you could find the reasons for failing down...and probably even in your error log of apache you may find it..

Link to comment
Share on other sites

Right! we now know the port settings, but what about my second question htdocs location, I know you are working from '/Applications/MAMP/htdocs', BUT! is MAMP?Where should I store my HTML and PHP pages? on the web site, DOES IT show under Apache -> document root (as shown in web site example) '/Applications/MAMP/htdocs' without the single quotes.NOTE: it does NOT need to show /Applications/MAMP/htdocs/test, this is to identify THE htdocs (root/ document root / web root / localhost) folder/ directory location.We have established that by your port setting you should be most definitely and absolutely using http://localhost:8888/myfirstpage.php, or if file placed in test folder http://localhost:8888/test/myfirstpage.php.Once we establish that the document root is correct, we can consider changing port setting for Apache, as i mentioned before, Mac sometime come with Apache pre installed and it is looking at this version, instead of the newly installed version. By giving a new port setting, it might not be conflicting with old Apache.

Link to comment
Share on other sites

If you don't know, you need to find out. What steps have you tried?About the text color, I'm not sure what you mean. Maybe you need to associate the file type with an application to open it. If you right click on the file, you should have the option to open with. From there you can choose an application, "TextWrangler" and have it always choose to open with the program. That should have it automatically open php files with TextWrangler when you double click on them.
Sorry, I haven´t written ´text´. Red means the Apache server is not running! But why???But the other question is also important! How do I save my files made by TextWrangler correctly? (I know you replied this question yesterday!)
Link to comment
Share on other sites

this thread is going nowhere fast.....I don't know what else there is to tell you eduardchile. I have no idea what you mean about "written 'text'".Multiple people including myself have told you how to find where your webroot is, which is the place to put your files, and where Apache will be looking for them when you type localhost in your browser.We've also told you how to save the files, and I've told you something to try in case it doesn't recognize the file format for some reason. There should be no reason why you cant just write some of the test code we've given you, save it in your webroot as (exactly - in other words manually include the extension in the filename) myfile.php.We've also given you plenty of links to the MAMP documentation suggesting you look for yourself for questions about getting MAMP running. They have an FAQ, for exactly this reason. Do something about this! We can't, and won't, keep guessing and doing all the work while you just keep rehashing all this stuff over and over again, assuming something will be different because you ask the same question enough times. Go to the source. Look on their website. Ask/search in their forums.

Link to comment
Share on other sites

did you make sure MAMP is running, and that you've hit Start Servers? You need to figure out why they're not running. Look in the documents, read it. Search through their forums. Try posting over there.we've already told you how to save a file. Hit File, then select save, and the save your file, i.e. myfile.php. I would recommend making sure UTF-8 is set and the encoding type. (this option will be in the save file dialog)
But what should the encoding be: UTF-8, no BOM)????
Link to comment
Share on other sites

uughh...... :)

did you make sure MAMP is running, and that you've hit Start Servers? You need to figure out why they're not running. Look in the documents, read it. Search through their forums. Try posting over there.we've already told you how to save a file. Hit File, then select save, and the save your file, i.e. myfile.php. I would recommend making sure UTF-8 is set as the encoding type. (this option will be in the save file dialog)
Link to comment
Share on other sites

Right! we now know the port settings, but what about my second question htdocs location, I know you are working from '/Applications/MAMP/htdocs', BUT! is MAMP?Where should I store my HTML and PHP pages? on the web site, DOES IT show under Apache -> document root (as shown in web site example) '/Applications/MAMP/htdocs' without the single quotes.NOTE: it does NOT need to show /Applications/MAMP/htdocs/test, this is to identify THE htdocs (root/ document root / web root / localhost) folder/ directory location.We have established that by your port setting you should be most definitely and absolutely using http://localhost:8888/myfirstpage.php, or if file placed in test folder http://localhost:8888/test/myfirstpage.php.Once we establish that the document root is correct, we can consider changing port setting for Apache, as i mentioned before, Mac sometime come with Apache pre installed and it is looking at this version, instead of the newly installed version. By giving a new port setting, it might not be conflicting with old Apache.
I don´t understand your reply! On the website? (save it on the website of the localhost (Apache)?
Link to comment
Share on other sites

So let's do this again..when you open MAMP's preferences, and select Apache, the directory displayed there is your webroot, as set for your local computer. This is where your files need to go. The default location is most likelyApplications/MAMP/htdocsWhen you type localhost in your browser, you are essentially viewing this directory in your browser (for the most part). And again, you may need to specify a port when typing localhost in your browser. This can be found under the ports tab.so when you put myfile.php in Applications/MAMP/htdocs and if you have a port setting of 8888 from the ports tab (like I do on my computer),I type this into my browser

http://localhost:8888/myfile.php

But none of this matters if you don't get the server running!

Link to comment
Share on other sites

But what should the encoding be: UTF-8, no BOM)????
Yes.But that's irrelevant to your question. It's just a good thing to do in general, for other reasons.
Link to comment
Share on other sites

this thread is going nowhere fast.....I don't know what else there is to tell you eduardchile. I have no idea what you mean about "written 'text'".Multiple people including myself have told you how to find where your webroot is, which is the place to put your files, and where Apache will be looking for them when you type localhost in your browser.We've also told you how to save the files, and I've told you something to try in case it doesn't recognize the file format for some reason. There should be no reason why you cant just write some of the test code we've given you, save it in your webroot as (exactly - in other words manually include the extension in the filename) myfile.php.We've also given you plenty of links to the MAMP documentation suggesting you look for yourself for questions about getting MAMP running. They have an FAQ, for exactly this reason. Do something about this! We can't, and won't, keep guessing and doing all the work while you just keep rehashing all this stuff over and over again, assuming something will be different because you ask the same question enough times. Go to the source. Look on their website. Ask/search in their forums.
I´m really angry of your replies:1 To have php files work, a webserver is needed, but isn´t written anywhere! I didn´t knpw what a webserver was!2 I´ve repeadtely written that my Apache server isn´t running (the light is RED), but I haven´t got a decent reply so far (and it isn´t written in the documentation of MAMP!3 You yourself use a Apple computer! You are tired of reading that I have a Apple computer, but couldn´t you say much earlier that it is better to use TextWrangler as wwordprocessor?Those things mentioned I could have saved a lot of time and still I can´t read .php files!
Link to comment
Share on other sites

I´m really angry of your replies:
They're all written with good intentions in mind. The problem is you keep failing to comprehend them and/or read them fully. We're actually being more patient with you than with anyone else on this forum. Try to see it from our point of view.
1 To have php files work, a webserver is needed, but isn´t written anywhere! I didn´t knpw what a webserver was!
It is!
However, if your server does not support PHP, you must install PHP.
You just never read it, because you keep jumping over steps. You need to take this slow. Don't give me the "I need money" speach again. There's no way to take this at the pace you want. You must keep reading even when it seems you aren't getting an immediate solution, and stop to think of what you've learned so far to see how it fits with what you already know.
2 I´ve repeadtely written that my Apache server isn´t running (the light is RED), but I haven´t got a decent reply so far (and it isn´t written in the documentation of MAMP!
At the same place where the light is red, there should be a "Start servers" button. Click it, and try the rest of the stuff afterwards without closing that window.
3 You yourself use a Apple computer! You are tired of reading that I have a Apple computer, but couldn´t you say much earlier that it is better to use TextWrangler as wwordprocessor?
Again: Not related to your problem. It doesn't matter which text editor you choose for PHP to run. Using TextWrangler, or any other editor, is a matter of choice.
Those things mentioned I could have saved a lot of time and still I can´t read .php files!
No they couldn't, because they aren't related.
Link to comment
Share on other sites

I´m really angry of your replies:1 To have php files work, a webserver is needed, but isn´t written anywhere! I didn´t knpw what a webserver was!2 I´ve repeadtely written that my Apache server isn´t running (the light is RED), but I haven´t got a decent reply so far (and it isn´t written in the documentation of MAMP!3 You yourself use a Apple computer! You are tired of reading that I have a Apple computer, but couldn´t you say much earlier that it is better to use TextWrangler as wwordprocessor?Those things mentioned I could have saved a lot of time and still I can´t read .php files!
If we've said it once, we've said it a million times, you just don't read or do research! And frankly I'm starting to feel like you just don't listen, either. To anything.1) First page of the tutorials tells you that. You need a server. I know we've told you to read the tutorials multiple times.http://www.w3schools.com/php/php_intro.asp2) Did you hit start servers when MAMP opens? If you hit start, does an error pop-up show up? This has been asked of but never been replied too.3) Once it became an issue in your development process, we addressed it. It's not like I knew you were using text edit for this until you mentioned it. Wasting your time would have been not suggesting an alternative to text-edit, after you mentioned it. I gave you two alternatives. What else do you want from us? Fly down there and setup the computer for you?For the record, I didn't have know anything about MAMP when I installed it, but I just followed the directions, and hit up Google when I came across the one issue that I found. And yeah, I may have been experienced in coding, but I had never worked with setting up a local server environment. I was in a very similar position to yourself.edit: oh yeah, Stop blaming us! we've only tried to help! Do you not think there's a correlation between your topics and the fact that most of them balloon (help/hope)/lessly out of control with responses and supprt?
Link to comment
Share on other sites

They're all written with good intentions in mind. The problem is you keep failing to comprehend them and/or read them fully. We're actually being more patient with you than with anyone else on this forum.It is! Where??? Not very clear!You just never read it, because you keep jumping over steps. You need to take this slow. Don't give me the "I need money" speach again. There's no way to take this at the pace you want. You must keep reading even when it seems you aren't getting an immediate solution, and stop to think of what you've learned so far to see how it fits with what you already know.At the same place where the light is red, there should be a "Start servers" button. Click it, and try the rest of the stuff afterwards without closing that window. I hit that button 100 (aprox.) times!Again: Not related to your problem. It doesn't matter which text editor you choose for PHP to run. Using TextWrangler, or any other editor, is a matter of choice. That´s not a reply to my point!No they couldn't, because they aren't related.
SEE ABOVE!
Link to comment
Share on other sites

hit the button once! It changes to a stop button after everything's on. god forbid you do some searching about the problem :)http://www.google.com/#sclient=psy&hl=...91c13988e8371daedit: can we just old yeller this thread?

Link to comment
Share on other sites

Because it is most likely that it is conflicting with an application that is already using that port Ie (the preinstalled Apache), the same thing happen when I installed wamp NO CONNECTY TO WEB SERVEE, it was conflicting with IIS windows server, which was using the same port, and skype. disabling IIS, and forcing skype to use another port fixed this problem.I've got the answer to what port is used 8888, from the MAMP preferences, but STILL no DEFINITE answer on the document root from MAMP preferences.its no good changing the port, and using this new port setting, when the root directory is looking in a totally different location.last time then I'm off. it will get to the point where you will post a topic, and people who have already attempted to help, will just give it a wide birth, and ignore.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...