Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 18th, 2004, 11:20 AM
Authorized User
 
Join Date: May 2004
Location: Chapel HIll, NC, .
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

Reply With Quote
  #2 (permalink)  
Old May 18th, 2004, 12:21 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
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
::::::::::::::::::::::::::::::::::::::::::
Reply With Quote
  #3 (permalink)  
Old May 18th, 2004, 01:17 PM
Authorized User
 
Join Date: May 2004
Location: Chapel HIll, NC, .
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....

Reply With Quote
  #4 (permalink)  
Old May 18th, 2004, 03:35 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
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
::::::::::::::::::::::::::::::::::::::::::
Reply With Quote
  #5 (permalink)  
Old May 19th, 2004, 11:04 AM
Authorized User
 
Join Date: May 2004
Location: Chapel HIll, NC, .
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]

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:24 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.