php-windows Digest 16 Nov 2001 01:31:29 -0000 Issue 856
Topics (messages 10425 through 10443):
Re: PHP as Apache module
10425 by: Ross Fleming
Re: Speed of SQL queries, profiling?
10426 by: Svensson, B.A.T. (HKG)
10442 by: Arnout van der Kamp
HELP! how to load phpapache2.dll filter under Win32
10427 by: Paco Ortiz
Sessions trouble
10428 by: Michel Laine
How to compile my own PHP extension in Windows?
10429 by: GRI
help!!
10430 by: Alejandro
10436 by: Angie Tollerson
How to compile PHP with cygwin?
10431 by: GRI
10435 by: Frank M. Kromann
PHP/HTTP authentication with register_globals = Off
10432 by: Stéphane Vinsot
Re: [PHP-DEV] How to compile my own PHP extension in Windows?
10433 by: Frank M. Kromann
Re: PHP and Lotus Notes
10434 by: Frank M. Kromann
why doesn´t exec("dir"); work ?
10437 by: Daniel Hellstrand
10438 by: Boget, Chris
10439 by: Daniel Hellstrand
5760 Melt away extra5891 pounds and inches today! 4372028
10440 by: 2843720weigh_out.business.com
Win 2k, IIS 5 and PHP
10441 by: Martin Steel
Re: [PHP-DEV] How to compile PHP with cygwin?
10443 by: Alan Knowles
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 ---
See attached manual
-----Original Message-----
From: astenios [mailto:[EMAIL PROTECTED]]
Sent: 15 November 2001 12:28
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] PHP as Apache module
How can I install PHP4 as Apache module on Win2K??
Thanks in advance.
xavi
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
PHP/Windows Installation Notes
==============================
Installation on Windows 9x/Me/NT/2000 systems
=============================================
There are two main ways to install PHP for Windows: either
manually or by using the InstallShield installer.
Windows InstallShield
=====================
The Windows PHP installer is available from the downloads page at
www.php.net. This installs the CGI version of PHP and, for IIS, PWS,
and Xitami, configures the web server as well.
Note that this version does *NOT* install any extensions or server
api versions of PHP.
Install your selected HTTP server on your system and make sure
that it works.
Run the executable installer and follow the instructions provided by
the installation wizard. Two types of installation are supported -
standard, which provides sensible defaults for all the settings it
can, and advanced, which asks questions as it goes along.
The installation wizard gathers enough information to set up the
php.ini file and configure the web server to use PHP.
For IIS and also PWS on NT Workstation, a list of all the
nodes on the server with script map settings is displayed, and you
can choose those nodes to which you wish to add the PHP script
mappings.
Once the installation has completed the installer will inform you
if you need to restart your system, restart the server, or just
start using PHP.
Windows Manual installation from zip binary distribution
========================================================
This install guide will help you manually install and configure
PHP on your Windows 9x/Me/NT/2000 webservers. This guide was compiled by
Bob Silva. The original version can be found at
http://www.umesd.k12.or.us/php/win32install.html
This guide provides manual installation support for:
Personal Web Server 3 and 4 or newer
Internet Information Server 3 and 4 or newer
Apache 1.3.x
OmniHTTPd 2.0b1 and up
Oreilly Website Pro
Xitami
Netscape Enterprise Server, iPlanet
PHP 4 for Windows comes in two flavours - a CGI executable (php.exe),
and several SAPI modules (for exapmle php4isapi.dll). The latter form
is new to PHP 4, and provides significantly improved performance and
some new functionality. However, please note that the SAPI modules
are *NOT* yet considered to be production quality.
In particular, with the ISAPI module, you are likely to encounter serious
reliability problems especially on platforms older than W2K - you may
witness a lot of server 500 errors and suffer from other server modules
such as ASP also failing. You have been warned!
The reason for this is that the PHP SAPI modules are using the
thread-safe version of the PHP code, which is new to PHP 4, and has
not yet been tested and pounded enough to be considered completely
stable, and there are actually a few known bugs. On the other hand,
some people have reported very good results with the SAPI modules,
and there a few reports of problems with the Apache module version.
In short - your mileage may vary; If you need
absolute stability, trade the performance of the SAPI modules
with the stability of the CGI executable.
If you choose one of the SAPI modules and use Windows 95, be sure
to download the DCOM update from
http://download.microsoft.com/msdownload/dcom/95/x86/en/dcom95.exe"
For the ISAPI module, an ISAPI 4.0 compliant Web server
is required (tested on IIS 4.0, PWS 4.0 and IIS 5.0). IIS 3.0 is
*NOT* supported; You should download and install the Windows NT 4.0
Option Pack with IIS 4.0 if you want native PHP support.
The following steps should be performed on all installations
before the server specific instructions.
Extract the distribution file to a directory of your choice.
C:\PHP\ is a good start.
Copy the file, php.ini-dist to your %WINDOWS% directory on
Windows 95/98 or to your %SYSTEMROOT% directory under Windows NT
or Windows 2000 and rename it to php.ini. Your %WINDOWS% or
%SYSTEMROOT% directory is typically:
c:\windows for Windows 95/98
c:\winnt or c:\winnt40 for NT/2000 servers
Edit your php.ini file:
You will need to change the 'extension_dir' setting to
point to your php-install-dir, or where you have placed
your 'php_*.dll' files. ex: c:\php
If you are using OmniHTTPd, do not follow the next step.
Set the 'doc_root' to point to your webservers
document_root. ex: c:\apache\htdocs or c:\webroot
Choose which extensions you would like to load when PHP
starts, noting that several extensions are already built
into the Windows release, see the section about
Windows extensions for details of the built in extensions.
You can uncomment the: 'extension=php_*.dll' lines
in php.ini to load these extensions.
Some extensions require you to have additional libraries
installed on your system for the module to work correctly.
The PHP FAQ at www.php.net/FAQ.php has more information on
where to get supporting libraries. You can also load a
module dynamically in your script using dl. See the section
about Windows extensions.
Note that on a new installation it is advisable to first get
PHP working and tested without any extensions before enabling
them in php.ini.
On PWS and IIS, you can set the browscap.ini
to point to: 'c:\windows\system\inetsrv\browscap.ini' on
Windows 9x/Me and 'c:\winnt\system32\inetsrv\browscap.ini'
on NT/2000 Server. Additional information on using the
browscap functionality in PHP can be found at
http://php.netvision.net.il/browser-id.php3
select the "source" button to see it in action.
Note that the mibs directory supplied with the Windows distribution
contains support files for SNMP. This directory should be moved to
DRIVE:\usr\mibs (DRIVE being the drive where PHP is installed.)
Some DLLs are required for some PHP extensions. Please copy them to
your to your windows/system (Win9.x) or winnt/system32 (WinNT, Win2000)
directory. If you already have these DLLs installed on your system,
overwrite them only if something is not working correctly.
Before overwriting them, it is a good idea to back them or move them to
another folder - just in case something goes wrong.
Installation of Windows extensions
==================================
After installing PHP and a webserver on Windows, you will
probably want to install some extensions for added functionality.
The following table describes some of the extensions available. As
described in the manual installation steps, you can choose which
extensions you would like to load when PHP starts by uncommenting the:
extension=php_*.dll' lines in php.ini. Some
extensions require you to have additional libraries installed on
your system for the module to work correctly. The PHP
FAQ at at www.php.net/FAQ.php has more information on
where to get supporting libraries. You can also load a module
dynamically in your script using dl.
The DLLs for PHP extensions are prefixed with 'php_'. This
prevents confusion between PHP extensions and their supporting
libraries.
Note:
In PHP 4.0.5 MySQL, ODBC, FTP, Calendar, BCMath, COM, PCRE,
Session, WDDX and XML support is <emphasis>built-in</emphasis>.
You don't need to load any additional extensions in order to
use these functions.
PHP Extensions
php_calendar.dll Calendar conversion functions
php_crypt.dll Crypt functions
php_dbase.dll dBase functions
php_dbm.dll Berkeley DB2 library
php_filepro.dll Read-only access to Filepro databases
php_gd.dll GD library functions for GIF manipulation
php_hyperwave.dll HyperWave functions
php_imap4r2.dll IMAP 4 functions
php_ldap.dll LDAP functions
php_msql1.dll mSQL 1 client
php_msql2.dll mSQL 2 client
php_mssql.dll MSSQL client (requires MSSQL DB-Libraries)
php3_mysql.dll (built into PHP 4) MySQL functions
php_nsmail.dll Netscape mail functions
php_oci73.dll Oracle functions
php_snmp.dll SNMP get and walk functions (NT only!)
php_zlib.dll ZLib compression functions
Web server configuration
========================
Installing PHP on Windows with Apache 1.3.x
There are two ways to set up PHP to work with Apache 1.3.x
on Windows. One is to use the CGI binary (php.exe),
the other is to use the Apache module dll. In either case
you need to stop the Apache server, and edit your
srm.conf or httpd.conf to configure Apache to work with PHP.
Although there can be a few variations of configuring PHP
under Apache, these are simple enough to be used by the
newcomer. Please consult the Apache Docs for further
configuration directives.
If you unzipped the PHP package to C:\PHP\ as desribed
above, you need to insert these lines to your Apache conf
file to set up the CGI binary:
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
Remember to restart the server, for example,
NET STOP APACHE
followed by
NET START APACHE
If you would like to use PHP as a module in Apache,
you should move php4ts.dll to the windows/system (for Windows 9x/Me)
or winnt/system32 (for Windows NT/2000) directory, overwriting any
older file. Then you should add the following two lines to you Apache
conf file:
LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php
Remember to restart the server, for example,
NET STOP APACHE
followed by
NET START APACHE
To use the source code highlighting feature, simply create a PHP
script file and stick this code in:
<?php show_source("original_php_script.php"); ?>
Substitute original_php_script.php with the name of the
file you wish to show the source of. (This is the only way of
doing so).
On Win-Apache all backslashes in a path statement such
as: "c:\directory\file.ext", must be converted to
forward slashes.
----------------------------------------------------------
Installing PHP on Windows with IIS/PWS
This section contains notes and hints specific to IIS (Microsoft
Internet Information Server). Installing PHP for PWS/IIS 3 and
PWS/IIS 4 or newer versions.
Windows and PWS/IIS 3 - including PWS on Win 9x/ME
The recommended method for configuring these servers is to use
the REG file incuded with the distribution (pws-php4cgi.reg).
You may want to edit this file and make sure the extensions and PHP
install directories match your configuration - once you have done
this, just double click on the file and it will update your registry.
Alternatively, you can follow the steps below to do it manually.
WARNING:
These steps involve working directly with the Windows
registry. One error here can leave your system in an unstable
state. We highly recommend that you back up your registry
first. The PHP Development team will not be held responsible if
you damage your registry.
Run Regedit.
Navigate to:
HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/W3Svc/Parameters/ScriptMap
On the edit menu select: New->String Value.
Type in the extension you wish to use for your php scripts. ex: .php
Double click on the new string value and enter the path to
php.exe in the value data field.
ex: c:\php\php.exe
Repeat these steps for each extension you wish to associate
with PHP scripts.
The following steps do not affect the web server installation and only
apply if you want your php scripts to be executed when they are run
from the command line (ex. run c:\myscripts\test.php) or by double
clicking on them in a directory viewer window. You may wish to skip
this step as you might prefer the php files to load into a text
editor when you double click on them.
Now navigate to: HKEY_CLASSES_ROOT
On the edit menu select: New->Key
Name the key to the extension you setup in the previous
section. ex: .php
Highlight the new key and in the right side pane, double click
the "default value" and enter phpfile.
Repeat the last step for each extension you set up in the
previous section.
Now create another New->Key under
HKEY_CLASSES_ROOT and name it phpfile
Highlight the new key 'phpfile' and in the
right side pane, double click the "default value" and enter
PHP Script.
Right click on the 'phpfile' key and select
New->Key, name it Shell.
Right click on the 'Shell' key and select
New->Key, name it open.
Right click on the 'open' key and select
New->Key, name it command.
Highlight the new key 'command' and in the
right side pane, double click the "default value" and enter
the path to php.exe ex: c:\php\php.exe -q %1
(don't forget the '%1').
Exit Regedit.
If using PWS on Windows, reboot to reload the registry.
PWS and IIS 3 users now have a fully operational system. IIS 3
users can use a nifty tool available at
http://www.genusa.com/iis/iiscfg.html
from Steven Genusa to configure their script maps.
Windows NT/2000 and IIS 4 or newer and PWS 4 on NT Workstation or W2K non server
editions
To install PHP on an NT/2000 Server running IIS 4 or newer,
follow these instructions. You have two options to set up
PHP, using the CGI binary (php.exe) or with the ISAPI module.
In either case, you need to start the Microsoft Management
Console (may appear as 'Internet Services Manager', either
in your Windows NT 4.0 Option Pack branch or the Control
Panel=>Administrative Tools under Windows 2000). Then
right click on your Web server node (this will most probably
appear as 'Default Web Server'), and select 'Properties'.
If you want to use the CGI binary, do the following:
Under 'Home Directory', 'Virtual Directory', or
'Directory', click on the 'Configuration' button,
and then enter the App Mappings tab.
Click Add, and in the Executable box, type:
c:\php\php.exe (assuming that you have unzipped PHP in c:\php\).
In the Extension box, type the file name extension you want
associated with PHP scripts. Leave 'Method exclusions'
blank, and check the Script engine checkbox. You may also
like to check the 'check that file exists' box - for a small
performance penalty, IIS (or PWS) will check that the script
file exists and sort out authentication before firing up php.
This means that you will get sensible 404 style error messages
instead of cgi errors complaing that php did not output any data.
You must repeat from 'Click Add...' for each extension you
want associated with PHP scripts.
(.php is recommended. although .phtml and .php3 may be
required for legacy applications.)
Set up the appropriate security. (This is done in Internet
Service Manager), and if your NT Server uses NTFS file system,
add execute rights for I_USR_ to the directory that contains
php.exe
To use the ISAPI module, do the following:
If you don't want to perform HTTP Authentication using PHP,
you can (and should) skip this step. Under ISAPI Filters,
add a new ISAPI filter. Use PHP as the filter name, and
supply a path to the php4isapi.dll.
Under 'Home Directory', click on the 'Configuration' button.
Add a new entry to the Application Mappings. Use the path
to the php4isapi.dll as the Executable, supply .php as the
extension, leave Method exclusions blank, and check the
Script engine checkbox.
Stop IIS completely (net stop iisadmin)
Start IIS again (net start w3svc)
----------------------------------------------------------
Installing PHP on Windows with OmniHTTPd Server
This section contains notes and hints specific to
OmniHTTPd 2.0b1 and up for Windows
This has got to be the easiest config there is:
Step 1: Install OmniHTTPd server.
Step 2: Right click on the blue OmniHTTPd icon in the system
tray and select 'Properties'
Step 3: Click on 'Web Server Global Settings'
Step 4: On the 'External' tab, enter:
virtual = .php | actual = c:\path-to-php-dir\php.exe
and use the Add button.
Step 5: On the Mime tab, enter:
virtual = wwwserver/stdcgi | actual = .php
and use the Add button.
Step 6: Click 'OK'
Repeat steps 2 - 6 for each extension you want to associate with PHP.
NOTE:
Some OmniHTTPd packages come with built in PHP support.
You can choose at setup time to do a custom setup, and
uncheck the PHP component. We recommend you to use the latest
PHP binaries. Some OmniHTTPd servers come with PHP 4 beta
distributions, so you should choose not to set up
the built in support, but install your own. If the server
is already on your machine, use the Replace button in Step
4 and 5 to set the new, correct information.
----------------------------------------------------------
Installing PHP on Windows with Oreilly Website Pro
This section contains notes and hints specific to Oreilly
Website Pro 2.5 and up for Windows
This list describes how to set up the PHP CGI binary
or the ISAPI module to work with Oreilly Website Pro
on Windows.
Edit the Server Properties and select the tab "Mapping".
From the List select "Associations" and enter the desired
extension (".php") and the path to the CGI exe (ex. c:\php\php.exe)
or the ISAPI dll file (ex. c:\php\sapi\php4isapi.dll).
Select "Content Types" add the same extension ".php"
and enter the content type. If you choose the CGI exe
file, enter 'wwwserver/shellcgi', if you chose the
ISAPI module, enter 'wwwserver/isapi' (both without quotes).
----------------------------------------------------------
Installing PHP on Windows with Xitami
This section contains notes and hints specific to Xitami.
This list describes how to set up the PHP CGI binary
to work with Xitami on Windows.
Make sure the webserver is running, and point
your browser to xitamis admin console
(usually http://127.0.0.1/admin), and click on
Configuration.
Navigate to the Filters, and put the
extension which php should parse (i.e. .php)
into the field File extensions (.xxx).
In Filter command or script put the path and name
of your php executable i.e. c:\php\php.exe.
Press the 'Save' icon.
----------------------------------------------------------
Installing PHP on Windows with Netscape servers.
To Install PHP as CGI (for Netscape Enterprise Server, iPlanet, perhaps Fastrack)
Copy php4ts.dll to your systemroot (the directory where you installed windows)
Make a file assocition from the command line (type the 2 following lines)
assoc .php=PHPScript
ftype PHPScript=c:\php\php.exe %1 %*
In the Netscape Enterprise Administration Server create a dummy shellcgi
directory and remove it just after (this step creates 5 important lines in
obj.conf and allow the web server to handle shellcgi scripts)
In the Netscape Enterprise Administration Server create a new mime type
(Category:type,Content-Type:magnus-internal/shellcgi,File Suffix:php)
Do it for each web server instance you want php to run
More details http://benoit.noss.free.fr/php/install-php.html
To Install PHP as NSAPI (for Netscape Enterprise Server, iPlanet, perhaps Fastrack)
Copy php4ts.dll to your systemroot (the directory where you installed windows)
Make a file assocition from the command line (type the 2 following lines)
assoc .php=PHPScript
ftype PHPScript=c:\php\php.exe %1 %*
In the Netscape Enterprise Administration Server create a new mime type
(Category:type,Content-Type:magnus-internal/x-httpd-php,File Suffix:php)
Stop your web service and edit obj.conf
At the end of the Init section, place these 2 lines (necessarily after mime type
init!)
Init fn="load-modules" funcs="php4_init,php4_close,php4_execute,php4_auth_trans"
shlib="c:/php/sapi/php4nsapi.dll"
Init fn="php4_init" errorString="Failed to initialise PHP!"
In The < Object name="default" > section, place this line necessarily after all
'ObjectType' and before all 'AddLog' lines!
Service fn="php4_execute" type="magnus-internal/x-httpd-php"
At the end of the file, create a new object called x-httpd-php, by inserting this
lines
<Object name="x-httpd-php">
ObjectType fn="force-type" type="magnus-internal/x-httpd-php"
Service fn=php4_execute
</Object>
Restart your web service and apply changes
Do it for each web server instance you want php to run
More details http://benoit.noss.free.fr/php/install-php4.html
----------------------------------------------------------
Problems?
=========
Read the FAQ
Some problems are more common than others. The most common ones
are listed in the PHP FAQ, found at www.php.net/FAQ.php
Common problems with Windows
The following problems often occur with IIS/PWS, but some points may
also apply to other servers.
For test purposes it is best to use just a simple test script. One
containing just the following line will suffice:
<?php phpinfo();?>
You have installed PHP, but when try to access a php script file via your
browser, you get a blank screen:
Do a 'view source' in the web browser and you will probably find that you
can see the source code of your php script. This means that the web server
did not send the script to php for interpretation. Something is wrong with
the server configuration - double check the server configuration against
the php installation instructions.
You have installed PHP, but when try to access a php script file via your
browser, you get a server 500 error:
Something went wrong when the server tried to run PHP. To get to see a
sensible error message, from the command line, change to the directory
containing php.exe and run <literal>php.exe -i</literal>
If php has any problems running, then a suitable error message will be displayed
which will give you a clue as to what needs to be done next.
If you get a screen full of html codes (the output of the phpinfo() function) then
php is working ok, and your problem may be related to your server configuration
which you should double check.
You have installed PHP, but when try to access a php script file via your
browser, you get the error:
cgi error:
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
This error message means that php failed to output anything at all.
From the command line hange to the directory containing php.exe. Run
php.exe -i
If php has any problems running, then a suitable
error message will be displayed which will give you a clue as to what needs to
be done next. If you get a screen full of html codes (the output of the
phpinfo() function) then php is working ok.
Once php is working at the command line, try accessing the php script via the
browser again.
If it still fails then it could be one of the following:
file permissions on your php script, php.exe, php4ts.dll, php.ini or any php
extensions you are trying to load are such that the anonymous internet user
ISUR_<machinename> cannot access them.
The script file does not exist (or possibly isn't where you think it is
relative to your web root directory). Note that for IIS you can trap this error by
ticking
the 'check file exists' box when setting up the script mappings in the Internet
Services
Manager. If a script file does not exist then the server will return a 404 error
instead.
There is also the additional benefit that IIS will do any authentication required
for you
based on the NTLanMan permissions on your script file.
Other problems
If you are still stuck, someone on the PHP installation mailing list may be
able to help you. You should check out the archive first, in case
someone already answered someone else who had the same problem as
you. The archives are available from the support page on www.php.net
To subscribe to the PHP installation
mailing list, send an empty mail to
[EMAIL PROTECTED]
The mailing list address is
[EMAIL PROTECTED]
If you want to get help on the mailing list, please try to be
precise and give the necessary details about your environment
(which operating system, what PHP version, what web server, if
ou are running PHP as CGI or a server module, etc.), and
referably enough code to make others able to reproduce and test
our problem.
Bug reports
===========
If you think you have found a bug in PHP, please report it. The
PHP developers probably don't know about it, and unless you
report it, chances are it won't be fixed. You can report bugs
using the bug-tracking system at
http://bugs.php.net/
Read the Bugs-Dos-And-Donts at
http://bugs.php.net/bugs-dos-and-donts.php
before submitting any bug reports!
--- End Message ---
--- Begin Message ---
A decent RDBMS should provide the developer with a query analyser which
displays how the query will be compiled and give an estimate of execution
time in each part so you can investigate where most of the power is drained.
By the way, your question is rather not that much about php. (Not that I
uses php and care that much... :)
-----Original Message-----
From: Arnout van der Kamp
To: [EMAIL PROTECTED]
Sent: 2001-11-15 01:21
Subject: [PHP-WIN] Speed of SQL queries, profiling?
I've written some code to extract a database from SQL. I'm doing about
10
queries times 60.000 or so. It's quite slow. 8 hours in total (estimated
time left).
Now I would like to know where all of my execution time is going, so I
was
wondering if it's easy to do some profiling on esp. the SQL queries as I
think there is where my time is going. Is there some sort of
sql_query_time() routine. Or something similar? I'm quite new to SQL and
even PHP so I'm don't know where to look either.
--
Later
Arnout http://www.supras.nl
"Life is too short to drive an opel"
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
> By the way, your question is rather not that much about php. (Not that I
> uses php and care that much... :)
Well I was more thinking of some profiling routines than checking the actual
SQL queries. I've done so with 'explain' command and it seems the queries
all make use of the right index files. Still takes 20 minutes a file, doing
18 files in total.
--- End Message ---
--- Begin Message ---
Hello,
I just compiled php4apache2 filter for Win32, but the README
file says how to use it only under apache 2.0.x for UNIX. It's
clear because PHP is compiled into Apache. But...
Can somebody tell me how to load the sapi filter under
Apache 2.0.x Win32, in http.conf file? I can't find any docs
about it.
I currently have Apache 2.0.28-beta and the latest PHP CVS files
for apache2filter.
Thank you !
___________________________________
Francisco Javier Ortiz Torre
ComuNET,S.A.
mailto:[EMAIL PROTECTED]
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--------- Fin de mensaje reenviado --------
___________________________________
Francisco Javier Ortiz Torre
ComuNET,S.A.
mailto:[EMAIL PROTECTED]
ComuNET, S.A
Gral. Concha 39,6º
48012 Bilbao España
Tel: +34 944 700 101
Fax: +34 944 700 185
http://www.comunet.es
___________________________________
--- End Message ---
--- Begin Message ---
Using 98SE / PWS / PHP 4.0.4pl1 / MySQL 3.23.22 for some
testing-intranet stuff.
Until now i have used a login system (which works) that consist of a
login page, include file and logout file - named Login.php, Auth.inc and
Logout.php. Database.inc, which is referenced and contain the login and
pwd for the database is left out as it doesn't contain anything
critical. Auth.inc includes a function that is used in Login.php to
verify the login data. Login.php calls itself until the login is
successful - then the user gets presented with a link back to where he
came from.
Clarification:
The issue here is not the PHP installation or PHP.INI settings - this is
a code problem.
If you *do* belive it is - Prove me wrong.
In the code supplied, the 'GO BACK' links does not work. This because i
have tried about 1000 different ways to solve the current problem
without luck. This is just a 'cleaned' version of the current files.
When it worked i had a hardcoded URL link back to the (only) calling
page.
Now i have to modify this login system so that i can call Login / Logout
from any other page and be able to link back to the correct page.
It seems like *IF* i use a
<a href="login.php?refpage=<?PHP echo "http://" . "$SERVER_NAME" .
"$PHP_SELF"; ?>">Login with ref</a>
in the link to Login.php, and the first thing i do in Login.php is to
store away $HTTP_SERVER_VARS['HTTP_REFERER'] in a variable, this get
lost as soon as the SESSION_START gets executed in Auth.inc. I have
verified that the HTTP_REFERER really exist as i store it.
I have successfully tested some simple login / logout pages which don't
contain the Auth stuff - and those work with the above approach.
Any suggestions on how i can solve this?
A complete rewrite is not out of the question.
I want to keep session functions and be able to keep a reference back to
the page which called Login / Logout.
- sorry if the code incorporates some 'Swenglish' and unneccesary stuff
;-)
********* AUTH.INC ************************
<?PHP
Function auth(
$login ='',
$pwd = '',
$pwd_file = 'pwd.txt'
){
session_start();
global $PHP_SELF, $authdata;
include ("databas.inc");
$check = ! empty( $login );
if ( is_array ( $authdata )) {
return true;
} elseif ( $check ) {
mysql_connect($DBserver, $DBlogin, $DBpwd);
mysql_select_db($DBnamn);
$result = mysql_query("SELECT anvandare.login, anvandare.pwd,
anvandare.id, anvandare.namn, anvandare.efternamn, anvandare.sign FROM
anvandare");
if ($row = mysql_fetch_array($result)) {
do {
if (( $row[0] == $login) && (($row[1] == $pwd) OR
($row[1] == NULL) )){
$authdata = array ("a_login" => $login,
"a_id" => $row[2],
"a_namn" => $row[3],
"a_efternamn" => $row[4],
"a_sign" => $row[5]);
session_register ( 'authdata' );
return true;
}
} while($row = mysql_fetch_array($result));
} else {
unset( $authdata );
return false;
}
} else {
return false;
}
}
********* END AUTH.INC **********************
********* LOGIN.PHP ************************
<?php
include ('auth.inc');
Function loginform( $error = false ) {
?>
<HTML>
<HEAD><TITLE>Login page</TITLE></HEAD>
<BODY>
<?PHP if ( $error) { ?>
Error - Please re-enter your Username and Password:
<?PHP } else {?>
Please enter Username and Password:
<?PHP } ?>
<FORM ACTION="<?PHP echo $PHP_SELF; ?>" METHOD=POST>
Login: <INPUT TYPE="text" NAME="login"><BR>
Pwd: <INPUT TYPE="password" NAME="pwd"><BR>
<BR>
<INPUT TYPE="submit" VALUE="LOG IN">
</FORM>
</BODY>
</HTML>
<?PHP }
if ( !auth ( $HTTP_POST_VARS['login'], $HTTP_POST_VARS['pwd'] )) {
loginform ( isset ( $HTTP_POST_VARS['login'] ));
}
if (auth())
{
echo "<center>You are now registered as $authdata[a_namn]
$authdata[a_efternamn] on the intranet <br><a href=\"$refpage\">Go
back</a></center>";
}
?>
********* END LOGIN.PHP **********************
********* LOGOUT.PHP ************************
<?php
session_start();
session_destroy();
?>
<center>
Du har nu loggat ut ifrån INTRANÄTET.
<BR>
<a href="<?PHP echo "$refpage"; ?>">Go back</a>
</center>
********* END LOGOUT.PHP **********************
--- End Message ---
--- Begin Message ---
Hi
Does anyone know how to compile a php extension in windows.. in linux it
is simple.. just to install php source and compile the extension. it
doesn´t work in windows.
Thanks in advanced.
--- End Message ---
--- Begin Message ---
I have a problem:I have a php page wich runs well when I run it, but when I
run a html page and links the php file, the source code is seen on the
screen. It´s like apache wouldn't understand php!!. Any ideas? Thanks
Hola!.tengo un problema y es que tengo una página .php que, cuando la llamo
por separado, funciona de maravilla, pero cuando la enlazo desde un .htm,
aparece el código a pelo, es decir, no reconoce el php. ¿¿Podeis
ayudarme??.¡¡Es muy urgente
--- End Message ---
--- Begin Message ---
You cannot run php from an html page unless you do a serverside cgi include... An
HTML page is just that..and will not excute php code unless you map it to. only files
mapped to php will run in php.
Angie Tollerson
Alliance Technologies
Web Programmer
(515)245-7628
[EMAIL PROTECTED]
>>> "Alejandro" <[EMAIL PROTECTED]> 11/15/01 11:53AM >>>
I have a problem:I have a php page wich runs well when I run it, but when I
run a html page and links the php file, the source code is seen on the
screen. It s like apache wouldn't understand php!!. Any ideas? Thanks
Hola!.tengo un problema y es que tengo una página .php que, cuando la llamo
por separado, funciona de maravilla, pero cuando la enlazo desde un .htm,
aparece el código a pelo, es decir, no reconoce el php. ¿¿Podeis
ayudarme??.¡¡Es muy urgente
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi
I wonder if anyone have managed to compile PHP with cygwin. I get
several errors when doing this.
I also wonder if I intend to make a dll to extend PHP for windows,
should I then compile PHP with cygwin or with MS Visual C++?
Thanks
--- End Message ---
--- Begin Message ---
Hi,
Only MS VC++ is supported at this point.
- Frank
> Hi
>
> I wonder if anyone have managed to compile PHP with cygwin. I get
> several errors when doing this.
>
> I also wonder if I intend to make a dll to extend PHP for windows,
> should I then compile PHP with cygwin or with MS Visual C++?
>
> Thanks
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
--- End Message ---
--- Begin Message ---
Hi,
i'm trying to switch to a "register_globals = Off" model to improve the
security of my site.
The problem is that when using this parameter, i can't logon anymore. The
following script always ask for my user name and password. it seems that
$PHP_AUTH_USER is not set.
What is the way to go around this if i use this option ?
thanks
Stephane Vinsot
PS: Authentication code
<?php
if(!isset($PHP_AUTH_USER)) {
Header("WWW-Authenticate: Basic realm=\"my realm\"");
Header("HTTP/1.0 401 Unauthorized");
echo "Acces denied\n";
exit;
} else {
echo "Hello $PHP_AUTH_USER.<P>";
echo "You entered the password $PHP_AUTH_PW.<P>";
}
?>
--- End Message ---
--- Begin Message ---
It is almost as simple on Win32.
You need to have MS Visual C++ installed to do it. Have a look at some of the existing
extensions, all compiled as php_<ext>.dll.
if you take a look at one of the simple extensions eg. exif. It has three files used
on Win32 exif.c, php_exif.h and exif.dsp. If yor extension is like this, just copy the
dsp file, and replace all references to exif to your extension name. Make sure to
maitain the same case though.
- Frank
> Hi
>
> Does anyone know how to compile a php extension in windows.. in linux it
> is simple.. just to install php source and compile the extension. it
> doesn´t work in windows.
>
> Thanks in advanced.
>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
--- End Message ---
--- Begin Message ---
At this point you have to read the source file. If you read the comments you can find
all the prototypes for the functions.
In order to compile the extension you need to have the Notes Toolkit installed on yor
system.
- Frank
> Hi,
>
> Any suggestions where I might find out about the Notes PHP extension??? I
> been looking for ages, and as far as I can see its almost developed but
> nobody seems to know much more about it.
>
> Where can I get hold of it???
>
> Richy
>
> -----Original Message-----
> From: Frank M. Kromann [SMTP:[EMAIL PROTECTED]]
> Sent: 13 November 2001 23:10
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]; Kevin
> Subject: Re: RE: [PHP-WIN] PHP and Lotus Notes
>
> Hi,
>
> LDAP is one way and it requires that LDAP is enabled on the Notes server.
> There is also a notes extension for php where you can read and write to all
> notes bases.
> There is no documentation on this extension at this point.
>
> - Frank
>
> > > Is there a way to have a PHP script display a Lotus Notes
> > > database such as the address book?
> >
> > I think (but I could be wrong on this) that you can use LDAP functions
> > to access a Lotus Notes address book. For more information try searching
> > for 'ldap' on http://php.net.
> >
> > For example, to search for people called 'Smith' on server
> > 'lotus1.domain.com', return their full name and mail and dump the
> > results to the page so you can see what you got:
> > <?php
> > $connection = ldap_connect('lotus1.domain.com');
> > $bind = ldap_bind($connection);
> > $search = ldap_search($ldap, '', 'cn=*smith*', array('cn', 'mail'));
> > $results_array = ldap_get_entries($connection, $search);
> > ldap_close($connection);
> > echo '<pre>';
> > print_r($results_array);
> > echo '</pre>';
> > ?>
> >
> > HTH,
> > D.
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--- End Message ---
--- Begin Message ---
why can´t I run exec("dir"); ?
The thing I wanna do is list a directory and put all the
dirnames/filenames into a .txt file but first I have to figure out how I
can make a dir, or is there a built in command in PHP to do this ?
/Dan
--- End Message ---
--- Begin Message ---
> why can´t I run exec("dir"); ?
What you want is:
exec( "dir", $dirContents );
foreach( $dirEntry as $dirContents ) {
echo $dirEntry;
}
I believe that'll work and do what you want...
Chris
--- End Message ---
--- Begin Message ---
Shouldn´t it be: foreach( $dirContents as $dirEntry ) ?
And another problem: I still get an error saying: "unable to fork [dir]"
when I run this (I got that when I ran exec("dir") too)
/Dan
Chris Boget wrote:
> > why can´t I run exec("dir"); ?
>
> What you want is:
>
> exec( "dir", $dirContents );
> foreach( $dirEntry as $dirContents ) {
> echo $dirEntry;
>
> }
>
> I believe that'll work and do what you want...
>
> Chris
--- End Message ---
--- Begin Message ---
My name is Linda Gillie. I am 31 years old. A mother of three,
a wife of 13 years to a wonderful man, Michael My heart told
me to share my story with you, so you don't give up hope.
I have found a weight loss product that really works. It gets
rid of fat fast and keeps it off, FOR GOOD!
The youngest of 6 children, with both sides of my family
prone to be he= avy, I have battled being overweight since
I was a kid. I've been on ;just about every diet program, pill,
liquid, & anything else you can think of.
It was a never-ending cycle. Up, down, up, down, up. My
weight loss and gain was a literal "yo-yo!"
Nothing I did worked permanently! I had always gained
back more than I would lose every time I got tired of a
particular diet.
I was disgusted with my looks, mentally and physically
depressed. I just about gave up hope forever of losing
my excess pounds, until I was introduced to an all-natural
weight loss product, which has changed my life in every way!
My dearest friend and her husband have lost a lot of weight
on a product called "Weigh Out". So, I decided to try it.
In the first month I dropped from size 24 to 18 in 10 months
I lost 78 pounds and 10 dress sizes and '85 I have kept it off
for more than a year.
I feel like a "new person" and everyone around me cannot
believe the difference! I have a lot more energy and I just feel
all around good. This is the easiest program I've ever been
on. You just follow the instructions and the pounds and
inches just fall off! No more up and down." Weigh Out "has
changed all that. Now it's down,down, down, and away!
All of my old belts were in the first hole. You can imagine
how excited I was when I used the last hole, and then had to
buy a couple of new ones. It's the most incredible feeling!
This is the first time in my life i have ever lost weight and
KEPT it off.
I am still losing a pound or two every week or so and that is
fine with me My husband has lost 3 pant sizes during the same
time and gets into clothes he had not worn in years! (He
looks great in his "tight fitting' jeans!) I know people that
have lost over 80 lbs with "Weigh Out". There are literally
thousands of people like you and me who have WON the
"battle of the bulge" because of "Weigh Out"!
Thank God for "Weigh Out" and David & Edie for helping me
find it. I have the BEST life now! I thank my family for being
so supportive.
I do hope you will check this out. I NOW have "no fear" of
EVER being overweight again.
It doesn't matter how much weight you have to lose; 20, 40,
/83
100, or 200 + lbs pounds. this will change your life forever.
I encourage you to try it for 30-days. I promise you'll be
calling for more soon after!
Click on the link below to see the details:
http://weighout.yeah.net
Thank you, for allowing me the opportunity to tell my story.
Good Life and God Bless
Linda Gillie
--- End Message ---
--- Begin Message ---
Hi,
I installed php on my win2k machine running IIS 5, i've set it up as the
install.txt file says, and i cant use any php scripts that use variables,
such as $HTTP_USER_AGENT, but can use commands such as echo, can anyone
help? and tell me how to set up php with iis using isapi so that it will
work.
Thanks,
Martin.
--- End Message ---
--- Begin Message ---
Have a look through the mailing list archives (php-dev) - somebody has
done this.
GRI wrote:
>Hi
>
>I wonder if anyone have managed to compile PHP with cygwin. I get
>several errors when doing this.
>
>I also wonder if I intend to make a dll to extend PHP for windows,
>should I then compile PHP with cygwin or with MS Visual C++?
>
>Thanks
>
>
>
>
--- End Message ---