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 (http://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 |
What do your error and access logs say?
|
Why don't you create a staging web that has a docroot of your project development directory?
Regards, Alunduil |
You can enable UserDir directive to allow Apache to read pages from /home/you/public_html. See Apache docs http://httpd.apache.org/docs/2.2/howto/public_html.html
|
Quote:
|
Quote:
|
Quote:
Code:
toor@toor-d ~/ $ php ./myscript.php |
A staging web is a webserver that runs on your local machine that allows you to quickly view the websites you're developing. I use a combination of rewriterule and aliasmatch to get a nice listing of current projects when I browse to localhost and am able to then see what my projects are doing.
On a side note, the best PHP editor I know of right now is vim (I hope this doesn't start a fire). Regards, Alunduil |
Quote:
Just kidding, vim is my preferred editor for most languages. That being said emacs and eclipse are fine development environments as well. Whatever you're comfortable with is great. |
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? |
you should probably create it as a virtual host
create a (pick_a_name.conf) in /etc/apache2/sites_available with the following Code:
<VirtualHost 127.0.0.1:80> Code:
127.0.0.1 same_name_as_above then create a symlink from /etc/apache2/sites-available/same_name_as_above.conf to /etc/apache2/sites-enabled/same_name_as_above.conf Code:
ln -s /etc/apache2/sites-available/same_name_as_above.conf /etc/apache2/sites-enabled/same_name_as_above.conf |
Quote:
Now when I try to access http://jan.com I get 403 error again: Quote:
|
Usually, a forbidden is either a permissions problem or Directory statement with the wrong options. What are the permissions on the files in your vhost's docroot?
Regards, Alunduil |
some versions of apache might have a vhosts.conf others might just have the vhosts defined in the apache2.conf or (more likely) the httpd.conf file
another option is to use webmin http://www.webmin.com/ to create the vhost Quote:
any folder you want uploading to should be writable |
Just to chime in with my 2cents, I would go the route of the virtual host. Normally I create a group called webmaster and add my account to the Root folder for the site. I give the webserver's user account and the webmaster group rw on the folder.
As for a development I normally use EclipsePHP for the project management, But normally get frustrated by it and go back to vim. I am just more efficient with vim. But you might want to look into Bluefish. Also as for your error that is usually a permissions problem. meaning that the webserver's user account does not have at least read access to the directory. |
All times are GMT -5. The time now is 02:24 PM. |