Author Topic: zf.sh php not found  (Read 6132 times)

0 Members and 1 Guest are viewing this topic.

Offline DEVILofDARKNESSTopic starter

  • Enthusiast
  • Posts: 498
  • Gender: Male
  • Kill Bill, We need no Microsoft and Gates
    • View Profile
    • Ninv
zf.sh php not found
« on: August 19, 2009, 08:34:27 AM »
if I run zf.sh (Zend Framework)  I get the error: 44: php: not found

What have I done wrong?
echo "I love PHP";
Code: [Select]
print "And python!"

Offline Dj Kat

  • Addict
  • Posts: 1,507
  • Gender: Male
    • View Profile
Re: zf.sh php not found
« Reply #1 on: August 19, 2009, 08:37:07 AM »
how are you running the file? Are you using a terminal under linux?

Offline DEVILofDARKNESSTopic starter

  • Enthusiast
  • Posts: 498
  • Gender: Male
  • Kill Bill, We need no Microsoft and Gates
    • View Profile
    • Ninv
Re: zf.sh php not found
« Reply #2 on: August 19, 2009, 08:47:08 AM »
yes I simply do zf
and I first did:
alias zf='/opt/lampp/Zendframewor-1.9.1/bin/zf.sh'
« Last Edit: August 19, 2009, 08:47:47 AM by DEVILofDARKNESS »
echo "I love PHP";
Code: [Select]
print "And python!"

Offline Dj Kat

  • Addict
  • Posts: 1,507
  • Gender: Male
    • View Profile
Re: zf.sh php not found
« Reply #3 on: August 19, 2009, 08:53:31 AM »
Hmm just typing zf in the terminal should work.
You said you received the following error 44: php: not found
Maybe you can't run php in the terminal. what happens if you type php in the terminal?

Offline DEVILofDARKNESSTopic starter

  • Enthusiast
  • Posts: 498
  • Gender: Male
  • Kill Bill, We need no Microsoft and Gates
    • View Profile
    • Ninv
Re: zf.sh php not found
« Reply #4 on: August 19, 2009, 08:55:18 AM »
it says php not found, you can install it by doing sudo apt-get install php5-cli
although php5 is installed. :(?
echo "I love PHP";
Code: [Select]
print "And python!"

Offline Dj Kat

  • Addict
  • Posts: 1,507
  • Gender: Male
    • View Profile
Re: zf.sh php not found
« Reply #5 on: August 19, 2009, 08:57:24 AM »
running php-cli and php under apache(or any other webserver software) are different. You need to install the php-cli.

Offline DEVILofDARKNESSTopic starter

  • Enthusiast
  • Posts: 498
  • Gender: Male
  • Kill Bill, We need no Microsoft and Gates
    • View Profile
    • Ninv
Re: zf.sh php not found
« Reply #6 on: August 19, 2009, 08:59:01 AM »
okay I installed the php5-cli
and now it gives an other error:
Quote
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/gd.so' - /usr/lib/php5/20060613+lfs/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/mcrypt.so' - /usr/lib/php5/20060613+lfs/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/mysql.so' - /usr/lib/php5/20060613+lfs/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/mysqli.so' - /usr/lib/php5/20060613+lfs/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/pdo_mysql.so' - /usr/lib/php5/20060613+lfs/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0

Fatal error: Cannot redeclare class Zend_OpenId_Provider in /usr/share/php/libzend-framework-php/Zend/OpenId/Provider.php on line 44
echo "I love PHP";
Code: [Select]
print "And python!"

Offline Dj Kat

  • Addict
  • Posts: 1,507
  • Gender: Male
    • View Profile
Re: zf.sh php not found
« Reply #7 on: August 19, 2009, 09:23:42 AM »
Hmmm don't know how to solve those warnings I haven't experienced anything like that before as I am fairly fresh with Linux myself (6 months). Maybe you should ask that in the Linux forum.

As for the fatal error.
Quote
Fatal error: Cannot redeclare class Zend_OpenId_Provider in /usr/share/php/libzend-framework-php/Zend/OpenId/Provider.php on line 44

In your php.ini file , what does your include_path setting look like? I suspect that you're including the Zend Framework twice somehow.
« Last Edit: August 19, 2009, 09:24:37 AM by Dj Kat »

Offline DEVILofDARKNESSTopic starter

  • Enthusiast
  • Posts: 498
  • Gender: Male
  • Kill Bill, We need no Microsoft and Gates
    • View Profile
    • Ninv
Re: zf.sh php not found
« Reply #8 on: August 19, 2009, 09:26:58 AM »
include_path = ".:/opt/ZendFramework-1.9.1/library"

This is the only include_path there is...

(I use linux for 3 months now I guess :) )
echo "I love PHP";
Code: [Select]
print "And python!"

Offline Dj Kat

  • Addict
  • Posts: 1,507
  • Gender: Male
    • View Profile
Re: zf.sh php not found
« Reply #9 on: August 19, 2009, 09:37:06 AM »
Not sure if this is the case with your Linux distro but I have two php.ini files (or more not sure at the moment since I am not behind my own PC). There is a php.ini for the webserver and a php.ini for the php-cli. What distro of Linux are you running? And do you have more then one php.ini file?

The paths could look like:
Code: [Select]
/etc/php/php.ini
/etc/php-cli/php.ini

The include_path seems right but the error does not seem to verify this.
Quote
Fatal error: Cannot redeclare class Zend_OpenId_Provider in /usr/share/php/libzend-framework-php/Zend/OpenId/Provider.php on line 44
That error would indicate that you have a include path like:
Code: [Select]
include_path = ".:/usr/share/php/libzend-framework-php/"

Offline DEVILofDARKNESSTopic starter

  • Enthusiast
  • Posts: 498
  • Gender: Male
  • Kill Bill, We need no Microsoft and Gates
    • View Profile
    • Ninv
Re: zf.sh php not found
« Reply #10 on: August 19, 2009, 09:47:50 AM »
I'm using ubuntu 9.04,

but I first tried to install zendframework via synaptic,
but I couldn't find where it was installed so I manually installed it later
(I will de-install the synaptic files, maybe that is the problem)

I have a php.ini file in my lampp directory (the one I changed)
and I have one in /etc/php5/apache2/php.ini
but if I change that, lampp doesn't work anymore because the apache of /etc takes it over

I don't have a /etc/php5-cli or /etc/php-cli
...
echo "I love PHP";
Code: [Select]
print "And python!"

Offline Dj Kat

  • Addict
  • Posts: 1,507
  • Gender: Male
    • View Profile
Re: zf.sh php not found
« Reply #11 on: August 19, 2009, 10:05:09 AM »
While I had a pretty good experience with Xampp under Windows I don't like it much under Linux it had too many bugs for me. I recommend not using lampp but installing mysql Apache and php with synaptic instead if you can. It will be a lot easier to manage upgrade and addons especially if you want to run other stuff such as python and ruby on Apache.

I don't think your php.ini file for php cli is located in your lampp directory. Try doing a scan and search if you have more then just the two php.ini files you mentioned.

Offline DEVILofDARKNESSTopic starter

  • Enthusiast
  • Posts: 498
  • Gender: Male
  • Kill Bill, We need no Microsoft and Gates
    • View Profile
    • Ninv
Re: zf.sh php not found
« Reply #12 on: August 19, 2009, 10:10:08 AM »
Okay I will do
Like I said I had tried to install zendframework first with synaptic,
I tried to un-done this, and know I get first a lot of errors then the zendframe screen,
but if I do a zf command, the same happens followed by bash which doesnt know the command :(
echo "I love PHP";
Code: [Select]
print "And python!"

Offline thorpe

  • Administrator
  • 'Mind Boggling!'
  • *
  • Posts: 29,255
    • View Profile
Re: zf.sh php not found
« Reply #13 on: August 20, 2009, 04:23:29 AM »
Before I start, these comment relate to Debian. Ubuntu being based off Debian should be the same (or very similar).

apt will install zend framework under /usr/share/php5, this is the same location things like pear will end up in.

You should have a separate php.ini file for both mod_php and the cli, what is the output of....

Code: [Select]
find /etc -name 'php*ini'

As for using lampp, I wouldn't bother. PHP is VERY easy to install and maintain on Debian. The way Apache is setup is rather nice too IMO.

Offline DEVILofDARKNESSTopic starter

  • Enthusiast
  • Posts: 498
  • Gender: Male
  • Kill Bill, We need no Microsoft and Gates
    • View Profile
    • Ninv
Re: zf.sh php not found
« Reply #14 on: August 20, 2009, 01:39:50 PM »
/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini

(btw, ZendFramework is installed by synaptic in /usr/share/php, but not in php5 is this bad? because There is a file php5 in share)
echo "I love PHP";
Code: [Select]
print "And python!"

Offline DEVILofDARKNESSTopic starter

  • Enthusiast
  • Posts: 498
  • Gender: Male
  • Kill Bill, We need no Microsoft and Gates
    • View Profile
    • Ninv
Re: zf.sh php not found
« Reply #15 on: August 20, 2009, 01:50:12 PM »
PS: I got ZendFrameWork running in /opt/ZendFramework-1.9.1

and I succeeded in creating a new project,

but the tutorial said that I know could view this project in localhost/zf-tutorial (the project is called zf-tutorial)

if I use my browser I get an error that it doesn't exist on the server...
if I go to localhost, I get the homepage of my main project (not with Zend) which is located in /home/username/public_html
echo "I love PHP";
Code: [Select]
print "And python!"

Offline thorpe

  • Administrator
  • 'Mind Boggling!'
  • *
  • Posts: 29,255
    • View Profile
Re: zf.sh php not found
« Reply #16 on: August 20, 2009, 05:49:19 PM »
/home/username/public_html isn't the normal location for sites to reside. Are you using Apache as installed by synaptic? Your sites should be under /var/www.

You still need to make an apache vhost for any new project, you'll also need to create the document root manually.

This is why I hate things like lampp. I think you need a better understanding of how Apache is configured.
« Last Edit: August 20, 2009, 05:50:00 PM by thorpe »

Offline DEVILofDARKNESSTopic starter

  • Enthusiast
  • Posts: 498
  • Gender: Male
  • Kill Bill, We need no Microsoft and Gates
    • View Profile
    • Ninv
Re: zf.sh php not found
« Reply #17 on: August 30, 2009, 08:22:22 AM »
Pff, it's a huge mess, I think I just don't gonna use zf,
everything works fine for me now and I'm going to stay with it,

although thanks for you help guys!
echo "I love PHP";
Code: [Select]
print "And python!"