How to I find/access my php.ini include_path?



Hi everyone I am very much a novice at anything dealing with server/unix stuff so if anyone can walk me through this I would be forever grateful.

I am trying to install PHPMailer. It says all I need to do is copy a file into my php.ini include path to install. I have no idea where to start. Can I do this with my FTP program (Transmit on OS X) or do I have to use Telnet?

Can anyone point me to a way to explore any directories below my main user directory, and more specifically find out what my php.ini include path is and how to copy files there?

Sorry for my complete lack of knowledge.

EDIT: Here’s what I’ve found out on my own so far:

  1. Enabled shell access and used SFTP to log in

  2. Located my php.ini file and the includes path

  3. Went on the wiki and found out how to copy the PHP 5 cgi to my own server and update it with a cron job (cron job doesn’t seem to be working but that’s ok for now)

  4. Changed my local php.ini file’s includes path from “.:/usr/local/lib/php” to “.:/home/timtastic/”

  5. Copied everything from “.:/usr/local/lib/php” to “.:/home/timtastic/”

  6. Copied the phpmailer class to “.:/home/timtastic/”

  7. Created an .htaccess file containing
    AddHandler php-cgi .php
    Action php-cgi /cgi-bin/php.cgi
    And saved it into “.:/home/timtastic/”

Should this work?

I started getting new PHP errors when I checked my site

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/.mahesa/timtastic/ in /home/.mahesa/timtastic/ on line 2

So I removed my .htaccess file. Can anyone check my work and think of anything I did wrong?


EDIT #2:

I fixed that error - I think the default PHP error reporting was just missing it and the structure of my code was improper. Now I get to the problem of correctly placing and accessing the includes path.

As I said before I have my includes in


And I’ve set:

include_path = “.:/home/.mahesa/timtastic/”

in my php.ini, which is in


Now, when I test PHPMailer

I am getting this error:

Warning: main(…/class.phpmailer.php): failed to open stream: No such file or directory in /home/.mahesa/timtastic/ on line 10

Seems to indicate I have used the wrong path for include_path in php.ini. I have tried lots of variants including site root relative and paths relative to php.ini itself, but nothing has yielded results. What am I doing wrong?


Here is what mine looks like in the php.ini file. Whether it is right or wrong I don’t know, but I don’t get errors.
include_path = ".:/php/includes"

My website


Thanks Silk. I just found out that I didn’t even need to include the class in the php includes folder, so I just removed my php binary and am using the default version. No more headaches, but this experience was definitely useful.