Forum   Search   Register   Log in SUPERJER FORA
 

Install php

Pages: [1]
Programming Help
sprinkles

Chrome Whore
2009 Sep 6 • 2480
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.
...then I got some ap, and shot a big ass lazar at everyone.
    2010 Sep 23 at 16:37
Down Rodeo
Cap'n Moth of the Firehouse

Find the Hole II Participation Medal
2007 Oct 19 • 5327
57,583 ₧
Well yes, you are telling the package manager to download the files. Hence "install".
Everyone stares when you walk in the room, they stare when you go....
    2010 Sep 23 at 16:53
sprinkles

Chrome Whore
2009 Sep 6 • 2480
10 ₧
You should really stop drinking.
...then I got some ap, and shot a big ass lazar at everyone.
    2010 Sep 23 at 17:43
Down Rodeo
Cap'n Moth of the Firehouse

Find the Hole II Participation Medal
2007 Oct 19 • 5327
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.
Everyone stares when you walk in the room, they stare when you go....
    2010 Sep 24 at 03:37
sprinkles

Chrome Whore
2009 Sep 6 • 2480
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...
...then I got some ap, and shot a big ass lazar at everyone.
    2010 Sep 24 at 13:51
Down Rodeo
Cap'n Moth of the Firehouse

Find the Hole II Participation Medal
2007 Oct 19 • 5327
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.
Everyone stares when you walk in the room, they stare when you go....
    2010 Sep 24 at 14:32
sprinkles

Chrome Whore
2009 Sep 6 • 2480
10 ₧
http://98.245.129.68
...then I got some ap, and shot a big ass lazar at everyone.
    2010 Sep 24 at 22:06
superjer
superjer

2005 Mar 20 • 3762
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 24 at 23:53
sprinkles

Chrome Whore
2009 Sep 6 • 2480
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.

...then I got some ap, and shot a big ass lazar at everyone.
    2010 Sep 25 at 01:17
superjer
superjer

2005 Mar 20 • 3762
Try installing php5-mysql
    (Edited 2010 Sep 25 at 01:36)     2010 Sep 25 at 01:36
sprinkles

Chrome Whore
2009 Sep 6 • 2480
10 ₧
Does that install mysql and php?
...then I got some ap, and shot a big ass lazar at everyone.
    2010 Sep 25 at 02:21
superjer
superjer

2005 Mar 20 • 3762
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 02:29
sprinkles

Chrome Whore
2009 Sep 6 • 2480
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);
?>

...then I got some ap, and shot a big ass lazar at everyone.
    2010 Sep 25 at 02:32
superjer
superjer

2005 Mar 20 • 3762
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 02:42
sprinkles

Chrome Whore
2009 Sep 6 • 2480
10 ₧
Bumped for RB.
...then I got some ap, and shot a big ass lazar at everyone.
    2010 Oct 12 at 19:13

Pages: [1]
Forum and design copyright © 2008-2010 SuperJer.com