Forum Moderators: coopster

Message Too Old, No Replies

Where shall I put php.ini

Can't find the right location for "php.ini"

         

Montbazin

12:01 pm on Jul 20, 2005 (gmt 0)

10+ Year Member



I cant find where to install the php.ini file on my Linux Mandrake-9.1
I hage just put the "register_globals" to "On".
I have tried at "usr/local/lib" , "etc/php" and "var/www/html"
but my modification on the "register globals" is not taken ito account.
I would like to do this in order to avoid using the "$_POST" or "$_GET" variables, so I can check my older php routines.

thanks
roberto

SeanW

12:38 pm on Jul 20, 2005 (gmt 0)

10+ Year Member



Create a page with a call to phpinfo() ...

You did restart httpd after making the change, right?

Sean

Montbazin

1:16 pm on Jul 20, 2005 (gmt 0)

10+ Year Member



Yes I have this page with phpinfo() and there it shows that the "register_globals" are "Off".

How do I have to restart httpd?

Montbazin

1:25 pm on Jul 20, 2005 (gmt 0)

10+ Year Member



Now I am in the "etc/httpd/2.0" folder and when I type
ls -l

I get a red blinking line which says:
../../../usr/lib/apache2-2.0.44/build

do you know what this means?

SeanW

1:53 pm on Jul 20, 2005 (gmt 0)

10+ Year Member



Look at the output of phpinfo. There are a few important lines:

Configuration File (php.ini) Path/etc/php.ini
Scan this dir for additional .ini files/etc/php.d
additional .ini files parsed/etc/php.d/mysql.ini,
/etc/php.d/snmp.ini

As for restarting httpd, try something like /etc/init.d/httpd graceful

Sean

Montbazin

3:03 pm on Jul 20, 2005 (gmt 0)

10+ Year Member



Thanks again
I have seen the lines you mentioned in phpinfo()

I have checked /etc and /etc/php
there is php.ini in both folders with the following setting:

register_globals = On [Security, Performance]

I took the "[Security, Performance]" mention off

so what's left is

; comments...
register_globals = On
; comments...
; comments...

then I did as you told me:

/etc/init.d/httpd graceful

the computer said:

Reloading httpd2: [ OK ]

I have rebooted the machine...
still no results...
when I call phpinfo(), "register_globals" shows "Off"

sometimes one feels like getting nuts!

roberto

SeanW

3:17 pm on Jul 20, 2005 (gmt 0)

10+ Year Member



That's odd. Did you check those other directories for something that overrides the setting in php.ini?

cd /etc/php
grep -i "register" *

Sean

Montbazin

4:40 pm on Jul 20, 2005 (gmt 0)

10+ Year Member



all my fault!
I had mistaken a comment with the instruction, so I took the ( ; ) sign off before the "register_globals = On" and I thougt that this was it.
thanks to the "grep" command you suggested to use I realized that there was still the REAL "register_globals = Off" later in the text of the php.ini file.
Nevertheless the instruction "/etc/init.d/httpd graceful" was necessary to make the whole thing work.

Thank you so much for your help, now I'm a big step ahead...
Amitiés
roberto

Montbazin

10:51 pm on Jul 20, 2005 (gmt 0)

10+ Year Member



hello again Sean

I probably did a wrong manipulation and PHP doesn't recognize MySql anymore.
It worked fine but now it's down.

Separately PHP works fine and MySQL works on the command line. I'm on a Linux Mandrake platform.

I have uninstalled an reinstalled "rpm php_mysql"l. I verified the presence of "/etc/php/34_mysql.ini" and it contains the line "extension = mysql.so" the way it should. But something else must be wrong?

I've made a ne topic on this since it's not the same subject anymore.

thanx
roberto

SeanW

12:23 am on Jul 21, 2005 (gmt 0)

10+ Year Member



Check your phpinfo() again, does it include anything about mysql?

Sean

Montbazin

6:56 am on Jul 21, 2005 (gmt 0)

10+ Year Member



Password, username or host are OK.
I have just reinstalled "rpm php_mysql" when I saw that the php-mysql link was down.
phpifo() mentions the existence of the "/etc/php/34_mysql.ini" file. Thats all I can tell.

roberto

Montbazin

12:49 pm on Jul 21, 2005 (gmt 0)

10+ Year Member



I took the drastic resolution to make a "clean" reinstall of my Mandrake 9.1 distribution.

So everything works PHP, and also MySQL on the command line. I managed to create a base and enter some tables with some content. All that is fine...

But when I try to connetct to MySQL with

 mysql_connect($server,$user,$passw); or die ("error");

it eveven doesn't show the error message...
the proble remains with the function
 mysql_pconnect()

thanks for your help
roberto

SeanW

1:16 pm on Jul 21, 2005 (gmt 0)

10+ Year Member



Try the sample code at [ca.php.net...]

If mysql works from the command line and the mysql stuff is in php, I don't see where there could be a problem with your setup.

Sean

Montbazin

1:46 pm on Jul 21, 2005 (gmt 0)

10+ Year Member



I really don't understand...

all the php scrips I use have been working perfectly.
soa I expectet when doing a clean reinstall it would start to work again.
after reinstalling linux which had PHP active, I installed the mysql applications:

MySQL-4.0.11a-5mdk
MySQL-client-4.0.11a-5mdk
php-mysql-4.3.0-2mdk

... what's going wrong...

roberto

jatar_k

3:57 pm on Jul 21, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



we'll lock this and keep it to one thread
[webmasterworld.com...]