Jump to content


Photo

php includes not working after php update


  • Please log in to reply
6 replies to this topic

#1 babyewok

babyewok

    Junior Member

  • Member
  • Pip
  • 27 posts
  • Main OS: Windows XP

Posted 13 November 2009 - 11:37 AM

I just updated php to 5.2.9 so that it reflects the version running on my hosting account and it seems that I can no longer view my php includes (php parsed in HTML files). Upgrading php is all the I have done - the includes were working fine before.

I can access a Prestashop shop that I have set up (uses php), so the php is running correctly. I don't know whether it is just php being parsed in html files that is no longer working or the php include function itself.

Any ideas?

#2 Ric

Ric

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 1,535 posts
  • Gender:Male
  • Location:Cambridge,UK
  • Interests:Electronics
    Internet in general
    Open source projects
  • SourceForge IDmpgcan
  • Wiki ID: Ric
  • Main OS: Windows XP

Posted 13 November 2009 - 12:41 PM

Which version of Uniform Server did you perform the upgrade on?

All the best
Ric :rolleyes:

#3 babyewok

babyewok

    Junior Member

  • Member
  • Pip
  • 27 posts
  • Main OS: Windows XP

Posted 13 November 2009 - 12:50 PM

Which version of Uniform Server did you perform the upgrade on?

All the best
Ric :rolleyes:


It's Version 4

#4 Ric

Ric

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 1,535 posts
  • Gender:Male
  • Location:Cambridge,UK
  • Interests:Electronics
    Internet in general
    Open source projects
  • SourceForge IDmpgcan
  • Wiki ID: Ric
  • Main OS: Windows XP

Posted 13 November 2009 - 01:43 PM

Oops! I think I asked a silly question

This page lists stables releases of 4-Series

http://wiki.uniforms...Server_releases

Are you using one of these?

Could you post some simple code that fails just makes it easier to isolate the problem

All the best
Ric :rolleyes:

#5 babyewok

babyewok

    Junior Member

  • Member
  • Pip
  • 27 posts
  • Main OS: Windows XP

Posted 13 November 2009 - 02:36 PM

Thanks for your help. It is 4.0 and I upgraded php to 5.2.9-2. It seems to fail when I have an html page and just want to show a menu with a php include (worked fine before and I have tried a number of htaccess changes for parsing php):

<?php include("php-includes/menu.php"); ?>

It's just annoying because I upgraded php to resolve one problem and ended up causing another!

#6 Ric

Ric

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 1,535 posts
  • Gender:Male
  • Location:Cambridge,UK
  • Interests:Electronics
    Internet in general
    Open source projects
  • SourceForge IDmpgcan
  • Wiki ID: Ric
  • Main OS: Windows XP

Posted 13 November 2009 - 02:51 PM

OK You have two options:

Add the following line to file: UniServer\udrive\www\.htaccess
AddType application/x-httpd-php .html .htm

Alternatively edit this file: UniServer\udrive\usr\local\apache2\conf\httpd.conf

Locate this line:
AddType application/x-httpd-php .phtml .php3 .php
Change to
AddType application/x-httpd-php .html .htm .phtml .php3 .php


All the best
Ric :rolleyes:

#7 babyewok

babyewok

    Junior Member

  • Member
  • Pip
  • 27 posts
  • Main OS: Windows XP

Posted 13 November 2009 - 03:33 PM

I thought I had already tried every htaccess option under the sun, but apparently not that one! Turns out that the particular site I was working on required

AddHandler x-httpd-php .php .html .htm

which uniserver didn't like. I changed it to the one you suggested and it works fine now. In fact I'm wondering if I've been slightly dappy and that the problem was actually that when the site went live, the server it was on didn't like the .htaccess file that worked in Uniserver, so I changed it. Obviously that then caused it not to work on Uniserver. I did do the php ugrade at around the same time, so I just blamed it on that!

Oh well, thank you for helping me work it though!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users