Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PHP code question

Posted on 2014-09-23
7
Medium Priority
?
167 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
 
LVL 1

Author Comment

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

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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 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 111

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
 
LVL 1

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 111

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
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 dynamically set the form action using jQuery.

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