10

I'm trying to install Zend on a machine running xampp. Zend's help file says that in order to set up the command-line tools, I need to make sure that the contents of the /library directory are placed inside my php include_path specified directory.

When I look at my php.ini, include_path is commented out, but the value looks like this:

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"

Where exactly is the include_path pointing to? I'm pretty new to Linux, and have never seen .: as part of a file path.

3
  • 2
    You mentioned "a machine running xampp" You may want to remove it and install lamp-server instead which is a package in Ubuntu Nov 23, 2010 at 16:06
  • 1
    Why? xampp runs perfectly well.
    – EmmyS
    Nov 23, 2010 at 16:07
  • 2
    Ubuntu's lamp-server metapackage (tasksel → LAMP Server) is a distribution of the lamp stack that is tailored to work especially well with ubuntu. You can use xampp of course - and it'll work just fine, but Ubuntu's distribution (version) is recommended (and required if you want to use canonical's enterprise support). Nov 23, 2010 at 16:21

2 Answers 2

7

.: is actually just . ( since : is the keyword that separates multiple paths ) which means the current folder the script is being executed in is included as part of the include_path. That way when you have two files in the same directory:

index.php
include-me.php

You can include the second in PHP with include('include-me.php');. Without . being in path you wouldn't be able to do so.

So in order to complete the install as mentioned you would need to either put the contents of /library in the same folder the script you are working on is in - or in /php/includes (Granted you remove the ; from the ini file). You can also create another directory - like /opt/Zend/library and add /opt/Zend/library to your include path statement: include_path = ".:/php/includes:/opt/Zend/library"

Lastly - since you are running Ubuntu it is recommended that you use Ubuntu's LAMP setup instead (Most all documentation assumes you are using). This can be installed by removing XAMPP and performing sudo tasksel install lamp-server which will install Apache 2.2, MySQL, PHP 5.3 onto the system. As covered in What's the easiest way to set up a LAMP stack?

2
  • 1
    I'm perfectly happy with xampp. I do appreciate the other info, though.
    – EmmyS
    Nov 23, 2010 at 16:19
  • @EmmyS That's fine :D - I just included my response to your comment "Why" in my answer. Just want to make sure you're informed. Nov 23, 2010 at 16:21
4

: is a separator in the list of directories.

. means the current directory

So when a php script is looking for an include file, it will look it the same directory as the php file, and /php/includes.

2
  • So the path is currently including two directories - the current one (by which I assume you mean the directory that actually contains php.ini) and /php/includes? Where is /php/includes (as far as this path is concerned)? Inside the current directory? Or somewhere else?
    – EmmyS
    Nov 23, 2010 at 16:09
  • Almost, . is current directory relative to each particular php file, not the php.ini. /php/includes is an absolute path, expecting a top level 'php' folder in your filesystem (at the same level as /usr, /etc)
    – misterben
    Nov 23, 2010 at 16:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .