[1] configuring PHP and MySQL in a WWW webserver
Moderators: egami, macek, gesf
Thanks for visiting my topic.
I have to configure PHP and MySQL in my site.
PHP scripts are working just fine but i want to establish a connection with the MySQL database but i can't find the php.ini file..
can someone help me ? please
I have to configure PHP and MySQL in my site.
PHP scripts are working just fine but i want to establish a connection with the MySQL database but i can't find the php.ini file..
can someone help me ? please
no not like that...
i have to set the session.savepath location to my webfolder location also.. some configurations are to be done in php.ini file ..
can u help me again
i have to set the session.savepath location to my webfolder location also.. some configurations are to be done in php.ini file ..
can u help me again
I bet you don't have access to the php.ini.
Use PHP's ini_set() function.
Ex.:
Use PHP's ini_set() function.
Ex.:
Code: Select all
<?php
ini_set('session.name', 'sid');
ini_set('session.cache_expire', 0);
ini_set('session.save_handler', 'user');
ini_set('session.save_path', 'sessions_table');
?>
Sincerely,
Gonçalo "gesf" Fontoura
gesf.org | sessionstart.com | urlms.com
Gonçalo "gesf" Fontoura
gesf.org | sessionstart.com | urlms.com
Thankyou Mr.Mod for replying to my query.
But where should i add these snippet.
I have a lot of PHP files more than 40.. also i am unable to proceed anything further because of this criteria.
My website control panel is very tricky to understand.I don't know where to add the files..
however,PHP scripts are workin fine but i don't know how to configure it with MySQL.
In my home system.. I use easyPHP and I have Mysql DB
this is my connect.php file
<?php
$db_host="localhost";
$db_user="root";
$db_pass="admin";
$connect=mysql_connect($db_host, $db_user, $db_pass) or
die("Couldn't establish connection.....");
?>
I will run my file as..
http://127.0.0.1/connect.php
it just works fine.. but in this real-time WWW server i am unable to link it
Please reply sir....
But where should i add these snippet.
I have a lot of PHP files more than 40.. also i am unable to proceed anything further because of this criteria.
My website control panel is very tricky to understand.I don't know where to add the files..
however,PHP scripts are workin fine but i don't know how to configure it with MySQL.
In my home system.. I use easyPHP and I have Mysql DB
this is my connect.php file
<?php
$db_host="localhost";
$db_user="root";
$db_pass="admin";
$connect=mysql_connect($db_host, $db_user, $db_pass) or
die("Couldn't establish connection.....");
?>
I will run my file as..
http://127.0.0.1/connect.php
it just works fine.. but in this real-time WWW server i am unable to link it
Please reply sir....
Like having your connect.php, you can have some config.php which you'll include in every file... at first in the code.
Sincerely,
Gonçalo "gesf" Fontoura
gesf.org | sessionstart.com | urlms.com
Gonçalo "gesf" Fontoura
gesf.org | sessionstart.com | urlms.com
Thanks for mentioning it.
My website name is http://www.2xceed.net/
now what i have to add the host,username,password in the connect.php file.
Any idea ??
My website name is http://www.2xceed.net/
now what i have to add the host,username,password in the connect.php file.
Any idea ??
That's it! Thanks ruturajv... i forgot to mention that!
Sincerely,
Gonçalo "gesf" Fontoura
gesf.org | sessionstart.com | urlms.com
Gonçalo "gesf" Fontoura
gesf.org | sessionstart.com | urlms.com
Thanks guys .
Also i need a small clarification..
I have used sessions for user and how to expire a session (automatically) when the user closes the browser window without logging out.
Please help me again.
Also i need a small clarification..
I have used sessions for user and how to expire a session (automatically) when the user closes the browser window without logging out.
Please help me again.
By default a session ends when the user closes the browser.
That is given to you by session.cookie_lifetime (defaults to 0).
That is given to you by session.cookie_lifetime (defaults to 0).
Sincerely,
Gonçalo "gesf" Fontoura
gesf.org | sessionstart.com | urlms.com
Gonçalo "gesf" Fontoura
gesf.org | sessionstart.com | urlms.com
- ruturajv
- php-forum Super User
- Posts: 1279
- Joined: Sat Mar 22, 2003 9:42 am
- Location: Mumbai, India
- Contact:
there is also a session garbage collection probability, check that out
http://in.php.net/manual/en/ref.session.php
--------------------------------------------------------------------------
session.gc_probability integer
session.gc_probability in conjunction with session.gc_divisor is used to manage probability that the gc (garbage collection) routine is started. Defaults to 1. See session.gc_divisor for details.
session.gc_divisor integer
session.gc_divisor coupled with session.gc_probability defines the probability that the gc (garbage collection) process is started on every session initialization. The probability is calculated by using gc_probability/gc_divisor, e.g. 1/100 means there is a 1% chance that the GC process starts on each request. session.gc_divisor defaults to 100.
session.gc_maxlifetime integer
session.gc_maxlifetime specifies the number of seconds after which data will be seen as 'garbage' and cleaned up.
Note: If different scripts have different values of session.gc_maxlifetime but shares the same place for storing the session data then the script with the minimum value will be cleaning the data. In this case, use this directive together with session.save_path.
Note: If you are using the default file-based session handler, your filesystem must keep track of access times (atime). Windows FAT does not so you will have to come up with another way to handle garbage collecting your session if you are stuck with a FAT filesystem or any other filesystem where atime tracking is not available. Since PHP 4.2.3 it has used mtime (modified date) instead of atime. So, you won't have problems with filesystems where atime tracking is not available.
http://in.php.net/manual/en/ref.session.php
--------------------------------------------------------------------------
session.gc_probability integer
session.gc_probability in conjunction with session.gc_divisor is used to manage probability that the gc (garbage collection) routine is started. Defaults to 1. See session.gc_divisor for details.
session.gc_divisor integer
session.gc_divisor coupled with session.gc_probability defines the probability that the gc (garbage collection) process is started on every session initialization. The probability is calculated by using gc_probability/gc_divisor, e.g. 1/100 means there is a 1% chance that the GC process starts on each request. session.gc_divisor defaults to 100.
session.gc_maxlifetime integer
session.gc_maxlifetime specifies the number of seconds after which data will be seen as 'garbage' and cleaned up.
Note: If different scripts have different values of session.gc_maxlifetime but shares the same place for storing the session data then the script with the minimum value will be cleaning the data. In this case, use this directive together with session.save_path.
Note: If you are using the default file-based session handler, your filesystem must keep track of access times (atime). Windows FAT does not so you will have to come up with another way to handle garbage collecting your session if you are stuck with a FAT filesystem or any other filesystem where atime tracking is not available. Since PHP 4.2.3 it has used mtime (modified date) instead of atime. So, you won't have problems with filesystems where atime tracking is not available.
thank you guys i will check this out and come back again.
My mailfunction is not working this is the code any problem in it please reply...
<?php
$mailTo="xxx@xxx.net";
$subject="Testing Mail() From PHP";
$contents="zzzzzzzz";
$mailFrom="yyy@yyy.net";
mail($mailTo,$subject,$contents,$mailFrom);
?>
<?php
$mailTo="xxx@xxx.net";
$subject="Testing Mail() From PHP";
$contents="zzzzzzzz";
$mailFrom="yyy@yyy.net";
mail($mailTo,$subject,$contents,$mailFrom);
?>