Install php

Install php

sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
So I decided to setup a simple web server so I can test out some php scripts. I did:
bash code
apt-get install php-pear

bash code
apt-get install php5-dev

But, the php files still download instead of display.
 
 
 
2010 Sep 23 at 23:37 UTC
Down Rodeo
Cap'n Moth of the Firehouse

Find the Hole II Participation Medal
2007 Oct 19 • 5486
57,583 ₧
 
 
 
2010 Sep 23 at 23:53 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
You should really stop drinking.
 
 
 
2010 Sep 24 at 00:43 UTC
Down Rodeo
Cap'n Moth of the Firehouse

Find the Hole II Participation Medal
2007 Oct 19 • 5486
57,583 ₧
That's creepy, how did you know? I mean, I had *one* glass of wine, sue me.

Anyway, apt-get install downloads and installs the packages. You can then use the files, not sure how it goes with PHP but you might be able to include files in projects or invoke an interpreter somewhere.
 
 
 
2010 Sep 24 at 10:37 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
Can you/somebody tell me how to make it so that php files are shown instead of downloaded?

httpd.conf code
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps


Weird thing though, bash said that httpd wasn't a recognized service...
 
 
 
2010 Sep 24 at 20:51 UTC
Down Rodeo
Cap'n Moth of the Firehouse

Find the Hole II Participation Medal
2007 Oct 19 • 5486
57,583 ₧
sprinkles said:
shown

Not sure what you mean by that. However, there should be samples available in a directory, which can probably be ascertained by reading a man page or package details.
 
 
 
2010 Sep 24 at 21:32 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
 
 
 
2010 Sep 25 at 05:06 UTC
SuperJer
Websiteman

2005 Mar 21 • 6660
For the record, you should only need to...

code
apt-get install apache2 php5 libapache2-mod-php5


...to get PHP and Apache and have them play nice together.

And you shouldn't have to do anything at all if you chose "LAMP server" (or something similar) when you installed the OS.
 
 
 
2010 Sep 25 at 06:53 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
New problem...
mysql doesn't like php...
Its telling me I have to enable mysql functions in php or I have to enable php functions in mysql...
code
vBulletin 4.0.7 requires that the MySQL functions in PHP be available. Please ask your host to enable this.

 
 
 
2010 Sep 25 at 08:17 UTC
SuperJer
Websiteman

2005 Mar 21 • 6660
Try installing php5-mysql
 
 
 
2010 Sep 25 at 08:36 UTC — Ed. 2010 Sep 25 at 08:36 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
Does that install mysql and php?
 
 
 
2010 Sep 25 at 09:21 UTC
SuperJer
Websiteman

2005 Mar 21 • 6660
It installs the mysql functions for php.

But as a result it will probably install mysql and php too if you don't already have them. Because otherwise it would be useless.
 
 
 
2010 Sep 25 at 09:29 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
php code

<?php
function escape_string($string)
{
if (
$this->functions['escape_string'] == $this->functions['real_escape_string'])
{
return
$this->functions['escape_string']($string, $this->connection_master);
}
else
{
return
$this->functions['escape_string']($string);
}
}
?>


What does this code do?
I was getting errors so I changed:
php code

<?php
return $this->functions['escape_string']($string);
?>


to
php code

<?php
return $this->functions['real_escape_string']($string);
?>

 
 
 
2010 Sep 25 at 09:32 UTC
SuperJer
Websiteman

2005 Mar 21 • 6660
It depends on the definitions of
$this->functions['escape_string']
and
$this->functions['real_escape_string']

Normally you would use the builtin functions mysql_escape_string and mysql_real_escape_string to make strings SQL safe and prevent SQL injection attacks on your server.
 
 
 
2010 Sep 25 at 09:42 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
Bumped for RB.
 
 
 
2010 Oct 13 at 02:13 UTC
Page [1]