LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Open edit Php file problem (PhP apache installed) (http://www.linuxquestions.org/questions/programming-9/open-edit-php-file-problem-php-apache-installed-888602/)

waerfwe 06-27-2011 01:10 PM

Open edit Php file problem (PhP apache installed)
 
Hello Guys,
My problem is that everytime i create a php file with gedit or with open office,when i try to open it ..it will open with the editor by default and if i drag and drop it to firefox it won't show as a web page..it will prompt me to download my own file..what should i do ??
(The apache is running while i m doing all this.)

paulsm4 06-27-2011 01:47 PM

Hi, waerfwe -

1. Edit the PHP source file (EX: /var/www/myfile.php) with gedit
2. Make your changes and SAVE with gedit
3. VIEW with your web browser (EX: firefox, http://localhost/myfile.php)

Reason for step 3) being separate from steps 1) and 2):

The apache server needs to INTERPRET your PHP file (in order for you to see what you expect to see). Using a browser is the most practical way to request the server to process the file. Dragging and dropping the file to Firefox, on the other hand, completely bypasses the server.

Make sense ;)?

waerfwe 06-30-2011 06:07 AM

Man thanks so much! :) my only problem now is to give permission to my www folder so i cn copy the file there... can you help me ?

yancek 06-30-2011 10:29 AM

On most distributions the www directory is owner:group = apache:apache and has 755 permissions. Any user you want to have access should be in the apache group. Some distributions use a different user:group name wwwrun?? You'll need to check on whichever distribution you are using.


All times are GMT -5. The time now is 09:06 PM.