Solved

PHP code question

Posted on 2014-09-23
7
157 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

937 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

8 Experts available now in Live!

Get 1:1 Help Now