Jump to content
The Uniform Server Community

[Solved] php includes


tomk358
 Share

Recommended Posts

I have a site that I'm trying to run locally with uniform server, and am having issues.

 

For some reason I can't get my include() statements in php to work.

They just come through as text, rather than get interpreted as php scripts.

The includes are all .php files.

 

I tried adding "allow_url_include = on" to both the php.ini file in my site's top directory,

and adding it to the main php.ini, but neither worked.

 

I tried running uniserver as a service, and as a process, that also didn't work.

 

Any ideas?

Link to comment
Share on other sites

Hi tomk358,

 

Are you able to show me those two files? I'll be able to help you from a PHP viewpoint.

 

Thanks

Kalpz

ATOMIC Web Hosting 2007 - 2011

Shared Hosting - Reseller Hosting - Dedicated Servers - Virtual Private Servers (Request Dedicated/VPS Servers via E-mail)

E-mail: sales@atomicwebhosting.com Website: http://www.atomicwebhosting.com/

Link to comment
Share on other sites

  • 2 weeks later...

Ok, so I've got index.php

in the body of that document I have the following:

<? include("topnav.php");?>

 

Then I have topnav.php with just some text to test.

 

When I view index.php on localhost through uniserver, it doesn't include the content from topnav.php, as it would on my ISP's webserver.

 

Ideas?

Link to comment
Share on other sites

You are using short tags this has been disabled in Uniform Server to force users to be standards compliant!

 

The line: include("topnav.php");?>

Should be: <?php include("topnav.php");?>

 

Uniform Server is not draconian hence you can enable short tags in php.ini

 

Edit the three ini files:

UniServer\usr\local\php\php.ini

UniServer\usr\local\php\php.ini_delvelopment_nano

UniServer\usr\local\php\php.ini_production_nano

 

Search for line: short_open_tag = Off

Change to: short_open_tag = On

 

I would recommend always use the long tag <?php format.

Think about it, what happens if you move to an ISP that is standards compliant!

 

All the best

Ric :)

Link to comment
Share on other sites

Ah, I too should have known that! As soon as I get Uniform Server I turn on the short tags. Oh well, glad its solved!

ATOMIC Web Hosting 2007 - 2011

Shared Hosting - Reseller Hosting - Dedicated Servers - Virtual Private Servers (Request Dedicated/VPS Servers via E-mail)

E-mail: sales@atomicwebhosting.com Website: http://www.atomicwebhosting.com/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...