[PHP] Re: [PHP-DB] Re: Problems when trying to use ibm_db2 extension
I'd say that on Windows, when you, or software you install, modifies the PATH environment variable, and a service, like apache, relies on a directory being in the path, you have to restart Windows in order for that service to see the new path. In other words, services get the new path only after you reboot. Dave On 4/16/07, Leo Jokinen [EMAIL PROTECTED] wrote: Problem solved: I restarted my computer and after that apache loaded ibm_db2 extension. My conclusion: 1. When you add some extensions to php.ini, you need to restart windows in order to get those extensions available through apache 2. However, those extensions are instantly available if you use php command line interface Anyone disagree? -Leo- Leo Jokinen wrote: Hi all, I've been banging my head into the wall cause I can't get ibm_db2 extension working with Apache 2.0.59 and PHP 5.2.1 (as apache module). (Operating system is winxp pro SP2) For some reason, this code is working on command line but not when placed to htdocs folder: ?php if(function_exists('db2_connect')) { echo 'Function db2_connect() exists'; } else { echo 'Unknown function db2_connect()'; exit; } echo \nTrying to connect DB2 database..\n; $database = 'services'; $user = 'db2admin'; $password = 'xxx'; $hostname = '127.0.0.1'; $port = 5; $conn_string = DRIVER={IBM DB2 ODBC DRIVER};DATABASE=$database; . HOSTNAME=$hostname;PORT=$port;PROTOCOL=TCPIP;UID=$user;PWD=$password;; $conn = db2_connect($conn_string, '', ''); if ($conn) { echo OK: Connection established\n; db2_close($conn); } else { echo ERROR: Connection failed\n; } ? Command line output: C:\php c:\db2_test.php Function db2_connect() exists Trying to connect DB2 database.. OK: Connection established Web output: Unknown function db2_connect() Some extra output: Fatal error: Call to undefined function db2_connect() in F:\www\services.itella.net\app\webroot\index.php on line 57 Also, phpinfo() won't say nothing that module ibm_db2 is in use More info: php_ibm_db2.dll file is in folder C:/php-5.2.1/ext php.ini: extension_dir = C:/php-5.2.1/ext extension=php_ibm_db2.dll httpd.conf: AddType application/x-httpd-php .php LoadModule php5_module C:/php-5.2.1/php5apache2.dll PHPIniDir C:/php-5.2.1/ Can someone point out the right direction for me? Regards Leo Jokinen -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Sessions on Windows
OK, I managed to get it working. I first attempted to edit the php.ini so that the session save path was C:\Temp. No matter what I did, the save path always showed up in phpinfo() as /tmp. So I created folder on the root of C: called tmp and everything worked. Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Sessions on Windows
Hello, How does one get sessions working on Windows? I have modified my php.ini file so that session.save_path = C:\Temp, restarted and Apache. Still I get this error message: Warning: session_start(): open(/tmp\sess_26310affee160329c9e50f27663f8971, O_RDWR) failed: No such file or directory (2) in c:\apache\htdocs\dbmdata\admin\61646d696e.php on line 2 This is the code that is triggering the error. It seems very straightforward to me: session_start(); echo $_SESSION['user']; Why is this so incredibly difficult? Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Newbie Date Question
Hey Guys and Girls, I'm selecting a datetime value from SQL Server. In the database the data looks like: 2001-11-16 18:33:56 When I print out the results on the page I get this: 1005958764 This is how I'm displaying the data: while(!$rs-EOF) { print(trtdfont class=smallText . $dtmDate-value . /font/tdtd $rs-MoveNext(); } I'm obviously missing something here Any suggestions would be appreciated. Dave % David Mitchell [EMAIL PROTECTED] www.IceRadio.ca % -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Total Newbie - concatenating variables.
Hi, This is my first foray into PHP (coming from a VB, ASP background). What I am trying to do should be ridiculously easy, but for some reason I can't figure out how to do this. I have a form that builds a dynamic number of text boxes in a loop: for($i=0;$i$count;$i++) { print(input type=text name=item . $i . ); } that works fine. I end up with a number of textboxes named item0, item1, item2 and so on...When I submit the form, I pass over the $count value and I want to loop through the count so that I can ge the value for each textbox by building the textbox name dynamically. For example: for($i=0;$i$count;$i++) { print($item . $i); } Trying to print the value of $item0, $item1, etc...Obviously this doesn't work. What am I overlooking here? Many thanks in advance, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]