Xampp doesn't recognise PHP files

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Xampp doesn't recognise PHP files

Postby lexton » 07. January 2006 08:12

I've installed xampp .5 and when I start xammp in the terminal I get this:

sudo /Applications/xampp/xamppfiles/mampp start

Starting XAMPP for MacOS X 0.5...
Unknown option: n
Usage: head [-options] <url>...
-m <method> use method for the request (default is 'HEAD')
-f make request even if head believes method is illegal
-b <base> Use the specified URL as base
-t <timeout> Set timeout value
-i <time> Set the If-Modified-Since header on the request
-c <conttype> use this content-type for POST, PUT, CHECKIN
-a Use text mode for content I/O
-p <proxyurl> use this as a proxy
-P don't load proxy settings from environment
-H <header> send this HTTP header (you can specify several)

-u Display method and URL before any response
-U Display request headers (implies -u)
-s Display response status code
-S Display response status chain
-e Display response headers
-d Do not display content
-o <format> Process HTML content in various ways

-v Show program version
-h Print this message

-x Extra debugging output
XAMPP: Starting Apache with SSL ...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP for MacOS X started.

when I try to access a php file I get a pop up dialog that says:

index.php is an application

Are you sure you want to download the application index.php?

I've created html files and they work fine in apache. So what is not configured right for PHP? I've enabled PHP 5 -> sudo /Applications/xampp/xamppfiles/mampp php5

Still get the same result...

Is there a config option in http.conf that is not set properly?

any suggestions greatly appreciated
lexton
 
Posts: 4
Joined: 07. January 2006 07:08

Fixed!

Postby lexton » 07. January 2006 08:42

well I found a fix for this.

I went in to httpd.conf and explicitly loaded the libphp5.so module. I first commented out this code:

#<IfDefine PHP4>
#LoadModule php4_module modules/libphp4.so
#</IfDefine>
#<IfDefine PHP5>
#LoadModule php5_module modules/libphp5.so
#</IfDefine>

and then I loaded php5 in the same way that all other modules were getting loaded. just added libphp5 to the end of the load module list like this:

LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php5_module modules/libphp5.so

I also had to chmod 755 the xampp directory and chmod 777 --> /xampp/lang.tmp in order to get the xampp/index.php page to work properly

This must have been a file permissions error of some kind. Has anyone else had these problems?
lexton
 
Posts: 4
Joined: 07. January 2006 07:08

php startup issue

Postby aboeing » 11. December 2007 01:53

yes..this problem is cause your /usr/bin/head command was replaced when installing some perl library or maybe fink.
I went thtrough the scripts and found the commands that are being called, although if you look closely you can see clearly the output coming from the head command:
Usage: head [-options] <url>...
This is not the original head command which is suppose to show the first n lines of a file. head -n number
You have to replace (reinstall) the original head command. I just did it on my machine, lucky me I had 3 macs in my office, so I just copied from another machine, moved the /usr/bin/head to /usr/local/head(hopefully I didnt break the perl dependency) and copied the new head to its original place.
It WORKS, no more errors and my phpserver started fine and it's serving the pages fine.

Good luck.

(ps: if you need a copy of head and are brave enough to use it on your machine, ring me ;) ) Actually I have 2 machines 10.4 and a new one 10.5.
aboeing
 
Posts: 1
Joined: 11. December 2007 01:01
Location: Belgium


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 10 guests