sneakyimp;10996764 wrote:

I believe it's also feasible to set the include_path value in your script.

True, but it would get rather annoying if you constantly had to include that ini_set() statement in all of your PHP files.

Plus, what happens if the path ever changes? Even though you just got done adding that statement to n PHP files, you now get to go back through all n of them and update the path.

sneakyimp;10996764 wrote:

Downloading the files manually into your public_html directory is not super-hard

Agreed, and note that this is all that "installing PEAR" really means... just downloading various PHP files into a certain directory. Other than setting your include_path correctly, there really is no "installing" PEAR per sé.

sneakyimp;10996764 wrote:

but involves including the file Mail.php (which you can download from pear.php.net) and once that works, you'll see complaints about it trying to include other files, etc. Each time it complains about not finding a file, you have to go to pear.php.net to find the right file and then put it in the right subdirectory of your public_html directory.

You could do that, but that would get quite tedious for some packages.

A much better alternative would be to "install" PEAR yourself; see the PEAR manual for PEAR in hosting environments. PEAR already includes a nice web-based frontend that you can use if you don't have access to the CLI.

    bradgrafelman;10996765 wrote:

    True, but it would get rather annoying if you constantly had to include that ini_set() statement in all of your PHP files.

    Plus, what happens if the path ever changes? Even though you just got done adding that statement to n PHP files, you now get to go back through all n of them and update the path.

    That's what auto_prepend is for.

      Derokorian;10996766 wrote:

      That's what auto_prepend is for.

      And how would you change that PHP directive?

      Once you come up with an answer to that, then the next question would be: Well why didn't you just change the include_path directive in the first place? 😉

        .htacces: php_value auto_prepend_file includePath.php

          ... which leads right into my second question:

          bradgrafelman;10996767 wrote:

          Well why didn't you just change the include_path directive in the first place? 😉

            BG is right as always and proposes to do the right thing. Unfortunately, I think Mindy doesn't have the ideal circumstances with her hosting situation so I was hoping to provide some ideas about how to keep moving forward. Installing the needed files in one's public_html directory was the approach that worked for me before I understood all the server configuration stuff.

              You tell me BG - How would you add a path, to the current listed paths, in .htaccess?

              Anyway back to the point, if you can't change the ini, and you are directly accessing many different scripts, the best solution is still to include a file that alters the current path, instead of trying to alter it on every script. This is kind of the point of includes anyway - to avoid retyping the same code.

                sneakyimp;10996771 wrote:

                ... before I understood all the server configuration stuff.

                ... in other words, we should simply her understand the "server configuration stuff" rather than going down the lengthy and tedious task of installing a duplicate copy of PEAR? I agree. 😉

                Derokorian;10996772 wrote:

                You tell me BG - How would you add a path, to the current listed paths, in .htaccess?

                php_value include_path ".:/usr/lib/php:/usr/local/lib/php:/home/tanoak/php/"

                  Let us not forget the original poster. Anyone care to explain what .htaccess is doing? Do we know if this actually works on her hosting setup?

                  As for changing the server configuration, do we even know if Mindy has administrator and/or ssh access to the server?

                    Hi Everyone!

                    First of all, let me thank you for spending your time to try and find some solutions for me! It's a nice feeling to know that people I don't know are out there supporting me!

                    With your help, I was able to point my VPS support team in the right direction. I find it strange that I had to shed some light on the issue, but when I explained that I was confused the include_path variable in php.ini didn't seem correct, something was fixed, and now my PHP script with SMTP authentication is working for my client!!!

                    Wow! Two months going back and forth between support teams, and it took 2 days with the help of the folks on this forum! Your efforts are greatly appreciated!!!

                    Thanks so much!
                    Mindy : )

                      Write a Reply...