LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 01-27-2008, 02:19 AM   #1
noican
LQ Newbie
 
Registered: Jan 2008
Posts: 2

Rep: Reputation: 0
PHP from windows to fedora


First things first, i'm a newbie in fedora. Just installed it two days ago.

I have coded PHP before in Windows XP-Apache, and is working fine. After copy-pasting the file to fedora, it no longer works(HTTP 404 Error: Page not Found). I tried creating a new file in fedora and recoding my work, it now works.

Can anyone help me what happened because i still have more programs to be transferred to fedora?

Thank you.
 
Old 01-28-2008, 02:42 PM   #2
rubadub
Member
 
Registered: Jun 2004
Posts: 236

Rep: Reputation: 33
404 error means page not found, not a php error! Maybe you need to check your httpd.conf (/etc/httpd/conf/httpd.conf) file. In there there'll be a line like this:
DocumentRoot "/var/www/html"
That tell's you where to put your files. However your problem might be an incomplete install of php? You'll need a line similar to this:
AddType application/x-httpd-php .php .phtml .html
to tell the server which files are sent to the php interpreter.
 
Old 01-28-2008, 03:24 PM   #3
code933k
Member
 
Registered: Aug 2007
Location: Bogotá, Colombia. South America
Distribution: ArchLinux / Source Mage GNU Linux (test branch) / openSUSE
Posts: 130

Rep: Reputation: Disabled
Post

Quote:
Originally Posted by rubadub View Post
404 error means page not found, not a php error! Maybe you need to check your httpd.conf (/etc/httpd/conf/httpd.conf) file. In there there'll be a line like this:
DocumentRoot "/var/www/html"
That tell's you where to put your files. However your problem might be an incomplete install of php? You'll need a line similar to this:
AddType application/x-httpd-php .php .phtml .html
to tell the server which files are sent to the php interpreter.
This is very right! you are confusing a server error with a php error, though, you could try a light http server as lighthttp is if you don't want too much hassles with Apache.

1.) What do you need is checking whether the default Apache config is working for you.
In a browser of your choice:

http://127.0.0.1:[Apache port ie. 80] so http://127.0.0.1:80 should show "Your Apache install is working" or so.

2.) Checking PHP is too simple.
Make an archive like this in your home using your editor of choice, for example probe.php:
Code:
#!/usr/bin/env php
<?php
 print "PHP is working!! \n"
?>
Then, from any terminal type:
Code:
chmod 755 probe.php
and then
Code:
./probe.php
If you see the message PHP is working!!
your problem is definitely Apache so you need to go 3

3.) Follow carefully the recommendations of rubadub, but beware of complicating more the Apache setup. What you can do is checking firstly whether you have installed or not mod_php

If both of them seem to be working, the Apache logs are the answer...

Regards.

Last edited by code933k; 01-28-2008 at 03:26 PM.
 
Old 01-30-2008, 08:47 PM   #4
noican
LQ Newbie
 
Registered: Jan 2008
Posts: 2

Original Poster
Rep: Reputation: 0
It was indeed my php. I did a dos2unix command first then edited my code. I have used $DOCUMENT_ROOT."folder/file.php", so when I viewed the script, it reads /var/www/htmlfolder/file.php. I forgot to add "/", I now changed it to $DOCUMENT_ROOT."/folder/file.php"

tnx guys for the help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php comment problem // and /* on Fedora Core 5 and PHP 5.1.4 shakeel_125 Linux - Server 4 09-29-2006 04:42 AM
php comment problem // and /* on Fedora Core 5 and PHP 5.1.4 shakeel_125 Fedora 4 09-29-2006 02:14 AM
How to get php 4.4.2 and php 5.1.4 running on fedora core 5? markg85 Linux - Software 2 06-18-2006 09:23 AM
PHP / VideoLAN / Fedora Core Question - how can I get the PHP "exec" function to work gtrawoger Linux - Software 3 12-21-2005 06:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 07:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration