Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've tried to install PHP by downloading the .gz file from another computer, transferring it over to the Linux PC, and doing the tar, ./configure, make, and make install process.

But I dun goof'd somewhere.

The Problem:

Loading any PHP pages shows the PHP codes, as opposed to the proper website. Now, I tried a lot of things to get this working, and even asked a question about it, but so far, no luck. Strange that it works on the command line, but the browser fails to display it.

The one and only time I got PHP working was when I used yum to get it. So I want to try that again.

However, I'm not sure of the consequences of doing a yum install php when PHP is already installed on my system.

What I've Tried:

My attempts to correct the "Display PHP codes" problem is a long list, but to summarize:

  • Re-installed PHP (using make, the very same installation I want to get rid off now)
  • Configure httpd.conf - with varying results. Modifying the httpd.conf file absolutely breaks apache, for some reason.

As for my problems regarding getting rid of the existing PHP:

  • I've tried going into the directory where I extracted the php stuff, and typing in make uninstall, but that only returned No rule to make target 'uninstall'. Stop.

The System:

  • Fedora 19 x86_64
  • Oracle 11g
  • Apache 2.4.6

I hope someone can help, and a thanks in advance for any who will. This problem has gone on for far too long.

share|improve this question

2 Answers 2

so this sounds like an issue with Apache in my opinion. Are you loading PHP in your httpd.com file? I suggest the following configs be present..

LoadModule php5_module modules/libphp5.so

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>


<FilesMatch "\.ph(p[2-6]?|tml)$">
    SetHandler application/x-httpd-php
</FilesMatch>

<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>


RewriteEngine On
RewriteRule (.*\.php)s$ $1 [H=application/x-httpd-php-source]

Then make sure you restart Apache. Hope that helps.

share|improve this answer
    
this works properly for Apache with the preform mpm which is the old and limited processing model. threaded Apache version do not work with linphp5.so and often require use of CGI or similar. –  alxgomz Dec 20 '13 at 6:25
    
A lot of people said that too, and I believe them, but for some reason if I edit httpd.conf, Apache fails to start, saying there's a syntax error wherever I insert anything. –  zack_falcon Dec 20 '13 at 7:18
    
Could you give me the error, my syntax above may be a tad off. –  Byron Dec 20 '13 at 14:39
    
Failed to start Apache HTTP server. Syntax error on line 364 - This is where I added the code above. –  zack_falcon Jan 2 at 1:16

the fact that your php interpreter works on the command line shows it works. if the browser tries to download files instead of display website this is because Apache is misconfigured and content negotiation fails to tell the browser what type of content it s about to send. from the top of my head, you need to set a handler in httpd.conf to let Apache knows it's able to interprete php code. However if you're struggling setting this up, I would definitely recommend you install php with your package manager.

make sure to remove your first install with

make uninstall (of your Make file has this target) or by removing the prefix folder if possible.

share|improve this answer
    
I copied over the php.tar.gz in root/Documents and extracted it there. There, I ran the ./configure, make, and make install. I went back into that folder to run make uninstall, but it returns the error No rule to make target 'uninstall'. Stop.. –  zack_falcon Dec 20 '13 at 9:14
    
Just to make sure, uninstall has to be run in the source directory, the Make file lies, not in the install directory. Having said that, of you the configure script without arguments, php had been installed in /use/local. If you installed no other software from sources, it's likely you can just delete the content of /usr/local. Buy make sure only php is installed there or you may break your system –  alxgomz Dec 20 '13 at 17:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.