php-general Digest 2 Dec 2009 15:12:04 -0000 Issue 6469

Topics (messages 300195 through 300210):

Re: Emergency! Performance downloading big files
        300195 by: Brian Dunning
        300196 by: Nathan Nobbe
        300198 by: Kim Madsen
        300201 by: Colin Guthrie
        300202 by: Michael Shadle

Re: Can I get the IP address from a visitor?
        300197 by: Ben

Re: PHP APACHE SAVE AS
        300199 by: Julian Muscat Doublesin

Compatiabilty issues
        300200 by: Julian Muscat Doublesin
        300203 by: Ashley Sheridan
        300204 by: Ashley Sheridan
        300205 by: Ashley Sheridan
        300206 by: Ashley Sheridan
        300207 by: Julian Muscat Doublesin
        300208 by: Kim Emax
        300209 by: Ashley Sheridan

Best way to read first 20 characters of a string?
        300210 by: Chris Payne

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 ---
Can someone explain how this would work? It's a Windows web server running IIS 
and the files are saved to a drive that is outside the web root. PHP is 
grabbing each filename from a MySQL database, along with the URL and 
credentials for it, and ends up with a url something like this:
https://server.com?filename=filename.pdf&user=xxx&pass=xxx&something=xxx


On Dec 1, 2009, at 2:55 PM, Ashley Sheridan wrote:

> Why not put the files behind a secured directory. Apache will handle
> that, so PHP needs not be involved. Once logged in, they can download
> loads without it being asked for again.



--- End Message ---
--- Begin Message ---
On Tue, Dec 1, 2009 at 4:56 PM, LinuxManMikeC <[email protected]>wrote:

> On Tue, Dec 1, 2009 at 3:48 PM, Brian Dunning <[email protected]>
> wrote:
> >
> > This is a holiday-crunch emergency.
> >
> > I'm dealing with a client from whom we need to download many large PDF
> docs 24x7, several thousand per hour, all between a few hundred K and about
> 50 MB. Their security process requires the files to be downloaded via https
> using a big long URL with lots of credential parameters.
> >
> > Here's how I'm doing it. This is on Windows, a quad Xeon with 16GB RAM:
> >
> > $ctx = stream_context_create(array('http' => array('timeout' => 1200)));
> > $contents = file_get_contents($full_url, 0, $ctx);
> > $fp = fopen('D:\\DocShare\\'.$filename, "w");
> > $bytes_written = fwrite($fp, $contents);
> > fclose($fp);
> >
> > It's WAY TOO SLOW. I can paste the URL into a browser and download even
> the largest files quite quickly, but the PHP method bottlenecks and cannot
> keep up.
> >
> > Is there a SUBSTANTIALLY faster way to download and save these files?
> Keep in mind the client's requirements cannot be changed. Thanks for any
> suggestions.
> >
> >
>
> Well one problem with your code is file_get_contents.  Its downloading
> the entire file, putting it in a variable, then returning that
> variable.  Then you write this super huge variable (as much as 50MB
> from what you said) to a file.  If you think about what might be going
> on underneath that seemingly simple function, there could be millions
> of memory reallocations occurring to accommodate this growing
> variable.  I would instead use fopen and read a set number of bytes
> into a buffer variable (taking into consideration available bandwidth)
> and write it to the file.  That said, I would never do this kind of a
> program in PHP.  Like other's have suggested, use curl or wget, and
> you can interface with it through PHP to initiate and control the
> process if you need to.


agreed.  ideally a memory buffer size would be defined and as it filled, it
would periodically be flushed to disk.. thinks back to C programming in
college.

in this day and age, id just give the curl option CURLOPT_FILE a shot as its
most likely implementing said logic already.

depending on the upstream bandwidth your client has, and your download
bandwidth, you may also see greater throughput by downloading multiple files
in parallel, aka, curl_multi_init() ;)

-nathan

--- End Message ---
--- Begin Message ---
Brian Dunning wrote on 2009-12-01 23:48:
This is a holiday-crunch emergency.

I'm dealing with a client from whom we need to download many large PDF docs 
24x7, several thousand per hour, all between a few hundred K and about 50 MB. 
Their security process requires the files to be downloaded via https using a 
big long URL with lots of credential parameters.

Here's how I'm doing it. This is on Windows, a quad Xeon with 16GB RAM:

$ctx = stream_context_create(array('http' => array('timeout' => 1200)));
$contents = file_get_contents($full_url, 0, $ctx);
$fp = fopen('D:\\DocShare\\'.$filename, "w");
$bytes_written = fwrite($fp, $contents);
fclose($fp);

It's WAY TOO SLOW. I can paste the URL into a browser and download even the 
largest files quite quickly, but the PHP method bottlenecks and cannot keep up.

Is there a SUBSTANTIALLY faster way to download and save these files? Keep in 
mind the client's requirements cannot be changed. Thanks for any suggestions.

try readfile()

--
Kind regards
Kim Emax - masterminds.dk

--- End Message ---
--- Begin Message ---
'Twas brillig, and Michael Shadle at 01/12/09 23:51 did gyre and gimble:
On Tue, Dec 1, 2009 at 3:21 PM, James McLean <[email protected]> wrote:

The suggestion from other users of off-loading the PDF downloading to
Apache (or another webserver) is a good idea also.

^

I never allow PHP to be [ab]used and kept open to spoonfeed clients
with fopen/readfile/etc.

I think there has been some confusion.... The OP wanted a way to *download* the files *from* somewhere, not dish them up to his clients.

I think some or the replies were assuming he wanted to have a PHP script as a guardian to protect content from unauthorised users but that is not what he actually said!

in apache there is a "mod_sendfile" module I think. never used it.

The above said, I didn't know about this module and it looks rather useful, so thanks for pointing it out :D

Here is the first Google result I found on this issue which explains it a bit.
http://codeutopia.net/blog/2009/03/06/sending-files-better-apache-mod_xsendfile-and-php/

Col

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


--- End Message ---
--- Begin Message --- Ah I didn't pay attention to the first part. Just gave my typical don't spoonfeed bytes from php rant :)

Sent from my iPhone

On Dec 2, 2009, at 1:42 AM, Colin Guthrie <[email protected]> wrote:

'Twas brillig, and Michael Shadle at 01/12/09 23:51 did gyre and gimble:
On Tue, Dec 1, 2009 at 3:21 PM, James McLean <[email protected]> wrote:
The suggestion from other users of off-loading the PDF downloading to
Apache (or another webserver) is a good idea also.
^
I never allow PHP to be [ab]used and kept open to spoonfeed clients
with fopen/readfile/etc.

I think there has been some confusion.... The OP wanted a way to *download* the files *from* somewhere, not dish them up to his clients.

I think some or the replies were assuming he wanted to have a PHP script as a guardian to protect content from unauthorised users but that is not what he actually said!

in apache there is a "mod_sendfile" module I think. never used it.

The above said, I didn't know about this module and it looks rather useful, so thanks for pointing it out :D

Here is the first Google result I found on this issue which explains it a bit.
http://codeutopia.net/blog/2009/03/06/sending-files-better-apache-mod_xsendfile-and-php/

Col

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
 Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
 Mandriva Linux Contributor [http://www.mandriva.com/]
 PulseAudio Hacker [http://www.pulseaudio.org/]
 Trac Hacker [http://trac.edgewall.org/]


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


--- End Message ---
--- Begin Message --- I happen to have grabbed this function from php.net a while back, and have been using it since:

// by "fr600 at hotmail dot com" at http://us2.php.net/getenv
function getip()
{
if(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown'))
    $ip = getenv('HTTP_CLIENT_IP');
else if(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown'))
    $ip = getenv('HTTP_X_FORWARDED_FOR');
else if(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown'))
    $ip = getenv('REMOTE_ADDR');
else if(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown'))
    $ip = $_SERVER['REMOTE_ADDR'];
  else
    $ip = 'unknown';

  return($ip);
}

though as others have pointed out, IP address is not a very good way to uniquely identify visitors (at least not on its own).

Lars Kristiansson wrote:
Hi!

This is probably the wrong forum. Please redirect me if im out of place.

I would like to find out what IP address my visitor uses when visiting a php script page on my domain. This page would contain a form in which the visitor would state his/her message.

My goal is to create purchase-orders written on unique files, and to separate them my idea was to baptize files with the IP addresses, which would ive each visitor an unique purchase-order...

Any hints to a newbie?

Cheers, Lars


--- End Message ---
--- Begin Message ---
Hello Everyone,

I solved the mysql issue too. thanks for your help. I had to change the root
the the extnsion directory as it was set to the linux style. Also found out
that for windows it is always best to use C:/ instead of C:\ This works in
some situations and in others it does not.

On Fri, Nov 27, 2009 at 10:02 PM, Bastien Koert <[email protected]> wrote:

>  On Fri, Nov 27, 2009 at 11:20 AM, Ashley Sheridan
> <[email protected]> wrote:
> > On Fri, 2009-11-27 at 17:10 +0100, Julian Muscat Doublesin wrote:
> >
> >> Hi,
> >>
> >> Just to update every one. This solution below worked perfectly. Thank
> you
> >> very much Jonathan. I have one other question though. Can anyone help me
> on
> >> the folowing. Database Error: Unable to connect to the database:The
> MySQL
> >> adapter "mysql" is not available.
> >>
> >> Thank you
> >>
> >> Julian
> >>
> >> On Fri, Nov 27, 2009 at 1:34 PM, Jonathan Tapicer <[email protected]>
> wrote:
> >>
> >> > You are probably missing something like this in the apache httpd.conf:
> >> >
> >> > LoadModule php5_module "c:/PHP/php5apache2_2.dll"
> >> > PHPIniDir "c:/PHP/php.ini"
> >> > AddType application/x-httpd-php .php
> >> > DirectoryIndex index.php index.html index.html.var
> >> >
> >> > Regards,
> >> >
> >> > Jonathan
> >> >
> >> > On Fri, Nov 27, 2009 at 6:24 AM, Julian Muscat Doublesin
> >> > <[email protected]> wrote:
> >> > > Hello Everyone,
> >> > >
> >> > > I have installed PHP, Apache and MySQL on a Windows 7 machine
> :(.........
> >> > I
> >> > > would prefer linux or unix :)
> >> > >
> >> > > These have been setup and working correctly. However when I access a
> php
> >> > > page. I get the save as dialog. Has anyone ever experinced such a
> >> > situation.
> >> > > Can anyone please advise.
> >> > >
> >> > > Thank you very much in advance.
> >> > >
> >> > > Julian
> >> > >
> >> >
> >
> >
> > It sounds like you've installed both PHP and MySQL, but not the
> > php-mysql module, which allows PHP to talk to the database. Depending on
> > how you installed PHP, there could be a variety of ways to fix this.
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >
>
> Try opening the php.ini file and uncommenting the line
>
> ;extension = php_mysql.dll;
>
> (by uncommenting i mean remove the first semi-colon). save the file
> and restart the apache service
>
> --
>
> Bastien
>
> Cat, the other other white meat
>

--- End Message ---
--- Begin Message ---
Hello Everyone,

I am having trouble with the mod_rewrite. This is not working on windows
64bit. I am also having trouble with the directory password protection.
However thse bot work perfectly on my UNIX Mac.

>From my experince I can see that this is due to file system compatibility.
Can anyone confirm this. You would be of greate help as I am going through
HELL right now. Can any suggest the best Unix or Linx OS for hosting phph
websites and MySQL.

Thank you very much in advanace.

--- End Message ---
--- Begin Message ---
On Wed, 2009-12-02 at 10:27 +0100, Julian Muscat Doublesin wrote:

> Hello Everyone,
> 
> I am having trouble with the mod_rewrite. This is not working on windows
> 64bit. I am also having trouble with the directory password protection.
> However thse bot work perfectly on my UNIX Mac.
> 
> From my experince I can see that this is due to file system compatibility.
> Can anyone confirm this. You would be of greate help as I am going through
> HELL right now. Can any suggest the best Unix or Linx OS for hosting phph
> websites and MySQL.
> 
> Thank you very much in advanace.


By any chance, are you using IIS on your Windows machine?

Pretty much most hosting companies offer Linux web-hosting. My advice
would be to try and use a company based in the same country as you are,
because it's nice to be able to contact them during your hours when
something goes wrong. And be ready to accept that things may go wrong at
some point.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On Wed, 2009-12-02 at 11:42 +0100, Julian Muscat Doublesin wrote:

> Yes - running IIS 7. 
> 
> 
> On Wed, Dec 2, 2009 at 11:27 AM, Ashley Sheridan
> <[email protected]> wrote:
> 
>         
>         On Wed, 2009-12-02 at 10:27 +0100, Julian Muscat Doublesin
>         wrote: 
>         
>         > Hello Everyone,
>         > 
>         > I am having trouble with the mod_rewrite. This is not working on 
> windows
>         > 64bit. I am also having trouble with the directory password 
> protection.
>         > However thse bot work perfectly on my UNIX Mac.
>         > 
>         > >From my experince I can see that this is due to file system 
> compatibility.
>         > Can anyone confirm this. You would be of greate help as I am going 
> through
>         > HELL right now. Can any suggest the best Unix or Linx OS for 
> hosting phph
>         > websites and MySQL.
>         > 
>         > Thank you very much in advanace.
>         
>         
>         
>         
>         By any chance, are you using IIS on your Windows machine?
>         
>         Pretty much most hosting companies offer Linux web-hosting. My
>         advice would be to try and use a company based in the same
>         country as you are, because it's nice to be able to contact
>         them during your hours when something goes wrong. And be ready
>         to accept that things may go wrong at some point.
>         
>         Thanks,
>         Ash
>         http://www.ashleysheridan.co.uk
>         
>         
>         
> 
> 


That is why mod_rewrite isn't working! IIS doesn't support that. It has
something else instead, by a name I forget just now. Afaik, you have to
purchase the support for this other bit as an extra module though.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On Wed, 2009-12-02 at 11:55 +0100, Julian Muscat Doublesin wrote:

> is this the issue.
> 
> 
> On Wed, Dec 2, 2009 at 11:55 AM, Julian Muscat Doublesin
> <[email protected]> wrote:
> 
>         I am runnning both IIS and Apache. The php webites are hosted
>         on Apacahe. 
>         
>         
>         
>         
>         
>         On Wed, Dec 2, 2009 at 11:41 AM, Ashley Sheridan
>         <[email protected]> wrote:
>         
>                 
>                 On Wed, 2009-12-02 at 11:42 +0100, Julian Muscat
>                 Doublesin wrote:
>                 
>                 > Yes - running IIS 7. 
>                 > 
>                 > On Wed, Dec 2, 2009 at 11:27 AM, Ashley Sheridan
>                 > <[email protected]> wrote: 
>                 > 
>                 >         
>                 >         On Wed, 2009-12-02 at 10:27 +0100, Julian
>                 >         Muscat Doublesin wrote: 
>                 >         
>                 >         > Hello Everyone,
>                 >         > 
>                 >         > I am having trouble with the mod_rewrite. This is 
> not working on windows
>                 >         > 64bit. I am also having trouble with the 
> directory password protection.
>                 >         > However thse bot work perfectly on my UNIX Mac.
>                 >         > 
>                 >         > >From my experince I can see that this is due to 
> file system compatibility.
>                 >         > Can anyone confirm this. You would be of greate 
> help as I am going through
>                 >         > HELL right now. Can any suggest the best Unix or 
> Linx OS for hosting phph
>                 >         > websites and MySQL.
>                 >         > 
>                 >         > Thank you very much in advanace.
>                 >         
>                 >         
>                 >         
>                 >         By any chance, are you using IIS on your
>                 >         Windows machine?
>                 >         
>                 >         Pretty much most hosting companies offer
>                 >         Linux web-hosting. My advice would be to try
>                 >         and use a company based in the same country
>                 >         as you are, because it's nice to be able to
>                 >         contact them during your hours when
>                 >         something goes wrong. And be ready to accept
>                 >         that things may go wrong at some point.
>                 >         
>                 >         Thanks,
>                 >         Ash
>                 >         http://www.ashleysheridan.co.uk
>                 >         
>                 >         
>                 >         
>                 >         
>                 > 
>                 > 
>                 
>                 
>                 
>                 
>                 That is why mod_rewrite isn't working! IIS doesn't
>                 support that. It has something else instead, by a name
>                 I forget just now. Afaik, you have to purchase the
>                 support for this other bit as an extra module though. 
>                 
>                 
>                 
>                 Thanks,
>                 Ash
>                 http://www.ashleysheridan.co.uk
>                 
>                 
>                 
>         
>         
>         
> 
> 


Are you sure the PHP ones are running under Apache? Just to check, see
what you get in the $_SERVER array. Also, have you checked to see if
mod_rewrite is enabled in the httpd.conf file?

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On Wed, 2009-12-02 at 12:10 +0100, Julian Muscat Doublesin wrote:

> I setup apache myself. That I'm sure of. I had a look at the php info
> and saw that mod_write in enabled. I checked the conf file and made
> sure that the AllowOverride is set to All.
> 
> 
> On Wed, Dec 2, 2009 at 11:55 AM, Ashley Sheridan
> <[email protected]> wrote:
> 
>         
>         On Wed, 2009-12-02 at 11:55 +0100, Julian Muscat Doublesin
>         wrote:
>         
>         > is this the issue.
>         > 
>         > On Wed, Dec 2, 2009 at 11:55 AM, Julian Muscat Doublesin
>         > <[email protected]> wrote:
>         > 
>         >         I am runnning both IIS and Apache. The php webites
>         >         are hosted on Apacahe. 
>         >         
>         >         
>         >         
>         >         On Wed, Dec 2, 2009 at 11:41 AM, Ashley Sheridan
>         >         <[email protected]> wrote: 
>         >         
>         >                 
>         >                 On Wed, 2009-12-02 at 11:42 +0100, Julian
>         >                 Muscat Doublesin wrote:
>         >                 
>         >                 > Yes - running IIS 7. 
>         >                 > 
>         >                 > On Wed, Dec 2, 2009 at 11:27 AM, Ashley
>         >                 > Sheridan <[email protected]>
>         >                 > wrote: 
>         >                 > 
>         >                 >         
>         >                 >         On Wed, 2009-12-02 at 10:27 +0100,
>         >                 >         Julian Muscat Doublesin wrote: 
>         >                 >         
>         >                 >         > Hello Everyone,
>         >                 >         > 
>         >                 >         > I am having trouble with the 
> mod_rewrite. This is not working on windows
>         >                 >         > 64bit. I am also having trouble with 
> the directory password protection.
>         >                 >         > However thse bot work perfectly on my 
> UNIX Mac.
>         >                 >         > 
>         >                 >         > >From my experince I can see that this 
> is due to file system compatibility.
>         >                 >         > Can anyone confirm this. You would be 
> of greate help as I am going through
>         >                 >         > HELL right now. Can any suggest the 
> best Unix or Linx OS for hosting phph
>         >                 >         > websites and MySQL.
>         >                 >         > 
>         >                 >         > Thank you very much in advanace.
>         >                 >         
>         >                 >         
>         >                 >         
>         >                 >         By any chance, are you using IIS
>         >                 >         on your Windows machine?
>         >                 >         
>         >                 >         Pretty much most hosting companies
>         >                 >         offer Linux web-hosting. My advice
>         >                 >         would be to try and use a company
>         >                 >         based in the same country as you
>         >                 >         are, because it's nice to be able
>         >                 >         to contact them during your hours
>         >                 >         when something goes wrong. And be
>         >                 >         ready to accept that things may go
>         >                 >         wrong at some point.
>         >                 >         
>         >                 >         Thanks,
>         >                 >         Ash
>         >                 >         http://www.ashleysheridan.co.uk
>         >                 >         
>         >                 >         
>         >                 >         
>         >                 >         
>         >                 >         
>         >                 > 
>         >                 > 
>         >                 
>         >                 
>         >                 
>         >                 That is why mod_rewrite isn't working! IIS
>         >                 doesn't support that. It has something else
>         >                 instead, by a name I forget just now. Afaik,
>         >                 you have to purchase the support for this
>         >                 other bit as an extra module though. 
>         >                 
>         >                 
>         >                 Thanks,
>         >                 Ash
>         >                 http://www.ashleysheridan.co.uk
>         >                 
>         >                 
>         >                 
>         >                 
>         >         
>         >         
>         >         
>         > 
>         > 
>         
>         
>         
>         
>         Are you sure the PHP ones are running under Apache? Just to
>         check, see what you get in the $_SERVER array. Also, have you
>         checked to see if mod_rewrite is enabled in the httpd.conf
>         file? 
>         
>         
>         
>         Thanks,
>         Ash
>         http://www.ashleysheridan.co.uk
>         
>         
>         
> 
> 


OK, what does your .htaccess file look like? Also, have you named it
correctly? It starts with a period (.) character, which Windows might
sometimes complain about.

PS, don't forget to hit reply to all, as the last few messages I keep
having to copy the list back in!

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
Sorry about the reply to all. the htaccess files worked correctly on a wamp
setup I had. All this happened once I did the big move to apache.

On Wed, Dec 2, 2009 at 12:10 PM, Ashley Sheridan
<[email protected]>wrote:

>   On Wed, 2009-12-02 at 12:10 +0100, Julian Muscat Doublesin wrote:
>
> I setup apache myself. That I'm sure of. I had a look at the php info and
> saw that mod_write in enabled. I checked the conf file and made sure that
> the AllowOverride is set to All.
>
> On Wed, Dec 2, 2009 at 11:55 AM, Ashley Sheridan <[email protected]>
> wrote:
>
>
>  On Wed, 2009-12-02 at 11:55 +0100, Julian Muscat Doublesin wrote:
>
> is this the issue.
>
> On Wed, Dec 2, 2009 at 11:55 AM, Julian Muscat Doublesin <
> [email protected]> wrote:
>
> I am runnning both IIS and Apache. The php webites are hosted on Apacahe.
>
>
>
> On Wed, Dec 2, 2009 at 11:41 AM, Ashley Sheridan <[email protected]>
> wrote:
>
>
> On Wed, 2009-12-02 at 11:42 +0100, Julian Muscat Doublesin wrote:
>
> Yes - running IIS 7.
>
> On Wed, Dec 2, 2009 at 11:27 AM, Ashley Sheridan <[email protected]>
> wrote:
>
>
> On Wed, 2009-12-02 at 10:27 +0100, Julian Muscat Doublesin wrote:
>
> Hello Everyone,
>
> I am having trouble with the mod_rewrite. This is not working on windows
> 64bit. I am also having trouble with the directory password protection.
> However thse bot work perfectly on my UNIX Mac.
>
> >From my experince I can see that this is due to file system compatibility.
> Can anyone confirm this. You would be of greate help as I am going through
> HELL right now. Can any suggest the best Unix or Linx OS for hosting phph
> websites and MySQL.
>
> Thank you very much in advanace.
>
>
>
> By any chance, are you using IIS on your Windows machine?
>
> Pretty much most hosting companies offer Linux web-hosting. My advice would
> be to try and use a company based in the same country as you are, because
> it's nice to be able to contact them during your hours when something goes
> wrong. And be ready to accept that things may go wrong at some point.
>
>   Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
>
>
>
>
>
> That is why mod_rewrite isn't working! IIS doesn't support that. It has
> something else instead, by a name I forget just now. Afaik, you have to
> purchase the support for this other bit as an extra module though.
>
>
>   Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
>
>
>
>
>
>
>  Are you sure the PHP ones are running under Apache? Just to check, see
> what you get in the $_SERVER array. Also, have you checked to see if
> mod_rewrite is enabled in the httpd.conf file?
>
>
>
>   Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
>
>
> OK, what does your .htaccess file look like? Also, have you named it
> correctly? It starts with a period (.) character, which Windows might
> sometimes complain about.
>
> PS, don't forget to hit reply to all, as the last few messages I keep
> having to copy the list back in!
>
>
>   Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>

--- End Message ---
--- Begin Message ---


Ashley Sheridan wrote on 2009-12-02 12:10:

PS, don't forget to hit reply to all, as the last few messages I keep
having to copy the list back in!

Is it just me or should NON-PHP issues be kept out of the "php-general" list? Use an Apache list/group instead? That's what I do when I have issues with Apache, CSS, Ajax, Javascript, Unix etc.

--
Take Care
Kim Emax - master|minds - Vi tænker IT for dig...
Konsulentbistand, programmering, design & hosting af websites.
http://www.masterminds.dk - http://www.emax.dk
Køb din vin online på http://www.gmvin.dk

--- End Message ---
--- Begin Message ---
On Wed, 2009-12-02 at 12:17 +0100, Julian Muscat Doublesin wrote:

> Sorry about the reply to all. the htaccess files worked correctly on a wamp
> setup I had. All this happened once I did the big move to apache.
> 
> On Wed, Dec 2, 2009 at 12:10 PM, Ashley Sheridan
> <[email protected]>wrote:
> 
> >   On Wed, 2009-12-02 at 12:10 +0100, Julian Muscat Doublesin wrote:
> >
> > I setup apache myself. That I'm sure of. I had a look at the php info and
> > saw that mod_write in enabled. I checked the conf file and made sure that
> > the AllowOverride is set to All.
> >
> > On Wed, Dec 2, 2009 at 11:55 AM, Ashley Sheridan <[email protected]>
> > wrote:
> >
> >
> >  On Wed, 2009-12-02 at 11:55 +0100, Julian Muscat Doublesin wrote:
> >
> > is this the issue.
> >
> > On Wed, Dec 2, 2009 at 11:55 AM, Julian Muscat Doublesin <
> > [email protected]> wrote:
> >
> > I am runnning both IIS and Apache. The php webites are hosted on Apacahe.
> >
> >
> >
> > On Wed, Dec 2, 2009 at 11:41 AM, Ashley Sheridan <[email protected]>
> > wrote:
> >
> >
> > On Wed, 2009-12-02 at 11:42 +0100, Julian Muscat Doublesin wrote:
> >
> > Yes - running IIS 7.
> >
> > On Wed, Dec 2, 2009 at 11:27 AM, Ashley Sheridan <[email protected]>
> > wrote:
> >
> >
> > On Wed, 2009-12-02 at 10:27 +0100, Julian Muscat Doublesin wrote:
> >
> > Hello Everyone,
> >
> > I am having trouble with the mod_rewrite. This is not working on windows
> > 64bit. I am also having trouble with the directory password protection.
> > However thse bot work perfectly on my UNIX Mac.
> >
> > >From my experince I can see that this is due to file system compatibility.
> > Can anyone confirm this. You would be of greate help as I am going through
> > HELL right now. Can any suggest the best Unix or Linx OS for hosting phph
> > websites and MySQL.
> >
> > Thank you very much in advanace.
> >
> >
> >
> > By any chance, are you using IIS on your Windows machine?
> >
> > Pretty much most hosting companies offer Linux web-hosting. My advice would
> > be to try and use a company based in the same country as you are, because
> > it's nice to be able to contact them during your hours when something goes
> > wrong. And be ready to accept that things may go wrong at some point.
> >
> >   Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >
> >
> >
> >
> >
> >
> > That is why mod_rewrite isn't working! IIS doesn't support that. It has
> > something else instead, by a name I forget just now. Afaik, you have to
> > purchase the support for this other bit as an extra module though.
> >
> >
> >   Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >  Are you sure the PHP ones are running under Apache? Just to check, see
> > what you get in the $_SERVER array. Also, have you checked to see if
> > mod_rewrite is enabled in the httpd.conf file?
> >
> >
> >
> >   Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >
> >
> >
> > OK, what does your .htaccess file look like? Also, have you named it
> > correctly? It starts with a period (.) character, which Windows might
> > sometimes complain about.
> >
> > PS, don't forget to hit reply to all, as the last few messages I keep
> > having to copy the list back in!
> >
> >
> >   Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >


Erm, Wamp is Apache!

Well, have you done other things in the .htaccess that are failing,
causing the whole thing to fail?

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
Hi everyone,

I'm pulling data from a mysql database, but need only the first 20
characters of each string for a short description, what is the best
method to just grab the first 20 characters from a string regardless
of whether they are letters or numbers?

Chris

--- End Message ---

Reply via email to