SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 39

Thread: PHP on Linux

  1. #1
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP on Linux

    Hello,

    I am a linux user (fedora 12), and I would like to start with PHP, JS and MySQL development.

    So I've installed apache (httpd), php, mysql, phpmyadmin and eclipse with PHP plugin.
    I've managed to configure it to work, but one thing bothers me.

    The only way I can get my test.php to run is by manually placing it inside var/www/html which you are able to manipulate with only with root permissions.
    Which means the development in such case would be pain in the ass. I can't manage to get my php run in firefox from my workspace.

    I also tried trough Eclipse's run in browser (127.0.0.1:8000/test/index.php), but all I get is blank (php not executing).

    Please help, how do I make it run PHP script from everywhere on my system.

    Also I miss Dreamveawer, is there any good alternative for linux?

    Thanks,

    Jan

  2. #2
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it is not PHP on linux question but more likely Apache config question.
    you can setup any directory as a DocumentRoot for your site in httpd.conf

  3. #3
    SitePoint Addict
    Join Date
    Apr 2009
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alternatively, you could store the PHP in question in /var/www/html and give your user account write permissions to that folder.

  4. #4
    SitePoint Wizard
    Join Date
    Nov 2005
    Posts
    1,191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd recommend using virtual hosts so you can have
    /home/[user]/webprojects/site1/
    /home/[user]/webprojects/site2/
    http://site1.local
    http://site2.local

    Google it, you will find lots of info

  5. #5
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, I went to etc/httpd/conf/httpd.conf and I changed DocumentRoot to my dir where I keep my php stuff.

    But now when I run localhost in browser I get Forbidden error. Any ideas?

  6. #6
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    1,661
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    Check if the webserver's user has permission to access that directory.

  7. #7
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have, do I have to chmod my DocumentRoot? Also how do I do it?

  8. #8
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    as any other folder
    using chmod utility

  9. #9
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Shrapnel_N5 View Post
    as any other folder
    using chmod utility
    what command (and parameters)?

  10. #10
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did chmod +x +r but it didn't help. Any ideas why I get 403?

  11. #11
    SitePoint Evangelist smftre's Avatar
    Join Date
    Dec 2008
    Location
    London
    Posts
    436
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You want to set your dir to say x755 or something so you can write and execute files.
    And no, there's not really an "alternative" to Dreamweaver on Linux, there are other apps similar and you can actually run Dreamweaver through Wine or one of those.
    Why are you looking at doing PHP development and thinking of using Dreamweaver? Dreamweaver is not good when it comes to real coding..
    Statvoo.com The Website Traffic Monitor
    The best way to monitor traffic to your sites for free!


    Web Development London UK We make web 3.0 applications

  12. #12
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure that you've defined a <Directory> directive for that folder and given permission.

    http://httpd.apache.org/docs/1.3/mod...html#directory
    http://httpd.apache.org/docs/2.0/mod...html#directory
    http://httpd.apache.org/docs/2.2/mod...html#directory

    Code:
    Order deny,allow
    Allow from all

  13. #13
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nono, I use Eclipse SDK with PHP addon for doing PHP, I just want dreamweaver for HTML, CSS and JS as I'm used to it.

    Here is what I have in config:
    DocumentRoot "/home/jan1024188/Desktop/WORKSPACE"
    <Directory "/home/jan1024188/Desktop/WORKSPACE">

    Order allow,deny
    Allow from all
    Still is 403

  14. #14
    SitePoint Evangelist AlienDev's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure to restart Apache after changing config.
    Me on StackOverflow | Blog & personal website.

    I mostly use: PHP, Java, JavaScript, Android.

  15. #15
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I've done it million of times already!

  16. #16
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check Apache's logs to see if they say anything worthwhile.

    Checklist:
    1. <Directory> directive
    2. Appropriate user & permission modes
    3. You are accessing a file, and not a directory listing
    4. You are editing the right configuration file

  17. #17
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, here it is:
    [Fri Mar 05 21:02:10 2010] [error] [client 127.0.0.1] (13)Permission denied: access to /test denied

  18. #18
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Throw in a test.html file, and try to browse to that.

    Do ls -l while in /home/jan1024188/Desktop/ (and remove unrelated entries if you wish).

  19. #19
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I throw index.html, still 403 forbidden

  20. #20
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, so I made public_html in my jan1024188 and copied in .htaccess from my server. That didn't work either (same as with other folders).

  21. #21
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This obviously doesn't work, I will try virtual server now

  22. #22
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ohhh, I am killiing myself today.

    I setup virtual server so now I have http://jan.com, but when I open it, guess what FUC*ING FORBIDDEN ERROR AGAIN.

    I did everything, I did chmod 755, I setup everything including persmissions for my account and still!
    Forbidden

    You don't have permission to access / on this server.

    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
    Apache/2.2.14 (Fedora) Server at jan.com Port 80

  23. #23
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    webserver can have it's own reasons to forbid, differ from the filesystem ones

    May I suggest to use windows workstation, as it seems you are not too familiar with unix?

  24. #24
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No way, windows sucks. Im not going back to windows ever again (I have it only to play games LOL), Linux rulez!

    I want to setup the workshop here on linux.

    I'm not complete freshby, I've been using linux 3 years ago for about a year so I am a bit familiar with it.

    So any ideas why I keep getting 403?

  25. #25
    SitePoint Wizard
    Join Date
    Nov 2005
    Posts
    1,191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Shrapnel_N5 View Post
    May I suggest to use windows workstation, as it seems you are not too familiar with unix?
    The title of the thread is "php on linux", so I'm gonna guess you may not


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •