Forum Moderators: phranque

Message Too Old, No Replies

Not loading php files properly

When I try to view pages with php content it show text ... or

         

Gannes

12:17 pm on May 7, 2006 (gmt 0)

10+ Year Member



Hello anyone,

I've got the following lines added to my httpd.conf file (apache 2,0,52):
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

I've installed php 5,0,4 on my osx

If I set the first line to: AddType application/x-httpd-php .php
- the browser thinks the php page is a program and tries to download it.

If I set the first line to: AddType application/x-httpd-php .php5
- the browser thinks the code in the page is just text .. for example if I put the following php code in my page; <?php phpinfo();?>.

What am I doing wrong?

I'm struggling for two days now ...

jdMorgan

12:15 am on May 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need AddHandler, not AddType.

Jim

Gannes

8:34 am on May 8, 2006 (gmt 0)

10+ Year Member



Thanks Jim. I don't if it will work ... I've deinstalled the webserver and am back to the original one. The 1,3 version wich ships with osx 10,4. Why?

Because it didn't solve my problem ...

And now I'm back again. Apache 1,3/ php 5,1,2 and I don't see any blob uploads put of my mysql database and when i try a different script, to upload files to a directory, it doesn't upload.

I don't know what to do anymore. I had the same scripts running on a windows machine and it all worked fine. But something, some configuration isn't set right.

At a loss. Can you give me a tip?

coopster

4:44 pm on May 8, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, Gannes.

Are you over the parsing piece then? I mean, are you able to successfully run a phpinfo() script and see parsed PHP documents or is it still trying to download the document? Don't forget to restart your Apache server after making changes to the httpd.conf file.

Gannes

5:24 pm on May 8, 2006 (gmt 0)

10+ Year Member



Hello Coopster,

Yeah, well. I'm running php, mysql and apache, and yes phpinfo() does parse correctly. But still having problems with viewing (uploading) pictures from the database ...

coopster

1:56 pm on May 9, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



It certainly could be a configuration issue. I would start with small files uploads to see if they work correctly. If so, then it is likely a configuration directive that needs to be changed. The PHP manual is a good starting place to read and learn about the different directives and what they do for you during file uploads [php.net].

Gannes

7:03 pm on May 9, 2006 (gmt 0)

10+ Year Member



I think your right. It has to be a configuration issue. I'll read the link you send me! Thanks for now ...