[PHP] Re: Call to undefined function problem

2001-09-10 Thread Doug Farmer

Further information:

The page is navigated to via a previous page using a Location: /test.php
header.   The problem occurs when I first navigate to the page.  If I then
do a refresh from the browser, the problem disappears.

I also did further testing where I put the following type of code between
the requires (a unique number for each statement):

if (function_exists(setNoCacheHeaders))
{
   echo exists 1br;
}
else
{
   echo does not exist 1br;
}

In the broken scenario, the function never exists.  In the working scenario
it is
always there.

I also neglected to say that I was switching from php3.0.14 to php4.0.6.


Doug Farmer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 I'm doing the following:

  test.php -
 ?php
 require(functions.php);
 require();  // several other requires here

 setNoCacheHeaders();   // this is line 16

 // other stuff here
 ?

 -- functions.php -
 ?php

 if (!define(__FUNCTIONS__) )
 {
 define( __FUNCTIONS__, 1, 1 );

 // a bunch of other defines here
 echo here 1br;
 function setNoCacheHeaders( ) {
 static $headersNotSet = TRUE;

 if ( $headersNotSet ) {
 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);// Date in
the
 past
 header(Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT); //
 always modified
 header(Cache-Control: no-cache, must-revalidate);  // HTTP/1.1
 header(Pragma: no-cache);  // HTTP/1.0
 $headersNotSet = FALSE;
 }
 }
 echo here 2br;

 // a few more functions here

 }

 

 My output is
 here 1
 here 2

 Fatal error: Call to undefined function: setnocacheheaders() in
 $DOCUMENT_ROOT/test.php on line 16

 Can someone explain?  I found something similar in the archives but no
 answer was given.  This exact code worked under php3.  The only changes in
 the files were files ending in php3 were changed to end php.  I also had 2
 classes that I was using that had initializers in the variable
declaration.
 I moved the initialization to constructors.

 Note that on some clients the request goes through w/o errors.  This is
 intermittent but consistent on a per client basis.

 - doug







-- 
PHP General 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]




Re: [PHP] How to pass variables to php functions from url's?

2001-09-07 Thread Doug Granzow

   Let's assume we have a server called www.test.com
   When a user access http://www.test.com/path/username,
   I want a php script to execute, as if the url entered was
   http://www.test.com/path.php?value=username.
  
   I'm running PHP 4.0.6 on Apache 1.3.20.

Step 1:  Rename path.php to path

Step 2:  Add this to your Apache conf file:

Location /path
ForceType application/x-httpd-php
/Location

This causes path to be executed as a PHP script even though it does not
have a .php extension.

Step 3:  Add this to your path php script:

// $PATH_INFO = the rest of the URI after dmb/

// remove anything other than letters, numbers, dots, underscores,
// and dashes, and put into an array

// for example trading/toptraders will be an array consisting
// of trading ($args[1]) and toptraders ($args[2]).  The / is
discarded.

ereg((^[-_.\/a-zA-Z0-9]*$), $PATH_INFO, $arg);
$args = split( /, $arg[1]);


Hope this helps.

Doug Granzow
[EMAIL PROTECTED]



-- 
PHP General 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] Re: Problems with Sessions?

2001-09-07 Thread Doug Granzow

On the first page of a session, PHP attempts to set a PHPSESSID cookie.  It
won't get that cookie back until you reload the page or load another page,
so it has no way of knowing on the first page whether or not the browser
accepted the cookie.  So, it adds the PHPSESSID string to all of your local
links in order to maintain the session.  When you load another page during
the same session and your browser sends the cookie back, PHP sees that
cookies are working, so it no longer modifies your links.

If you want to disable this behavior, you can add this line to your php.ini
file:

session.use_trans_sid = 0

This will cause sessions to not work on browsers where cookies are disabled.

Doug Granzow
[EMAIL PROTECTED]

Tim [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 When I first browse to a site on my LAN, I get links with URLs that look
 like this:

 chat/?PHPSESSID=f3d149f79f5196bd709fb3c256dbb3d8

 after a refresh, the whoe PHPSESSID goes away.

 Wondered if there was some setting in php.ini that I've overlooked?

 I'm running PHP4 with Apache on an Unstable Debian box.

 Any help would be appreciated :-)





-- 
PHP General 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] Re: mysql timestamp field

2001-09-07 Thread Doug Granzow

The timestamp data type is a special MySQL type that automatically updates
whenever you add or update a row in a table.

If you want timestamp to work when you add a row but not when you update a
row, you need to write your update statements like this:

UPDATE tbl_name SET vartochange=newvalue, t_stamp=t_stamp WHERE ...

The t_stamp=t_stamp will cause t_stamp to not change to now().

Doug Granzow
[EMAIL PROTECTED]



Mesut Tunga [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all,

 I need an update on my table. but I have a timestamp field called
 t_stamp. When I update a field other than t_stamp field, t_stamp field
 also updates to now(). I need it not to update and saves its value.

 How should I do this?

 Regards
 Mesut Tunga...




-- 
PHP General 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] Re: mysql_fetch_array

2001-09-07 Thread Doug Granzow


[EMAIL PROTECTED] wrote in message
001001c136af$7c649db0$[EMAIL PROTECTED]">news:001001c136af$7c649db0$[EMAIL PROTECTED]...
Can someone tell me what i'm doing wrong here?

while($myrowmysql_fetch_array($result2))


I would guess that you actually want that line to read:

while($myrow=mysql_fetch_array($result2))


Doug Granzow
[EMAIL PROTECTED]



-- 
PHP General 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] Re: code troble

2001-09-07 Thread Doug Granzow

You don't have a closing } for function obrada().

When the line number of the parse error is the last line of the file, I've
found it is almost *always* due to a missing brace, paren, or quote
somewhere in the file.

Doug Granzow
[EMAIL PROTECTED]

Nikola Veber [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi
 I'm having trobles with this code. Can you take a look at it?
 Parse error:  parse error in C:/XITAMI/webpages/index.php on line 34 is
the
 error msg.

 thanx

 html
 head
 titleExample 2.01/title
 meta http-equiv=Content-Type content=text/html;
 charset=iso-8859-1
 /head
 body
 ?php
 if (emty(provera)) {pokazi();}
 else {obrada();}
 ?
 ?php
 function pokazi() {
 global $PHP_SELF;
 ?
 form target = ?php echo $PHP_SELF ?; METHOD = get
 input type = text name = ime
 input type = text name = vrednost
 input type =hidden name = provera value = rezultati
 /form
 ?php
 }
 ?
 ?php
 function obrada() {
 global $ime;
 global $vrednost;
 if ($ime == Nikola  $vrednost == 100){
 echo Zdravo $ime br;
 echo Iznos na Vasem racunu je $vrednost dolara;
 }
 ?
 /body
 /html





-- 
PHP General 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] Re: network connections

2001-09-07 Thread Doug Granzow

If you're talking over a million messages, I think you need a solution that
is designed specifically for handling mail. I would suggest looking into
qmail (www.qmail.org) to replace sendmail on the server in question.  qmail
is much more efficient than sendmail in handling large amounts of mail, and
it won't drag your server down.

I think it's possible that some of your smtp connections are hanging for
some reason or another, and PHP is not timing them out.  10,000 connections
out of 1 million emails means about 1% of your connections are failing in
some way -- not surprising when talking smtp.

If you're talking smtp directly to remote mail server, how are you handling
retries, failed mail, etc.?  Again, I would suggest qmail since it would
take care of all of that for you, instead of you having to reinvent the
wheel.  I have a script which sends out about 30,000 emails once a month,
through qmail, and it is set up so that qmail automatically routes any
bounces back to another script where I can update my database to reflect
which users' mail is bouncing.

Doug Granzow
[EMAIL PROTECTED]

J.R. Lillard [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 i've got a command-line php script that i've been using to deliver large
 amounts of e-mail.  originally it relied on mail() to deliver the
 messages but i could easily overload sendmail and bring the box (redhat
 7.1) to a crawl.  so i am now using the various network functions to
 speak smtp directly from the script.  i seem to be having a problem with
 an excessive number of tcp connections that eventually brings down the
 machine.

 i have attempted a semi-multi-threaded approach by spawning off
 additional copies of the script to deliver more mail simultaneously.  so
 i might have 100 copies of the script running at the same time.  and
 this was after dumping a million messages into my mysql-based mail
 queue.  things may run okay for a few hours...maybe even a day...but
 then doing a netstat shows over 10k tcp connections.  and the only way
 i've found to fix the problem is to reboot the machine.

 thinking that i was attempting too many connections at the same time, i
 throttled down the number of threads to 25.  this slowed down my mail
 delivery of course.  and it allowed the machine to stay up longer.  but
 i eventually ran into the same problem after maybe two or three weeks.
 just before it died, i was showing over 30k tcp connections.

 are they any known issues in the php networking code that would cause
 this to happen?  as far as i know, i should never have more than 25 tcp
 connections open.  but i'm not sure if they are not being closed
 properly or what.

 --
 -jr




-- 
PHP General 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] Re: execute a script on access to a directory

2001-09-07 Thread Doug Granzow

You can make go the name of your PHP script, then put this in your Apache
config:

Location /go
ForceType application/x-httpd-php
/Location

Now in your go script, you have it do whatever you wanted it to do, then
use an include to load the getit script.

Here's an except from my equivalent of your 'go' script:

// $PATH_INFO = the rest of the URI after dmb/
// (in http://www.minarets.net/dmb/trading/toptraders;)

// remove anything other than letters, numbers, dots, underscores,
// and dashes, and put into an array

// for example trading/toptraders will be an array consisting
// of trading ($args[1]) and toptraders ($args[2]).  The / is
discarded.

ereg((^[-_.\/a-zA-Z0-9]*$), $PATH_INFO, $arg);

$args = split( /, $arg[1]);
$file = include/ . $args[1] . .inc;
if (file_exists($file)) {
  include $file;
} else {
  ?
  404 not found
  ?
}

Note the line that sets the value of $file.  In this case, your 'getit'
script is in the include directory, not the go directory.  (You can't
have a directory named 'go' since you now have a script named 'go'.)

Doug Granzow
[EMAIL PROTECTED]


Enrique Vadillo [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I would like to know how i can force a PHP script to be
 executed everytime a certain directory is accessed, for
 example in http://domain.com/go/getit the presence of the
 /go/ directory would force a PHP script to be executed
 prior to any operation.

 Do i need to play with rewriting urls in Apache or is
 there any other cleaner method (that would not require
 rewriting URLs) to achieve this? i'd hate to have to
 rewrite URLs...

 thanks.

 Enrique-


 _
 Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp




-- 
PHP General 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] a good PHP editor

2001-07-18 Thread doug

Hiya everybody,
I'm relatively new to PHP and I'm looking for a good text editor on
win2k for creating/manipulating php pages. Notepad is great if your in a
bind, and I've tried phpedit and activestate's Komodo and both seem to have
problems (crashing etc...). Anybody got any suggestions? Free/small fee
programs doesn't matter Thanks

Doug Henry


-- 
PHP General 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]




Re: [PHP] a good PHP editor

2001-07-18 Thread doug

Ok I downloaded and looked at a few and the winner seems to be
edit+.Thanks everybody!

Doug Henry

- Original Message -
From: Chris Lambert - WhiteCrown Networks [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 18, 2001 1:42 PM
Subject: Re: [PHP] a good PHP editor


 Would you give the same advice if it were Zend Cache? Show some respect,
 please.

 /* Chris Lambert, CTO - [EMAIL PROTECTED]
 WhiteCrown Networks - More Than White Hats
 Web Application Security - www.whitecrown.net
 */

 - Original Message -
 From: Maxim Maletsky [EMAIL PROTECTED]
 To: 'doug' [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Wednesday, July 18, 2001 2:41 PM
 Subject: RE: [PHP] a good PHP editor


 | EditPlus (editplus.com - not free but easily crackable through a simple
 | search on astalavista.box.sk)
 | A great editor - believe me.
 |
 | -maxim
 |
 |
 | -Original Message-
 | From: doug [mailto:[EMAIL PROTECTED]]
 | Sent: Thursday, July 19, 2001 3:16 AM
 | To: [EMAIL PROTECTED]
 | Subject: [PHP] a good PHP editor
 |
 |
 | Hiya everybody,
 | I'm relatively new to PHP and I'm looking for a good text editor on
 | win2k for creating/manipulating php pages. Notepad is great if your in a
 | bind, and I've tried phpedit and activestate's Komodo and both seem to
 have
 | problems (crashing etc...). Anybody got any suggestions? Free/small fee
 | programs doesn't matter Thanks
 |
 | Doug Henry
 |
 |
 | --
 | PHP General 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 General 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 General 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 General 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]




RE: [PHP] Good Free PHP Editor?

2001-03-12 Thread Doug Brewer

As long as you are stretching the discussion to shareware, I highly
recommend UltraEdit. This is the most feature-loaded extensible text
editor I've ever seen. The $30 registration was more than worth it. It
has add-on support for syntax highlighting for 100+ languages
including PHP.

http://www.ultraedit.com

Doug

| -Original Message-
| From: Kevin Cawthorne [mailto:[EMAIL PROTECTED]]
| Sent: Monday, March 12, 2001 8:35 AM
| To: [EMAIL PROTECTED]
| Subject: Re: [PHP] Good Free PHP Editor?
|
|
| Edit Plus - every time !!!
|
| www.editplus.com
|
| I love it - syntax highlighting and great auto-indent features!
|
| Kevin
|
|
| --
| PHP General 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 General 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] recursive problem

2001-03-06 Thread Doug Brewer

Hello,

I've got a script that recurses to build a path name (it's more
complex than that). The script uses static variables to do this.

Based on certain conditions, the script might cause a redirect. I find
that when the script redirects, the value of the static variable is
not reset, and I get a doubled path.

So instead of:

$path == path/to/first/script

I get

$path == path/to/first/script/path/to/second/script

I tried resetting $path based upon the whether or not a flag variable
like $is_redirect is in existence, but all other variables seemed to
be reset when the browser redirects...which is what you'd expect,
except these static variables seem to keep their value.

any ideas?

TIA,

Doug Brewer


-- 
PHP General 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]




RE: [PHP] removing and item out of a string

2001-03-06 Thread Doug Brewer

what about

preg_replace("(\d),(\d)", "$1$2",$your_string);

to replace every occurence of a comma surrounded by digits?

This works with 4.04, prior to that the "replace" string would by
"\\1\\2".

Doug

| -Original Message-
| From: Brian C. Doyle [mailto:[EMAIL PROTECTED]]
| Sent: Tuesday, March 06, 2001 12:08 PM
| To: [EMAIL PROTECTED]
| Subject: [PHP] removing and item out of a string
|
|
| Hello all,
|
| I need to remove a comma from inside of 2 quotes ie
| "1,234.56" I need to
| change that to "1234.56"
| Unfortunatly I can not do reg_replace(",","","1,234.56");
| This is inside a csv file.
|
|
|
| Brian C. Doyle
| Coach Team Force
| Earthlink Technical Support
| [EMAIL PROTECTED]
|


-- 
PHP General 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] compile error

2001-03-05 Thread Doug Kite

I am having trouble installing php4.

When I try to compile, it stops with the following error:

In file included from /usr/src/php4/ext/standard/fsock.h:43,
 from /usr/src/php4/ext/standard/php_standard.h:43,
 from main.c:52:
/usr/include/sys/socket.h:48: conflicting types for `socklen_t'
php.h:115: previous declaration of `socklen_t'
*** Error code 1

Stop.

This is on a machine that has been recently upgraded to FreeBSD
3.0-stable.

Can anyone advise how to fix this error?

Thank you,
Doug

-- 
PHP General 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]




Re: [PHP] Going backwards with sessions.

2001-02-13 Thread Doug Budny

Basically I'm trying to get 3 session vars on a page in a sub directory, 
clientid, clientname and rnum.  I do a session_start() at the beginning of 
every page, I also do a session_id($HTTP_COOKIE_VARS['sessId']) on each 
page, with the sessid being the same.  But when I do "echo session_id()" on 
the second page after setting it and starting the session, it comes back 
blank, as thought the session was being destroyed or just not starting.

I've tried registering the variable on the second page, and it still 
doesn't work

At 2/13/2001 04:20 PM, you wrote:
mine is alot simpler and works fine, try this.

?php
 session_start();

 if (!isset($HTTP_SESSION_VARS['SessionID']))
 {
 $SessionID = mtime();
 session_register('SessionID');
 }
?


--


Chris Lee
Mediawaveonline.com

em. [EMAIL PROTECTED]

ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120


"Doug Budny" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I'm having a strange problem with sessions, it appears that they are not
  propagating to the next page.  When I run the login page the sess vars get
  registered, the session_id() get's set, and the cookie sessId get's
  set.  However when I go to the order page in a subdirectory only the
cookie
  sessId comes over correctly.  It will not set the session_id().  The only
  thing that prints as expected is the cookie var and $sessionId.
 
  I'm using 4.0.4pl1 on Redhad 6.2 apache 1.3.9 .  enable_track_vars is
  enabled and so is register_globals.  Am I doing something wrong or is
  Sessions broken in pl1?
 
  ?php
 
  // login page
 
  srand((double)microtime()*100);
  $sessionId = md5(uniqid(rand()));
  session_id($sessionId);
  session_start();
  setcookie("sessId", $sessionId);
 
  session_register('clientid');
  session_register('clientname');
  session_register('rnum');
 
  ?
 
 
  ?php
 
  // order page
 
  $sessionId = $HTTP_COOKIE_VARS['sessId'];
 
  session_id($sesssionId);
  session_start();
 
 
  //global $clientname;
  //global $clientid;
 
  echo ('brClient ID :' . $clientid);
  echo ('brRnumber   :' . $rnum);
  echo ('brSessCli Name  :' . $HTTP_SESSION_VARS['clientname']);
 
  echo ('brSession_Id() :' . session_id());
  echo ('brSession_name() :' . session_name());
  echo ('brsessId :' . $HTTP_COOKIE_VARS['sessId']);
 
  ?
 
 
  --
  PHP General 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 General 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]



Atheism is a non-prophet organization.


-- 
PHP General 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] Help w/ PHP2 install

2001-02-06 Thread Doug Taylor

Hello,

I posted a message a few days back about a compile error I was getting on a
Apache install w/ PHP2, PHP4, msql, mysql, and ssl.  I haven't had any
response, so I decided to try and simplify and isolate the problem by
eliminating PHP4, mysql, and ssl.  Basically, I've prepped PHP2 as an Apache
module with msql support (msql is already installed on my system), and now
I'm just trying to compile PHP2 into Apache, via the following commands:

[root@machine apache_1.3.14]# ./configure
--activate-module=src/modules/extra/libphp.a --enable-module=php
--prefix=/usr/local/apache

...
configuration output... blah blah blah
...

[root@machine apache_1.3.14]# make
it goes through several directories compiling successfully, then I get the
following error:
gcc -DLINUX=2 -DUSE_HSREGEX -DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED
`./apaci` \
-o httpd buildmark.o modules.o modules/standard/libstandard.a
modules/extra/libextra.a main/libmain.a
./os/unix/libos.a ap/lib ap.a regex/libregex.a lib/expat-lite/libexpat.a
-lm -lcrypt
modules/extra/libextra.a: could not read symbols: Archive has no index; run
ranlib to add one
collect2: ld returned 1 exit status
make[2]: *** [target_static] Error 1
make[2]: Leaving directory `/usr/local/source/apache_1.3.14/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/usr/local/source/apache_1.3.14'
make: *** [build] Error 2
[root@machine apache_1.3.14]#

I've searched the web and found references to this error
(modules/extra/libextra.a: could not read symbols: Archive has no index; run
ranlib to add one)... but no solution. Any assistance would be appreciated,
and yes, I have tried the obvious:
ranlib /path/to/modules/extra/libextra.a

libextra.a is an archive which contains libphp.a (which was created by the
PHP2 module compile), so I suppose it's possible that the error is actually
in libphp.a.

libextra.a is created by the command "ar cr libextra.a libphp.a" in the
apache compile.  I ran ar --help and found that the s option creates an
index, so I tried ar crs libextra.a libphp.a, but still met with the same
error when I tried running make again.

FWIW, I have ranlib version "GNU ranlib 2.9.5", and I'm running under Yellow
Dog Linux (supported on iMac hardware, which is unfortunately the only box I
can use right now)

D



[PHP] sessions without cookies

2001-02-03 Thread Doug Kite

How can you get something like:

header ("Location: $PHP_SELF?");

to redirect with the sessid in the url? In my tests, it redirects, but
does not append the sessid.

I have compiled with --enable-trans-sid. Transparent sid is working, I
can use it on links like:

A HREF="?php echo "$PHP_SELF?"; ?"

and it works. I have put this on the links on my page, so that the
session will be kept even if the user has cookies disabled. But if the
user (who has cookies disabled) clicks on the browser back button, they
go back to the first page and start a new session.

Is there a way to redirect this first page back to itself quickly, with
the sessid in the url, so that even a user with cookies disabled will
not lose the session if they use the browser back or reload buttons?

Thanks,
Doug

-- 
PHP General 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] Compile error w/ libextra.a (ranlib)

2001-02-03 Thread Doug Taylor

Hello,

I am attempting to take over development and maintenance of a very neglected
website (and with your donation of only 50 per day...).  The site contained
code which was originally thought to be some proprietary, modified version
of PHP (which really pissed me off!)... but eventually it was discovered
that this was merely the somewhat out of date and rarely seen _PHP2_ (phew,
I guess...).

So I need to get hosting support for this site up ASAP. I will need support
for both PHP2 and PHP4 (which I will be converting the code to) and both
msql and mysql (again, converting from the former to the latter).  Seeing as
how there are several hundred pages on the site, in various states of decay
and coded by various individuals, batch replacements and regular expressions
will not readily handle the conversion, thus necessitating the PHP2 and
msql.  I have one and only one server available for this site (including for
my conversion development), thus necessitating the PHP4 and mysql.

So I'm trying to compile apache w/ the following command (oh, did I mention
I'm adding SSL too?):

[root@machine apache_1.3.14]# SSL_BASE=../openssl-0.9.6
RSA_BASE=/rsaref-2.0/local ./configure --enable-module=ssl
--activate-module=src/modules/php4/libphp4.a --enable-module=php4
--activate-module=src/modules/extra/libphp.a --enable-module=php
--prefix=/usr/local/apache --enable-shared=ssl

...
configuration output... blah blah blah
...

[root@machine apache_1.3.14]# make

it goes through several directories compiling successfully, including
/modules/php4 and modules/extra (which is where PHP2 is).

Then I get the following error:

gcc -c  -I./os/unix -I./include   -DLINUX=2 -DMOD_SSL=207101
-I/usr/local/source/php-4.0.3pl1 -I/usr/local/source/php-4.0.3pl1/main
-I/usr/local/source/php-4.0.3pl1/main -I/usr/local/source/php-4.0.3pl1/Zend
-I/usr/local/source/php-4.0.3pl1/Zend -I/usr/local/source/php-4.0.3pl1/TSRM
-I/usr/local/source/php-4.0.3pl1/TSRM -I/usr/local/source/php-4.0.3pl1
-DEAPI -DUSE_EXPAT -I./lib/expat-lite `./apaci` buildmark.c
gcc  -DLINUX=2 -DMOD_SSL=207101 -I/usr/local/source/php-4.0.3pl1
-I/usr/local/source/php-4.0.3pl1/main -I/usr/local/source/php-4.0.3pl1/main
-I/usr/local/source/php-4.0.3pl1/Zend -I/usr/local/source/php-4.0.3pl1/Zend
-I/usr/local/source/php-4.0.3pl1/TSRM -I/usr/local/source/php-4.0.3pl1/TSRM
-I/usr/local/source/php-4.0.3pl1 -DEAPI -DUSE_EXPAT -I./lib/expat-lite
`./apaci`   -rdynamic \
 -o httpd buildmark.o modules.o modules/standard/libstandard.a
modules/php4/libphp4.a modules/extra/libextra.a main/libmain.a
./os/unix/libos.a ap/libap.a  lib/expat-lite/libexpat.a
-Wl,-rpath,/usr/local/Hughes/lib -Wl,-rpath,/usr/local/mysql/lib/mysql
-rdynamic -L/usr/local/Hughes/lib -L/usr/local/mysql/lib/mysql
-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4  -lpam  -
ldl -lmysqlclient -lz -lmsql -lgd -lresolv -lm -ldl -lcrypt -lnsl  -lresolv
-lm -lcrypt -ldl

modules/extra/libextra.a: could not read symbols: Archive has no index; run
ranlib to add one
collect2: ld returned 1 exit status
make[2]: *** [target_static] Error 1
make[2]: Leaving directory `/usr/local/source/apache_1.3.14/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/usr/local/source/apache_1.3.14'
make: *** [build] Error 2
[root@machine apache_1.3.14]#


Now, I've searched the archives and found references to the
"modules/extra/libextra.a: could not read symbols: Archive has no index; run
ranlib to add one" error... but no solution.  The one exception was someone
who was screwing up because they were trying to use libextra.a as part of a
PHP3 install, not a PHP2 install.  Duh.  Unfortunately that's not the case
here.

Any assistance would be appreciated, and yes, I have tried the obvious:
ranlib /path/to/modules/extra/libextra.a

FWIW, this is ranlib version "GNU ranlib 2.9.5"

Any assistance appreciated, TIA...

-- 
Doug Taylor
Lead Web Developer
Enabled Sites
331 Soquel Ave, Suite 205
Santa Cruz, CA 95062 




<    1   2