Learning/running PHP/MySQL on my Mac

Posted:
in General Discussion edited January 2014
Okay, so I'm completely fed up with the Dreamweaver tutorial for making PHP/MySQL sites, so I'm turning to this forum to point me in the direction of a good (preferably free) tutorial on how to set up Dreamweaver and my Mac to design and run web applications.



Just a quick question: out of the box, is a Mac with Dreamweaver installed equipped with everything I need to work with PHP/MySQL? What should I download if the answer is "no"?





Thanks.

Comments

  • Reply 1 of 17
    I dunno about using dreamweaver ( all BBEdit all the time ), but this site:

    http://www.entropy.ch/software/macosx/ helped me get up and running pretty quickly with regards to PHP/mySQL
  • Reply 2 of 17
    ishawnishawn Posts: 364member
    I am using the article suggested above by segovius and I only have one question... In the finder I see a few new folders in the Network setting..

    They are called "local" , "MSHOME" , Servers, and "WORKGROUP" I would like to know what these are, if I can delete the ones I wouldn't use, and what is the difference in putting files in the ~Shawn/Sites/ folder or if I should put stuff in the folder which looked like was the suggested folder /Library/Webserver/Documents .... or am I getting confused with something.



    While you're at it, let me know if you can get to the default index:

    http://192.168.0.2/~Shawn/

    BTW... no one can like steal and delete all of my files using a webserver from this can they? (Anymore than they can from any server)
  • Reply 3 of 17
    First off, I have no idea what Dreamweaver can or can't do for you, but if you're going to use UNIX, I can offer some advice. Pick up a good book on UNIX. I remember seeing a really good one that's just blue lettering on a white paperback book. It's good.



    I installed the latest MySQL, Apache, PHP, GD, and all sorts of other good stuff a few months ago on a DP G4 500. I'm not going to lie, it was certianly a "process," but then again it was way easier than getting Linux running on my hacked-up PM7500. Keep in mind that HFS+ is case aware but not case sensitive.
  • Reply 4 of 17
    toweltowel Posts: 1,479member
    Quote:

    Originally posted by segovius

    I couldn't get to it - kept getting timed out...



    That's a joke, right?



    iShawn, the difference between where you put your files depends on which user account you want hosting them. If you put them in /Users/Shawn/Sites, then they're hosted on your account, at http://[your.ip.address]/~Shawn. If you put them in /Library/Webserver/Documents, they're hosted by (for simplicity's sake) the system itself, and would be accessed directly at http://[your.ip.address]. If you're the only user on the computer, that's fine. If there are several users, better to have each use their own account to host things.



    As for the IP address, 192.168.x.x is not a "real" IP address. It's for use within a local network only. You have a router hooked up to a broadband modem, I presume? Well, that router will assign ever computer in your home one of these local IP addresses, so they can all talk to each other within your home network, and share the broadband connection. But only your router has a "real" IP address, the one assigned to you by your ISP.



    A good analogy might be apartment numbers vs. street addresses. If you tell me your address is A103, that doesn't help me find you. Every apartment building has an A103. What I need is your street address: 101 East Northwood Rd. Now I can find you. Once I get there, I know which door to knock on by your apartment number.



    Similarly, if you want people to be able to visit youir web server from the wide world, you need to give them your router's "real" IP address. Your router should include instructions on how to do that. For D-Links, you point your web browser to 192.168.0.1 (that's the internal IP address of the router - it has one IP for internal use, as well as one for external use). Then click on "Status", and note the IP address in the "WAN" section. That's the number to give people.



    But you're not done yet. Just giving them that number would be like giving out your apartment's street address without your apartment number. People can drive there, but have no idea which door to knock on. In this case, you need to tell your router where to direct HTTP traffic, so whenever someone comes knocking on your IP address, the router will send them to the right place (your new web-serving Mac).



    The term for that is called "Port forwarding". Web traffic is on Port 80. You need to tell your router to direct all incoming traffic on Port 80 to your Mac. The internal IP address of your Mac is 192.168.0.2, right? So go back to your router (192.168.0.1) in your web browser. If it's a D-Link, click on "Advanced". Scroll down to the Virtual Servers list, and click on the little notepad on the right side of "Virtual Server HTTP". In the form at the top, change "Private IP" to 192.168.0.2. Click the "Apply" button.



    That's it. Now, when someone points their web browser to http://[your.router's.ip.address]/~Shawn, your web page will appear in their browser.
  • Reply 5 of 17
    thuh freakthuh freak Posts: 2,664member
    Quote:

    Originally posted by iShawn

    I am using the article suggested above by segovius and I only have one question... In the finder I see a few new folders in the Network setting..

    They are called "local" , "MSHOME" , Servers, and "WORKGROUP" I would like to know what these are, if I can delete the ones I wouldn't use, and ...




    The 'Network' folder contains "folders" which point to shares and network file systems for your local network. "MSHOME" and "WORKGROUP" are two very common names for windows sharing (sometimes called "Samba", "Smbfs" or {i think the last one is} CIFS). These folders and the files they contain aren't actually on your computer. I haven't actually touched those folders myself, but I presume they would be re-connected on re-boot or re-login. They are all very separate and unrelated to any web work you might have done.



    You might benefit from a little web serving 101. Based on your response to this thread it seems you don't quite grasp how web serving and the internet protocol (the IP in TCP/IP) work.



    Dreamweaver is basically just a text-editor with special html and php and what-have-you functions. It can edit the files you want to serve with your web server, but it has no part in actually serving them.
  • Reply 6 of 17
    dgnr8dgnr8 Posts: 196member
    Dreamweaver is a really fancy WYSIWYG editor. You can create your document via text (HTML code) or thru graphic style with a nice ftp site control window. It however will not control the server. It will not give you any MySql or PHP control at all. That being said it does have features where you can connect up to the server and input data into the database. (Really kiss ass at working with Cold Fusion.) I personaly would not use anything but Dreamweaver and have not for almost three years now.



    PS.

    I would also say PHP is a great markup language and is quick to get started but it does take a while before you truly appreciate the power of it.



    I personal think a walk down to local bookstore, i.e. Barnes and Noble, for some reference books would limit a lot of your frustration.

  • Reply 7 of 17
    placeboplacebo Posts: 5,767member
    Yeah, I have a book at the library on order, and I've been looking at some of the basic stuff on W3schools.com. Just another question, which ports would I need to forward on my router to use DyDNS/serve a website off of my comp? I'm a real cheapskate, and I'd rather serve a website myself than pay for hosting.
  • Reply 8 of 17
    relicrelic Posts: 4,735member
    <?php

    $text = array('software' => array('Zend Studio', 'Eclipse', 'BBEdit'));

    echo <<<html

    <p>Can I recommend the following software: $text['software'][0], $text['software'][1] or $text['software'][2]</p>

    html;

    ?>
  • Reply 9 of 17
    dgnr8dgnr8 Posts: 196member
    Quote:

    Originally posted by Relic

    <?php

    $text = array('software' => array('Zend Studio', 'Eclipse', 'BBEdit'));

    echo <<<html

    <p>Can I recommend the following software: $text['software'][0], $text['software'][1] or $text['software'][2]</p>

    html;

    ?>




    This might work a little better

    <?php

    $text = array('software' => array('Zend Studio', 'Eclipse', 'BBEdit'));

    echo "<html><p>Can I recommend the following software: " . $text['software'][0], $text['software'][1] . " or " . $text['software'][2] . "</p></html>";

    ?>
  • Reply 10 of 17
    placeboplacebo Posts: 5,767member
    How do I tell Apache to navigate to a certain document upon opening my site, instead of listing a directory index?
  • Reply 11 of 17
    relicrelic Posts: 4,735member
    Quote:

    Originally posted by DGNR8

    This might work a little better

    <?php

    $text = array('software' => array('Zend Studio', 'Eclipse', 'BBEdit'));

    echo "<html><p>Can I recommend the following software: " . $text['software'][0], $text['software'][1] . " or " . $text['software'][2] . "</p></html>";

    ?>






    Ok, Obiwan.
  • Reply 12 of 17
    relicrelic Posts: 4,735member
    Quote:

    Originally posted by Placebo

    How do I tell Apache to navigate to a certain document upon opening my site, instead of listing a directory index?



    Create a index.html page in the root directory of your webserver /Library/WebServer/Documents/ with <a href="page1.html">link me</a> pointing to a directory or page.



    I would also create Aliases in the httpd.conf found here /etc/httpd on you local system. Use vi (personal favorite), emacs or Pico to edit file.





    Alias /somename/ "/<path to files on local host>/"



    <Directory "/Library/WebServer/Documents/<path to files on local host>">

    Options Indexes FollowSymlinks MultiViews

    AllowOverride None

    Order allow,deny

    Allow from all

    </Directory>
  • Reply 13 of 17
    placeboplacebo Posts: 5,767member
    I got the whole DNS redirect and router deal settled and working through Apache 1.3. I just installed the Serverlogistics version of Apache 2.0. Where do I put the files that use to be in Library/Webserver/Documents, if I want to serve them via Apache 2?
  • Reply 14 of 17
    relicrelic Posts: 4,735member
    Quote:

    Originally posted by Placebo

    I got the whole DNS redirect and router deal settled and working through Apache 1.3. I just installed the Serverlogistics version of Apache 2.0. Where do I put the files that use to be in Library/Webserver/Documents, if I want to serve them via Apache 2?



    Where did you install Apache 2.0, the default document folder is /var/apache/htdocs/ but you can also change the document root in the httpd.conf file to point to /Library/Webserver/Documents so you won't have copy.
  • Reply 15 of 17
    placeboplacebo Posts: 5,767member
    Quote:

    Originally posted by Relic

    Where did you install Apache 2.0, the default document folder is /var/apache/htdocs/ but you can also change the document root in the httpd.conf file to point to /Library/Webserver/Documents so you won't have copy.



    I don't see that directory referenced to in the whole doc...



    I installed Apache in Library/Apache2
  • Reply 16 of 17
    ishawnishawn Posts: 364member
    I got confused when trying to install MySQL, I have decided to give up, maybe try again some other time. Is there a way to uninstall MySQL though?
Sign In or Register to comment.