[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PHP



Try the following:

for problem 1): Try deleting the mime types application/x-httpd-php...
(or similar) from your applications in your Netscape preferences. It
seems to me when netscape is faced with a php script that is sent as
source by the server (ie without the correct headers) it adds the mime
type to the helper applications list.

for 2): install the package php3-mysql using # apt-get install
php3-mysql

Also, why are you using php3? I am running php4 for all our php scripts,
works fine. Plus if you add other extensions to the list...

AddType application/x-httpd-php .php .php3 .asp

it will make apache parse all these extensions as php scripts. So php3
scripts will work under php4 and we can now disguise php scripts as asp
scripts to fool would be crackers (only for a little while at least).

hope that helps,

Andreas

Keneth wrote:
> 
> Hi b3,
> 
> Apache can exceute php file externsion now. But I still have two problems:
> 
> 1) I added the lines below into httpd.conf, howvever it ask me to download
> the *.php3 file instead of running it.
> 
> AddType application/x-httpd-php3 .php3 .php
> #AddType application/x-httpd-php3-source .phps
> 
> 2) I have mysql_connect script, but it said
> Fatal error: Call to unsupported or undefined function mysql_connect() in
> /var/www/t.php on line 6
> 
> Keneth
> 
> > Hi Keneth,
> >
> > The php3 and php3-mysql packages are for version 3 of php.  The
> > packages I mentioned are for version 4.  If you want to use version 3,
> > and NOT version 4, then you have the correct packages.  If you want to
> > upgrade to php4, install the ones I mentioned.
> >
> > I'm unfamiliar with the tweaks needed to activate the php3 packages,
> > as I haven't installed them myself.  I know the php4 packages pretty
> > well, though =)
> >
> > There are basically 2 things you should have to do, to make sure that
> > your apache install recognizes your version of php.
> >
> > The first is to make sure you're loading the php modules.  In
> > httpd.conf, look for a line resembling the following:
> >
> >     LoadModule php4_module /usr/lib/apache/1.3/libphp4.so
> >
> > (this is the php4 module - yours might be libphp3.so or libphp.so)
> >
> > Make sure it's uncommented.
> >
> > Next, look for the following section:
> >
> >     # For example, the PHP 3.x module (not part of the Apache
> >     # distribution - see http://www.php.net) will typically use:
> >     #
> >     #AddType application/x-httpd-php3 .php3
> >     #AddType application/x-httpd-php3-source .phps
> >     #
> >     # And for PHP 4.x, use:
> >     #
> >     AddType application/x-httpd-php .php
> >     AddType application/x-httpd-php-source .phps
> >
> > (here I have the php4 entries uncommented, but you can see the php3
> > ones above it, commented out in my case.  In your case you'll probably
> > want the php3 ones active, and the php4 ones uncommented.)
> >
> > After making sure everything is correct, stop apache with:
> >
> > # /etc/init.d/apache stop
> >
> > Verify that it's indeed stopped (ps aux | grep apache) and restart
> > it with:
> >
> > # /etc/init.d/apache start
> >
> > Now, in your apache docroot (default on Debian seems to be /var/www)
> > make a file called phpinfo.php3 (or phpinfo.php if you upgrade to
> > php4) containing the following:
> >
> > <? phpinfo(); ?>
> >
> > Save it, then bring it up in a browser with:
> >
> > http://localhost/phpinfo.php3
> >
> > If all goes well, you should see the php information page, which can
> > tell you all sorts of nifty things about your installation.
> >
> > If all doesn't go well, let us know what happens.
> >
> > -b3
> >
> > On Thu, May 17, 2001 at 09:39:36AM +0800, Keneth wrote:
> > > I found that PHP3 and PHP3-MYSQL installed in "DSELECT", should I remove
> > > them and install the deb you mentioned?
> > >
> > > PIVO
> > > >
> > > > Very odd.  Did you install apache/php/mysql from source, or from debs?
> > > >
> > > > IIRC, when installing the debs (at least in unstable) it asks to run
> > > > apacheconf to set things up.  I do remember having to go in and
> > > > manually set the mime-type config for .php files, however.  I don't
> > > > recall having to touch the Add/LoadModule lines (although it'd be a
> > > > good idea to check)
> > > >
> > > > Here's the general set of debs I have apt install:
> > > >
> > > > apache php4 php4-dev php4-imap php4-gd php4-mysql mysql-server
> > > > libapache-mod-perl libapache-dbi-perl libdbi-perl libdbd-mysql-perl
> > > >
> > > > I think that's everything - if you don't want mod_perl, you can leave
> > > > out the last four pretty safely.
> > > >
> > > > -b3
> > > >
> > > > On Wed, May 16, 2001 at 05:09:21PM +0800, Keneth wrote:
> > > > > The line has been added! and I feel that there is something wrong
> with
> > > the
> > > > > httpd.conf. I added manually below code by myself, but doesnt seem
> to
> > > load
> > > > > the php modules
> > > > >
> > > > > AddModule php4_module mod_php4.c
> > > > > LoadModule php4_module /usr/local/apache/modules/libphp4.so
> > > > >
> > > > > Besides I coudlnt find libphp.so after following the install guide
> come
> > > with
> > > > > the PHP-4.0.5 too.
> > > > >
> > > > > I am using Apache_1.3.19 and mysql.
> > > > >
> > > > > Could you help?
> > > > > From: "Kevin Ross" <kevin@FamilyRoss.net>
> > > > > To: "Keneth" <hongkong@cuhk.edu.hk>; <debian-user@lists.debian.org>
> > > > > Sent: Wednesday, May 16, 2001 5:03 PM
> > > > > Subject: Re: PHP
> > > > >
> > > > >
> > > > > > > Please help, my apache only load the content of a php instead of
> > > runnnig
> > > > > > it.
> > > > > >
> > > > > > Make sure you have a line in your httpd.conf file which reads:
> > > > > >
> > > > > > AddType application/x-httpd-php .php
> > > > > >
> > > > > > or, for PHP3:
> > > > > >
> > > > > > AddType application/x-httpd-php .php3
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > listmaster@lists.debian.org
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > listmaster@lists.debian.org
> > > >
> > >
> >
> > --
> > Brent Bourgoine                                            b3@b4k4.net
> > ----------------------------------------------------------------------
> > Geek Code Version: 3.1
> > G d- s+:+ a- C++++$ UBL+++$>++++ P+$>+++ L++$>++++ E$>++ W+++$ N++ o?
> > K w--- O M- !V PS+++ PE Y+ PGP++ t+ 5++ X+ R(++) tv(+) b+++ DI++++ D++
> > G e h r++(+++) y?(+++)
> > ----------------------------------------------------------------------
> >
> >
> > --
> > To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> > with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
> >
> 
> --
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: