php-general Digest 14 Jul 2005 06:29:31 -0000 Issue 3566
Topics (messages 218638 through 218658):
Re: 404 error - why???!!
218638 by: Joseph
218639 by: Grosz, Steve (IPG IT)
Re: Time Zone names
218640 by: Philip Hallstrom
Re: DAO/VO Pattern Help
218641 by: Manuel Lemos
404 error - DLL files needed ??
218642 by: Grosz, Steve (IPG IT)
218643 by: Mikey
218645 by: Grosz, Steve (IPG IT)
218646 by: glumtail
218647 by: Grosz, Steve (IPG IT)
218650 by: Tjoekbezoer van Damme
218651 by: Grosz, Steve (IPG IT)
404 Header Problems
218644 by: Scott Taylor
218649 by: Jasper Bryant-Greene
Install directions for Win2003 SP1??
218648 by: Grosz, Steve (IPG IT)
New Install Question
218652 by: php.swimwebs.com
218653 by: php.swimwebs.com
Dynamic Images and File Permissions
218654 by: Adam Hubscher
Echo array string index?
218655 by: Matt Darby
218656 by: Adam Hubscher
Removing special characters
218657 by: Computer Programmer
218658 by: Marek Kilimajer
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:
php-general@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Steve, I may have missed this response, if this is a repeat please
excuse me...
Make sure you have the correct mysql and php versions to run phpBB. I
had 404 errors with a blogging/forum application where the index file
moved to another page. But because there were some errors in setup the
page came up as 404.
You might try to put this in a page: info.php
<html>
<body>
<?php
phpinfo();
?>
</body>
</html>
Then go to the page, this will let you know if php is running. I have a
feeling it is the BB which is having the problem.
jzf
Grosz, Steve (IPG IT) wrote:
OK, you lost me, execute/write on which file?
I don't use asp, I use Coldfusion, and .htm, I'm only installing PHP so
I can use the phpBB system.
-----Original Message-----
From: glumtail [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 13, 2005 12:05 PM
To: php-general@lists.php.net
Subject: Re: [PHP] 404 error - why???!!
Hello,
it seems that your ISAPI is ok.
1. with full permission? e.g: execute,write and so on...
2. how about asp file?
2005/7/14, Grosz, Steve (IPG IT) <[EMAIL PROTECTED]>:
Ok, now it appears the ISAPI is loaded, I get the green up arrow, but
the priority always shows as 'unknown'.
Still get the 404 errors when trying to view .php pages
Steve
-----Original Message-----
From: glumtail [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 13, 2005 11:10 AM
To: php-general@lists.php.net
Subject: Re: [PHP] 404 error - why???!!
Hello Steve,
Administrator tools -> Internet Services Manager -> Default Web Site
-> ISAPI ....
2005/7/14, Grosz, Steve (IPG IT) <[EMAIL PROTECTED]>:
I guess I'm not sure how to tell if its loading correctly. Can you
tell me how to confirm that it is?
I'm using PHP 4.x as well.
Steve
-----Original Message-----
From: glumtail [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 13, 2005 11:00 AM
To: php-general@lists.php.net
Subject: Re: [PHP] 404 error - why???!!
Hello Steve,
is the ISAPI loaded success?
what's your PHP version? Version 4.x works fine.
2005/7/14, Grosz, Steve (IPG IT) <[EMAIL PROTECTED]>:
Regular .htm files work just fine. Its kinda strange......
-----Original Message-----
From: Richard Davey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 13, 2005 10:18 AM
To: php-general@lists.php.net
Subject: Re: [PHP] 404 error - why???!!
Hello Steve,
Wednesday, July 13, 2005, 5:11:58 PM, you wrote:
GSII> Ok, I thought I had installed PHP correctly on my Win2003
GSII> server, using ISAPI. I added the extension, and mapped it to
GSII> the
GSII> php4isapi.dll file, added a path to my /php folder in
GSII> Win2003,
GSII> edited my php.ini file which I copied to my
GSII> /windows/system32
folder.
This won't fix the 404 (sorry), but the php.ini doesn't go in
system32, it just goes in the Windows directory. Do you only get
404s on PHP files? What happens if you copy an .html file into the
same location and request that?
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services "I do not
fear computers. I fear the lack of them." - Isaac Asimov
--
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
--
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
--- End Message ---
--- Begin Message ---
I appreciate the try, but no, I still get a 404 error. :)
This is killing me!!
-----Original Message-----
From: Joseph [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 13, 2005 12:34 PM
To: Grosz, Steve (IPG IT)
Cc: php-general@lists.php.net
Subject: Re: [PHP] 404 error - why???!!
Steve, I may have missed this response, if this is a repeat please
excuse me...
Make sure you have the correct mysql and php versions to run phpBB. I
had 404 errors with a blogging/forum application where the index file
moved to another page. But because there were some errors in setup the
page came up as 404.
You might try to put this in a page: info.php
<html>
<body>
<?php
phpinfo();
?>
</body>
</html>
Then go to the page, this will let you know if php is running. I have a
feeling it is the BB which is having the problem.
jzf
Grosz, Steve (IPG IT) wrote:
>OK, you lost me, execute/write on which file?
>
>I don't use asp, I use Coldfusion, and .htm, I'm only installing PHP so
>I can use the phpBB system.
>
>-----Original Message-----
>From: glumtail [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, July 13, 2005 12:05 PM
>To: php-general@lists.php.net
>Subject: Re: [PHP] 404 error - why???!!
>
>Hello,
> it seems that your ISAPI is ok.
>1. with full permission? e.g: execute,write and so on...
>2. how about asp file?
>
> 2005/7/14, Grosz, Steve (IPG IT) <[EMAIL PROTECTED]>:
>
>
>>Ok, now it appears the ISAPI is loaded, I get the green up arrow, but
>>the priority always shows as 'unknown'.
>>
>>Still get the 404 errors when trying to view .php pages
>>
>>Steve
>>
>>-----Original Message-----
>>From: glumtail [mailto:[EMAIL PROTECTED]
>>Sent: Wednesday, July 13, 2005 11:10 AM
>>To: php-general@lists.php.net
>>Subject: Re: [PHP] 404 error - why???!!
>>
>>Hello Steve,
>>Administrator tools -> Internet Services Manager -> Default Web Site
>>-> ISAPI ....
>>
>>2005/7/14, Grosz, Steve (IPG IT) <[EMAIL PROTECTED]>:
>>
>>
>>>I guess I'm not sure how to tell if its loading correctly. Can you
>>>tell me how to confirm that it is?
>>>
>>>I'm using PHP 4.x as well.
>>>
>>>Steve
>>>
>>>-----Original Message-----
>>>From: glumtail [mailto:[EMAIL PROTECTED]
>>>Sent: Wednesday, July 13, 2005 11:00 AM
>>>To: php-general@lists.php.net
>>>Subject: Re: [PHP] 404 error - why???!!
>>>
>>>Hello Steve,
>>>is the ISAPI loaded success?
>>>what's your PHP version? Version 4.x works fine.
>>>
>>>2005/7/14, Grosz, Steve (IPG IT) <[EMAIL PROTECTED]>:
>>>
>>>
>>>>Regular .htm files work just fine. Its kinda strange......
>>>>
>>>>-----Original Message-----
>>>>From: Richard Davey [mailto:[EMAIL PROTECTED]
>>>>Sent: Wednesday, July 13, 2005 10:18 AM
>>>>To: php-general@lists.php.net
>>>>Subject: Re: [PHP] 404 error - why???!!
>>>>
>>>>Hello Steve,
>>>>
>>>>Wednesday, July 13, 2005, 5:11:58 PM, you wrote:
>>>>
>>>>GSII> Ok, I thought I had installed PHP correctly on my Win2003
>>>>GSII> server, using ISAPI. I added the extension, and mapped it to
>>>>
>>>>
>
>
>
>>>>GSII> the
>>>>
>>>>
>>>>GSII> php4isapi.dll file, added a path to my /php folder in Win2003,
>>>>
>>>>
>>>>GSII> edited my php.ini file which I copied to my
>>>>GSII> /windows/system32
>>>>folder.
>>>>
>>>>This won't fix the 404 (sorry), but the php.ini doesn't go in
>>>>system32, it just goes in the Windows directory. Do you only get
>>>>404s on PHP files? What happens if you copy an .html file into the
>>>>
>>>>
>
>
>
>>>>same location and request that?
>>>>
>>>>Best regards,
>>>>
>>>>Richard Davey
>>>>--
>>>>http://www.launchcode.co.uk - PHP Development Services "I do not
>>>>fear computers. I fear the lack of them." - Isaac Asimov
>>>>
>>>>--
>>>>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
>>>>
>>>>
>>>>
>>>>
>>>--
>>>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
>>
>>
>>
>>
>
>
>
--- End Message ---
--- Begin Message ---
I'd like to generate a list of time zones (EST, CDT, whatever) for a popup.
Seems like it should be easy...
This is so the Sales guy can just plug in the time and zone of who he's
gotta call back, and I stuff that in the database, and he gets a morning
report of who to call.
<?php
for ($offset = 0; $offset <= 23; $offset++){
$z = ???;
echo "<option>$z</option>\n";
}
?>
What can I use for ??? to get the time zone name for offsets?
We did this for our app... we're always on FreeBSD though, but I imagine
the same files exist on Linux/others just somewhere else...
define("ZONETAB", "/usr/share/zoneinfo/zone.tab");
$fd = @fopen(ZONETAB, "r");
if (!$fd) {
print("<option value='GMT'>GMT");
} else {
while (!feof($fd)) {
$line = fgets($fd);
if (ereg("^US\t", $line)) {
list($x, $x, $tz_file, $tz_name) = explode("\t",
trim($line));
print("<option value='$tz_file'>$tz_name");
}
}
fclose($fd);
}
Gives you a kind of odd format though (we needed the actual timezone file name,
not the offset), but maybe this gets you closer...
<option value='America/New_York' >Eastern Time
<option value='America/Detroit' >Eastern Time - Michigan - most locations
<option value='America/Louisville' >Eastern Time - Kentucky - Louisville area
<option value='America/Kentucky/Monticello' >Eastern Time - Kentucky - Wayne
County
<option value='America/Indianapolis' >Eastern Standard Time - Indiana - most
locations
<option value='America/Indiana/Marengo' >Eastern Standard Time - Indiana -
Crawford County
<option value='America/Indiana/Knox' >Eastern Standard Time - Indiana - Starke
County
<option value='America/Indiana/Vevay' >Eastern Standard Time - Indiana -
Switzerland County
<option value='America/Chicago' >Central Time
<option value='America/Menominee' >Central Time - Michigan - Wisconsin border
<option value='America/North_Dakota/Center' >Central Time - North Dakota -
Oliver County
<option value='America/Denver' >Mountain Time
<option value='America/Boise' >Mountain Time - south Idaho & east Oregon
<option value='America/Shiprock' >Mountain Time - Navajo
<option value='America/Phoenix' >Mountain Standard Time - Arizona
<option value='America/Los_Angeles' selected>Pacific Time
<option value='America/Anchorage' >Alaska Time
<option value='America/Juneau' >Alaska Time - Alaska panhandle
<option value='America/Yakutat' >Alaska Time - Alaska panhandle neck
<option value='America/Nome' >Alaska Time - west Alaska
<option value='America/Adak' >Aleutian Islands
<option value='Pacific/Honolulu' >Hawaii
--- End Message ---
--- Begin Message ---
Hello,
on 07/13/2005 01:28 PM Jed R. Brubaker said the following:
As I am trying to take my PHP code in a more enterprise direction with
strict model/logic/view layers, I have been working with DAOs and the
matching VOs.
So I am running into a problem that I could really use some direction on:
DAO/VO works great with single tables, but I tend to make my database work
for its existance, and joins ar eeverywhere. What I don't understand is how
to approach DAO/VO when table joins are involved.
Can anyone think of some good resources?
You may want to take a look at Metastorage. It is a mature
Object-Relational mapping (ORM) code generation tool.
It lets you design the classes of your application persistent objects
using a simple XML format that defines the class variables,
relationships, validation rules and define the types of functions that
you want to manipulate the objects.
Then it generates the ORM classes, classes to install or update your
database schema, so you do not have to hand code SQL.
It also supports an Object Query Language (OQL) that lets you define
search expressions that are converted into efficient SQL to let your
search and retrieve persistent objects that satisfy a given condition,
all without writing a single line of SQL.
Here you may find more about it:
http://www.meta-language.net/metastorage.html
Screenshots of the Web interface:
http://www.meta-language.net/screenshots.html
A tutorial:
http://www.meta-language.net/metastorage-tutorial.html
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--- End Message ---
--- Begin Message ---
In installing PHP4 on Win2003/IIS 6, I have noticed that only 1 dll file
is used on the ISAPI install.
What is the php4ts.dll file used for? And do I need to add it into my
ISAPI area within IIS or just use the php4isapi.dll file...
Steve
--- End Message ---
--- Begin Message ---
Grosz, Steve (IPG IT) wrote:
In installing PHP4 on Win2003/IIS 6, I have noticed that only 1 dll file
is used on the ISAPI install.
What is the php4ts.dll file used for? And do I need to add it into my
ISAPI area within IIS or just use the php4isapi.dll file...
Steve
Well, as per the installation instructions, that dll needs to be in your
system path - system32 is the best place for it.
hth,
Mikey
--- End Message ---
--- Begin Message ---
I'm afraid it didn't help. I know the php4ts.dll need to be in the
path, and the instructions say that if that file is in the /php
directory, and there is a Path to that directory, all should be fine.
I'm curious if within IIS I use php4isapi.dll for my extension and
ISAPI filter.
-----Original Message-----
From: Mikey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 13, 2005 1:38 PM
To: php-general@lists.php.net
Subject: Re: [PHP] 404 error - DLL files needed ??
Grosz, Steve (IPG IT) wrote:
>In installing PHP4 on Win2003/IIS 6, I have noticed that only 1 dll
>file is used on the ISAPI install.
>
>What is the php4ts.dll file used for? And do I need to add it into my
>ISAPI area within IIS or just use the php4isapi.dll file...
>
>Steve
>
>
>
Well, as per the installation instructions, that dll needs to be in your
system path - system32 is the best place for it.
hth,
Mikey
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Dear Steve:
php4ts.dll is needed by php4isapi.dll.
if you can visit your pages in wwwroot folder, just try to rename that page
to php extension.
e.g: rename postinfo.html to postinfo.php
C:\PHP
│ install.txt
│ license.txt
│ magic.mime
│ news.txt
│ php-cli.exe
│ php.exe
│ php.gif
│ php.ini
│ php.ini-dist
│ php.ini-recommended
│ php4embed.lib
│ php4isapi.dll
│ php4ts.dll
│ php4ts.lib
│
├─dlls
│
├─extensions
│
├─mibs
│
├─openssl
│
├─pdf-related
│
└─sapi
2005/7/14, Grosz, Steve (IPG IT) <[EMAIL PROTECTED]>:
>
> I'm afraid it didn't help. I know the php4ts.dll need to be in the
> path, and the instructions say that if that file is in the /php
> directory, and there is a Path to that directory, all should be fine.
>
> I'm curious if within IIS I use php4isapi.dll for my extension and
> ISAPI filter.
>
> -----Original Message-----
> From: Mikey [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 13, 2005 1:38 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] 404 error - DLL files needed ??
>
> Grosz, Steve (IPG IT) wrote:
>
> >In installing PHP4 on Win2003/IIS 6, I have noticed that only 1 dll
> >file is used on the ISAPI install.
> >
> >What is the php4ts.dll file used for? And do I need to add it into my
> >ISAPI area within IIS or just use the php4isapi.dll file...
> >
> >Steve
> >
> >
> >
> Well, as per the installation instructions, that dll needs to be in your
> system path - system32 is the best place for it.
>
> hth,
>
> Mikey
>
> --
> 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
>
>
--- End Message ---
--- Begin Message ---
I tried that, renamed a txt file to .php, but when I try to get the .php file,
I just get a 404 error.
-----Original Message-----
From: glumtail [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 13, 2005 2:15 PM
To: php-general@lists.php.net
Subject: Re: [PHP] 404 error - DLL files needed ??
Dear Steve:
php4ts.dll is needed by php4isapi.dll.
if you can visit your pages in wwwroot folder, just try to rename that page to
php extension.
e.g: rename postinfo.html to postinfo.php C:\PHP │ install.txt │ license.txt │
magic.mime │ news.txt │ php-cli.exe │ php.exe │ php.gif │ php.ini │
php.ini-dist │ php.ini-recommended │ php4embed.lib │ php4isapi.dll │ php4ts.dll
│ php4ts.lib │ ├─dlls │ ├─extensions │ ├─mibs │ ├─openssl │ ├─pdf-related │
└─sapi
2005/7/14, Grosz, Steve (IPG IT) <[EMAIL PROTECTED]>:
>
> I'm afraid it didn't help. I know the php4ts.dll need to be in the
> path, and the instructions say that if that file is in the /php
> directory, and there is a Path to that directory, all should be fine.
>
> I'm curious if within IIS I use php4isapi.dll for my extension and
> ISAPI filter.
>
> -----Original Message-----
> From: Mikey [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 13, 2005 1:38 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] 404 error - DLL files needed ??
>
> Grosz, Steve (IPG IT) wrote:
>
> >In installing PHP4 on Win2003/IIS 6, I have noticed that only 1 dll
> >file is used on the ISAPI install.
> >
> >What is the php4ts.dll file used for? And do I need to add it into my
> >ISAPI area within IIS or just use the php4isapi.dll file...
> >
> >Steve
> >
> >
> >
> Well, as per the installation instructions, that dll needs to be in
> your system path - system32 is the best place for it.
>
> hth,
>
> Mikey
>
> --
> 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
>
>
--- End Message ---
--- Begin Message ---
On 7/13/05, Grosz, Steve (IPG IT) <[EMAIL PROTECTED]> wrote:
> I tried that, renamed a txt file to .php, but when I try to get the .php
> file, I just get a 404 error.
Grosz, this might very well be your webserver invoking. By default,
IIS 6.0 all webserver extensions (like PHP). To check if your server
still does, open up your IIS manager
(Start->Run->'c:\windows\system32\inetsrv\iis.msc') Then browse to Web
Service Extensions on the left. If you did install PHP correctly you
should see PHP appearing in the list on the right. Set it to
'Allowed'. Now try requesting the page via your browser again.
Good luck!
Tjoekbezoer
--- End Message ---
--- Begin Message ---
Tjoekbezoer,
I can tell you that it is there, because I manually added it, and it is
set to 'allowed'.
Steve
-----Original Message-----
From: Tjoekbezoer van Damme [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 13, 2005 3:52 PM
To: php-general@lists.php.net
Subject: Re: [PHP] 404 error - DLL files needed ??
On 7/13/05, Grosz, Steve (IPG IT) <[EMAIL PROTECTED]> wrote:
> I tried that, renamed a txt file to .php, but when I try to get the
.php file, I just get a 404 error.
Grosz, this might very well be your webserver invoking. By default, IIS
6.0 all webserver extensions (like PHP). To check if your server still
does, open up your IIS manager
(Start->Run->'c:\windows\system32\inetsrv\iis.msc') Then browse to Web
Service Extensions on the left. If you did install PHP correctly you
should see PHP appearing in the list on the right. Set it to 'Allowed'.
Now try requesting the page via your browser again.
Good luck!
Tjoekbezoer
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I'm trying to issue a 404 header on one of my pages. But it does not
redirect. I figured, with many function calls before it, that it might
be outputting something to the screen before the header() command was
issued. So, I tried issuing a 404 header from a new page, consisting of
this code:
<?
header("HTTP/1.0 404 Not Found");
exit();
?>
or
<?
header("HTTP/1.0 404 Not Found");
?>
But neither of these work. Notice how there should also be no ouput to
the screen before the header is closed.
I've also tried:
<?
|header("Status: 404 Not Found");
?>
which gives the same results. The results are this: an output of
<html><head></head></html>. I'm on a large shared server, and my guess
is that when there is a bug with some code in php, the server chooses to
ouput this instead of the actual error code(s). I've experienced this
many times when I upload a page and there is a simple syntax error such
as one semi-colon missing from a statment. This is probably so that the
server doesn't get hacked.
If I try to issue both commands, in either order, I get this:
Not Found
The requested URL /cgi-sys/php.cgi/testing_server/404_error.php was not
found on this server.
Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.
So....what's going on here? Am I to conclude that the 404 header does
not work, and that I should just use a Redirect: header() to my 404 page?
Best Regards,
Scott Taylor
--- End Message ---
--- Begin Message ---
Scott Taylor wrote:
I'm trying to issue a 404 header on one of my pages. But it does not
redirect. I figured, with many function calls before it, that it might
be outputting something to the screen before the header() command was
issued. So, I tried issuing a 404 header from a new page, consisting of
this code:
Issuing a 404 header on a PHP page will not cause the server to redirect
to the standard 404 error page. This behaviour is by design, and is
because of the order in which the request is dealt with.
All you need to do is issue a 404 Not Found header and include() the 404
error page you've set up in Apache config.
Jasper
--- End Message ---
--- Begin Message ---
Does anyone have a step by step, screenshots would be great, of how to
install PHP 4.x on a Win2003 SP1 server?
I've tried going through the install instructions on PHP.net's site for
windows, but its still not working, so I think I'm missing something
somewhere along the way.
Thanks!
Steve
--- End Message ---
--- Begin Message ---
We just set up a new webserver using Apache 2 and PHP5. When I
transferred all the files over from my old server, I saw that none of
the PHP files are being rendered (i.e. I see the PHP source instead of
the resulting HTML).
Here is the PHP.conf file we are using:
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
LoadModule php5_module modules/libphp5.so
#
# Cause the PHP interpreter handle files with a .php extension.
#
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 524288
</Files>
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
What am I doing wrong? Or there another setting I need to set
somewhere?
Thanks,
Robbert van Andel
--- End Message ---
--- Begin Message ---
Never mind, I answered my own question. I added "AddType
application/x-httpd-php .php" to the bottom of php.conf and that fixed
the problem. We did not have that with our old system running php4.
[EMAIL PROTECTED] wrote on 07/14/2005, 12:40:02 AM:
>
> We just set up a new webserver using Apache 2 and PHP5. When I
> transferred all the files over from my old server, I saw that none of
> the PHP files are being rendered (i.e. I see the PHP source instead of
> the resulting HTML).
>
> Here is the PHP.conf file we are using:
> #
> # PHP is an HTML-embedded scripting language which attempts to make it
> # easy for developers to write dynamically generated webpages.
> #
>
>
> LoadModule php5_module modules/libphp5.so
>
>
> #
> # Cause the PHP interpreter handle files with a .php extension.
> #
>
> SetOutputFilter PHP
> SetInputFilter PHP
> LimitRequestBody 524288
>
>
>
> #
> # Add index.php to the list of files that will be served as directory
> # indexes.
> #
> DirectoryIndex index.php
>
>
> What am I doing wrong? Or there another setting I need to set
> somewhere?
>
> Thanks,
> Robbert van Andel
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I have a script that generates, creates, and updates dynamic banner
images for users of a service.
Recently I have run into a problem with file permissions... that has
thoroughly annoyed me. I found a solution to fix the problem, however,
it was then hit with another problem, and I'm not sure how secure I find
my solution to be.
During the image creation process, the files are given the normal image
permission of 644 (rw-r--r--). Of course, this makes updating impossible.
I attempted to use a simple chmod();, however, the script didnt have the
permissions to do this. I couldnt figure out a way to fix this, so I
moved on to looking for other solutions.
I ended up with somethign that worked, slightly, but did not provide me
with an actual fix due to another problem. I would connect to the folder
via local FTP, then using ftp_site run a direct CHMOD on the files.
However, in doing this, I feel that the script itself is insecure. Also,
it didnt work in the end. After running the update script, to test out
my new solution, I was confronted with a new problem that I didnt
understand.
The FTP command returned "Bad File Descriptor" after executing the
CHMOD. After attempting in a few other of my own FTP clients, I ran into
-exactly- the same problem.
My questions are this:
A) Is there any way to set the permissions on the file on creation of
the image?
B) If no, is there a way I can do the CHMOD, even though chmod();
returned insufficient permissions to do so?
C) If no, is there a way I can fix the bad file descriptor, to fix the
ftp solution I have?
Any other solutions would be able as well, given that they're somewhat
secure.
--- End Message ---
--- Begin Message ---
I have an array setup as such: *$arr['generated text']='generated number';*
What would be the best way to echo the key in a loop?
Seems pretty easy but I've never attempted...
Thanks all!
Matt Darby
--- End Message ---
--- Begin Message ---
Matt Darby wrote:
I have an array setup as such: *$arr['generated text']='generated number';*
What would be the best way to echo the key in a loop?
Seems pretty easy but I've never attempted...
Thanks all!
Matt Darby
I'm not sure I understand the question.
You could do foreach($arr as $key => $value) { print($key); }.
There are also a number of functions that get the current key on the
array's pointer:
http://us2.php.net/manual/en/function.key.php
http://us2.php.net/manual/en/function.array-keys.php
But once again, it really comes down to what exactly it is you want to do...
--- End Message ---
--- Begin Message ---
Is there a PHP built-in function to retrieve only the alphanumeric
characters from a given string?
I know that I can check for alphanumeric characters using the
function ctype_alphanum () but it won't retrieve the alphanum characters.
I also know that I can use str_replace to replace an array of special
characters such as the example below:
$str = "I*m using <html tags> with special/chars like | how to get
rid of it???";
$removeChars = array ('*','?','|','>','<','/','\\');
$str = str_replace ($removeChars, "", $str);
However, could there be a specific function for just retrieving
alphanumeric characters? or a specific function for just stripping
special characters? Or maybe a better way to do those things from the
example given above?
Thanks in advance. :)
___________________________
PHP Version: 4.4.0
--- End Message ---
--- Begin Message ---
Computer Programmer wrote:
Is there a PHP built-in function to retrieve only the alphanumeric
characters from a given string?
I know that I can check for alphanumeric characters using the function
ctype_alphanum () but it won't retrieve the alphanum characters.
I also know that I can use str_replace to replace an array of special
characters such as the example below:
$str = "I*m using <html tags> with special/chars like | how to get rid
of it???";
$removeChars = array ('*','?','|','>','<','/','\\');
$str = str_replace ($removeChars, "", $str);
However, could there be a specific function for just retrieving
alphanumeric characters? or a specific function for just stripping
special characters? Or maybe a better way to do those things from the
example given above?
$str = preg_replace('/[^a-z0-9]/i', '', $str);
--- End Message ---