Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: PHP Album. Can't get it to work.

  1. #11
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    PHP 5.3 has a lot of changes that make scripts that worked with earlier version of php not function correctly anymore. I learned this from "trial and error" as well. Anyway, glad that it is working for you now.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  2. #12
    Join Date
    Aug 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by nunofyer bzness View Post
    OK, I just posted the code to a web site (www.bestrmvacation.com/album.htm), and IT WORKS THERE. It does NOT work on my installation of PHP/Apache. After some snooping on the internet, I turned on some more error reporting and I find the following errors in the error log:

    [Tue Aug 25 17:45:53 2009] [error] [client 127.0.0.1] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for '-6.0/DST' instead in C:\\webdev\\rmv3\\album\\getalbumpics.php on line 12, referer: http://localhost/album.php

    [Tue Aug 25 17:45:56 2009] [error] [client 127.0.0.1] File does not exist: C:/webdev/rmv3/favicon.ico

    (The first warning is repeated for each image that I have in the folder). Any suggestions?

    Thanks.
    I just deinstalled apache and php and re-installed it from fresh sources. no change. I can't get the script to work on my computer. Now I get another error in addition:

    [Tue Aug 25 21:29:11 2009] [error] [client 127.0.0.1] PHP Deprecated: Function eregi() is deprecated in C:\\webdev\\rmv3\\album\\getalbumpics.php on line 11, referer: http://localhost/album.php

    I don't know if this would call the script to fail, but it is definitely not working on my computer.

  3. #13
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Are you familiar with PHP? If so, I'd try and modify albumpics.php per the error warnings you've been receiving to see if that changes anything:

    1) For the date() function, I don't see any issues mentioned in the documentation, but perhaps I missed something.

    2) For eregi(), The docs do say it's deprecated, and I'll most likely be updating the php script officially for this soon. In the meantime, try using preg_match instead.
    DD Admin

  4. #14
    Join Date
    Aug 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin View Post
    Are you familiar with PHP? If so, I'd try and modify albumpics.php per the error warnings you've been receiving to see if that changes anything:

    1) For the date() function, I don't see any issues mentioned in the documentation, but perhaps I missed something.

    2) For eregi(), The docs do say it's deprecated, and I'll most likely be updating the php script officially for this soon. In the meantime, try using preg_match instead.
    Thanks. I will see if I can do that. I just saw another piece of information. This morning I fired up my computer and started the web page in Firefox while it was still loading up. I guess that slowed it down a bit, and I saw briefly flashing on the page an icon (with a red "X", the "loading.gif, and a text "loading...". I coldn't make out more details as it flashed by prety quickly. I believe that this is from the PHP script, right? So, between that point and the display, something seems to go wrong. I am wondering if the time code inserts some unwanted characters that are then interpreted wrong and the filenames are not right, and then your script cannot load the images. I just don't know how to debug php. I'm familiar with other languages, and there is always a way to insert some comments to see where things might go wrong, or there is a debugger tool that let's you do that and watch variables, for example. How does that work with php?

  5. #15
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    No, the red "x" and brief animation is from the JavaScript, which isn't the issue. I think you are getting closer earlier as far as those PHP log errors are concerned. Basically some of the code inside getalbumpics.php is incompatible on your home server. You'll need to try modifying some of the code inside the PHP script based on the error messages mentioned.

    If and when your PHP code does work, you should be able to call it directly in your browser, and have it return a JavaScript array such as when you click on the below:

    http://www.dynamicdrive.com/dynamici....php?id=jaguar
    DD Admin

  6. #16
    Join Date
    Jan 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Found the problem. Had to sign up and post a simple fix for anyone else who needs to show some photos quick

    Open the file getalbumpics.php and change the first line from
    PHP Code:
    <?
    to

    PHP Code:
    <?php
    Or you can open php.ini and set

    Code:
    short_open_tag = On
    it is off by default and will give you a blank page if not turned on

    Hope this helps someone else. Took me over an hour to figure it out. Guess I should have started looking at the code first instead of my apache/php settings.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •