Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 18th, 2004, 11:20 AM
Authorized User
 
Join Date: May 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default include problems on Mac OS

Hello,

     I have installed php/mysql on my G5 os 10.3.3 machine and when I'm running scripts, all include files are ignored. I have the generic document root of: /Library/WebServer/Documents. For example: if this script "include_test.php" has this code:

<? echo "hello World!"; ?>

and I include it at the top of "test.php" like this:

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

Nothing will be printed.

I'm sure it has to to w/ the php.ini file but that's as far as I can guess.

Thanks for any help.

Clem C

 
Old May 18th, 2004, 12:21 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Anything showing up when you view the source code in the browser?

Perhaps short tags (e.g. <? ?>) are disabled. These aren't a good idea to get in the habit of using anyway, stick with <?php ?>

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old May 18th, 2004, 01:17 PM
Authorized User
 
Join Date: May 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks so much for getting back to me. I tried the long tags and it didn't change anything....

 
Old May 18th, 2004, 03:35 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Do these exist in the same directory?

A few things to check:
1st, file permissions, PHP needs at least read permission to be able to get the file.

See this article for setting permissions in Unix / OSX
http://p2p.wrox.com/topic.asp?TOPIC_ID=11962

2nd, the include_path directive in php.ini. This is where PHP will look for files, by default it just looks in the absolute/relative path you tell it to, this simplifies things a bit by not requiring an absolute path for every include in the directories specified by this directive.

Code:
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old May 19th, 2004, 11:04 AM
Authorized User
 
Join Date: May 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Everythings working fine now. Thanks for your help. It was just the permissions thing.

As usual - the OBVIOUS.

Cheers,

[b] Clem C/b]






Similar Threads
Thread Thread Starter Forum Replies Last Post
text editor for mac os 9.2 starfrog CSS Cascading Style Sheets 4 February 1st, 2018 06:47 AM
Javascript & Safari (On MAC OS) usman_iftikhar Javascript 2 October 1st, 2006 11:01 PM
Download mov file in MAC OS JeromeQin Classic ASP Professional 1 July 20th, 2006 05:00 AM
JRun4 for Mac OS + Mac OS X's Java 1.4.1 elbicho J2EE 0 June 27th, 2003 12:18 PM
Connect from Mac OS to Windows yarith Forum and Wrox.com Feedback 1 June 4th, 2003 08:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.