Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
2  
You mentioned "a machine running xampp" You may want to remove it and install lamp-server instead which is a package in Ubuntu –  Marco Ceppi Nov 23 '10 at 16:06
1  
Why? xampp runs perfectly well. –  EmmyS Nov 23 '10 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). –  Stefano Palazzo Nov 23 '10 at 16:21
add comment

2 Answers 2

up vote 3 down vote accepted

: 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.

share|improve this answer
    
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 '10 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 '10 at 16:14
add comment

.: 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?

share|improve this answer
    
I'm perfectly happy with xampp. I do appreciate the other info, though. –  EmmyS Nov 23 '10 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. –  Marco Ceppi Nov 23 '10 at 16:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.