php-windows Digest 11 Nov 2004 06:37:42 -0000 Issue 2464
Topics (messages 24956 through 24962):
Re: Shell Script error
24956 by: Rui Francisco
Re: [PHP] Shell Script error
24957 by: Angelo Zanetti
Re: php-windows Digest 8 Nov 2004 03:10:01 -0000 Issue 2459
24958 by: colin_e
Re: Error opening dictionary with php pspell function pspell_new
24959 by: PHPDiscuss - PHP Newsgroups and mailing lists
Copyright law, how to protect your investment, how to protect your work... Was
- RE: [PHP-DB] Please point me in the right direction.......
24960 by: Gryffyn, Trevor
Apache2+PHP5+MySQL4 --> mysql_connect fails, PHP5+MySQL4+CLI --> mysql_connect
works
24961 by: Steven James Samuel Stapleton
24962 by: Steven James Samuel Stapleton
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Its a simple script
$_SERVER['utilizador']='user';
$_SERVER['pass']='pass';
$_SERVER['host']='localhost or IP address';
$_SERVER['db_name']='c:/path/dbname.fdb';
include_once('DB.php');
$dsn="ibase://".$_SERVER['utilizador'].":".$_SERVER['pass']."@".$_SERVER['host']."/".$_SERVER['db_name'];
$ligacaoBD=DB::connect($dsn);
if (DB::isError($ligacaoBD)) {
die($ligacaoBD->getMessage());
}
The user has admin right on the database, and the database doesn't
implement security measures like Mysql for access from other hosts.
The problem is that if i run the script on the browser it works, but on
the command line on Windows machine it doesn't work
Thanks in advance
Rui Francisco
Luis Moreira wrote:
I am not exactly an expert on PEAR, but if the error says "connect
failed", you are not reaching the DBand/or the server were it resides.
Check the way you are connecting :
- Is the server named correctly ?
- If the access is authenticated, are you using the correct
username/password ?
- Do you have enough rights to access the DB ?
- Are you accessing the correct table ?
Luis
Rui Francisco wrote:
Hi,
I have a small problem with a PHP script with Pear DB
The problem is the following: I'm creating a shell script in PHP that
access one interbase database.
The problem is that if i run it on a webserver the script run correctly
but if i runit in the command line it reports one error (DB Error:
connect failed).
Does anybody know what is the problem ?
Thanks in advance
Rui Francisco
--
Rui Francisco - [EMAIL PROTECTED]
FCCN - Funda��o para a Computa��o Cient�fica Nacional
Av. Brasil, 101 1700-066 Lisboa - Portugal
Tel: +351 218440100 Fax: +351 218472167
-----------------------------------------------------
--- End Message ---
--- Begin Message ---
not too sure but can your database name be a path??
>>> Rui Francisco <[EMAIL PROTECTED]> 11/10/2004 4:28:21 PM >>>
Its a simple script
$_SERVER['utilizador']='user';
$_SERVER['pass']='pass';
$_SERVER['host']='localhost or IP address';
$_SERVER['db_name']='c:/path/dbname.fdb';
include_once('DB.php');
$dsn="ibase://".$_SERVER['utilizador'].":".$_SERVER['pass']."@".$_SERVER['host']."/".$_SERVER['db_name'];
$ligacaoBD=DB::connect($dsn);
if (DB::isError($ligacaoBD)) {
die($ligacaoBD->getMessage());
}
The user has admin right on the database, and the database doesn't
implement security measures like Mysql for access from other hosts.
The problem is that if i run the script on the browser it works, but on
the command line on Windows machine it doesn't work
Thanks in advance
Rui Francisco
Angelo Zanetti wrote:
>well maybe you are trying to connect to localhost which could be fine
>for the server but not from commandline... send more info.
>
>
>
>>>>Rui Francisco <[EMAIL PROTECTED]> 11/10/2004 2:06:09 PM >>>
>>>>
>>>>
>Hi,
>
>I have a small problem with a PHP script with Pear DB
>
>The problem is the following: I'm creating a shell script in PHP that
>access one interbase database.
>
>The problem is that if i run it on a webserver the script run
>correctly
>but if i runit in the command line it reports one error (DB Error:
>connect failed).
>
>Does anybody know what is the problem ?
>
>Thanks in advance
>Rui Francisco
>
>
>
--
Rui Francisco - [EMAIL PROTECTED]
FCCN - Funda��o para a Computa��o Cient�fica Nacional
Av. Brasil, 101 1700-066 Lisboa - Portugal
Tel: +351 218440100 Fax: +351 218472167
-----------------------------------------------------
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--------------------------------------------------------------------
Disclaimer
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is
intended for the attention and use only of the addressee.
Should you have received this e-mail in error, please delete
and destroy it and any attachments thereto immediately.
Under no circumstances will the Cape Technikon or the sender
of this e-mail be liable to any party for any direct, indirect,
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
--- End Message ---
--- Begin Message ---
George,
At first glance this sounds slow, but with databases disk
performance and RAM are often
far more important than CPU, your laptop may be a bad guide.
Having said that, I suggest you run your queries in the MySQL
command-line tool and use the
"Explain Select ..." function to look at how your queries are being
executed. Sometimes you find
an index is not being used, and a restructure of the query can give you
a big performance gain.
Regards; Colin
Subject:
Performance question?
From:
"George Pitcher" <[EMAIL PROTECTED]>
Date:
Sun, 7 Nov 2004 10:53:36 -0000
To:
<[EMAIL PROTECTED]>
To:
<[EMAIL PROTECTED]>
Hi,
I'm currently rebuilding a site previously constructed using
Lasso/Filemaker. I'm using PHP5/MySQL4/PEAR::DB and Smarty.
The site holds course content information for universities and colleges.
My first page after logging on displays courses for the user. This lists
relevant courses, their status and some stats for items that require
attention.
This involves one SQL query to a course table containing 3,100 records, and
in my sample returned 4 records. The stats and status data require another
12 SQL queries to a transaction table containing over 32,000 records. In
both these tables, I have indexed all the columns.
My testing this weekend is producing disappointing results with the page
taking between 20 and 50 seconds to appear.
I'm running this on a fairly fast laptop with XP, IIS5, using the ISAPI
method. The deployment is going to be on slower NT servers.
Does anyone have any tips to improve performance?
MTIA
George
--- End Message ---
--- Begin Message ---
Hey Glyn,
Within the english dictionaries distributed by the win32 port of aspell,
there are two
files in the data directory that are screwed. They are ISO8859-1.dat and
standard.krb. They have dos carriage returns in them. Running a unix
dos2unix
command on them, and replacing them will fix the problem. If you don't
have
access to a unix box, this website does the trick:
http://www.iconv.com/dos2unix.htm
Best,
Drew
Glyn Burton wrote:
> I'm trying to get up and running using the pspell functions on Windows.
> It seems everything is installed OK. I can use aspell from the Windows
> command prompt fine. PHP thinks the pspell module is loaded OK.
> However, when I try to execute the pspell_new function I get the
> following: -
> "Warning: PSPELL couldn't open the dictionary. reason: No word lists
> can be found for the language "en". in ..."
> I have installed both an english and welsh dictionary and they both work
> find using aspell from the Windows command prompt.
> The strange thing is that if I call pspell_new twice then it seems to
> succeed 2nd time. See code sample and correctsponding output below: -
> CODE
> /* Set up test data */
> $cWords[0] = "good";
> $cWords[1] = "badd";
> $numWords = count($cWords);
> /* Load the dictionary */
> $pDict = pspell_new("en");
> echo("pDict is $pDict<br>n");
> $pDict = pspell_new("en");
> echo("pDict is $pDict<br>n");
> /* Check the words */
> for($i=0; $i<$numWords; $i++)
> {
> if(pspell_check($pDict, $cWords[$i]))
> echo("$cWords[$i] is spelled OK<br>n");
> else
> echo("$cWords[$i] is misspelled<br>n");
> }
> OUTPUT
> Warning: PSPELL couldn't open the dictionary. reason: No word lists can
> be found for the language "en". in C:Program FilesApache
> GroupApache2htdocsphpRemoteAdstractpreview.php on line 22
> pDict is
> pDict is 2
> good is spelled OK
> badd is misspelled
> ENVIRONMENT
> Windows XP service pack 1
> PHP 4.3.8
> Aspell 0.50.3
> Apache 2.0.47
> Any advice or suggestion appreciated.
> - Glyn
--- End Message ---
--- Begin Message ---
I'm surprised I havn't seen this question come up before (might have
just missed it) but it's an excellent question so forgive the
crossposting as it's extremely relevant to coders and those purchasing
services of coders.
Anyone who's gotten married and hired a wedding photographer is probably
familiar with the idea of "You can't make your own reprints, the photos
are owned by the photographer". What kind of BS is that eh? It was
your wedding! You paid the guy, right?
I read a really interesting article talking about this a while ago and
found out that they key words you want to use (if you want to own what
you pay for) are the words "work for hire". Usually this would be put
in the contract or even on the check you use to pay for the services..
"Signing this check constitutes the payee's acknowledgement that the
services performed and the final output/art/photos/etc is considered a
Work for Hire" or something like that. It's not good enough to say "All
copy rights transfer to the client" apparently.
How I understand it is this... Any artist (musician, coder, author,
painter, etc) has an implicit copyright on whatever they make as soon as
they make it. While in the process of making something, it's
considered a "Work in progress" and has additional rights under certain
laws (see the Steve Jackson case with the Secret Service about them
seizing electronic copies of a game manual that was "in progress" as a
suspected guide to hacking. The electronic copies weren't protected
back then whereas a printed copy would have been.. But they may be
protected from seizure in legal cases these days... Not sure).
Anyway... So you write this code and you own it. Regardless of whether
someone paid you to write it. Unless of course you have an
"intellectual property" thing with the company you work for (like I do..
It says whatever I create for the company... On company time... Is
theirs).
So all those websites and PHP scripts that you set up for people...
They're yours. Unless the client specifies that it's a "work for hire"
in your contract or on the check you gotta sign to get your bucks.
Now from the client's side of things.. Because we don't always write our
own stuff.. It's important to know about this as well so you can
protect your investment. I don't know that a coder can legally demand
that you stop using their code, but it means that if you want to re-sell
what you had developed, you need to clear it with the coder first. A
lot of people don't know this stuff and it's hard to find out when
someone's pirating code that technically belongs to you.. But it's good
to know what rights you do have.
Doing a quick search on Yahoo for "work for hire" and "copyright", I
found a TON of sites that seem to cover the subject. I don't have time
to read them, but at a glance, some of these sounded like good things to
check up on:
http://www.weblawresources.com/Work-For-Hire-Clause.htm
http://www.gigalaw.com/articles/2000/loc-2000-02.html
http://www.copylaw.com/new_articles/wfh.html
http://repositories.cdlib.org/boaltwp/55/
http://www.keytlaw.com/Copyrights/wfhire.htm
http://www.copyright.gov/circs/circ1.html
http://www.music-law.com/workforhire.html
Hope this helps and maybe informs a few people. You can ask me
questions if you want, but this is literally all I know about the
subject. You're better off reading up on the sites above (and Googling
for others) and talking to a copyright lawyer about the matter if you
want more details.
Good luck everyone!
-TG
> -----Original Message-----
> From: Michael Cortes [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 10, 2004 2:12 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Please point me in the right direction.......
>
> I have a question about contracts or agreements.
>
> I am considering hiring a local company to do some coding for
> us in LAMP to
> augment what we have done already. I have a problem with the
> standard "we
> own the code and copyright" clause in thier service agreement.
>
> Can someone point me to the correct mailing list as I don't
> wish to start an
> inapropriate thread.
>
>
> Thank you.
> --
>
> Michael Cortes
> Fort LeBoeuf School District
> 34 East Ninth Street
> PO Box 810
> Waterford PA 16441-0810
> 814.796.4795
--- End Message ---
--- Begin Message ---
Relevant information:
Windows XP Pro SP2
PHP 5.0.2
MySQL 4.0.21-nt
Apache 2
PATH:
C:\WINDOWS\system32
C:\c\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WBP\php //PHP bin dir
C:\WBP\Apache2\bin //Apache bin dir
MySQL's bin dir is not in path
I have tried calling
mysql_connect(...) with PHP's php_mysql.dll in and not-in the path.
CLI works great, database gets put through hoops, lots of changes, all is
good.
In Apache, it fails at the connect:
Fatal error: Call to undefined function mysql_connect() in
C:\WBP\WBP\lib\db_capsule_mysql.php on line 124
both classes are using the same conect routine through the db_capsule
wrapper call the same mysql_connect function.
I have tried this with and without the php\ and Apache2\bin dirs in the
path.
Suggestions?
-Jim Stapleton
--- End Message ---
--- Begin Message ---
Fixed: For some reason Apache wanted a php.ini in the windows directory
rather than in the PHP install directory. Explicitly set the PhpIniDir in
the httpd.conf and fixed it.
-Jim
----- Original Message -----
From: "Steven James Samuel Stapleton" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, November 10, 2004 7:00 PM
Subject: [PHP-WIN] Apache2+PHP5+MySQL4 --> mysql_connect fails,
PHP5+MySQL4+CLI --> mysql_connect works
Relevant information:
Windows XP Pro SP2
PHP 5.0.2
MySQL 4.0.21-nt
Apache 2
PATH:
C:\WINDOWS\system32
C:\c\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WBP\php //PHP bin dir
C:\WBP\Apache2\bin //Apache bin dir
MySQL's bin dir is not in path
I have tried calling
mysql_connect(...) with PHP's php_mysql.dll in and not-in the path.
CLI works great, database gets put through hoops, lots of changes, all is
good.
In Apache, it fails at the connect:
Fatal error: Call to undefined function mysql_connect() in
C:\WBP\WBP\lib\db_capsule_mysql.php on line 124
both classes are using the same conect routine through the db_capsule
wrapper call the same mysql_connect function.
I have tried this with and without the php\ and Apache2\bin dirs in the
path.
Suggestions?
-Jim Stapleton
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---