include_path parameter (in php.ini)

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

include_path parameter (in php.ini)

Postby Michele » 16. July 2008 06:58

Hello,
I have to use external libraries (classes) and to simplify code maintenance I've put them in a separate path.
Using phpinfo() I located the loaded configuration file ( /Applications/xampp/etc/php.ini ), so I edited php.ini accordingly:
include_path = ".:/Applications/xampp/xamppfiles/lib/php:/Users/michele/PHP/includes"
(of course, I removed the semicolon at the beginning of the line)

After that, I restarted Apache (and PHP 5)
Checking again with phpinfo(), the parameter hasn't been modified at all, but the php.ini file i saved and contains what I entered.

I tried also to move the 3.rd party classes into Applications/xampp/xamppfiles/lib/php (the preset include_path) but I haven't enough permissions to write there.
By the way, which is the default password for su in a mac OS.X Tiger (I never set it anyway) ?

Thank you very much!!!
Michele
Michele
 
Posts: 6
Joined: 16. July 2008 06:42
Location: Milano, Italy

Postby Nobbie » 16. July 2008 12:33

> but the php.ini file i saved and contains what I entered.

Did you edit and save the right(!) php.ini? Run phpinfo() to see which php.ini is used at runtime.

>By the way, which is the default password for su in a mac OS.X Tiger (I never set it anyway) ?

Seems that the "root" account is disabled per default on OSX Systems. See http://support.apple.com/kb/HT1528?viewlocale=en_US
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

include_path parameter (in php.ini)

Postby Michele » 16. July 2008 21:06

Hello Nobbie,
I've checked and checked again. As I wrote, I've edited the right php.ini.
I guess the problem is related to the script that invokes php.
In phpinfo() is displayed a rather long Configure Command:
'./configure' '--prefix=/Applications/xampp/xamppfiles' '--program-suffix=-5.2.6' '--libdir=/Applications/xampp/xamppfiles/lib/php/php5' '--includedir=/Applications/xampp/xamppfiles/include/php/php5' '--with-apxs2=/Applications/xampp/xamppfiles/bin/apxs' '--with-config-file-path=/Applications/xampp/etc' '--with-mysql=/Applications/xampp/xamppfiles' '--disable-debug' '--enable-bcmath' '--enable-calendar' '--enable-ctype' '--enable-dbase' '--enable-discard-path' '--enable-exif' '--enable-filepro' '--enable-force-cgi-redirect' '--enable-ftp' '--enable-gd-imgstrttf' '--enable-gd-native-ttf' '--with-ttf' '--enable-magic-quotes' '--enable-memory-limit' '--enable-safe-mode' '--enable-shmop' '--enable-sigchild' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-wddx' '--enable-yp' '--with-ftp' '--with-ncurses=/Applications/xampp/xamppfiles' '--with-gdbm=/Applications/xampp/xamppfiles' '--with-jpeg-dir=/Applications/xampp/xamppfiles' '--with-png-dir=/Applications/xampp/xamppfiles' '--with-freetype-dir=/Applications/xampp/xamppfiles' '--without-xpm' '--with-zlib=yes' '--with-zlib-dir=/Applications/xampp/xamppfiles' '--with-openssl=/Applications/xampp/xamppfiles' '--with-expat-dir=/Applications/xampp/xamppfiles' '--enable-xslt=/Applications/xampp/xamppfiles' '--with-xsl=/Applications/xampp/xamppfiles' '--with-dom=/Applications/xampp/xamppfiles' '--with-ldap=/Applications/xampp/xamppfiles' '--with-gd=/Applications/xampp/xamppfiles' '--with-mysql-sock=/Applications/xampp/xamppfiles/var/mysql/mysql.sock' '--with-mcrypt=/Applications/xampp/xamppfiles' '--with-mhash=/Applications/xampp/xamppfiles' '--enable-sockets' '--with-curl=/Applications/xampp/xamppfiles' '--enable-mbregex' '--enable-zend-multibyte' '--with-zip=/Applications/xampp/xamppfiles' '--enable-exif' '--with-sqlite' '--with-libxml-dir=/Applications/xampp/xamppfiles' '--enable-soap' '--enable-pcntl' '--enable-dbx' '--with-mysqli=/Applications/xampp/xamppfiles/bin/mysql_config' '--with-bz2=/Applications/xampp/xamppfiles' '--with-ming=shared,/Applications/xampp/xamppfiles' '--with-pear=/Applications/xampp/xamppfiles/lib/php/pear' '--with-mssql=/Applications/xampp/xamppfiles' '--with-imap-dir=/Applications/xampp/xamppfiles' '--with-imap=/Applications/xampp/xamppfiles' '--enable-mbstring=all' '--with-pgsql=shared,/usr' '--with-gettext=/Applications/xampp/xamppfiles' '--with-pdo-mysql=/Applications/xampp/xamppfiles'

but actualy there isn't a /Applications/xampp/xamppfiles/include/php/php5 dir
so I immagine something tricky like:
1) the include_path in php.ini overrides the default settings
2) the --includedir overrides php.ini but fails because the dir is missing
3) the default value is reset again as a fallback measure...
Maybe I'm wrong, of course, with my guess, but I'm absolutely sure about the fact that I've edited thr right php.ini

Ciao
Michele
 
Posts: 6
Joined: 16. July 2008 06:42
Location: Milano, Italy

Postby jmdirc » 17. July 2008 22:47

I'm going to try and work backwords here:

There is no 'default' password for su on a Mac. It is the password you set up at installation - less you changed it along the way. The root is set.

What ever you type in after clicking on the xampp start icon - when it prompts you for a password - that is your root password unless you are a user on someone else's computer.

If you check the file name in the first post you have an colon after the 'php' in the center of the string which probably isn't correct; double check your path.

When moving files around to a different directory - copy the file first to your desktop - then drag that into the destination directory and you will be prompted for your password - use the same password that you use when you start xampp.

Lastly - which include_path statement did you modify? If you check your phpinfo page, under php core - about halfway down you will see your include path:
include_path .:/Applications/xampp/xamppfiles/lib/php
Last edited by jmdirc on 17. July 2008 23:20, edited 2 times in total.
User avatar
jmdirc
 
Posts: 154
Joined: 10. February 2008 22:44

Postby Michele » 17. July 2008 23:07

jmdirc, thanks, but...
I've discovered, lurking another topic, that if I type on the Mac console sudo su <pass> I succeed in getting root privileges.
Instead, if I type su <pass> I won't (of course <pass> is always the same I use for installing apps...).

By the way, there is no semicolon [;] in the path it's a colon [:] as it must be.

Let me clarify my needs:
1) I use with full satisfaction wamp server under windows and mamp under Mac: I don't need a *AMP distribution: I look for a BETTER *AMP distro.
2) I was attracted by xampp because it promises to support a wide range of operating systems (and I like coross platform solutions...)
3) If I only need to get things done (I mean working...) it's quite simple: I have to move the DB where xamppp expects the DB, I have to move include files where xampp is able to find them and everything is ok...
4) Let me say that this is non a flexible and a comfortable way... all in all, is easier to support different OS-dependent configurations, supported by comfortable UI, than having a too rigid environment.
5) I, and perharps many others, believe to be a humble user, but not a stupid. I'm able enough to distitinguish between a semicolon and a colon, to use phpinfo() and to locate the right path for a file... If I raise a question, it's because THERE IS a problem.
Fortunately, I have some IT experience so that I can overcome some common problems, but many people opts for a Mac because it's user friendly. I CAN adapt my configuration to xampp constraints, but I expected that xampp could adapt itself to my needs... nope
Let me say that xampp has a long way to go before becoming user-friendly.
And reading other posts in the forum, I feel to be not alone in this feeling.
Michele
 
Posts: 6
Joined: 16. July 2008 06:42
Location: Milano, Italy

Postby jmdirc » 18. July 2008 00:27

I didn't mean to ruffle your feathers. Just trying to be helpful. I did not imply or outright call you stupid. My reference to the 'semicolon' was only a typo where I meant 'colon' because to me, it looked out of place in the path.

As for xampp being user friendly - it is an easy package to use on the Mac. The install is straight forward. Yes, they do need to get their facts section up and moving; but hey, Rome wasn't built in a day. If you want something less "rigid" I strongly suggest installing php and mysql in individual packages - it isn't rocket science. Anytime you load programs on the Mac and similar on Windows your directory will always be different because of, if nothing else, structure. That you should know.

Any software you load, you will have to install for you, it is never the other way around - it just doesn't work that way.

As for your particular problem, most likely for the language barrier, it is a little hard to understand what your wanting to do. Instead of feeling insulted, try re-phrasing/clarifying your problem - it will work much better to retrieve adequate answers.

good luck to you
User avatar
jmdirc
 
Posts: 154
Joined: 10. February 2008 22:44

Postby Michele » 18. July 2008 06:44

jmdirc,
first of all, I really appreciate any one spending his time and attention for helping an unknown guy... and for free!
So the question is only technical, not personal.

Currently, I solved the problem because I managed to write the files that I needed in the include_path where php is able to find them.
As long as I work for myself on my PC or Mac, everything is ok. But I'm concerned about installation and support on others machines.

Since PHP, MySQL and Apache offers plenty configuration options, I try to take benefit from that. In my philosopy, I prefer a software architecture that allows to take in separate spaces:
1) The core platform (xampp in our case)
2) 3.rd party addons (eg. a charting class in the include_path)
3) My own (php) software
4) User specific data.
Since I love the Open Source philosophy, I expect to follow the rule:
"Release early, release often" but I expect also to be able to
"Install quickly, install easy" (the only way to keep the pace...).
Therefore, I prefer to place my SW elsewhere and point to it through configuration parameters.

Now, for instance, I've adopted pChart as a charting library, but imagine that in my next release I decide to adopt a different one: I expect to have a simple mechanism to copy to sent that new class and say "copy it into the folder xxx and copy my new release into the folder yyy and enjoy!"
But if the folder xxx is Applications/xampp/xamppfiles/lib/php it is not possible to copy anything unless you open the console, type sudo su <password> then type cp .... feasible, yes, but not practical nor elegant.

I hope you see what I mean (besides linguistic barriers and ruffled feathers ;-) ).

Theoretically, the point is pretty simple: PHP allows to have one or more paths where to look for includes. Each path is separated in Unix systems (and I guess also MAC) by a colon : so the statement
include_path = ".:/Applications/xampp/xamppfiles/lib/php:/Users/michele/PHP/includes" means:
look for the file to include into the following directories
1) . - the current one
2) /Applications/xampp/xamppfiles/lib/php - the XAMPP one
3) /Users/michele/PHP/includes - my personal one
Unfortunately, the statement is ignored.
I simply reported this BUG and, I repeat again, I edited the right php.ini with the proper syntax.
I'm the first person to admit to make mistakes (sometimes), so if I'm wrong, I humbly beg pardon, but I felt, in this forum, the attitude to think that the problem was MY problem and not a XAMPP problem (maybe...).
As first responsible of solving MY problems, of course, I managed a "turn-around". But as an "Apache-Friend" and an Open-Source supporter I hoped to give a small contribute to warn about what I think is a XAMPP problem.
Michele
 
Posts: 6
Joined: 16. July 2008 06:42
Location: Milano, Italy

Re: include_path parameter (in php.ini)

Postby Nobbie » 18. July 2008 10:48

Michele wrote:...
but actualy there isn't a /Applications/xampp/xamppfiles/include/php/php5 dir
so I immagine something tricky like:
1) the include_path in php.ini overrides the default settings
2) the --includedir overrides php.ini but fails because the dir is missing
3) the default value is reset again as a fallback measure...
Maybe I'm wrong, of course, with my guess, but I'm absolutely sure about the fact that I've edited thr right php.ini


Sorry, but this is totally wrong:

What you are seeing there is the (only informationally) 'configure' command of how to build (compile) the Apacher server for Mac OS. The includedir Option does not have to do anything with the include_path direction of PHP, it is an option for the C-Compiler and the makefile (which holds the dependencies for creating a new Apache executable) where to look for additionally modules at compile time: thats only an information for developers, who wants to build their own Apache version and needs to know, how the existing version was built.

You may download the so called "Xampp development package" which contains that directory (and many more), but it is of course not needed for running Apache and PHP and it is *not* a default for a PHP runtime Option.

Michele wrote:Unfortunately, the statement is ignored.


I still dont think so - if the statement is ignored, it would not show up any value - but it show the value of the initial run of PHP. Did you for example clear the browser cache to force a real reload of phpinfo()?

And did you restart Apache after changing php.ini?

Also the value of include_path may be overridden either by a .htaccess or by any PHP script. Did you check that?

What happens, if you supply a completely different include_path in php.ini (for example include_path = ".:/php/myinclude"), just to find out whats going wrong?

Last not least, can you show us the original lines of your php.ini and the output of phpinfo()?
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

Postby Michele » 26. July 2008 18:57

Dear Nobbie,
sorry for the delay, but I was away (totally disconnected) for a whole week.
I'm here again.
I don't know how to attach files to the forum, so, I will transcribe here what you have requested.
PHPINFO
When I run phpinfo() I get the following info:
Loaded Configuration File /Applications/xampp/etc/php.ini
include_path .:/Applications/xampp/xamppfiles/lib/php (same for both Local Value and Master Value)

php.ini
I mean /Applications/xampp/etc/php.ini
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
include_path = ".:/Applications/xampp/xamppfiles/lib/php:/Users/michele/PHP/includes"

I looked also in the directory /Applications/xampp/xamppfiles/logs in search of some hint but:
1) apachestart.log is empty 0 bytes
2) error_log doesn't contains any warning/error about includepath (even if I changed it in a totaly fake one and restarted xampp).

Ciao.
Michele
 
Posts: 6
Joined: 16. July 2008 06:42
Location: Milano, Italy

Postby Nobbie » 29. July 2008 10:26

What happens if you simply delete (or rename) php.ini?
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

Postby Michele » 29. July 2008 19:11

I renamed php.ini and restarted all (I use the XAMPP Control Panel) without error messages... but calling thereafter http://localhost/xampp/index.php I got new error messages:
Warning: include(.version) [function.include]: failed to open stream: No such file or directory in /Applications/xampp/xamppfiles/htdocs/xampp/start.php on line 12

Warning: include() [function.include]: Failed opening '.version' for inclusion (include_path='.:/Applications/xampp/xamppfiles/lib/php/pear') in /Applications/xampp/xamppfiles/htdocs/xampp/start.php on line 12
!

phpinfo() reports:
Configuration File (php.ini) Path /Applications/xampp/etc
Loaded Configuration File (none)
include_path .:/Applications/xampp/xamppfiles/lib/php/pear (in both columns)
Michele
 
Posts: 6
Joined: 16. July 2008 06:42
Location: Milano, Italy

Postby Nobbie » 30. July 2008 15:36

So obviously this is the right php.ini

Next test (what i asked previously):

Change php.ini and supply any include_path (some nonsense). Then run again.
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

Re: include_path parameter (in php.ini)

Postby TreborAlrad » 20. August 2010 18:02

What i found was that if i scrolled all the way to the bottom of the file there is a include_path that is added by go-pear once I added my path information there everything worked correctly.

Hope this helps
TreborAlrad
 
Posts: 1
Joined: 20. August 2010 17:59


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 68 guests