Menu

Unable to run index.php3 in demo

Help
Anonymous
2001-05-15
2001-08-25
  • Anonymous

    Anonymous - 2001-05-15

    I have installed the phpwidgets demo running on apache server with php 3.0.9 module (not CGI).  I have also installed PHPLIB 7.2 (which appears to be working--at least all the test php files work).  When I try to execute index.php3 in the phpwidgets demo, I get the following message:  Failed opening 'phpwidgets.inc.php3' for inclusion in /home/whatever/index.php3 on line 25.  I have all of the .php3 files chmod'd at 755.  Any suggestions what I might have left out?

     
    • Garth Dahlstrom

      Garth Dahlstrom - 2001-05-18

      Hi,

      Have you tried putting phpwidgets.inc.php3 in
      your one of your include directories.

      Typically, it will work if you throw it into
      your phplib include directory in php.ini's
      include_path.

      If that doesn't work try putting it into the
      same directory as index.php3 and see what
      that does.

      Also you might want to make sure that you have
      "." in your php.ini's include_path... so files
      in the current directory can be included.

      mine looks like this on my Win32 (the slashes
      are the other way on unix) system:

      include_path = ".;\apache\includes;\apache\htdocs\;\apache\htdocs\phpmyadmin"

      Let me know what comes up after you've tried that
      stuff...

      -Ironstorm

       
      • Anonymous

        Anonymous - 2001-05-21

        Thanks for the reply.

        I have the following in the .htaccess file at root level:

        php3_track_vars on
        php3_auto_prepend_file /home/whatever/phplib/php/prepend.php3
        php3_include_path /home/whatever/phplib/php/
        php3_include_path /home/whatever/phplib/php/.

        The file phpwidgets.inc.php3 is in the same directory as index.php3.

        The original problem was solved by changing line 25 of index.php3 to:

        include("./phpwidgets.inc.php3");  [added the "./"]

        Then index.php3 worked EXCEPT for this error:  Warning: Failed opening 'widgets_footer.w.php3' for inclusion in ./phpwidgets.inc.php3 on line 107

        Per your suggestion, I moved widgets_footer.w.php3 to my library directory and it did work (and I presume that I can also move phpwidgets.inc.php3 to the library as well and remove the "./" from line 25 of index.php3).

        So, it appears that PHP will find the includes in the same directory, unless the file ext is .php3, in which case the file needs to be in the library directory specified in .htaccess.  I did try adding "." and "./" to the list of php include paths, but this did not work (I received an error related to opening some of the prepend files).  I am new to PHP - is it typical that all .php3 files need to be in the same place as the library files (unless, as in my first solution, the exact location can be specified)? 

        Another question - is it necessary to have the php.ini file if I am running php as an Apache module and can specify the paths in .htaccess?  Would that give me more options?

        Thanks for your help!

         
        • Garth Dahlstrom

          Garth Dahlstrom - 2001-05-21

          >php3_track_vars on
          >php3_auto_prepend_file /home/whatever/phplib/php/prepend.php3
          >php3_include_path /home/whatever/phplib/php/
          >php3_include_path /home/whatever/phplib/php/.

          What you're doing doesn't look quite right to me.
          I think the last 2 lines are exactly the same
          for what they do, both point to /home/whatever/phplib/php/ and I think the second line will overwrite the first. 

          You could check this out by doing:
          php3_include_path test1
          php3_include_path test2

          make a file:
          <?php
          phpinfo();
          ?>
          and look at the include_path environment variables and see if you see test1 and test2
          or just test2.

          Anyway I think the proper syntax is something
          similar to:
          php3_track_vars on
          php3_include_path .:/home/whatever/phplib/php/
          php3_auto_prepend_file prepend.php3

          notice that the include_path line is a list
          of entries seperated by : on UNIX where
          . (current directory) is first, also you
          don't need the full path the prepend.php3
          since it will be looked for in the include_path directories.

          Try that and let me know how it goes for you...

          -Ironstorm

           
          • Anonymous

            Anonymous - 2001-05-21

            Thanks again.  I used your syntax for the .htaccess and it worked as you said it would! 

            The syntax I had used before was copied from the support area of my web hosting company, as they had indicated that adding that extra line (the one ending with ".") was the only way the prepend would work.  Not so - I should have checked with the PHP expert first!

            At any rate, with the "new" path in .htaccess, I have moved widgets_footer.w.php3 back into the demo directory (out of the library directory) and also removed the "./" from the [include("phpwidgets.inc.php3");] statement in index.php3, and all is well.

            Thanks again!

             
    • Garth Dahlstrom

      Garth Dahlstrom - 2001-05-18

      Also I pretty sure you don't need to have your
      .php and .php3 in chmod 755...  This won't do
      anything either way but you might change them
      back afterward you get it working... it's prolly
      more secure.

       
    • Ken Cheung

      Ken Cheung - 2001-08-22

      I got error in line 259 of 'phpwidgets.inc.php3' when I click "Personalize this page" in the demo index.php3. After I add back slashes to the blances "{" and "}" as "\{" and "\}" and it works now. Am I correct?

      (PS: I use PHP4 from RedHat 7.1, mod_php, apache)

       
      • Garth Dahlstrom

        Garth Dahlstrom - 2001-08-25

        "Personalize this page", that must be the old demo of PHP Widgets (0.92-)...

        Use the demo in release 0.94_PR#1,
        that is exactly like the one at Northern.CA/projects/phpwidgets.

        You will find that is more PHP4 friendly...
        I had to tackle a bunch of PHP3->PHP4 issues
        after the .92 demo that prolly fixed the
        error you describe.

        > I use PHP4 from RedHat 7.1, mod_php, apache)
        I run mod_PHP 4.0.6 on Debian 2.2 w/ apache...
        so you should be able to make that work, no
        worries.

        Hope that helps,

        -Ironstorm

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.