Solved

PHP code question

Posted on 2014-09-23
7
156 Views
Last Modified: 2014-09-23
Hi,
I'm trying to run a third party PHP script. It's called zensync and it's designed to allow fast upload of photos to the ZenFolio site (photo sharing/selling site).

The instructions say to modify the local config.php, which I did. It's local to the script directory zensync is in.
The it says to run it:   php zensync.php
When I type that nothing happens. I just get the command prompt back.
So I went into the zensync.php code and typed in an echo statement. If I put the echo before the first require, I get "Hello" back. Otherwise, I get nothing back. All the files listed as 'required' are in the local directory where the zensync scripts exists. So I don't understand why the script is coming back with nothing.
Ideas?
Better trouble shooting skills for php? I'm a programmer but not really PHP.

Thanks,
zensync.php:

echo "Hello";  ## Comes back with Hello
require("config.php");
echo "Hello";  ## Comes back with nothing
require("config.class.php");
require("logger.class.php");
require("helper.inc.php");
require("zenlogin.inc.php");
require("dirobj.class.php");
0
Comment
Question by:nachtmsk
  • 3
  • 3
7 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40339706
So config.php is in the same folder as zensync.php ?

Add to the top of the page after the opening php tag

error_reporting(E_ALL);
0
 

Author Comment

by:nachtmsk
ID: 40339754
Yeah, it's in the same dir (folder). I'll add that in and see what happens.
0
 

Author Comment

by:nachtmsk
ID: 40339768
Still nothing.
Here is the top of the main php script:

#!/usr/bin/php
<?php
error_reporting(E_ALL);
/*
*************************************************************************
  ZenSync - Zenfolio Image Depot Synchronizer
  Created and maintained by Dan Richardson and Harald Maida
*************************************************************************
  ZenSync is an opensource tool written in PHP running on any
  platform with a PHP installation that transfers a file system based
  depot of images into a Zenfolio photo gallery. It is easy to use
  and keeps your Zenfolio photo gallery in sync with the file system
  based image depot located on any desktop or server.

  ZenSync is distributed under the GNU General Public License.
*************************************************************************

  ZenSync - Zenfolio Image Depot Synchronizer
  Copyright 2007 and forever thereafter by Dan Richardson & Harald Maida.
  All rights reserved.

  This file and all related or dependant files distributed with this
  file are considered as a whole to make up ZenSync.

  ZenSync is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  ZenSync is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with ZenSync (see file LICENSE.txt); if not, write to the
  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  Boston, MA  02110-1301, USA

  For more information on ZenSync2 visit http://blog.harim.at/zensync
  For more information on ZenSync visit http://www.plymptonia.com/

**************************************************************************
  Originally created by Dan Richardson
  Extended by Harald Maida
**************************************************************************
*/
// Main ZenSync starts here
require("config.php");
echo "Hello";
require("config.class.php");
===========================================

Here  is a dir listing of everything in the same dir as the script:

-rwxrwxrwx 1 1796965  357519   609 Jun 10  2009 config.class.php
-rwxrwxrwx 1 1796965  357519  7609 Sep 23 11:23 config.php
-rwxrwxrwx 1 1796965  357519 17762 Jul  6  2009 dirobj.class.php
-rwxrwxrwx 1 1796965  357519   349 Jun 10  2009 helper.inc.php
-rwxrwxrwx 1 1796965  357519 15425 Apr 21  2005 LICENSE.txt
-rwxrwxrwx 1 1796965  357519  1087 Sep 10  2009 logger.class.php
-rwxrwxrwx 1 1796965  357519  2524 Jul  6  2009 make_h264.php
-rwxrwxrwx 1 1796965  357519  1266 Jul  6  2009 make_vid.php
-rwxrwxrwx 1 1796965  357519  3562 Jun 13  2009 README.txt
-rwxrwxrwx 1 1796965  357519    83 Aug 21  2009 sync.sh
-rwxrwxrwx 1 1796965  357519  2143 Jun 11  2009 TODO.txt
-rwxrwxrwx 1 1796965  357519    11 Jun 12  2009 VERSION.txt
-rwxrwxrwx 1 1796965  357519  1435 Jun  4  2009 zenlogin.inc.php
-rwxrwxrwx 1 1796965  357519  5975 Sep 23 12:00 zensync.php
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 40339772
PHP is notoriously bad about hiding the messages you need to see.  You may also need to add this line.

ini_set('display_errors', TRUE);
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40339802
Hmm... I just read the comments thread on this page:
http://www.plymptonia.com/?p=20

Might be worth checking out that thread.  Also checking to see if there is anything newer than the 2009 libraries.  PHP has changed a lot in the last 5 years.
0
 

Author Comment

by:nachtmsk
ID: 40339835
Ray
Thanks for the tip.
Getting lots of error messages now!! I'll see what I can do with them.
First one is that it needs a SOAP library. Guess I'll have to get that.

Don't think there are new libs for this script but I will check.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40339850
Good docs (as good as anything about SOAP can be) here: http://php.net/manual/en/book.soap.php
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now