Re: [PHP-DB] Php, Oracle on Mac, with strange behaviour

2009-03-16 Thread Grant Croker


On/El 16/03/09 13:03, Mark Halling-Brown wrote/escribió:

Grant, thank you very much. You are a life saver. This worked perfectly.

Thanks again
Mark


No problem,

g


--
Grant Croker - Ingres PHP and Ruby maintainer
http://blogs.planetingres.org/grant
It was so much easier to blame it on Them. It was bleakly depressing to think 
that They were Us. If it was Them, then nothing was anyone's fault. If it was 
us, what did that make Me? After all, I'm one of Us. I must be. I've certainly 
never thought of myself as one of Them. No one ever thinks of themselves as one 
of Them. We're always one of Us. It's Them that do the bad things.
-- Terry Pratchett, Jingo


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Php, Oracle on Mac, with strange behaviour

2009-03-16 Thread Grant Croker

Hi Mark,

you are right /System/Library/LaunchDaemons/org.apache.httpd.plist will 
not work in your case, it's for the Mac OS X supplied Apache. In your 
case you can edit /usr/local/apache2/bin/apachectl adding the following:


DYLD_LIBRARY_PATH=/opt/oracle/instanceclient
LD_LIBRARY_PATH=/opt/oracle/instanceclient
ORACLE_BASE=/opt/oracle/instanceclient
ORACLE_HOME=/opt/oracle/instanceclient
export DYLD_LIBRARY_PATH LD_LIBRARY_PATH ORACLE_BASE ORACLE_HOME

(note: As Chris Jones mentioned LD_LIBRARY_PATH is not used on OS X, 
however there is no harm in having it set)


Place the above some where near the top of apachectl, I cannot tell you 
exactly since fink will not install and MacPorts does not build SQLite3. 
Restart apache and you should see the correct values in getenv() or 
phpinfo().


regards

grant


On/El 16/03/09 12:13, Mark Halling-Brown wrote/escribió:

Hi Grant,

Thanks to your instructions, I am making a bit of progress.
I have entered the PassEnv commands into the https.conf.:
SetEnv DYLD_LIBRARY_PATH /opt/oracle/instanceclient
SetEnv LD_LIBRARY_PATH /opt/oracle/instanceclient
PassEnv DYLD_LIBRARY_PATH
PassEnv LD_LIBRARY_PATH

It now seems that this variable is passed through correctly, but it is 
not as I set it. Instead it states:

DYLD_LIBRARY_PATH: /usr/local/apache2/lib:

I restart apache as root user (sudo /usr/local/apache2/bin/apachectl 
restart) and it complains that:
[Mon Mar 16 11:08:53 2009] [warn] PassEnv variable LD_LIBRARY_PATH was 
undefined


 So I am guessing that root has not picked up any of 
the environment variables that I have set in various places around my 
system. I have put DYLD_LIBRARY_PATH in /etc/bashrc 
~/.bash_profileetc, but I still seems root doesn't know about them.


Have you any idea where I need to set these variables (Is there a root 
home directory I can edit a bash_profile or something?)


I did edit the /System/Library/LaunchDaemons/org.apache.httpd.plist 
file, but the apache I am using was compiled from source, so I fear it 
wont work list that plist?


Thanks for all your help
Mark




--
Grant Croker - Ingres PHP and Ruby maintainer
http://blogs.planetingres.org/grant
It was so much easier to blame it on Them. It was bleakly depressing to think 
that They were Us. If it was Them, then nothing was anyone's fault. If it was 
us, what did that make Me? After all, I'm one of Us. I must be. I've certainly 
never thought of myself as one of Them. No one ever thinks of themselves as one 
of Them. We're always one of Us. It's Them that do the bad things.
-- Terry Pratchett, Jingo



Re: [PHP-DB] Php, Oracle on Mac, with strange behaviour

2009-03-16 Thread Grant Croker

On/El 16/03/09 09:23, chris smith wrote/escribió:

On Mon, Mar 16, 2009 at 6:51 PM, Mark Halling-Brown
  wrote:
   

Thanks for your replies.
In my desperation, I declared those environment variables in as many places
as I could think of. The script (Although I know I shouldnt), php.ini and
also the apache httpd.conf file:

SetEnv ORACLE_HOME /opt/oracle/instanceclient
SetEnv DYLD_LIBRARY_PATH /opt/oracle/instanceclient
SetEnv LD_LIBRARY_PATH /opt/oracle/instanceclient
SetEnv ORACLE_BASE /opt/oracle/instanceclient

But given that it works on the command line, but not through the browser, I
think that the environment variables must be set correctly.
 


Did you restart apache after doing this?

The env variables are set correctly for your user, but not apache's
(which is the problem).

   
Does the mac have an /etc/environment file? That should cover all users.


Unfortunately not although with the stock/supplied Apache web server 
there is a plist file you can edit to add environment settings. Edit 
|/System/Library/LaunchDaemons/org.apache.httpd.plist, adding the 
relevant environment variable key/value information:|



"http://www.apple.com/DTDs/PropertyList-1.0.dtd";>



EnvironmentVariables

DYLD_LIBRARY_PATH
path goes here
ORACLE_HOME
path goes here
ORACLE_BASE
path goes here

Label
org.apache.httpd
.
.
.




Then you use PassEnv in Apache to pass these values through to PHP. The 
SetEnv directive in Apache is not the same as "setenv" or "export" in 
csh/bash/etc. Apache maintains its own symbol table for environment 
variables. Unless the OCI8 extension calls apache_getenv those 
declarations will have no effect.


regards

grant

--
Grant Croker - Ingres PHP and Ruby maintainer
http://blogs.planetingres.org/grant
Generally, old media don't die. They just have to grow old gracefully.
Guess what, we still have stone masons. They haven't been the primary
purveyors of the written word for a while now of course, but they still
have a role because you wouldn't want a TV screen on your headstone.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Migrate MySQL to Ingres

2007-05-15 Thread Grant Croker

On 13/05/07 17:12, Jeffrey scribbled:
We have a moderately complex PHP web app collecting data from a MySQL 
database. We've been offered a rather attractive proposition to build 
an Ingres version (ie. same app, but collects data from an Ingres 
database).


Questions for experts like you:

1) Is this a reasonably straightforward migration in which we can 
largely replace mysql_query with ingres_query, etc, or will it be more 
complex than that?
There are different functions provided by both the Ingres and MySQL 
interfaces. That and the parameter order of equivalent functions  do not 
always match.


2) Does Ingres compare reasonably well with MySQL in terms of 
scalability and speed?
Yes and then some - don't just take my word for it since I work for 
Ingres. If you wish to get the opinion of Ingres users go to 
comp.databases.ingres 
(http://groups.google.com/group/comp.databases.ingres/topics) or 
Ingres's own forums (http://community.ingres.com/)


3) Any dangers I should be aware of?

none that I am aware of.
I am trying to decide whether or not to go forward with this project. 
Your advice is much appreciated!

Feel free to contact me directly if you have any further questions

regards

grant
Ingres PECL maintainer

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Character encoding issues: Pound-sign

2005-12-13 Thread Grant Croker


-Original Message-
> From: "Alex Gemmell" [EMAIL PROTECTED]
> Date: 13/12/2005 14:07

> Hello,

Hi

> I'm experiencing some odd character encoding issues.  My PHP webpage is 
> displaying test from a MySQL database.  What happens is that I export 
> data from an SQL Server database to a MySQL (4.0) database.  Somewhere 
> along the line the British currency pound-sign "£" becomes a "ú" (u with 
> somesort of accent on it!).  I cannot figure out why this is happening 
> and what to do about it.

> I could use a PHP routine to find-and-replace the chars but surely there 
>   is a way to tackle the root problem?

Not really, SQL Server uses a Windows Code page to store its characters and I
guess MySQL server uses a DOS code page. ASCII chars they will be compatible but
for extended characters there will be mis-matches. The "£" is one such
mis-match, the "€" will be another. I cannot remember what a DOS "£" looks like
in Windows. You will have to search and replace all "ú" for "£" in your data
load scripts. 

> Any ideas gang?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php