php-install Digest 11 Apr 2002 13:13:38 -0000 Issue 786

Topics (messages 6620 through 6629):

Re: php and POST
        6620 by: Matt

'php_value not allowed here' in apache log
        6621 by: Rick Watts

Re: display the file in directory
        6622 by: Browning Nathan P SrA 509 CS/SCNO

Re: apache 2 install problems?
        6623 by: Andy Smith

Despite correct setup, PHP pages returning blank screens
        6624 by: Ian Daye
        6625 by: Ian Daye

OO-PHP Style question
        6626 by: Alok K. Dhir

Undefined Symbol: ldap_parse_reference in PHP 4.1.2
        6627 by: crobinso.fit.edu

Solaris 8 + Php 4.1.2 + apache 1.3.24
        6628 by: Todd Mortensen

Problem with installing php-4.1.2
        6629 by: muxa.narvajok.pv.ee

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 ---
If you changed the php.ini to set the register_globals to on, did you also
restart apache?  I'm sure you are aware that register globals is now turned
off by default in php 4.1+. Look at phpinfo() and make sure register_globals
is *really* on.  You really ought to be writing code with $_POST[], read
http://www.php.net/manual/en/security.php to see why.

----- Original Message -----
From: "Not Telling You!" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
>  But I cannot use passed variables.  I can however print what
> was passed using...
>
> printf("%s", $HTTP_POST_VARS["name"]);
>
> That works fine, I'm just unable to just call $name.  The php code does
> work as it is currently running on a RH 7.1 box with Apache 1.3.20 and
> php 4.0.6.



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

I have an 'out of the box' install of Suse Linux 7.2 with Apache 1.3.19 and
PHP 4.0.4pl1. I'm trying to set the include path for files served from
domain_name/~user directories but get the 'Internal Server Error' when I add

php_value include_path .:/home/user/php_include

as the only line in my .htaccess file and I get 'php_value not allowed here'
in my server's error log.

In /etc/httpd/httpd.conf I have added the lines

<Directory /home/*/public_html>
    AllowOverride Options
</Directory>

but I still get the error.

I'm assuming that this is a simple configuration problem, does anyone have
any ideas?

Rick Watts



--- End Message ---
--- Begin Message ---
Here's one that I put together.  It's browseable and easy on the eyes.  It's
not the prettiest code but it works. 

<?
// I have PHP 4.1.0 which needs this
error_reporting(E_ERROR);

// path to your web root (don't put trailing slash /)
$web_path = "/inetpub/wwwroot";

// If they try to get to the root directory redirect them to $web_path
if ($path == "/"):
        $path = "";
endif;

// If the directory doesn't exist redirect them to $web_path
if (!file_exists("$web_path" . "$path")):
        $path = "";     
endif;

$dir = opendir("$web_path" . "$path");

// Print the $file_name (s)
$msg = "<table width=\"600\">
        <tr>
        <td valign=\"top\" bgcolor=\"#C6C6FF\"><B>Files in
$web_path$path</b></td></tr>
        <tr><td>&nbsp;</td></tr>
        <tr>
        <td valign=\"top\"><ul>\n";
        while ($file_name = readdir($dir)):
                // Check to see if it's a directory.
                $is_dir = is_dir("$web_path" . "$path/$file_name");
                // Skip if the file_name returned is "." or ".."
              if (($file_name != ".") && ($file_name != "..")):
                // If it's not a directory then add it to the $files
variable and assign it class=file (this class we put in the style.css)
                if ($is_dir != "1"):
                        $files .= "<li class=\"file\"><a
href=\"$path/$file_name\" target=\"blank\"
                                title=\"View $file_name\">$file_name</a>\n";
                else:
                // If it's not a directory then add it to the $folders
variable and assign it class=dir (this class we put in the style.css)
                        $folders .= "<li class=\"dir\"><a
href=\"$PHP_SELF?path=$path/$file_name\"
                                title=\"Go to $file_name
directory\">$file_name</a>\n";
                // End if ($is_dir)
                endif;
        // End if (($file_name != ".") && ($file_name != ".."))
              endif;
        // End while reading directory
        endwhile;

// Put the $folders and $files variables together so folders show up first.
$msg .= $folders . $files;

// If there's no list items then the dir is empty.
        if ((preg_match("/<li class=\"file/", $msg)) || (preg_match("/<li
class=\"dir/", $msg))): 
              $msg .= "</ul>";
        else:
              $msg .= "</ul><P>This directory is empty.</p>";
        endif;

              $msg .= "<P><a
href=\"Javascript:history.go(-1)\">Back</a></p></td></tr>
                        </table>";

              closedir($dir);
?>
<html>
<head>
<title>Browse Files in <? echo "$web_path" . "$path"; ?></title>
<link rel="stylesheet" href="/style.css" type="text/css">
</head>
<body>
<? echo $msg; ?>
</body>
</html>

Here's the contents of style.css

li.dir { list-style: url(/images/folder.gif) disc }
li.file { list-style: url(/images/file.gif) disc }

I attached file.gif and folder.gif.

Hope this helps.

v/r,
NATHAN BROWNING, SrA, USAF
509 CS/SCNO  NCC Operations
DSN 975-5267  Comm (660) 687-5267
"The real art of conversation is not only to say the right thing at the
right time, but also to leave unsaid the wrong thing at the tempting
moment."

-----Original Message-----
From: Phil Huynh [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 10, 2002 8:29 AM
Cc: [EMAIL PROTECTED]
Subject: [PHP-INST] display the file in directory



Hi,
    I am trying to read the files in the directory and display them .
but I got the message " the document contain no data "

this is my code
<?
  $d = dir("/export/home/phuy/www/test/upload");
  echo "Handle: ".$d->handle."<br>";
  echo "Path: ".$d->path."<br>";

  while($entry=$d->read()) {
echo $entry."<br>\n";
  }
  echo "<hr>";
  $d->close();
?>

  Can anyone tell me what should I do to correct it.
  I would like some help, thank in advance.



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

--- End Message ---
--- Begin Message ---
On Wed, Apr 10, 2002 at 12:36:25AM +0100, Andy Smith wrote:

> php does appear to build and install OK, but once the AddModule and
> LoadModule lines are added to httpd.conf, the server segfaults on
> startup.  strace shows the following:

I've since tried this again with CVS apache 2 and CVS PHP and get
the same behaviour.

> .
> .
> .
> open("/usr/local/apache2/conf/mime.types", O_RDONLY) = 8
> fstat64(8, {st_mode=S_IFREG|0644, st_size=12322, ...}) = 0
> read(8, "# This is a comment. I love comm"..., 4096) = 4096
> read(8, "tool-message\napplication/vnd.gro"..., 4096) = 4096
> read(8, "on/vnd.wt.stf\napplication/vnd.xa"..., 4096) = 4096
> read(8, "ovie\nx-conference/x-cooltalk\t\tic"..., 4096) = 34
> read(8, "", 4096)                       = 0
> close(8)                                = 0
> semget(IPC_PRIVATE, 1, IPC_CREAT|0x180|0600) = 589831
> semctl(589831, 0, 0x110 /* SEM_??? */, 0xbffff6b8) = 0
> getcwd("/", 4095)                       = 2
> --- SIGSEGV (Segmentation fault) ---

Attachment: msg05418/pgp00000.pgp
Description: PGP signature

--- End Message ---
--- Begin Message ---
I am running Apache 1.3.20 (Win32) PHP/4.1.3-dev mod_perl/1.25_01-dev mod_ssl/2.8.4 
OpenSSL/0.9.6a on Windows XP Professional. I have followed the installation 
instructions (modifying httpd.conf and copying necessary files), but I am getting 
blank returns on all PHP pages.

Please help.

Thanks
Ian Daye
--- End Message ---
--- Begin Message ---
I am running Apache 1.3.20 (Win32) PHP/4.1.3-dev mod_perl/1.25_01-dev mod_ssl/2.8.4 
OpenSSL/0.9.6a on Windows XP Professional. I have followed the installation 
instructions (modifying httpd.conf and copying necessary files), but I am getting 
blank returns on all PHP pages.

Please help.

Thanks
Ian Daye
--- End Message ---
--- Begin Message ---

Given an app with the following overall class structure:

Base.class {
        function Base() {
                ##initialize stuff
        }
}

A.class extends Base {
        var $var;
        var $b;
        function A() {
                $var="x";
                $b=new B.class();
        }
}

B.class extends Base {
        var $y;
        function B() {
                $y="something";
                ##How do I refer to $var in A
        }
}

Now, how would/could an instance of B get to a variable in A (i.e. the
calling class).  One (seemingly rather ugly) way is to declare the A
instance global and refer to that from within B.  I.e.

<?
global $x
$x=new A;  ## now we can say something like "$x->var" from within B
?>

Or, another way is to pass a reference to A in with the call to B - so
we'd change the class defs for A and B to look like:

A.class extends Base {
        var $var;
        var $b;
        function A() {
                $var="x";
                $b=new B.class($this);  //pass a ref to myself
        }
}

B.class extends Base {
        var $a;
        var $y;
        function B(&$a) {  //always take this arg as a reference
                $y="something";
                // now $a contains a ref to the calling object
                echo $a->var;
        }
}

Am I thinking about this correctly?  Am I missing some obvious language
contruct which would obviate the need for A to pass itself as an arg to
the instantiation of B?  Is my object structure completely naive?

In the second case, what happens after you serialize and unserialize an
A object as in a session?  Will The instance of B called $b in the A
object still contain a _reference_ to the A object in it's $a var, or
will it now have a _copy_?

I'm trying to get an idea of best practices for these types of issues.
Any comments/discussion is very much appreciated.

Al




--- End Message ---
--- Begin Message ---
Environment:
Solaris 8
gcc 2.95.3
Shell: tcsh

Trying to compile Apache w/ mod_SSL+PHP+LDAP.

cd mod_ssl-2.8.8-1.3.24
./configure --with-apache=../apache_1.3.24

cd apache_1.3.24
./configure --prefix=/opt/software

cd ../php-4.1.2
./configure --with-apache=../apache_1.3.24 --with-openssl --with-ldap
--enable-track-vars
make
make install

cd ../apache_1.3.24
set SSL_BASE=../openssl-0.9.6c; ./configure --prefix=/opt/software
--activate-module=src/modules/php4/libphp4.a --enable-module=ssl
make

It errors on the make for apache.
Error Message:
Undefined                        first referenced
 symbol                              in file
ldap_parse_reference                 modules/php4/libphp4.a(ldap.o)
ld: fatal: Symbol referencing errors. No output written to httpd

I am tried the Solaris LDAP libraries and compiled the OpenLDAP
2.0.23 libraries in a different location w/ the compile
option --with-ldap=/opt/software for php. But, make errored on the
same spot and had an extra undefined symbol with ldap_initialize in the
same module.

I compiled OpenLDAP with these options:
./configure --prefix=/opt/software --with-tls --disable-slapd 
--disable-slurpd 
make depend
make 
make install

-- 
Curtis Robinson
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I am having trouble getting apache to load the php4 module.  Here is the
error and output of ldd -r on the php module. 

todd@svlecs01:~/src/php-4.1.2$sudo apachectl start
Syntax error on line 205 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/libphp4.so into server: ld.so.1:
/usr/local/apache/bin/httpd: fatal: relocation error: file
/usr/local/apache/libexec/libphp4.so: symbol ap_block_alarms: referenced
symbol not found
/usr/local/apache/bin/apachectl start: httpd could not be started
todd@svlecs01:~/src/php-4.1.2$ldd -r /usr/local/apache/libexec/libphp4.so 
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libcrypt_i.so.1 =>       /usr/lib/libcrypt_i.so.1
        libresolv.so.2 =>        /usr/lib/libresolv.so.2
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libpam.so.1 =>   /usr/lib/libpam.so.1
        libmm.so.11 =>   /usr/local/lib/libmm.so.11
        libmysqlclient.so.10 =>
/usr/local/mysql/lib/mysql/libmysqlclient.so.10
        libm.so.1 =>     /usr/lib/libm.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
        libgen.so.1 =>   /usr/lib/libgen.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libz.so.1 =>     /usr/lib/libz.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        symbol not found: ap_block_alarms
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_unblock_alarms
(/usr/local/apache/libexec/libphp4.so)
        /usr/platform/SUNW,Ultra-250/lib/libc_psr.so.1
        symbol not found: ap_user_id
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_server_root
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_group_id
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_user_name
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: top_module
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_max_requests_per_child
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_table_get
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_update_mtime
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_kill_timeout
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_uudecode
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_setup_client_block
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_add_cgi_vars
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_getword
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_getword_nulls_nc
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_destroy_sub_req
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_pstrdup
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_log_error
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_table_add
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_sub_req_lookup_uri
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_run_sub_req
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_register_cleanup
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_signal
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_send_http_header
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_block_alarms
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_child_terminate
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_set_etag
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_rwrite
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_table_set
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_get_client_block
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_add_version_component
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_hard_timeout
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_rflush
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_set_last_modified
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_reset_timeout
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_unblock_alarms
(/usr/local/apache/libexec/libphp4.so)
        symbol not found: ap_add_common_vars
(/usr/local/apache/libexec/libphp4.so)
todd@svlecs01:~/src/php-4.1.2$cat config.nice 
#! /bin/sh
#
# Created by configure

'./configure' \
'--with-mysql=/usr/local/mysql' \
'--enable-trans-sid' \
'--with-apxs' \
'--with-mm=/usr/local/lib' \
"$@"


I know this is a apache symbol but how can I fix this?  

Thanks. 
--- End Message ---
--- Begin Message ---
Hello.
I tried to install php-4.1.2 with apache 2.0.35.
So, i got both and began to install.
configured apache : --enable-module=so to /www
then as usual, make and install. all works fine.
so began to installing php:
configure --with-pgsql --with-apxs=/www/bin/apxs
then make
got following error messages:

sapi_apache.c: In function `apache_php_module_main':
sapi_apache.c:81: `NOT_FOUND' undeclared (first use in this function)
sapi_apache.c:81: (Each undeclared identifier is reported only once
sapi_apache.c:81: for each function it appears in.)
make[3]: *** [sapi_apache.lo] Error 1

So, tried to replace the NOT_FOUND in sapi_apache.c
this file compiled well after that, but in others appeared many more errors,
which broke the compiling process.
I think that maybe the the php i trying to compile for apache is too new..

Im using mandrake i dont think that there is anything to do with distribution.
or linux.

but who knows. maybe im mistaking.

sincirely yours.


Muxa. beginner in php
--- End Message ---

Reply via email to