Dynamo
30 replies to this thread. Most Recent
Brisprad
1 May 2008, 8:17 pm
CMS or PHP/MySQL?
Hi,
Back in September or so I posted about help with PHP/MySQL and Freeway integration and got great information. However, I still haven’t quite mastered it yet. Recently, I read some of the posts about using CMS and was wondering if that would work for my situation. (I tried searching for those old posts but couldn’t find them!)
Here’s my situation: I’ve made a general site for a personal trainer. He would like to allow people to log in and make a meal plan for themselves on like a daily basis. He would then like to be able to view what people entered. He would eventually like to make it so he can sell his fitness programs online a la Jillian of “Biggest Loser” fame. He offers about 3 different programs. I know FileMaker at maybe an intermediate level so creating a DB and making all the relationships is pretty straight forward to me. However, learning how to communicate with a DB via PHP and Freeway is not working for me yet. Is using CMS a way that could help make things a little easier? My gut says no because I haven’t seen anything where a user then can see content (in this case what is available in their plan) and enter it. I’ve looked up a little about WebYep and Joomla.
BTW, my biggest problem with PHP/MySQL and Freeway is that I haven’t been able to successfully make a site read correctly. I’ve followed the tutorial that uses Axiom Widgets as an example but my sales.php page (where the products should show up) end up showing just as the code. I’m been doing it mostly on my computer. I installed MAMP to give me PHP and MySQL. I’ve tried putting the files in either the Sites folder of my Home folder or the htdocs folder MAMP’s FAQ page directs you to do. As far as the mechanics of the tutorial (using a “page” as an .inc file, using the php make markup action to make the page all php code, et), I do understand it.
Any help would be greatly appreciated. I feel lost in so many ways.
Thank you!
waltd
2 May 2008, 1:31 amRecently, I read some of the posts about using CMS and was wondering if that would work for my situation. (I tried searching for those old posts but couldn’t find them!)
Here’s my situation: I’ve made a general site for a personal trainer. He would like to allow people to log in and make a meal plan for themselves on like a daily basis. He would then like to be able to view what people entered. He would eventually like to make it so he can sell his fitness programs online a la Jillian of “Biggest Loser” fame.
I think that you might have a long crawl trying to do any of this with a CMS or a blogging software. It’s just too specialized for that. This is the sort of project that screams out for custom development.
What I would recommend is getting a good book, and starting small with some simple projects. Luke Welling and Laura Thompson’s PHP and MySQL Web Development is an easy read, but goes incredibly deep.
Don’t worry too much about Freeway at first, just use a text editor and make some ugly (but database-backed) Web pages to get your feet wet. Getting database code into Freeway is startlingly easy, what with the Markup Items and HTML Markup slots. It’s very simple to take the guts out of a hand-coded application page and simply “thread it” into your highly designed layout. Once it’s there, you can move bits around and re-style them without having to rewrite anything.
Walter
Freeway user since 1997
Brisprad
2 May 2008, 6:37 amThanks Walter.
I’ve looked through that book (& a For Dummies book that had great information, too). I understand a lot of it, but not all of it. Your idea of trying the sample pages using a text editor is great. Any ideas of how to make sure I can use my own computer for practice? I do have a website on Yahoo I can use. I guess there probably really any big difference between using web host or my own computer. I just seemed easier to set up everything under a localhost.
Thanks again for your help.
Brian
waltd
2 May 2008, 1:40 pmI doubt that your Yahoo account will even approximate a “normal” hosting provider’s setup. I recommend that you try MAMP or if you’re daring, enable PHP on your Mac’s built-in Apache (google for directions) and download and install MySQL (it’s free, and there are one-click installers for most versions of Mac OS X).
Another approach would be to get one of the extremely affordable hosting setups from our own James Wilkinson or David Owen, both of whom provide amazing levels of personal service to the Freeway community. It’s pennies a day to have a hosting setup that will be exactly like any host your clients may direct you to use. It’s not only good practice, it’s a nice feature for your business to be able to say “I’ll post that on my development server…”
Walter
On May 2, 2008, at 2:37 AM, Brisprad wrote:
Thanks Walter.
I’ve looked through that book (& a For Dummies book that had great information, too). I understand a lot of it, but not all of it. Your idea of trying the sample pages using a text editor is great. Any ideas of how to make sure I can use my own computer for practice? I do have a website on Yahoo I can use. I guess there probably really any big difference between using web host or my own computer. I just seemed easier to set up everything under a localhost.
Thanks again for your help.
Brian
Freeway user since 1997
The Big Erns
2 May 2008, 2:15 pmExtremely wise advice.
On Fri, May 2, 2008 at 6:40 AM, Walter Lee Davis wrote:
…
Another approach would be to get one of the extremely affordable
hosting setups from our own James Wilkinson or David Owen, both of whom provide amazing levels of personal service to the Freeway community. It’s pennies a day to have a hosting setup that will be exactly like any host your clients may direct you to use. It’s not only good practice, it’s a nice feature for your business to be able to say “I’ll post that on my development server…”
Ernie Simpson — Freeway 5 Pro User — http://www.thebigerns.com/freeway/
Brisprad
2 May 2008, 2:48 pmI’ve tried using MAMP. The info page says everything is installed. I’ll try using just a basic text file with PHP code like you suggested to see if it is working correctly. Any Freeway page I’ve tried to do just shows the code and doesn’t build the page. Like I said above, I’ve even tried putting the files in the Sites folder or the htdocs folder that MAMP originally defaulted to (When I used Sites, I did direct MAMP there of course).
I guess my question with MAMP is: Is PHP and MySQL running on my Mac the same way as if I installed it directly?
As far as hosting, I understand what you mean. I’m doing another site for someone else and we chose a different host. Funny thing is it costs less than Yahoo and they offer more services-and better support for MySQL and PHP. I might just try to get the trainer to switch then.
Thanks again to both of you.
Brian
waltd
2 May 2008, 2:57 pmNo. MAMP fiddles with all of the paths and ports so that everything is running in your Applications folder and nothing conflicts. You can have MAMP and the “real” stuff installed on the same Mac, and neither one will know about the other. You will need to point your browser at a non-standard port to see your MAMP site, IIRC. So you would go to http://localhost:4000/mysite/mypage.php or something like that.
Walter
On May 2, 2008, at 10:48 AM, Brisprad wrote:
I guess my question with MAMP is: Is PHP and MySQL running on my Mac the same way as if I installed it directly?
Freeway user since 1997
Brisprad
4 May 2008, 10:54 pmThanks again Walter! Sorry I’m slow with the thank you but I’ve been busy the last 2 days with work and other things.
I decided to setup MySQL on my computer the normal way, not through MAMP. I also installed phpMyAdmin. But that has brought up more questions. I can look at a DB using the MySQL Admin tool you can download. I can even use CocoaMySQL to look at and set up DBs. However, I tried using phpMyAdmin and I keep getting an error that it can’t talk to MySQL. I go to the Setup Script page and can change things but it won’t save the file. Is this a problem only if I want to use phpMyAdmin? Can I do everything to administer DB through CocoaMySQL? The one thing I’ve noticed is the path for the socket is different: The setting MySQL has is /tmp/mysql.sock. phpMyAdmin has var/mysql/mysql.sock. If I try to reset it with the Setup page, it just won’t save.
I’m sorry if this is going a little off topic maybe but appreciate the help!
Brian
waltd
4 May 2008, 11:39 pmThis probably means that the folder where you are trying to save the file is set with permissions that won’t allow the www user to save the file. PHP runs as the same user as Apache (the Web server) so you need to make it possible for that user to save files.. You can solve this by making that folder world-writeable and world-executable. I haven’t done this in a while, but I think the folder is called configuration or config. Anyway, use Transmit or another app that can view local files and monkey with their permissions, and set that folder to world-everything (777 permissions) and try again. The setup script definitely works fine.
Walter
On May 4, 2008, at 6:54 PM, Brisprad wrote:
However, I tried using phpMyAdmin and I keep getting an error that it can’t talk to MySQL. I go to the Setup Script page and can change things but it won’t save the file.
Freeway user since 1997
Brisprad
5 May 2008, 6:38 amI was able to change it with Transmit-no problem. However, it still isn’t allowing me to use phpMyAdmin to change the configuration.
I did try using a Freeway file I created similar to the Axiom one (making the same pages, using the same DB) but I get these errors:
Warning: mysql_connect() [function.mysql-connect]: Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (38) in /Users/brisprad/Sites/sales/sales.php on line 6
Warning: mysql_db_query(): supplied argument is not a valid MySQL-Link resource in /Users/brisprad/Sites/sales/sales.php on line 17 Database error in GetProducts Error #2002: Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (38)
Like I said in my previous post, if I look at MySQL through Terminal and use the Status command, it says the Unix socket is /tmp/mysql.sock. Using a PHP test page, it shows /var/mysql/mysql.sock. Could this be a problem with the above errors?
I’m sorry if I’m getting to a pain about this. I’ve looked on Apple’s discussions, too. Is there somewhere else that would be better since I’m going beyond Freeway here?
Thanks again for your help.
Brian
Anyway, use Transmit or another app that can view local files and monkey with their permissions, and set that folder to world-everything (777 permissions) and try again. The setup script definitely works fine.
waltd
5 May 2008, 10:39 amOh, okay. That’s a well-known Mac MySQL problem. The Mac OS place to put the mysql “socket” file is in /tmp/ rather than /var/ .
If you have installed the Developer tools on your Mac, then open a Terminal and issue this command:
locate mysql.sock
Make note of where the system says it is. Now, move to where the PHP believes it is:
cd /var/mysql
If you get an error at this point that the path does not exist, then pause to create it:
sudo mkdir -p /var/mysql
You will be challenged for an administrator password. Use your own password, as the owner of the computer you are the default administrator.
Now, move into the folder (if you weren’t there already).
cd /var/mysql
Finally, make a symbolic link (kind of like an alias) to the real mysql.pid file:
sudo ln -s /tmp/mysql.sock
(The command above starts with lower-case L, not capital I or numeral 1.) You may be challenged again for your admin password, but if you have been working quickly, you may not. There’s a time-out between challenges.
After doing this level of change, it’s a good idea to stop and start Apache using the Sharing control panel.
Then try again, it should be working for you.
Walter
On May 5, 2008, at 2:38 AM, Brisprad wrote:
I was able to change it with Transmit-no problem. However, it still isn’t allowing me to use phpMyAdmin to change the configuration.
I did try using a Freeway file I created similar to the Axiom one (making the same pages, using the same DB) but I get these errors:
Warning: mysql_connect() [function.mysql-connect]: Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (38) in / Users/brisprad/Sites/sales/sales.php on line 6
Warning: mysql_db_query(): supplied argument is not a valid MySQL- Link resource in /Users/brisprad/Sites/sales/sales.php on line 17 Database error in GetProducts Error #2002: Can’t connect to local MySQL server through socket ‘/ var/mysql/mysql.sock’ (38)
Like I said in my previous post, if I look at MySQL through Terminal and use the Status command, it says the Unix socket is / tmp/mysql.sock. Using a PHP test page, it shows /var/mysql/ mysql.sock. Could this be a problem with the above errors?
I’m sorry if I’m getting to a pain about this. I’ve looked on Apple’s discussions, too. Is there somewhere else that would be better since I’m going beyond Freeway here?
Thanks again for your help.
Brian
Anyway, use Transmit or another app that can view local files and monkey with their permissions, and set that folder to world-everything (777 permissions) and try again. The setup script definitely works fine.
Freeway user since 1997
Brisprad
5 May 2008, 6:58 pmHi again,
I still can’t get it to work. I’ve even followed other help on these pages:
Getting MySQL and Mac OS X 10.5 Working
Working With PHP in Mac OS X 10.5
In Terminal, when I ask to see where the mysql.sock file is, it says /var/mysql/
I tried setting the default socket in the php.ini file to: mysql.default_socket = /var/mysql/mysql.sock and then to mysql.default_socket = /tmp/mysql.sock
Does it need to say private/var/…?
In editing the my.cnf file, I had to mess with permissions.
I’m worried now that I’ve messed with too much not exactly knowing what I’m doing and that it will never work. I understand that PHP is looking for the mysql.sock file in /var/mysql/ but that MySQL installed it in /tmp/. Where should the file officially reside? I have one in each location if you look by going through the Finder. I did notice that both are zero k files and thought that was odd.
Should I maybe follow the instructions on the first link again to reset?
I really do appreciate all the help and feel bad that I’m asking so much!
Thanks again, Brian
waltd
5 May 2008, 7:18 pmWhat version of Mac OS are you running there?
It’s not unusual for these files to appear very small, even 0k to the Finder. All they are is a reference to a process ID. Try this. Move into the directory where you want to look at the socket (either /var/ or /tmp/) and issue this command:
ls -a
(Lower-case L for the first character.)
That should tell you explicitly if what you are seeing is a symbolic link or not.
If both appear to be symbolic links, then you may have created an infinite loop! (The Space-Time Continuum could collapse, etc… Just kidding!) Delete both, and start over, but this time make sure that MySQL is actually running:
ps auxc | grep mysql | grep -v grep
If you don’t see anything listed after that command, then have a look through the MySQL documentation for how to start the server. I don’t know if there is a control panel for Leopard yet, so you may have to use the command-line to start it up.
Once MySQL is actually running, you will see a mysql.sock, in one location or the other, and then you can try the link thing if you can’t get PHP to see it. Basically, you should only need the link if PHP is looking for the socket in a different location. Also, try restarting your entire computer to see if that clears things up — although again you will need to start MySQL manually if you do this and you don’t have the control panel goodie to do that for you.
Walter
On May 5, 2008, at 2:58 PM, Brisprad wrote:
Hi again,
I still can’t get it to work. I’ve even followed other help on these pages:
Getting MySQL and Mac OS X 10.5 Working
Working With PHP in Mac OS X 10.5
In Terminal, when I ask to see where the mysql.sock file is, it says /var/mysql/
I tried setting the default socket in the php.ini file to: mysql.default_socket = /var/mysql/mysql.sock and then to mysql.default_socket = /tmp/mysql.sock
Does it need to say private/var/…?
In editing the my.cnf file, I had to mess with permissions.
I’m worried now that I’ve messed with too much not exactly knowing what I’m doing and that it will never work. I understand that PHP is looking for the mysql.sock file in /var/mysql/ but that MySQL installed it in /tmp/. Where should the file officially reside? I have one in each location if you look by going through the Finder. I did notice that both are zero k files and thought that was odd.
Should I maybe follow the instructions on the first link again to reset?
I really do appreciate all the help and feel bad that I’m asking so much!
Thanks again, Brian
Freeway user since 1997
waltd
5 May 2008, 7:23 pmForgot to clarify — the character that separates these commands is the Pipe (found as the Shift-character of the backslash on US keyboards). It’s a vertical line, and in this font, looks just like Capital i and Lower-case L. Grrrr. Damned ambiguous fonts.
Walter
On May 5, 2008, at 3:18 PM, Walter Lee Davis wrote:
ps auxc | grep mysql | grep -v grep
Freeway user since 1997
Brisprad
5 May 2008, 11:50 pmWhat version of Mac OS are you running there?
I have Leopard–10.5.2
If both appear to be symbolic links, then you may have created an infinite loop! (The Space-Time Continuum could collapse, etc… Just kidding!)
They seemed to me to be real links. Wouldn’t there have been something after the file name if I was looking through Terminal.
Delete both, and start over, but this time make sure that MySQL is actually running:
ps auxc | grep mysql | grep -v grep
know if there is a control panel for Leopard yet, so you may have to use the command-line to start it up.
I deleted them and restarted MySQL. The Control Panel works now for 10.5! I actually did it from Command line though since I was there.
Once MySQL is actually running, you will see a mysql.sock, in one location or the other, and then you can try the link thing if you can’t get PHP to see it.
It is now back in /var/mysql/.
I tried looking at my page I am trying to use and am not getting any errors-the page loads but doesn’t look into the database. That is, my variables like “$myDescription” show on the completed page.
Am I right in thinking I need to make a symbolic link in /tmp/ to tell MySQL to look at /var/?
When I try to log into MySQL as root under Terminal, I get this error:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
I can connect using the MySQL Administrator. I changed the socket name under Options>Advanced Networking tab to be /var/mysql/mysql.sock. Now when I lok at the mySQL status, it says the same thing. And it lets me log in.
My Freeway page still says the variable names. My page is nearly identical to the Axiom Widgets, just a different look. I followed the tutorial and used one of the templates.
I know I’m close!! Thanks again or all your huge help! I’m glad I didn make the Space-Time Continuum collapse-well, not yet!
Brian
waltd
6 May 2008, 1:22 amIs the page filename ending in .php? Take a look at your Apache config file:
/etc/apache2/httpd.conf
Make sure that the AddType is there for php — it should look like this:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
And then take a look at your DirectoryIndex statement, make sure that you have added index.php there:
DirectoryIndex index.html index.php
If you make either or both of these changes, be sure to bounce Apache (turn it off and on again) so that the configuration is re-loaded.
Walter
On May 5, 2008, at 7:50 PM, Brisprad wrote:
I tried looking at my page I am trying to use and am not getting any errors-the page loads but doesn’t look into the database. That is, my variables like “$myDescription” show on the completed page.
Freeway user since 1997
Brisprad
6 May 2008, 2:17 amIs the page filename ending in .php?
Yes.
Take a look at your Apache config file:
/etc/apache2/httpd.conf
Make sure that the AddType is there for php — it should look like this:
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
Where does it go on the list of other things? I searched for other AddTypes but most were commented out. I tried adding it after here:
If the AddEncoding directives above are commented-out, then you probably should define those extensions to indicate media types: #
# AddType application/x-compress .Z
# AddType application/x-gzip .gz .tgz
#
but then I couldn’t get any page to work after bouncing Apache. I moved it a little higher:
372 #
373 #AddType application/x-gzip .tgz
374 #
375 AddType application/x-httpd-php .php
376 AddType application/x-httpd-php-source .phps
377 #
It looks like I have the # in the wrong place. I’m sure this is basic but where do they go to tell the file the lines after are comments and the lines without are commands?
And then take a look at your DirectoryIndex statement, make sure that you have added index.php there:
DirectoryIndex index.html index.php
Am I correct in that I saw only one line that said DirectoryIndex? I simply added the index.php
Thanks again Walter! Hope this all makes sense to you.
Brian
waltd
6 May 2008, 9:49 amHave you uncommented the call to load PHP? Is PHP running?
Walter
On May 5, 2008, at 10:17 PM, Brisprad wrote:
Is the page filename ending in .php?
Yes.
Take a look at your Apache config file:
/etc/apache2/httpd.conf
Make sure that the AddType is there for php — it should look like this:
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phpsWhere does it go on the list of other things? I searched for other AddTypes but most were commented out. I tried adding it after here:
If the AddEncoding directives above are commented-out, then you probably should define those extensions to indicate media types: #
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
#
but then I couldn’t get any page to work after bouncing Apache. I moved it a little higher:
372 #
373 #AddType application/x-gzip .tgz
374 #
375 AddType application/x-httpd-php .php
376 AddType application/x-httpd-php-source .phps
377 #
It looks like I have the # in the wrong place. I’m sure this is basic but where do they go to tell the file the lines after are comments and the lines without are commands?
And then take a look at your DirectoryIndex statement, make sure that you have added index.php there:
DirectoryIndex index.html index.phpAm I correct in that I saw only one line that said DirectoryIndex? I simply added the index.php
Thanks again Walter! Hope this all makes sense to you.
Brian
Freeway user since 1997
Brisprad
6 May 2008, 1:51 pmOn 6 May. 2008, 9:49 am, waltd wrote:
Have you uncommented the call to load PHP? Is PHP running?
Yes. In fact, I also set up a PHP info page and was able to see it fine-that’s what made me realize that PHP was looking for the socket in /var/.
Does it matter where the AddType lines go? It has only been since I changed them that my page won’t load at all. I get a “Can’t find server” message.
Brian
waltd
6 May 2008, 2:14 pmRrrr. Roll back and let’s start this over a little smaller-scale.
I imagine that where you have those statements now is making Apache fail to start at all. If you have been editing your httpd.conf in BBEdit or TextMate or similar, use undo to get back to where you started. If you can’t get there from here, let me know and I will try to locate you a virgin Mac OS X 10.5 httpd.conf. My daughter’s mini probably hasn’t been fooled with at all.
What I would like you to do is to look for each of these statements in your (reverted) httpd.conf.
DirectoryIndex
AddType application/x-httpd-php
Wherever they are, edit them in place to get the desired code. You will probably find that DirectoryIndex is there, uncommented, but contains only index.html. You will also probably find that AddType is there, but commented out. If it isn’t commented out, then it will be wrapped in an IF statement that conditions it running on PHP being loaded as a module.
Finally, if you would pastie[1] your PHP page to me, I can see if there’s something fundamentally wrong with it that might be causing the problem. This could all be a storm in a teakettle — we’re running in circles trying to “fix” PHP, when the page has a syntax error or something…
Walter
On May 6, 2008, at 9:51 AM, Brisprad wrote:
On 6 May. 2008, 9:49 am, waltd wrote:
Have you uncommented the call to load PHP? Is PHP running?
Yes. In fact, I also set up a PHP info page and was able to see it fine-that’s what made me realize that PHP was looking for the socket in /var/.
Does it matter where the AddType lines go? It has only been since I changed them that my page won’t load at all. I get a “Can’t find server” message.
Brian
Freeway user since 1997
Brisprad
6 May 2008, 9:56 pmHi Walter,
I discovered something. I ended up opening the httpd.conf file and saw something odd-I was using TextWrangler and had turned on line numbers and saved it with numbers turned on. I feel stupid! I turned them off and then went back to my page and it works as far as Apache is concerned. It is still showing the variable names. I did copy the page code and used Pastie. I hope I did it right. The link is:
I also found out that there’s an original httpd.conf file in etc/apache2/originals. I have not edited anything. I had thought of copying that and redoing it according to your instructions. I remember when I first started this, it did not have a line about PHP5-I had to add:
LoadModule php5_module libexec/apache2/libphp5.so
Is there an easy way to make a page with Freeway to check the PHP and MySQL? I assume it is connecting just fine. I am understanding this all more and more thanks to your patient help!
Thanks! Brian
Brisprad
7 May 2008, 7:48 amThis could all be a storm in a teakettle — we’re running in circles trying to “fix” PHP, when the page has a syntax error or something…
Oh cool! I tried another Freeway tutorial. It’s one by Mike Brackenridge just called mysql_dynamic. It included a mysql dump file. I got it to work! Obviously there’s a syntax error on my other file. I’ll have to fully look at it and absorb it when I’m not so tired!
One last question: I noticed when I look at the source code of the Axiom site (when the page is displayed in the browser), it is all html. Am I correct in thinking that the PHP code is executed first and then the page created is HTML that used PHP to create the code?
Thanks again for all your help. You have been incredibly patient and nice to work with. BTW, I looked at your own site. Nice work-on your own and on your client’s.
Thanks again!
Brian
waltd
7 May 2008, 12:31 pmThe line numbers are never made a part of the resulting file. They appear on your screen only. If you want to confirm this, please try the following (in your /etc/apache2/ folder)
pico -w httpd.conf
Do this before and after saving the file with line numbers on.
Walter
On May 6, 2008, at 5:56 PM, Brisprad wrote:
something odd-I was using TextWrangler and had turned on line numbers and saved it with numbers turned on. I feel stupid!
Freeway user since 1997
waltd
7 May 2008, 12:34 pmThat’s the very point of PHP — the code part is executed on the
server, and its output is served along with the static HTML back to
the browser. None of your code ever leaks out to the visitor (unless
you make a grisly mistake, like leaving off the <?php ?> delimiters).
Note that if you preview PHP locally using Freeway’s “Preview in Browser” function, you will see the code; but that’s because the browser is simply opening the file as a text file. The PHP interpreter is not getting invoked.
Walter
On May 7, 2008, at 3:48 AM, Brisprad wrote:
One last question: I noticed when I look at the source code of the Axiom site (when the page is displayed in the browser), it is all html. Am I correct in thinking that the PHP code is executed first and then the page created is HTML that used PHP to create the code?
Freeway user since 1997
waltd
7 May 2008, 12:34 pmThank you for the kind words!
Walter
On May 7, 2008, at 3:48 AM, Brisprad wrote:
Thanks again for all your help. You have been incredibly patient and nice to work with. BTW, I looked at your own site. Nice work-on your own and on your client’s.
Freeway user since 1997
ulfr
27 Aug 2008, 2:01 pmI have read this thread and finally found the right question to ask.
Walter, you said the PHP interpreter is not getting invoked.
How do I do that?
I have MAMP running complete nice. OK with the infophp(), — but when I try a ordinary .php page in the browser it is not recognized. Firefox ask if it should be saved and Safari displays the code. Isn’t that funny??
I have changed the httpd.conf file uncommenting LoadModule php4_module libexec/httpd/libphp4.so and AddModule mod_php4.
I also managed to get php pages running by putting them in the folder Applications/MAMP/bin/mamp/ but only direct there, not in folders. Is that the only way? I would like to have all my sites in web pages folder as the OSX standard is.
Sorry for putting such a simple question, but
David Owen
27 Aug 2008, 2:30 pmAre you viewing MAMP from the right location?
Publish your Freeway site files into the htdocs folder (which is inside the MAMP application folder), maybe create a folder for each site you produce.
Then view in any browser using the MAMP URL http://localhost:8888/
(e.g, open the MAMP start page, and remove “MAMP/?language=English”)
David
On 27 Aug 2008, at 15:01, ulfr wrote:
I have MAMP running complete nice. OK with the infophp(), — but when I try a ordinary .php page in the browser it is not recognized. Firefox ask if it should be saved and Safari displays the code. Isn’t that funny??
David Owen Freeway Friendly Web hosting and Domains :: (Test Drive a web hosting account for Free) http://www.ineedwebhosting.co.uk http://www.printlineadvertising.co.uk/freeway
Printing:: (leaflets, letterheads, cards etc) http://www.printlineadvertising.co.uk/print.html
www.ineedwebhosting.co.uk | Twitter Offers and Web Design News
Freeway Friendly web hosting and Domain Names. (Create an account it’s Free!)
PrintlineAdvertising.co.uk | The Printline Advertising Blog
Print Design, Digital and Litho Printers, Promotional Merchandise and Corporate Gifts.
ulfr
27 Aug 2008, 8:45 pmyes , wow finally :) I wont be able to sleep tonight, thank you, David, thank you. I have been struggeling with this for three days.
Now I will go on with MySql. MAMP seems to be very user friedly, once you get it running.
Ulf
ulfr
28 Aug 2008, 1:21 pmActually I had the folder right, htdocs but not Localhost:8888/, consequenly I like to put another novice question:
How does Localhost:8888 work, besides linking to htdocs, it only works when MAMP is running?
Thanks
Ulf
waltd
28 Aug 2008, 3:23 pmWhen MAMP is running, it causes an instance of Apache + PHP to “listen” at port 8888 for any requests that get sent to it. When you type that URL into your browser, your browser sends a request to the server named ‘localhost’, which is a fancy name for your own computer, at that TCP/IP port. Because MAMP’s server is listening for requests on that port, it responds to that request with whatever specific resource was requested.
In simpler terms, you are temporarily running an entire Web server on your local computer, and interacting with it as if it was www.apple.com or similar.
Walter
On Aug 28, 2008, at 9:21 AM, ulfr wrote:
Actually I had the folder right, htdocs but not Localhost:8888/, consequenly I like to put another novice question:
How does Localhost:8888 work, besides linking to htdocs, it only works when MAMP is running?
Thanks
Ulf
Freeway user since 1997
ulfr
28 Aug 2008, 4:20 pmThanks Walter, great clarifying!
What would one do without FreewayTalk? Digging an whole in the ground or something.
