Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Jan 2012 10:22:49 +0200
From:      Aimelyne Mochiron <aimelynem@gmail.com>
To:        David Allen <the.real.david.allen@gmail.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: PHP Interactive Mode, phpsh
Message-ID:  <48A21BD5-9220-4986-B0AD-3CF25963E075@gmail.com>

next in thread | raw e-mail | index | archive | help
Hi David,

To enable PHP interactive mode, either readline or libedit must be =
compiled into the PHP binary. To do that, edit lang/php5's Makefile to =
add to CONFIGURE_ARGS either '--with-readline' or '--with-libedit' (the =
library you pick must be installed on your system).

Note that php -nm will list readline irrespective of whether you =
compiled it or libedit in; phpinfo() will report the correct configure =
command, however.

I'm afraid I can't help IRT phpsh, as I'm not familiar with it.

HTH,

AM

> Message: 2
> Date: Fri, 6 Jan 2012 04:25:00 -0800
> From: David Allen <the.real.david.allen@gmail.com>
> Subject: PHP Interactive Mode, phpsh
> To: freebsd-ports@freebsd.org
> Message-ID:
> 	=
<CAFsxFVmmfGLGz3j3WdRsk21WoQVvkmLwd=3DyUqHp4EpLGt4srng@mail.gmail.com>
> Content-Type: text/plain; charset=3DISO-8859-1
>=20
> The Gods seem to be conspiring against me.  I'm flummoxed as to why I
> can't get php running in interactive mode (php -a).  Some relevant =
info:
>=20
>    php5-5.3.8          PHP Scripting Language
>    php5-extensions-1.5 A "meta-port" to install PHP extensions
>    php5-readline-5.3.8 The readline shared extension for php
>    python27-2.7.2_2    An interpreted object-oriented programming =
language
>=20
> I tried doing an endrun around the problem by installing python in
> conjunction with the /devel/phpsh port.  That hasn't quite worked out
> either.
>=20
> Testing the installation of phpsh on a local build server:
>=20
>    $ phpsh
>    Starting php
>    Install pcntl to enable forking on every command.
>    type 'h' or 'help' to see instructions & features
>    php> echo "Hello world\n";
>    Hello world
>=20
>    php> d array_merge
>=20
>    Traceback (most recent call last):
>    File "/usr/local/bin/phpsh", line 127, in <module>
>        t_c_ret =3D s.try_command(line)
>    File "/usr/local/lib/python2.7/site-packages/phpsh/__init__.py", =
line
> 909, in try_command
>        import manual
>    File "/usr/local/lib/python2.7/site-packages/phpsh/manual.py", line =
4,
> in <module>
>        from sqlite3 import dbapi2 as sqlite
>    File "/usr/local/lib/python2.7/sqlite3/__init__.py", line 24, in
> <module>
>        from dbapi2 import *
>    File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 27, in =
<module>
>        from _sqlite3 import *
>    ImportError: No module named _sqlite3
>=20
>    [ At this point phpsh exits ]
>=20
> Building a phpsh package fails:
>=20
>    =3D=3D=3D>  Building package for phpsh-20110513
>    tar: etc/phpsh/config.sample: Cannot stat: No such file or =
directory
>    tar: etc/phpsh/php_manual.db: Cannot stat: No such file or =
directory
>    tar: etc/phpsh/rc.php: Cannot stat: No such file or directory
>    tar: Error exit delayed from previous errors.
>    pkg_create: make_dist: tar command failed with code 256
>    *** Error code 1
>=20
>    Stop in /usr/ports/devel/phpsh.
>    *** Error code 1
>=20
>    Stop in /usr/ports/devel/phpsh.
>=20
> Running 'pkg_info -L' reveals the missing files being installed into
> /usr/local/etc/phpsh, but no such directory (or files) exists.
>=20
> And just for fun, the results after installing phpsh on Mac OS X =
(where
> php interactive mode doesn't work either):
>=20
>    Warning: require_once(/opt/local/etc/phpsh/rc.php): failed to open
>    stream: No such file or directory in
>=20
> =
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/=
site-packages/phpsh/phpsh.php
>=20
>    on line 49
>=20
>    Fatal error: require_once(): Failed opening required
>    '/opt/local/etc/phpsh/rc.php' (include_path=3D'.:') in
>=20
> =
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/=
site-packages/phpsh/phpsh.php
>=20
>    on line 49
>=20
> Could someone shed some light as to why php interactive mode doesn't =
work
> with FreeBSD?  Or alternatively, how to fix my phpsh installation and =
get
> a package made?
>=20
> Thanks!
>=20



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48A21BD5-9220-4986-B0AD-3CF25963E075>