From: Colin Guthrie on
'Twas brillig, and Ashley Sheridan at 19/08/10 23:16 did gyre and gimble:
> I used the GUI: K-Menu->Configure your Computer->Install & Remove
> Software
>
> Then searched for 'php', and the first package listed was
> apache-mod_php, which I installed along with the other php modules that
> I normally install (like GD, mcrypt, etc). The package manager sorts out
> dependencies very well. I'm not sure if installing over the command line
> with rpmi will deal with dependencies like this, and it certainly won't
> automatically install apache-mod_php if php is installed, as php doesn't
> necessarily *have* to run as a web server module, let alone as an Apache
> one specifically.

Just for reference:

1. The Package Manager GUI will indeed sort it all out for you.

2. The Package Manager GUI is just a frontend for urpmi. All the
dependency tracking etc. is in urpmi. It's very much like Yum, but IMO
is easer to use and better at reporting conflicts and other such things.
But to each his own :)

3. Just install task-lamp. Who cares that you get mysql installed? I
doubt the space overhead is a problem and I'm very much presuming that
this is your development PC. No offence intended (we were all new once)
the fact that you are asking the questions you are means that this
simply *cannot* be a production setup!

If you have any doubt and want to be more specific, just install
task-lamp-php. All of these are listed in the Package Manager GUI. Just
pick "Meta Packages" and then look under System->Servers (or just search
for the name: staring the GUI and typing "lamp" into the search box is
really all that's needed).

4. Yes PHP can be installed as cgi, apache module or command line. There
is no such thing as "installing php" - you install which system you
want: command line (php-cli), apache module (apache-mod_php) or cgi
(php-cgi). I work with LAMP stacks on various flavours servers and I
find the Mandriva one to be very, very well thought out, and very
flexibly mainly due to the excellent work of Oden Ericsson.

Col




--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]

From: e-letter on
On 19/08/2010, Ashley Sheridan <ash(a)ashleysheridan.co.uk> wrote:
> No, because Apache doesn't need to process HTML in the same way it needs
> to process PHP. The tag <?php in your code is being sent down to your
> browser as HTML (view the source on the page you're browsing to) and
> interpreted as a tag by your browser, hence what appears to be partially
> processed output.
>
> It's fairly clear by now that Apache does not know about your PHP
> install (if there even is one)
>
> I've just set up and installed PHP and Apache on my Mandriva box since
> I've been at home, and it took all of 5 minutes from within the package
> manager. Trust me, it's far easier to go that route than install the
> packages one-by-one as you seem to be doing as, unless you know exactly
> what packages you need, it's all too easy to miss installing something.
>
Yes that is what I was inspecting; I plan to re-install the entire OS.
From: Ashley Sheridan on
On Fri, 2010-08-20 at 10:00 +0100, e-letter wrote:

> On 19/08/2010, Ashley Sheridan <ash(a)ashleysheridan.co.uk> wrote:
> > No, because Apache doesn't need to process HTML in the same way it needs
> > to process PHP. The tag <?php in your code is being sent down to your
> > browser as HTML (view the source on the page you're browsing to) and
> > interpreted as a tag by your browser, hence what appears to be partially
> > processed output.
> >
> > It's fairly clear by now that Apache does not know about your PHP
> > install (if there even is one)
> >
> > I've just set up and installed PHP and Apache on my Mandriva box since
> > I've been at home, and it took all of 5 minutes from within the package
> > manager. Trust me, it's far easier to go that route than install the
> > packages one-by-one as you seem to be doing as, unless you know exactly
> > what packages you need, it's all too easy to miss installing something.
> >
> Yes that is what I was inspecting; I plan to re-install the entire OS.
>


You don't have to reinstall the entire OS, that's a very Windows
approach to the problem. I played around a bit last night with urpmi and
you should be able to just list the packages you need with urpmq --fuzzy
package_name, and then install the ones listed you think you need. I did
notice that urpmi doesn't install the DB when you install the Apache mod
for that DB, so you might need to install that separately, but other
than that, you should be good to go if you install the Apache php mod.


Thanks,
Ash
http://www.ashleysheridan.co.uk


From: e-letter on
On 20/08/2010, Ashley Sheridan <ash(a)ashleysheridan.co.uk> wrote:
> You don't have to reinstall the entire OS, that's a very Windows
> approach to the problem. I played around a bit last night with urpmi and
> you should be able to just list the packages you need with urpmq --fuzzy
> package_name, and then install the ones listed you think you need. I did
> notice that urpmi doesn't install the DB when you install the Apache mod
> for that DB, so you might need to install that separately, but other
> than that, you should be good to go if you install the Apache php mod.
>
>
True with respect to the windoze mentality but I had other reasons to
reformat the pc so this was a good opportunity.

The resultant web page is:

Hi, I am a PHP script

this is a test

However, the manual page implies to me that the web page should have
shown the html code, i.e.

<html>
<head>
<title>php test
</title
</head>
<body>
<p>Hi, I am a PHP script</p>
<p>this is a test</p>
</body>
</html>

The source code of the web page:

<html>
<head>
<title>php test
</title
</head>
<body>
<p>Hi, I am a PHP script</p><p>
this is a test
</p>
</body>
</html>

Is this an error with the explanation of the manual or is the
apache-php configuration still at fault?
From: Ashley Sheridan on
On Thu, 2010-08-26 at 17:45 +0100, e-letter wrote:

> On 20/08/2010, Ashley Sheridan <ash(a)ashleysheridan.co.uk> wrote:
> > You don't have to reinstall the entire OS, that's a very Windows
> > approach to the problem. I played around a bit last night with urpmi and
> > you should be able to just list the packages you need with urpmq --fuzzy
> > package_name, and then install the ones listed you think you need. I did
> > notice that urpmi doesn't install the DB when you install the Apache mod
> > for that DB, so you might need to install that separately, but other
> > than that, you should be good to go if you install the Apache php mod.
> >
> >
> True with respect to the windoze mentality but I had other reasons to
> reformat the pc so this was a good opportunity.
>
> The resultant web page is:
>
> Hi, I am a PHP script
>
> this is a test
>
> However, the manual page implies to me that the web page should have
> shown the html code, i.e.
>
> <html>
> <head>
> <title>php test
> </title
> </head>
> <body>
> <p>Hi, I am a PHP script</p>
> <p>this is a test</p>
> </body>
> </html>
>
> The source code of the web page:
>
> <html>
> <head>
> <title>php test
> </title
> </head>
> <body>
> <p>Hi, I am a PHP script</p><p>
> this is a test
> </p>
> </body>
> </html>
>
> Is this an error with the explanation of the manual or is the
> apache-php configuration still at fault?
>


The manual page says that the output is the HTML code, which is exactly
what you're getting. Your browser is responsible for interpreting those
tags, based on the mime header that it receives from PHP (which is
text/html by default) You should only ever need to change this header
when you are outputting some other type of content, like XML, an image,
etc.

If you change your PHP script and add this line before you output any
content you will see the tags as your browser will interpret them as
plain text (Internet Explorer may screw this up, as it tends to ignore
header mime types more often than not):

header("Content-type: text/plain");

Thanks,
Ash
http://www.ashleysheridan.co.uk