Solved

PHP code question

Posted on 2014-09-23
7
163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 110

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 110

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 110

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do I Check for duplicate entries in mysql 15 50
Get data from two MySQL tables 6 66
PHP substring 3 54
Best hashing method? 1 23
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

752 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