php-general Digest 25 Oct 2008 09:34:30 -0000 Issue 5754
Topics (messages 282401 through 282420):
Re: index search
282401 by: Robert Cummings
282402 by: Andrew Ballard
282404 by: Robert Cummings
282407 by: Andrew Ballard
282409 by: Ryan S
Building an array, kind of?
282403 by: Dan Shirah
282405 by: David Otton
282406 by: Yeti
282411 by: Boyd, Todd M.
282412 by: Boyd, Todd M.
282413 by: tedd
282414 by: Dan Shirah
282420 by: Martijn Korse
Re: web shot script
282408 by: Jim Lucas
Re: ZendOptimizer + APC
282410 by: Jochem Maas
moved code to a new server
282415 by: Daniel P. Brown
282416 by: Mohamed Ainab
282417 by: Marc Fromm
282418 by: Eric Butera
282419 by: Jim Lucas
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 ---
On Fri, 2008-10-24 at 10:20 -0400, Andrew Ballard wrote:
> On Thu, Oct 23, 2008 at 10:49 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > On Thu, 2008-10-23 at 19:30 -0700, Ryan S wrote:
> >> Hey all,
> >> Was wondering how this is done, have a bunch of links like so:
> >> 0-9 : a : b : c -----> till Z
> >>
> >> these will be linked to the program (so far have done this) but when the
> >> user clicks any of those links I want to query the DB for just the first
> >> alphabet from the field "title", using LIKE is not working for me because
> >> its catching alphabets from the middle of the word as well.
> >
> > You're using like wrong... you want to use it with one %...
> >
> > where foo like 'a%'
> >
> >> Also how to do 0-9? do i have to have 10 if() conditions for that?
> >
> > Maybe you could add a new field to the table and set it to the first
> > character of the field or 0 if it's a digit. Then you can index it and
> > not use "like" or multiple conditions to match digits.
> >
> > Cheers,
> > Rob.
>
> I'm pretty sure that if your LIKE statement begins with a constant
> value as you have entered above, an index on the regular columns
> should still work. :-)
>
> As for the numeric comparison, I know MySQL has a REGEXP comparison
> similar to the LIKE comparator, but I don't know enough about MySQL to
> know if it can similarly benefit from indexes the same way. (SQL
> Server will let you say WHERE foo LIKE '[0-9]%', but this doesn't seem
> to work in MySQL.)
Yeah, I know about MySQL's regexp, but that didn't seem terribly efficient. For
small databases, under a million records, I prefer to trade space for time.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
On Fri, Oct 24, 2008 at 10:22 AM, Robert Cummings <[EMAIL PROTECTED]> wrote:
>> As for the numeric comparison, I know MySQL has a REGEXP comparison
>> similar to the LIKE comparator, but I don't know enough about MySQL to
>> know if it can similarly benefit from indexes the same way. (SQL
>> Server will let you say WHERE foo LIKE '[0-9]%', but this doesn't seem
>> to work in MySQL.)
>
> Yeah, I know about MySQL's regexp, but that didn't seem terribly efficient.
> For small databases, under a million records, I prefer to trade space for
> time.
>
> Cheers,
> Rob.
I've never used the regexp in MySQL, so I have no idea how it impacts
performance; I just saw it in the manual (where the comments confirm
that REGEXP does not use indexes - yuk).
In some cases, I agree with you that a small tradeoff in space to save
time is worthwhile. In this case though, I think it would work to say
WHERE foo BETWEEN '0' AND '9' and WHERE foo LIKE 'a%' since both are
able to use an existing index and don't need to maintain an additional
column.
Andrew
--- End Message ---
--- Begin Message ---
On Fri, 2008-10-24 at 10:49 -0400, Andrew Ballard wrote:
> On Fri, Oct 24, 2008 at 10:22 AM, Robert Cummings <[EMAIL PROTECTED]> wrote:
> >> As for the numeric comparison, I know MySQL has a REGEXP comparison
> >> similar to the LIKE comparator, but I don't know enough about MySQL to
> >> know if it can similarly benefit from indexes the same way. (SQL
> >> Server will let you say WHERE foo LIKE '[0-9]%', but this doesn't seem
> >> to work in MySQL.)
> >
> > Yeah, I know about MySQL's regexp, but that didn't seem terribly efficient.
> > For small databases, under a million records, I prefer to trade space for
> > time.
> >
> > Cheers,
> > Rob.
>
> I've never used the regexp in MySQL, so I have no idea how it impacts
> performance; I just saw it in the manual (where the comments confirm
> that REGEXP does not use indexes - yuk).
>
> In some cases, I agree with you that a small tradeoff in space to save
> time is worthwhile. In this case though, I think it would work to say
> WHERE foo BETWEEN '0' AND '9' and WHERE foo LIKE 'a%' since both are
> able to use an existing index and don't need to maintain an additional
> column.
Maintaining that extra column is like a one liner in the insert code.
Also the width of the field at one byte is pretty teency... a few more
bytes if you use UTF and plan to index non ascii characters. Since this
is a library of wine, it's more likely the case of occasional insert and
many many reads. So I think this is an exemplary candidate for a
separate indexed field.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
On Fri, Oct 24, 2008 at 11:08 AM, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Fri, 2008-10-24 at 10:49 -0400, Andrew Ballard wrote:
>> On Fri, Oct 24, 2008 at 10:22 AM, Robert Cummings <[EMAIL PROTECTED]> wrote:
>> >> As for the numeric comparison, I know MySQL has a REGEXP comparison
>> >> similar to the LIKE comparator, but I don't know enough about MySQL to
>> >> know if it can similarly benefit from indexes the same way. (SQL
>> >> Server will let you say WHERE foo LIKE '[0-9]%', but this doesn't seem
>> >> to work in MySQL.)
>> >
>> > Yeah, I know about MySQL's regexp, but that didn't seem terribly
>> > efficient. For small databases, under a million records, I prefer to trade
>> > space for time.
>> >
>> > Cheers,
>> > Rob.
>>
>> I've never used the regexp in MySQL, so I have no idea how it impacts
>> performance; I just saw it in the manual (where the comments confirm
>> that REGEXP does not use indexes - yuk).
>>
>> In some cases, I agree with you that a small tradeoff in space to save
>> time is worthwhile. In this case though, I think it would work to say
>> WHERE foo BETWEEN '0' AND '9' and WHERE foo LIKE 'a%' since both are
>> able to use an existing index and don't need to maintain an additional
>> column.
>
> Maintaining that extra column is like a one liner in the insert code.
Agreed.
> Also the width of the field at one byte is pretty teency... a few more
> bytes if you use UTF and plan to index non ascii characters.
Agreed.
> Since this is a library of wine, it's more likely the case of occasional
> insert and many many reads. So I think this is an exemplary candidate
> for a separate indexed field.
Also agreed. See? I can be rather agreeable. :-)
I'm not saying that what you proposed is a bad solution. I'll even
grant that in some cases it can be an excellent solution. I just don't
think it's necessary in THIS case.
Andrew
--- End Message ---
--- Begin Message ---
<clip>
Are you sure LIKE isn't working? I would think LIKE "a%" would work. For
0-9, I would think you can use <= 9 or you can use BETWEEN 0 and 9.
</clip>
Silly me, the reason it was not working was I am so used to %something% and
used that instead of
something%
Anyway, it was a not a useless post for me because the 0-9 part was not solved
in my head but a lot of interesting replies as to how to do it.
Thanks everyone!
/Ryan
--- End Message ---
--- Begin Message ---
TGIF?
Apparently my brain isn't working this Friday.
I'm trying to query my table to get the first 16 ID's. I then want
to assign the ID's to a variable and have them comma seperated.
// My query to select the first 16 rows
$get_charges2 = "SELECT FIRST 16 * FROM history WHERE id = '$id";
// Executing the query
$charge_result2 = ifx_query ($get_charges2, $connect_id);
How would I assign the result to a variable?
For instance, say my query returns rows like:
1234
1235
1236
1237
1238
1239
How would I go about putting that in a variable to equal
"1234,1235,1236,1237,1238,1239" ?
--- End Message ---
--- Begin Message ---
2008/10/24 Dan Shirah <[EMAIL PROTECTED]>:
> How would I go about putting that in a variable to equal
> "1234,1235,1236,1237,1238,1239" ?
>
Pseudocode:
$t = array();
foreach($resultset as $row)
$t[] = $row;
$t = join(',',$t);
--
http://www.otton.org/
--- End Message ---
--- Begin Message ---
<?php
$arr = array(1234, 1235, 1236, 1237, 1238, 1239);
$string = implode(', ', $arr);
var_dump($string);
?>
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Dan Shirah [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 24, 2008 9:52 AM
> To: PHP LIST
> Subject: [PHP] Building an array, kind of?
>
> TGIF?
>
> Apparently my brain isn't working this Friday.
>
> I'm trying to query my table to get the first 16 ID's. I then want
> to assign the ID's to a variable and have them comma seperated.
>
> // My query to select the first 16 rows
> $get_charges2 = "SELECT FIRST 16 * FROM history WHERE id = '$id";
>
> // Executing the query
> $charge_result2 = ifx_query ($get_charges2, $connect_id);
>
> How would I assign the result to a variable?
>
> For instance, say my query returns rows like:
>
> 1234
> 1235
> 1236
> 1237
> 1238
> 1239
>
> How would I go about putting that in a variable to equal
> "1234,1235,1236,1237,1238,1239" ?
I think someone's already used foreach() in an answer, but I don't see
the point in building an array and then immediately joining it to a
string and discarding the array...
$t = '';
foreach($resultset as $row)
$t .= ',' . $row;
Done and done.
Todd Boyd
Web Programmer
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Boyd, Todd M. [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 24, 2008 11:28 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Building an array, kind of?
>
> > -----Original Message-----
> > From: Dan Shirah [mailto:[EMAIL PROTECTED]
> > Sent: Friday, October 24, 2008 9:52 AM
> > To: PHP LIST
> > Subject: [PHP] Building an array, kind of?
> >
> > TGIF?
> >
> > Apparently my brain isn't working this Friday.
> >
> > I'm trying to query my table to get the first 16 ID's. I then want
> > to assign the ID's to a variable and have them comma seperated.
> >
> > // My query to select the first 16 rows
> > $get_charges2 = "SELECT FIRST 16 * FROM history WHERE id = '$id";
> >
> > // Executing the query
> > $charge_result2 = ifx_query ($get_charges2, $connect_id);
> >
> > How would I assign the result to a variable?
> >
> > For instance, say my query returns rows like:
> >
> > 1234
> > 1235
> > 1236
> > 1237
> > 1238
> > 1239
> >
> > How would I go about putting that in a variable to equal
> > "1234,1235,1236,1237,1238,1239" ?
>
> I think someone's already used foreach() in an answer, but I don't see
> the point in building an array and then immediately joining it to a
> string and discarding the array...
>
> $t = '';
> foreach($resultset as $row)
> $t .= ',' . $row;
>
> Done and done.
Gah. Well, same amount of work, I guess, since you'll need to either
trim the first comma or add the first row before the foreach() loop.
Damn you, cat skin!
Todd Boyd
Web Programmer
--- End Message ---
--- Begin Message ---
At 10:52 AM -0400 10/24/08, Dan Shirah wrote:
TGIF?
Apparently my brain isn't working this Friday.
I'm trying to query my table to get the first 16 ID's. I then want
to assign the ID's to a variable and have them comma seperated.
// My query to select the first 16 rows
$get_charges2 = "SELECT FIRST 16 * FROM history WHERE id = '$id";
// Executing the query
$charge_result2 = ifx_query ($get_charges2, $connect_id);
How would I assign the result to a variable?
For instance, say my query returns rows like:
1234
1235
1236
1237
1238
1239
How would I go about putting that in a variable to equal
"1234,1235,1236,1237,1238,1239" ?
from memory.
$var='';
while($row = mysql_fetch_array($charge_result2))
{
$var .= $row['id'] . ',';
}
cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
>
> from memory.
>>
>> $var='';
>> while($row = mysql_fetch_array($charge_result2))
>> {
>> $var .= $row['id'] . ',';
>> }
>>
>> cheers,
>>
>> tedd
>
>
Thanks all!
It works and here is the code I used:
$get_charges2 = "SELECT FIRST 16 * FROM history WHERE id = '$id";
$charge_result2 = ifx_query ($get_charges2, $connect_id);
while ($charge_row2 = ifx_fetch_row($charge_result2)) {
$charges .= $charge_row2['id'].",";
}
--- End Message ---
--- Begin Message ---
Or, if your mysql version allows it:
SELECT 1, GROUP_CONCAT(some_col) FROM history GROUP BY 1 LIMIT 0,16
That would take away the need to create a comma seperated string in php,
because mysql will have already done it for you ;-)
Dan Shirah wrote:
>
> TGIF?
>
> Apparently my brain isn't working this Friday.
>
> I'm trying to query my table to get the first 16 ID's. I then want
> to assign the ID's to a variable and have them comma seperated.
>
> // My query to select the first 16 rows
> $get_charges2 = "SELECT FIRST 16 * FROM history WHERE id = '$id";
>
> // Executing the query
> $charge_result2 = ifx_query ($get_charges2, $connect_id);
>
> How would I assign the result to a variable?
>
> For instance, say my query returns rows like:
>
> 1234
> 1235
> 1236
> 1237
> 1238
> 1239
>
> How would I go about putting that in a variable to equal
> "1234,1235,1236,1237,1238,1239" ?
>
>
-----
http://devshed.excudo.net http://devshed.excudo.net
--
View this message in context:
http://www.nabble.com/Building-an-array%2C-kind-of--tp20151654p20162597.html
Sent from the PHP - General mailing list archive at Nabble.com.
--- End Message ---
--- Begin Message ---
Andrew Barnett wrote:
> You might actually be onto something there Afan.
>
> As long as Ghostscript and Imagemagick are installed on the server, you will
> be able to convert a PDF to an image. So maybe that will help.
>
> Although, is it possible to have a continuous length PDF, or does it only
> fit to specific page sizes.
>
> Its probably worth a shot though Joey.
>
>
> Andrew
>
Isn't the idea of getting different screen shots about SEEING how the page
looks on various system configurations? Windows, Mac, *nix then throw in
various browsers like IE, FF, Opera, Google?
This is the service that I thought these other companies provided. You could
probably do something like this on one computer by having VMWare (or similar)
software running to see all the different renderings.
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
--- End Message ---
--- Begin Message ---
steve schreef:
> Run APC on the main site. Create a separate instance of apache running
> on another port and have it use the ZendOptimizer, and have the admin
> stuff there.
>
I did one better .. I got the go ahead to just remove ZendOptimizer :-)
it's better in that it's less work for me ;-)
> Also, have you tried changing the options for the zend thing to not
> actually optimize? It only has positive effects if you are also using
> their opcode cache. They moved the optimizer part into their decoder
> so they could name it that for a typical bait and switch job on
> unsuspecting webmasters. Bleh...
ah ... hmm. well ... yes. :-/
thanks for the info.
> On Thu, Oct 23, 2008 at 4:44 AM, Jochem Maas <[EMAIL PROTECTED]> wrote:
>> Nathan Nobbe schreef:
>>> On Wed, Oct 22, 2008 at 4:39 PM, Martin ZvarĂk <[EMAIL PROTECTED]> wrote:
>>>
>>>> Jochem Maas napsal(a):
>> napsal(a) ... that's even weirder than my 'schreef' :-)
>>
>>>>> anyone know whether running ZendOptimizer + APC simultaneously still
>>>>> causes allsorts
>>>>> of problems ... I know it did in the past but I can't find any very recent
>>>>> stuff about the
>>>>> issues online.
>>>>>
>>>> I believe you should look up eAccelerator or XCache, which should work with
>>>> ZendOptimizer.
>>>
>>> as Jocheem said before the app is bound to apc; depends on the
>>> implementation whether it could be ported to another solution.
>> technically I can remove/replace APC - but time and desire say otherwise.
>>
>> the joke is that the server in question will only be running my app ... with
>> the expection of a generic controlpanel thang for server management ...
>> which requires ZendOptimizer ... and the sysadmin doesn't want to turn off
>> ZendOptimizer because then the controlpanel app won't work
>> (the server only exists to run the app/site/foo I wrote for a given client,
>> but obviously I'll have to 'fix' my stuff so that the controlpanel can
>> continue to run)
>>
>> just another wtf. regardless, thanks to those that responded.
>>
>>
>>
>>> -nathan
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
--- End Message ---
--- Begin Message ---
Forwarded to General, since this doesn't belong on DB.
On Fri, Oct 24, 2008 at 6:18 PM, Marc Fromm <[EMAIL PROTECTED]> wrote:
> We moved our website to a new linux server. The code was running on a
> different linux server. Thus the OS environment is the same.
> We are receiving this error:
> [Fri Oct 24 14:53:37 2008] PHP Fatal error: require() [<a
> href='function.require'>function.require</a>]: Failed opening required 'this
> was a url to a .js file' (include_path='.:/usr/share/pear:/usr/share/php') in
> /var/www/html/path to .php file on line 4
>
> I'm not a php programmer thus I am in the dark.
You don't have to be, you just have to read the error message. If
you copied that verbatim, then 'this was a url to a .js file' exists
on line 4 of .php in /var/www/html/path, and PHP failed to open it.
Make sure the file exists exactly where PHP is looking for it, and
that it's accessible and readable to and by the user as which the
server is running when executing `.php` in /var/www/html/path, and
that the target file can be found from that directory.
--
</Daniel P. Brown>
http://www.parasane.net/ [New Look]
[EMAIL PROTECTED] || [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
would be very helpfull if you would post the code.
-----------
http://ainab.com | http://somaliyrics.net
-------- Original Message --------
Subject: [PHP] moved code to a new server
From: "Daniel P. Brown" <[EMAIL PROTECTED]>
Date: Fri, October 24, 2008 3:25 pm
To: "php php" <[EMAIL PROTECTED]>, "Marc Fromm"
<[EMAIL PROTECTED]>
Forwarded to General, since this doesn't belong on DB.
On Fri, Oct 24, 2008 at 6:18 PM, Marc Fromm <[EMAIL PROTECTED]> wrote:
> We moved our website to a new linux server. The code was running on a
> different linux server. Thus the OS environment is the same.
> We are receiving this error:
> [Fri Oct 24 14:53:37 2008] PHP Fatal error: require() [<a
> href='function.require'>function.require</a>]: Failed opening required 'this
> was a url to a .js file' (include_path='.:/usr/share/pear:/usr/share/php') in
> /var/www/html/path to .php file on line 4
>
> I'm not a php programmer thus I am in the dark.
You don't have to be, you just have to read the error message. If
you copied that verbatim, then 'this was a url to a .js file' exists
on line 4 of .php in /var/www/html/path, and PHP failed to open it.
Make sure the file exists exactly where PHP is looking for it, and
that it's accessible and readable to and by the user as which the
server is running when executing `.php` in /var/www/html/path, and
that the target file can be found from that directory.
--
</Daniel P. Brown>
http://www.parasane.net/ [New Look]
[EMAIL PROTECTED] || [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I think I fixed it. The error said that the file script.js, line 4 of the code,
could not be found:
4 <? require ("http://path/to/the/file/script.js")?>
I changed the line to this and it now works:
<? require ("script.js") ?>
I wonder why on the old server it could find the file based on the full url
while the new server cannot find the file with the full url.
-----Original Message-----
From: Mohamed Ainab [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2008 3:34 PM
To: Daniel P. Brown
Cc: php php; Marc Fromm
Subject: RE: [PHP] moved code to a new server
would be very helpfull if you would post the code.
-----------
http://ainab.com | http://somaliyrics.net
-------- Original Message --------
Subject: [PHP] moved code to a new server
From: "Daniel P. Brown" <[EMAIL PROTECTED]>
Date: Fri, October 24, 2008 3:25 pm
To: "php php" <[EMAIL PROTECTED]>, "Marc Fromm"
<[EMAIL PROTECTED]>
Forwarded to General, since this doesn't belong on DB.
On Fri, Oct 24, 2008 at 6:18 PM, Marc Fromm <[EMAIL PROTECTED]> wrote:
> We moved our website to a new linux server. The code was running on a
> different linux server. Thus the OS environment is the same.
> We are receiving this error:
> [Fri Oct 24 14:53:37 2008] PHP Fatal error: require() [<a
> href='function.require'>function.require</a>]: Failed opening required 'this
> was a url to a .js file' (include_path='.:/usr/share/pear:/usr/share/php') in
> /var/www/html/path to .php file on line 4
>
> I'm not a php programmer thus I am in the dark.
You don't have to be, you just have to read the error message. If
you copied that verbatim, then 'this was a url to a .js file' exists
on line 4 of .php in /var/www/html/path, and PHP failed to open it.
Make sure the file exists exactly where PHP is looking for it, and
that it's accessible and readable to and by the user as which the
server is running when executing `.php` in /var/www/html/path, and
that the target file can be found from that directory.
--
</Daniel P. Brown>
http://www.parasane.net/ [New Look]
[EMAIL PROTECTED] || [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Fri, Oct 24, 2008 at 6:50 PM, Marc Fromm <[EMAIL PROTECTED]> wrote:
> I think I fixed it. The error said that the file script.js, line 4 of the
> code, could not be found:
> 4 <? require ("http://path/to/the/file/script.js")?>
>
> I changed the line to this and it now works:
> <? require ("script.js") ?>
>
> I wonder why on the old server it could find the file based on the full url
> while the new server cannot find the file with the full url.
>
> -----Original Message-----
> From: Mohamed Ainab [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 24, 2008 3:34 PM
> To: Daniel P. Brown
> Cc: php php; Marc Fromm
> Subject: RE: [PHP] moved code to a new server
>
>
> would be very helpfull if you would post the code.
>
> -----------
> http://ainab.com | http://somaliyrics.net
>
> -------- Original Message --------
> Subject: [PHP] moved code to a new server
> From: "Daniel P. Brown" <[EMAIL PROTECTED]>
> Date: Fri, October 24, 2008 3:25 pm
> To: "php php" <[EMAIL PROTECTED]>, "Marc Fromm"
> <[EMAIL PROTECTED]>
>
> Forwarded to General, since this doesn't belong on DB.
>
> On Fri, Oct 24, 2008 at 6:18 PM, Marc Fromm <[EMAIL PROTECTED]> wrote:
>> We moved our website to a new linux server. The code was running on a
>> different linux server. Thus the OS environment is the same.
>> We are receiving this error:
>> [Fri Oct 24 14:53:37 2008] PHP Fatal error: require() [<a
>> href='function.require'>function.require</a>]: Failed opening required 'this
>> was a url to a .js file' (include_path='.:/usr/share/pear:/usr/share/php')
>> in /var/www/html/path to .php file on line 4
>>
>> I'm not a php programmer thus I am in the dark.
>
> You don't have to be, you just have to read the error message. If
> you copied that verbatim, then 'this was a url to a .js file' exists
> on line 4 of .php in /var/www/html/path, and PHP failed to open it.
>
> Make sure the file exists exactly where PHP is looking for it, and
> that it's accessible and readable to and by the user as which the
> server is running when executing `.php` in /var/www/html/path, and
> that the target file can be found from that directory.
>
> --
> </Daniel P. Brown>
> http://www.parasane.net/ [New Look]
> [EMAIL PROTECTED] || [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
fopen wrappers.
--- End Message ---
--- Begin Message ---
Marc Fromm wrote:
> I think I fixed it. The error said that the file script.js, line 4 of the
> code, could not be found:
> 4 <? require ("http://path/to/the/file/script.js")?>
>
> I changed the line to this and it now works:
> <? require ("script.js") ?>
>
> I wonder why on the old server it could find the file based on the full url
> while the new server cannot find the file with the full url.
>
> -----Original Message-----
> From: Mohamed Ainab [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 24, 2008 3:34 PM
> To: Daniel P. Brown
> Cc: php php; Marc Fromm
> Subject: RE: [PHP] moved code to a new server
>
>
> would be very helpfull if you would post the code.
>
> -----------
> http://ainab.com | http://somaliyrics.net
>
> -------- Original Message --------
> Subject: [PHP] moved code to a new server
> From: "Daniel P. Brown" <[EMAIL PROTECTED]>
> Date: Fri, October 24, 2008 3:25 pm
> To: "php php" <[EMAIL PROTECTED]>, "Marc Fromm"
> <[EMAIL PROTECTED]>
>
> Forwarded to General, since this doesn't belong on DB.
>
> On Fri, Oct 24, 2008 at 6:18 PM, Marc Fromm <[EMAIL PROTECTED]> wrote:
>> We moved our website to a new linux server. The code was running on a
>> different linux server. Thus the OS environment is the same.
>> We are receiving this error:
>> [Fri Oct 24 14:53:37 2008] PHP Fatal error: require() [<a
>> href='function.require'>function.require</a>]: Failed opening required 'this
>> was a url to a .js file' (include_path='.:/usr/share/pear:/usr/share/php')
>> in /var/www/html/path to .php file on line 4
>>
>> I'm not a php programmer thus I am in the dark.
>
> You don't have to be, you just have to read the error message. If
> you copied that verbatim, then 'this was a url to a .js file' exists
> on line 4 of .php in /var/www/html/path, and PHP failed to open it.
>
> Make sure the file exists exactly where PHP is looking for it, and
> that it's accessible and readable to and by the user as which the
> server is running when executing `.php` in /var/www/html/path, and
> that the target file can be found from that directory.
>
> --
> </Daniel P. Brown>
> http://www.parasane.net/ [New Look]
> [EMAIL PROTECTED] || [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
Probably because in your new system it has this in your php.ini file
allow_url_include = Off
Change it to this
allow_url_include = On
Restart your webserver and it should probably work just fine.
You might also want to check into this option too.
allow_url_fopen = Off
Change it to
allow_url_fopen = On
if you would like to allow the opening of remote files via
fopen/file_get_contents/etc...
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
--- End Message ---