Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

This question is closed because it's offtopic. I've posted again in http://serverfault.com/questions/481032/problems-installing-php5-from-source-in-ubuntu. Excuse me for the inconveniences.

I've been trying to install php5 for a while.

I'm using. Ubuntu 12.10 Apache 2.4.3

And the version of php I want to install is: PHP 5.4.11

I follow the documentation in the webpage.

I install Apache (after putting the apr and apr-util folders in ./scrlib, just as the documentation says).

sudo ./configure --enable-so
sudo make
sudo make install

All of these commands output a lot of information, but no error nor warning as long as I'm aware.

Just for the record:

/usr/local/apache2/bin/httpd -l
Compiled in modules:
  core.c
  mod_so.c
  http_core.c
  event.c

mod_so.c is there, so I think the installation were alright.

Now, I attempt to install PHP (after putting the

.sudo ./configure \
  --prefix=/home/usr/local/php5/ \
  --with-mysql \
  --with-apxs2=/usr/local/apache2/bin/apxs \
  --with-xsl \
  --with-gdbm \
  --with-gd \
  --with-freetype=/usr/include/freetype2/ \
  --with-zlib-dir=/usr/include \
  --with-ttf \
  --with-jpeg-dir=/usr/lib

Everything goes fine except the following warning:

configure: WARNING: unrecognized options: --with-freetype, --with-ttf

However, those options aren't the greatest of my problems and I follow to the next steps.

sudo make

And these are the lasts lines of the output.

Generating phar.php
Generating phar.phar
PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
invertedregexiterator.inc
pharcommand.inc
directorytreeiterator.inc
directorygraphiterator.inc
clicommand.inc
phar.inc

Build complete.
Don't forget to run 'make test'.

Next step.

sudo make install

Everything seems fine.

sudo cp php.ini-development /usr/local/lib/php.ini

I edit the conf file (/usr/local/apache2/conf/httpd.conf). The line...

LoadModule php5_module        modules/libphp5.so

...was already there. Just under that line I add:

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

I restart apache:

sudo service apache2 restart

So, php5 should be already installed. I make the following script in php.

// info.php
<?php
phpinfo();
?>

And saved it in /var/www/info.php

I put the following url in my browser:

http://127.0.0.1/info.php

There's no output.

Why? What did I miss?

share|improve this question
1  
You might be looking for ServerFault (which is another site on the StackExchange network). – h2ooooooo Feb 20 at 10:10
apt-get install php5 – Dave Feb 20 at 10:10
@Dave read the OP: And the version of php I want to install is: PHP 5.4.11. – h2ooooooo Feb 20 at 10:11
1  
anything in /var/log/apache2/error.log? – Colin Pickard Feb 20 at 10:12
@h2ooooooo i fail to see how that becomes an issue you can either hook into the unstable or experimental branches with apt or just grab a .deb instead. The need to compile from raw source these days is so rare and only really if you want to go to extreme performance tuning. – Dave Feb 20 at 11:26
show 2 more commentsadd comment (requires an account with 50 reputation)

closed as off topic by h2ooooooo, Tom van der Woerdt, ethrbunny, vstm, wtsang02 Feb 20 at 18:43

Questions on Stack Overflow are expected to relate to programming within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

Usually white page means that an error happens and you have diplay_errors to off. You should check your error log (in /var/log/apache2/) or enable your diplay_error on php.ini.

share|improve this answer
If I browse to my info.php file, the only new line added to the error.log is [Wed Feb 20 19:49:01 2013] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico – XavierusWolf Feb 20 at 18:50
Please check your error_reporting in php.ini (you can temporarily set it to E_ALL) and your error_log to check if it is something other that the usual /var/log/apache2... You could also set display_errors to On to see the error on your browser (NOT recommended for production servers) – tix3 Feb 20 at 19:23
I've tried setting display_errors = On in php.ini. Nothing is shown on the screen. – XavierusWolf Feb 20 at 19:31
Can you rey running php -i from a terminal ? – tix3 Feb 20 at 19:34
Running "php -i" I get the following:The program 'php' is currently not installed. You can install it by typing: sudo apt-get install php5-cli – XavierusWolf Feb 21 at 9:31
add comment (requires an account with 50 reputation)

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