Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #8512 > unrolled thread
| Started by | Cal Dershowitz <cal@example.invalid> |
|---|---|
| First post | 2013-02-28 17:49 -0800 |
| Last post | 2013-03-14 03:39 -0700 |
| Articles | 20 on this page of 51 — 15 participants |
Back to article view | Back to comp.lang.php
randomly sorting files in php Cal Dershowitz <cal@example.invalid> - 2013-02-28 17:49 -0800
Re: randomly sorting files in php Jerry Stuckle <jstucklex@attglobal.net> - 2013-02-28 23:45 -0500
Re: randomly sorting files in php Cal Dershowitz <cal@example.invalid> - 2013-02-28 22:23 -0800
Re: randomly sorting files in php David Robley <me@home.invalid> - 2013-03-01 17:24 +1030
Re: randomly sorting files in php Cal Dershowitz <cal@example.invalid> - 2013-03-03 18:59 -0800
getting perl and php to talk to each other, was Re: randomly sorting files in php Cal Dershowitz <cal@example.invalid> - 2013-03-05 01:19 -0800
Re: getting perl and php to talk to each other, was Re: randomly sorting files in php "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-03-05 19:43 +0100
Re: getting perl and php to talk to each other, was Re: randomly sorting files in php The Natural Philosopher <tnp@invalid.invalid> - 2013-03-05 19:20 +0000
Re: getting perl and php to talk to each other Ben Morrow <ben@morrow.me.uk> - 2013-03-05 22:06 +0000
Re: getting perl and php to talk to each other Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-06 00:20 +0100
Re: getting perl and php to talk to each other Ben Morrow <ben@morrow.me.uk> - 2013-03-05 23:59 +0000
Re: getting perl and php to talk to each other The Natural Philosopher <tnp@invalid.invalid> - 2013-03-06 01:01 +0000
Re: getting perl and php to talk to each other Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-05 20:08 -0500
Re: getting perl and php to talk to each other Cal Dershowitz <cal@example.invalid> - 2013-03-06 22:37 -0800
Re: getting perl and php to talk to each other Ben Morrow <ben@morrow.me.uk> - 2013-03-07 06:57 +0000
Re: getting perl and php to talk to each other Cal Dershowitz <cal@example.invalid> - 2013-03-07 00:52 -0800
Re: getting perl and php to talk to each other Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-07 08:17 -0500
Re: getting perl and php to talk to each other Cal Dershowitz <cal@example.invalid> - 2013-03-14 03:41 -0700
Re: getting perl and php to talk to each other The Natural Philosopher <tnp@invalid.invalid> - 2013-03-14 11:14 +0000
Re: getting perl and php to talk to each other Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-14 08:06 -0400
Re: getting perl and php to talk to each other Jürgen Exner <jurgenex@hotmail.com> - 2013-03-14 04:18 -0700
Re: getting perl and php to talk to each other Scott Johnson <noonehome@chalupasworld.com> - 2013-03-14 05:38 -0700
Re: getting perl and php to talk to each other Ben Morrow <ben@morrow.me.uk> - 2013-03-07 14:25 +0000
Re: getting perl and php to talk to each other Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-07 08:14 -0500
Re: getting perl and php to talk to each other Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-06 02:08 +0100
Re: getting perl and php to talk to each other Cal Dershowitz <cal@example.invalid> - 2013-03-06 22:53 -0800
Re: getting perl and php to talk to each other "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-03-07 09:46 +0100
Re: getting perl and php to talk to each other David Robley <me@home.invalid> - 2013-03-07 21:43 +1030
Re: getting perl and php to talk to each other "Peter H. Coffin" <hellsop@ninehells.com> - 2013-03-07 07:32 -0600
Re: getting perl and php to talk to each other SwissCheese <swisscheese@cfl.rr.com> - 2013-03-07 06:28 -0500
Re: getting perl and php to talk to each other Ben Morrow <ben@morrow.me.uk> - 2013-03-07 14:33 +0000
Re: getting perl and php to talk to each other Cal Dershowitz <cal@example.invalid> - 2013-03-14 02:16 -0700
Re: getting perl and php to talk to each other Cal Dershowitz <cal@example.invalid> - 2013-03-14 03:28 -0700
Re: getting perl and php to talk to each other SwissCheese <swisscheese@cfl.rr.com> - 2013-03-14 06:51 -0400
Re: getting perl and php to talk to each other Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-18 12:54 +0100
Re: getting perl and php to talk to each other SwissCheese <swisscheese@cfl.rr.com> - 2013-03-18 20:23 -0400
Re: getting perl and php to talk to each other alexd <troffasky@hotmail.com> - 2013-03-07 19:09 +0000
Re: getting perl and php to talk to each other Henry Law <news@lawshouse.org> - 2013-03-07 20:09 +0000
Re: getting perl and php to talk to each other Cal Dershowitz <cal@example.invalid> - 2013-03-14 02:23 -0700
Re: getting perl and php to talk to each other The Natural Philosopher <tnp@invalid.invalid> - 2013-03-07 20:43 +0000
Re: getting perl and php to talk to each other Alastair Black <abqab.nemo@example.net> - 2013-03-07 14:47 -0700
Re: getting perl and php to talk to each other "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-03-07 23:11 +0100
Re: getting perl and php to talk to each other Alastair Black <abqab.nemo@example.net> - 2013-03-07 15:50 -0700
Re: getting perl and php to talk to each other Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-07 19:45 -0500
Re: getting perl and php to talk to each other Cal Dershowitz <cal@example.invalid> - 2013-03-14 02:19 -0700
Re: getting perl and php to talk to each other Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-14 07:55 -0400
where to put the binaries was Re: getting perl and php to talk to each other Cal Dershowitz <cal@example.invalid> - 2013-03-14 03:11 -0700
Re: where to put the binaries was Re: getting perl and php to talk to each other The Natural Philosopher <tnp@invalid.invalid> - 2013-03-14 11:12 +0000
Re: where to put the binaries was Re: getting perl and php to talk to each other Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-14 08:04 -0400
Re: randomly sorting files in php Captain Paralytic <paul_lautman@yahoo.com> - 2013-03-04 02:45 -0800
Re: randomly sorting files in php Cal Dershowitz <cal@example.invalid> - 2013-03-14 03:39 -0700
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
| From | Jürgen Exner <jurgenex@hotmail.com> |
|---|---|
| Date | 2013-03-14 04:18 -0700 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <aec3k8dbkg6sueak0h2pcoftfl0ts6oh1n@4ax.com> |
| In reply to | #8655 |
Cal Dershowitz <cal@example.invalid> wrote: >On 03/07/2013 05:17 AM, Jerry Stuckle wrote: [...] >>>> Cal, please, try to learn one language properly before wildly >>>> introducing more languages to the equation. It *really* isn't going to >>>> help. >>> >>> Help what? Are you certain that it's completely impossible that a file >>> could go missing from me that I would need to do this, and that there >>> would be every reason in this fascist world world to keep me from >>> getting a decent web capability? >>> >> >> There are hundreds of millions of web sites which have "decent web >> capabilities" but don't try to mix languages. I agree with Ben - learn >> one language first. >> >> And if you want help, I *highly* suggest you change your attitude. >> Calling people facists does not endear ANYONE. > >People like me just fine. Fuck off. Your wish is my command: ***PLONK*** jue
[toc] | [prev] | [next] | [standalone]
| From | Scott Johnson <noonehome@chalupasworld.com> |
|---|---|
| Date | 2013-03-14 05:38 -0700 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <khsg88$1nb$1@dont-email.me> |
| In reply to | #8659 |
On 3/14/2013 4:18 AM, Jürgen Exner wrote: > Cal Dershowitz <cal@example.invalid> wrote: >> On 03/07/2013 05:17 AM, Jerry Stuckle wrote: > [...] >>>>> Cal, please, try to learn one language properly before wildly >>>>> introducing more languages to the equation. It *really* isn't going to >>>>> help. >>>> >>>> Help what? Are you certain that it's completely impossible that a file >>>> could go missing from me that I would need to do this, and that there >>>> would be every reason in this fascist world world to keep me from >>>> getting a decent web capability? >>>> >>> >>> There are hundreds of millions of web sites which have "decent web >>> capabilities" but don't try to mix languages. I agree with Ben - learn >>> one language first. >>> >>> And if you want help, I *highly* suggest you change your attitude. >>> Calling people facists does not endear ANYONE. >> >> People like me just fine. Fuck off. > > Your wish is my command: ***PLONK*** > > jue > Ditto
[toc] | [prev] | [next] | [standalone]
| From | Ben Morrow <ben@morrow.me.uk> |
|---|---|
| Date | 2013-03-07 14:25 +0000 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <0jkm0a-td13.ln1@anubis.morrow.me.uk> |
| In reply to | #8556 |
Quoth Cal Dershowitz <cal@example.invalid>: > On 03/06/2013 10:57 PM, Ben Morrow wrote: > > Quoth Cal Dershowitz <cal@example.invalid>: > >> > >> I've chosen this rather arbitrary task just to see what I can do with > >> this syntax which is new to me, php, as opposed to what a person can do > >> with, perl, which I have previously used to give me a webpage. > > > > Cal, please, try to learn one language properly before wildly > > introducing more languages to the equation. It *really* isn't going to > > help. > > Help what? Are you certain that it's completely impossible that a file > could go missing from me that I would need to do this, and that there > would be every reason in this fascist world world to keep me from > getting a decent web capability? I am quite certain that whatever it is you are trying to accomplish, you can do it more easily in either Perl or PHP alone than in both combined. You seem to keep losing files. You should consider taking backups, or using a version control system. > I don't seem to be loading up facebook.ben.pl very often. That makes no sense. If you want help, you should start by making at least a token effort to make sense. Ben
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2013-03-07 08:14 -0500 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <kha3p0$9l5$1@dont-email.me> |
| In reply to | #8552 |
On 3/7/2013 1:37 AM, Cal Dershowitz wrote: > On 03/05/2013 05:08 PM, Jerry Stuckle wrote: >> On 3/5/2013 6:59 PM, Ben Morrow wrote: > <snip> > What I wanted to do that this article had mentioned was to be able to > call perl reliably either from php or from a bash script that > comprehends it all. To what purpose? <snip> > I've chosen this rather arbitrary task just to see what I can do with > this syntax which is new to me, php, as opposed to what a person can do > with, perl, which I have previously used to give me a webpage. To what purpose? >> >> I agree it would be quite rare, but it's about the only reason I could >> think of people would need both languages. I'm sure there are more, >> though. > > Can I use perl regex's or do I have to learn a whole 'nother idea of > what that is? If you're writing in PHP, you learn PHP's way of doing things. It also has regex's (which are pretty close to Perl's). <snip> > I'm not thrilled with being OT again, but I just can't get > PHP::Interpreter to install and don't know exactly why. I don't like to > be OT, but something that seems to work for others isn't for me now, and > it's not at the level of scripting languages. > Most people don't try to mix languages like you are. It overly complicates things. > I can ask very-flawed specific questions but need to wonder aloud why > php-config doesn't work, why files that are supposed to be there aren't, > and how I troubleshoot the basic function of it before I actually get > this topic off the ground. > > What exactly do I have to do at this point to get a php-config that > works as far as PHP::Interpreter is concerned? > > I've tried ten things that don't work. So, how did you install PHP? -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2013-03-06 02:08 +0100 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <1941791.xHBDaC4yCW@PointedEars.de> |
| In reply to | #8535 |
Ben Morrow wrote:
> Quoth Thomas 'PointedEars' Lahn <php@PointedEars.de>:
>> Ben Morrow wrote:
>> > Note that the Perl in that article (or at least, the first page, which
>> > was all I read) is pretty bad:
>> >
>> > […]
>> > - using PHP to talk to a database, when Perl's DBI module is
>> > considerably better than PHP's rather random database functions.
>> >
>> > I don't know PHP well enough to comment on it,
>>
>> Yet you did, which shows that you have never used PHP Data Objects (PDO).
>> “*Random* database functions”? IBTD.
>
> I have not. The database functions used in the article referenced were
> mssql_connect and so on, which last time I used PHP (a long time ago)
> was all there was. I don't think you can deny that *those* functions
> (and the equivalent set for other databases) are a nasty mess.
Most certainly I deny that. I agree that several of those functions are
unsafe, and it is unfortunate that the order of arguments for MS SQL is
different than, for example, MySQL. But IMHO that is still a long way from
“a nasty mess”. They have been used and have worked for the better part of
a decade. After all, they have helped to build the Web that we have today,
so they cannot be all bad, can they?
AFAIK the first step towards a better interface (with support for Prepared
Statements) was mysqli by MySQL AB, now Oracle, with PHP 5.0 or later. Then
came PDO and others.
> I tried to make it clear that I understand the state of the PHP art has
> improved since then.
The state of the PHP art as the article suggests was even better back then.
You should not assume that the quality of PHP code as it can be found in
such articles, in blogs, and Web forums reflects the quality of the
programming language at the time. In fact, you would do well to assume that
it reflects the exact opposite. The same is true for other (overly)
beginner-friendly languages, for example ECMAScript implementations like
JavaScript. (And if you know that ECMAScript and its implementations as
well as PHP range among my favorite languages despite their flaws, you also
know that I do not make such statements lightly.)
> My major point was that I don't see any good reason to call into PHP
> just to connect to a database, when Perl already has perfectly good
> database code. Had the example been written the other way around the
> equivalent point could of course have been made about calling into Perl.
>
>> > but I wouldn't be surprised if the PHP code was just as bad (for
>> > instance, I understand PHP has a saner database interface these days; I
>> > don't know if it existed in 2007, though).
>>
>> It did; for example, “PDO [shipped] with PHP 5.1”, “[r]eleased: 24 Nov
>> 2005”, which is not that hard to find out:
>
> Not that hard had I been interested, which I'm not, and had I known
> 'PDO' was the term to look for, which I didn't.
Please don't play stupid with me. That section is part of a chapter of the
PHP manual about several database interfaces.
> (I was actually thinking of the PEAR DB module, which I've observed is a
> thing that exists.
Many things exist on PEAR, written by third parties, some with stupid
interfaces; the same was as many things exist on CPAN, some with stupid
interfaces.
<OT>
For example, I remember Number::Format from CPAN to be particularly stupid
with regard to locales:
my ( $thousands_sep, $mon_thousands_sep, $grouping, $decimal_point ) =
@{ localeconv() }{ 'thousands_sep', 'mon_thousands_sep', 'grouping',
'decimal_point' };
# Apply defaults if values are missing
$thousands_sep = $mon_thousands_sep unless $thousands_sep;
$thousands_sep = ' ' unless $thousands_sep;
# grouping and mon_grouping are packed lists
# of small integers (characters) telling the
# grouping (thousand_seps and mon_thousand_seps
# being the group dividers) of numbers and
# monetary quantities. The integers' meanings:
# 255 means no more grouping, 0 means repeat
# the previous grouping, 1-254 means use that
# as the current grouping. Grouping goes from
# right to left (low to high digits). In the
# below we cheat slightly by never using anything
# else than the first grouping (whatever that is).
my @grouping;
if ($grouping)
{
@grouping = unpack( "C*", $grouping );
}
else
{
@grouping = (3);
}
## FIXME: Why don't the defaults work already?
my $formatter = new Number::Format(
-decimal_point => $decimal_point,
-thousands_sep => $thousands_sep,
-kibi_suffix => ' KiB',
-mebi_suffix => ' MiB',
-gibi_suffix => ' GiB',
# -grouping => $grouping[0]
);
echo $formatter->format(421337);
----
Does that not qualify as a “god-awful mess” for you for something so basic
such as formatting numbers? [It is not really better in PHP with
number_format(), though. Apparently, despite its obvious importance – what
have *computers* originally been built for? –, easy and proper number
formatting, and string formatting in general, apparently is not on the list
of priorities in many programming language designs. As if many language
designers subscribed to the paradigm ”Who cares? Let the developer reinvent
the wheel over and over again” :-/]
</OT>
> Again, I've no idea if this is the currently-recommended database
> interface, or how it compares with the Perl DBI.)
I can recommend it from professional experience, because it is a very clean
and efficient, object-oriented, easily customizable, and rather compatible
interface. Zend Framework uses it by default, for example. Which allows
you in many cases just to switch the database adapter if you switch the
DBMS. (In case you do not know, the people who wrote/write the PHP VM are
at Zend.)
So I can only strongly suggest again that you RTFM and STFW before you make
any statement about languages that you say (or think) you do not know well
enough to make statements about, unless you want to make a fool out of
yourself.
HTH
PointedEars
--
> If you get a bunch of authors […] that state the same "best practices"
> in any programming language, then you can bet who is wrong or right...
Not with javascript. Nonsense propagates like wildfire in this field.
-- Richard Cornford, comp.lang.javascript, 2011-11-14
[toc] | [prev] | [next] | [standalone]
| From | Cal Dershowitz <cal@example.invalid> |
|---|---|
| Date | 2013-03-06 22:53 -0800 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <kqKdnfWb5I3RpKXMnZ2dnUVZ_h-dnZ2d@supernews.com> |
| In reply to | #8533 |
On 03/05/2013 02:06 PM, Ben Morrow wrote: > > Quoth Cal Dershowitz <cal@example.invalid>: >> [x-posted to clp.misc] > [...] >> >> This article has me convinced that I want perl and php able to deal with >> each other: >> >> http://www.linuxjournal.com/article/9282?page=0,1 > > Why on Earth would you want to do that? Seriously, I can't think of any > situation where mixing PHP and Perl is easier than just writing in Perl > in the first place. > > Note that the Perl in that article (or at least, the first page, which > was all I read) is pretty bad: > > - use of global filehandles, unnecessary since 2000, > - use of Thread.pm, deprecated since 2002, > - use of threads at all for such a trivial problem, > - using rindex and substr rather than pattern matching, > - using backticks instead of system(), > - using PHP to talk to a database, when Perl's DBI module is > considerably better than PHP's rather random database functions. > > I don't know PHP well enough to comment on it, but I wouldn't be > surprised if the PHP code was just as bad (for instance, I understand > PHP has a saner database interface these days; I don't know if it > existed in 2007, though). > >> so far so good, and then this thing which I've seen in the literature: >> >> using php_config 'php-config' >> Can't exec "php-config": No such file or directory at Makefile.PL line 55. >> Failed to find the 'php-config' executable. Make sure you have PHP and >> PHP sources installed, and that 'php-config' is in PATH. at Makefile.PL >> line 55. >> ... >> >> bla bla bla do not pass Go. Right now I have a default installation. >> >> Simple question: What types of things can I get configured with >> php-config? envelope data available? ftp data? > > php-config is a program installed with php, which tells other programs > how php was installed. For instance, on my system > > ~% php-config --libs > -lcrypt -lcrypt -lpcre -lm -lxml2 -lz -liconv -lm -lcrypt -lcrypt > ~% php-config --includes > -I/usr/local/include/php -I/usr/local/include/php/main > -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend > -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib > ~% > > and so on. If you've installed php properly (including any required > development packages, if you're using a package system), you should have > a php-config executable somewhere. Make sure it's in your PATH before > running Makefile.PL. Struggling. $ php-config --libs No command 'php-config' found, did you mean: Command 'pdp-config' from package 'pd-pdp' (universe) Command 'php-config5' from package 'php5-dev' (main) php-config: command not found $ -- Cal
[toc] | [prev] | [next] | [standalone]
| From | "M. Strobel" <sorry_no_mail_here@nowhere.dee> |
|---|---|
| Date | 2013-03-07 09:46 +0100 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <apr2g0FpbtdU1@mid.uni-berlin.de> |
| In reply to | #8553 |
Am 07.03.2013 07:53, schrieb Cal Dershowitz: > On 03/05/2013 02:06 PM, Ben Morrow wrote: >> and so on. If you've installed php properly (including any required >> development packages, if you're using a package system), you should have >> a php-config executable somewhere. Make sure it's in your PATH before >> running Makefile.PL. > > Struggling. > > $ php-config --libs > No command 'php-config' found, did you mean: > Command 'pdp-config' from package 'pd-pdp' (universe) > Command 'php-config5' from package 'php5-dev' (main) > php-config: command not found > $ strobel@suse122-intel:~> php-config --libs -lcrypt -lresolv -lpcre -lcrypt -lcrypt -lrt -lm -ldl -lnsl -lrt -lcrypt -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt strobel@suse122-intel:~> So the "...If you've installed php properly..." still holds. /Str.
[toc] | [prev] | [next] | [standalone]
| From | David Robley <me@home.invalid> |
|---|---|
| Date | 2013-03-07 21:43 +1030 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <kh9spc$n0d$1@news.albasani.net> |
| In reply to | #8555 |
M. Strobel wrote: > Am 07.03.2013 07:53, schrieb Cal Dershowitz: >> On 03/05/2013 02:06 PM, Ben Morrow wrote: > >>> and so on. If you've installed php properly (including any required >>> development packages, if you're using a package system), you should have >>> a php-config executable somewhere. Make sure it's in your PATH before >>> running Makefile.PL. >> >> Struggling. >> >> $ php-config --libs >> No command 'php-config' found, did you mean: >> Command 'pdp-config' from package 'pd-pdp' (universe) >> Command 'php-config5' from package 'php5-dev' (main) >> php-config: command not found >> $ > > strobel@suse122-intel:~> php-config --libs > -lcrypt -lresolv -lpcre -lcrypt -lcrypt -lrt -lm -ldl -lnsl -lrt -lcrypt > -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt > strobel@suse122-intel:~> > > So the "...If you've installed php properly..." still holds. > > /Str. Ooh, I can show more than that :-) bash-4.1$ php-config --libs -lcrypt -lz -lexslt -lresolv -lcrypt -lrt -lmysqlclient -lfreetype -lX11 - lXpm -lpng -lz -ljpeg -lz -lrt -lm -ldl -lnsl -lxml2 -lz -lm -lssl -lcrypto -ldl -lxml2 -lz -lm -lmysqlclient -lm -lrt -ldl -lmysqlclient -lm -lrt -ldl -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxslt - lxml2 -lz -lm -lcrypt -- Cheers David Robley Who is General Failure and why is he reading my disk?
[toc] | [prev] | [next] | [standalone]
| From | "Peter H. Coffin" <hellsop@ninehells.com> |
|---|---|
| Date | 2013-03-07 07:32 -0600 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <slrnkjh5nd.m9f.hellsop@nibelheim.ninehells.com> |
| In reply to | #8558 |
On Thu, 07 Mar 2013 21:43:50 +1030, David Robley wrote:
> Ooh, I can show more than that :-)
>
> bash-4.1$ php-config --libs
> -lcrypt -lz -lexslt -lresolv -lcrypt -lrt -lmysqlclient -lfreetype -lX11 -
> lXpm -lpng -lz -ljpeg -lz -lrt -lm -ldl -lnsl -lxml2 -lz -lm -lssl -lcrypto
> -ldl -lxml2 -lz -lm -lmysqlclient -lm -lrt -ldl -lmysqlclient -lm -lrt -ldl
> -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxslt -
> lxml2 -lz -lm -lcrypt
"You said lxml2 seven times."
*hock-spit* "I like lxml2."
--
I got told by a friend's ex-girlfriend that she could tell I was
a Linux geek from the way I *walked*.
-- Skud
[toc] | [prev] | [next] | [standalone]
| From | SwissCheese <swisscheese@cfl.rr.com> |
|---|---|
| Date | 2013-03-07 06:28 -0500 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <kh9tib$9k9$1@dont-email.me> |
| In reply to | #8553 |
On 03/07/2013 01:53 AM, Cal Dershowitz wrote: > On 03/05/2013 02:06 PM, Ben Morrow wrote: >> >> Quoth Cal Dershowitz <cal@example.invalid>: >>> [x-posted to clp.misc] >> [...] >>> >>> This article has me convinced that I want perl and php able to deal with >>> each other: >>> >>> http://www.linuxjournal.com/article/9282?page=0,1 >> >> Why on Earth would you want to do that? Seriously, I can't think of any >> situation where mixing PHP and Perl is easier than just writing in Perl >> in the first place. >> >> Note that the Perl in that article (or at least, the first page, which >> was all I read) is pretty bad: >> >> - use of global filehandles, unnecessary since 2000, >> - use of Thread.pm, deprecated since 2002, >> - use of threads at all for such a trivial problem, >> - using rindex and substr rather than pattern matching, >> - using backticks instead of system(), >> - using PHP to talk to a database, when Perl's DBI module is >> considerably better than PHP's rather random database functions. >> >> I don't know PHP well enough to comment on it, but I wouldn't be >> surprised if the PHP code was just as bad (for instance, I understand >> PHP has a saner database interface these days; I don't know if it >> existed in 2007, though). >> >>> so far so good, and then this thing which I've seen in the literature: >>> >>> using php_config 'php-config' >>> Can't exec "php-config": No such file or directory at Makefile.PL >>> line 55. >>> Failed to find the 'php-config' executable. Make sure you have PHP and >>> PHP sources installed, and that 'php-config' is in PATH. at Makefile.PL >>> line 55. >>> ... >>> >>> bla bla bla do not pass Go. Right now I have a default installation. >>> >>> Simple question: What types of things can I get configured with >>> php-config? envelope data available? ftp data? >> >> php-config is a program installed with php, which tells other programs >> how php was installed. For instance, on my system >> >> ~% php-config --libs >> -lcrypt -lcrypt -lpcre -lm -lxml2 -lz -liconv -lm -lcrypt -lcrypt >> ~% php-config --includes >> -I/usr/local/include/php -I/usr/local/include/php/main >> -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend >> -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib >> ~% >> >> and so on. If you've installed php properly (including any required >> development packages, if you're using a package system), you should have >> a php-config executable somewhere. Make sure it's in your PATH before >> running Makefile.PL. > > Struggling. > > $ php-config --libs > No command 'php-config' found, did you mean: > Command 'pdp-config' from package 'pd-pdp' (universe) > Command 'php-config5' from package 'php5-dev' (main) > php-config: command not found > $ Try php-config5 as php-config is a link to php-config5. Here they both reside in /usr/bin. If you are missing php-config link (it appears so) then create it. -- Norman Registered Linux user #461062 -Have you been to www.php.net yet?-
[toc] | [prev] | [next] | [standalone]
| From | Ben Morrow <ben@morrow.me.uk> |
|---|---|
| Date | 2013-03-07 14:33 +0000 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <d2lm0a-td13.ln1@anubis.morrow.me.uk> |
| In reply to | #8559 |
Quoth swisscheese@cfl.rr.com: > On 03/07/2013 01:53 AM, Cal Dershowitz wrote: > > > > Struggling. > > > > $ php-config --libs > > No command 'php-config' found, did you mean: > > Command 'pdp-config' from package 'pd-pdp' (universe) > > Command 'php-config5' from package 'php5-dev' (main) > > php-config: command not found > > $ > > Try php-config5 as php-config is a link to php-config5. Here they > both reside in /usr/bin. If you are missing php-config link (it appears > so) then create it. Installing the php-dev package should have created this link: http://xrl.us/bomxwq . Ben
[toc] | [prev] | [next] | [standalone]
| From | Cal Dershowitz <cal@example.invalid> |
|---|---|
| Date | 2013-03-14 02:16 -0700 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <beudnRE9qJkZCNzMnZ2dnUVZ_tSdnZ2d@supernews.com> |
| In reply to | #8568 |
On 03/07/2013 06:33 AM, Ben Morrow wrote:
>
> Quoth swisscheese@cfl.rr.com:
>> On 03/07/2013 01:53 AM, Cal Dershowitz wrote:
>>>
>>> Struggling.
>>>
>>> $ php-config --libs
>>> No command 'php-config' found, did you mean:
>>> Command 'pdp-config' from package 'pd-pdp' (universe)
>>> Command 'php-config5' from package 'php5-dev' (main)
>>> php-config: command not found
>>> $
>>
>> Try php-config5 as php-config is a link to php-config5. Here they
>> both reside in /usr/bin. If you are missing php-config link (it appears
>> so) then create it.
>
> Installing the php-dev package should have created this link:
> http://xrl.us/bomxwq .
>
> Ben
>
I can't tell what precisely is holding me back now. I do, for an
absolute fact, know that it is not due to a lack of OP spending time
trying to figure this stuff out as best he can.
$ cat phpini.sh
1 #!/bin/sh
2
3 set -e
4
5 #DEBHELPER#
6
7 if [ "$1" != "configure" ]; then
8 exit 0
9 fi
10
11 for i in php-config phpize; do
12 update-alternatives \
13 --install /usr/bin/"$i" $i /usr/bin/"$i"5 50 \
14 --slave /usr/share/man/man1/"$i".1.gz "$i".1.gz
/usr/share/man/man1/"$i"5.1.gz
15 done
16
17 exit 0
$ ./reg2.pl
1 #!/bin/sh
2
...
This primitive script is what I have for reg2.pl:
#!/usr/bin/perl -w
use strict;
use 5.010;
use File::Slurp;
my $in = 'phpini.sh';
my $out = 'php1.sh';
my @lines = read_file($in);
open( my $fh, ">", $out) or die $! ;
foreach (@lines) {
print $_ . "\n";
s/^\s+//;
s/^\d+//;
s/^\s+//;
print $fh $_;
}
close $fh;
...
$ cat php1.sh
#!/bin/sh
set -e
#DEBHELPER#
if [ "$1" != "configure" ]; then
exit 0
fi
for i in php-config phpize; do
update-alternatives \
--install /usr/bin/"$i" $i /usr/bin/"$i"5 50 \
--slave /usr/share/man/man1/"$i".1.gz "$i".1.gz
/usr/share/man/man1/"$i"5.1.gz
done
exit 0
$
...
$ ./php1.sh configure
update-alternatives: error: alternative path /usr/bin/php-config5
doesn't exist.
$
...
That has to say something there, doesn't it?
--
Cal
[toc] | [prev] | [next] | [standalone]
| From | Cal Dershowitz <cal@example.invalid> |
|---|---|
| Date | 2013-03-14 03:28 -0700 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <xpGdnU52KfSrO9zMnZ2dnUVZ_qWdnZ2d@supernews.com> |
| In reply to | #8559 |
On 03/07/2013 03:28 AM, SwissCheese wrote: > On 03/07/2013 01:53 AM, Cal Dershowitz wrote: >> On 03/05/2013 02:06 PM, Ben Morrow wrote: >>> >>> Quoth Cal Dershowitz <cal@example.invalid>: >>>> [x-posted to clp.misc] >>> [...] >>>> >>>> This article has me convinced that I want perl and php able to deal >>>> with >>>> each other: >>>> >>>> http://www.linuxjournal.com/article/9282?page=0,1 >>> >>> Why on Earth would you want to do that? Seriously, I can't think of any >>> situation where mixing PHP and Perl is easier than just writing in Perl >>> in the first place. >>> >>> Note that the Perl in that article (or at least, the first page, which >>> was all I read) is pretty bad: >>> >>> - use of global filehandles, unnecessary since 2000, >>> - use of Thread.pm, deprecated since 2002, >>> - use of threads at all for such a trivial problem, >>> - using rindex and substr rather than pattern matching, >>> - using backticks instead of system(), >>> - using PHP to talk to a database, when Perl's DBI module is >>> considerably better than PHP's rather random database functions. >>> >>> I don't know PHP well enough to comment on it, but I wouldn't be >>> surprised if the PHP code was just as bad (for instance, I understand >>> PHP has a saner database interface these days; I don't know if it >>> existed in 2007, though). >>> >>>> so far so good, and then this thing which I've seen in the literature: >>>> >>>> using php_config 'php-config' >>>> Can't exec "php-config": No such file or directory at Makefile.PL >>>> line 55. >>>> Failed to find the 'php-config' executable. Make sure you have PHP and >>>> PHP sources installed, and that 'php-config' is in PATH. at Makefile.PL >>>> line 55. >>>> ... >>>> >>>> bla bla bla do not pass Go. Right now I have a default installation. >>>> >>>> Simple question: What types of things can I get configured with >>>> php-config? envelope data available? ftp data? >>> >>> php-config is a program installed with php, which tells other programs >>> how php was installed. For instance, on my system >>> >>> ~% php-config --libs >>> -lcrypt -lcrypt -lpcre -lm -lxml2 -lz -liconv -lm -lcrypt -lcrypt >>> ~% php-config --includes >>> -I/usr/local/include/php -I/usr/local/include/php/main >>> -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend >>> -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib >>> ~% >>> >>> and so on. If you've installed php properly (including any required >>> development packages, if you're using a package system), you should have >>> a php-config executable somewhere. Make sure it's in your PATH before >>> running Makefile.PL. >> >> Struggling. >> >> $ php-config --libs >> No command 'php-config' found, did you mean: >> Command 'pdp-config' from package 'pd-pdp' (universe) >> Command 'php-config5' from package 'php5-dev' (main) >> php-config: command not found >> $ > > Try php-config5 as php-config is a link to php-config5. Here they > both reside in /usr/bin. If you are missing php-config link (it appears > so) then create it. > swiss, Can you elaborate? -- Cal
[toc] | [prev] | [next] | [standalone]
| From | SwissCheese <swisscheese@cfl.rr.com> |
|---|---|
| Date | 2013-03-14 06:51 -0400 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <khsa0r$3p1$1@dont-email.me> |
| In reply to | #8653 |
On 03/14/2013 06:28 AM, Cal Dershowitz wrote: > On 03/07/2013 03:28 AM, SwissCheese wrote: >> On 03/07/2013 01:53 AM, Cal Dershowitz wrote: >>> On 03/05/2013 02:06 PM, Ben Morrow wrote: >>>> >>>> Quoth Cal Dershowitz <cal@example.invalid>: >>>>> [x-posted to clp.misc] >>>> [...] >>>>> >>>>> This article has me convinced that I want perl and php able to deal >>>>> with >>>>> each other: >>>>> >>>>> http://www.linuxjournal.com/article/9282?page=0,1 >>>> >>>> Why on Earth would you want to do that? Seriously, I can't think of any >>>> situation where mixing PHP and Perl is easier than just writing in Perl >>>> in the first place. >>>> >>>> Note that the Perl in that article (or at least, the first page, which >>>> was all I read) is pretty bad: >>>> >>>> - use of global filehandles, unnecessary since 2000, >>>> - use of Thread.pm, deprecated since 2002, >>>> - use of threads at all for such a trivial problem, >>>> - using rindex and substr rather than pattern matching, >>>> - using backticks instead of system(), >>>> - using PHP to talk to a database, when Perl's DBI module is >>>> considerably better than PHP's rather random database functions. >>>> >>>> I don't know PHP well enough to comment on it, but I wouldn't be >>>> surprised if the PHP code was just as bad (for instance, I understand >>>> PHP has a saner database interface these days; I don't know if it >>>> existed in 2007, though). >>>> >>>>> so far so good, and then this thing which I've seen in the literature: >>>>> >>>>> using php_config 'php-config' >>>>> Can't exec "php-config": No such file or directory at Makefile.PL >>>>> line 55. >>>>> Failed to find the 'php-config' executable. Make sure you have PHP and >>>>> PHP sources installed, and that 'php-config' is in PATH. at >>>>> Makefile.PL >>>>> line 55. >>>>> ... >>>>> >>>>> bla bla bla do not pass Go. Right now I have a default installation. >>>>> >>>>> Simple question: What types of things can I get configured with >>>>> php-config? envelope data available? ftp data? >>>> >>>> php-config is a program installed with php, which tells other programs >>>> how php was installed. For instance, on my system >>>> >>>> ~% php-config --libs >>>> -lcrypt -lcrypt -lpcre -lm -lxml2 -lz -liconv -lm -lcrypt -lcrypt >>>> ~% php-config --includes >>>> -I/usr/local/include/php -I/usr/local/include/php/main >>>> -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend >>>> -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib >>>> ~% >>>> >>>> and so on. If you've installed php properly (including any required >>>> development packages, if you're using a package system), you should >>>> have >>>> a php-config executable somewhere. Make sure it's in your PATH before >>>> running Makefile.PL. >>> >>> Struggling. >>> >>> $ php-config --libs >>> No command 'php-config' found, did you mean: >>> Command 'pdp-config' from package 'pd-pdp' (universe) >>> Command 'php-config5' from package 'php5-dev' (main) >>> php-config: command not found >>> $ >> >> Try php-config5 as php-config is a link to php-config5. Here they >> both reside in /usr/bin. If you are missing php-config link (it appears >> so) then create it. >> > > swiss, > > Can you elaborate? The file 'php-config' is a pointer (hard/soft link) to 'php-config5'. Running 'php-config' actually runs 'php-config5'. Run the command: man ln ...to read up on how to use them. At worst you could just make a copy of 'php-config5' and rename it 'php-config' but I would have to say creating the link is the proper thing to do. -- Norman Registered Linux user #461062 -Have you been to www.php.net yet?-
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2013-03-18 12:54 +0100 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <2785829.OKbtRJzbVc@PointedEars.de> |
| In reply to | #8656 |
SwissCheese wrote: ^^^^^^^^^^^ Please put your real name there. And stop crossposting without Followup-To (F'up2). > The file 'php-config' is a pointer (hard/soft link) to 'php-config5'. Most likely it is not a hardlink, but a symlink. F'up2 .php PointedEars -- Use any version of Microsoft Frontpage to create your site. (This won't prevent people from viewing your source, but no one will want to steal it.) -- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)
[toc] | [prev] | [next] | [standalone]
| From | SwissCheese <swisscheese@cfl.rr.com> |
|---|---|
| Date | 2013-03-18 20:23 -0400 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <ki8b2e$bpp$1@dont-email.me> |
| In reply to | #8712 |
On 03/18/2013 07:54 AM, Thomas 'PointedEars' Lahn wrote: > SwissCheese wrote: > ^^^^^^^^^^^ > Please put your real name there. And stop crossposting without Followup-To > (F'up2). > My real name is in my sig... >> The file 'php-config' is a pointer (hard/soft link) to 'php-config5'. > > Most likely it is not a hardlink, but a symlink. > > I'm no master at all the different types of links, that's why I suggested he 'man ln' as well as telling him 'basically' what was going on. -- Norman Registered Linux user #461062 -Have you been to www.php.net yet?-
[toc] | [prev] | [next] | [standalone]
| From | alexd <troffasky@hotmail.com> |
|---|---|
| Date | 2013-03-07 19:09 +0000 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <khaoi9$6i8$1@dont-email.me> |
| In reply to | #8553 |
Cal Dershowitz (for it is he) wrote: > Struggling. > > $ php-config --libs > No command 'php-config' found, did you mean: > Command 'pdp-config' from package 'pd-pdp' (universe) > Command 'php-config5' from package 'php5-dev' (main) > php-config: command not found I should think that anybody with a passing familiarity with package management would be able to work out what this output is telling them. -- <http://ale.cx/> (AIM:troffasky) (UnSoEsNpEaTm@ale.cx) 19:08:28 up 80 days, 21:40, 8 users, load average: 0.91, 1.21, 1.25 Qua illic est reprehendit, illic est a vindicatum
[toc] | [prev] | [next] | [standalone]
| From | Henry Law <news@lawshouse.org> |
|---|---|
| Date | 2013-03-07 20:09 +0000 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <x8adnbDlrcNxbqXMnZ2dnUVZ8s-dnZ2d@giganews.com> |
| In reply to | #8576 |
On 07/03/13 19:09, alexd wrote: > I should think that anybody with a passing familiarity with package > management would be able to work out what this output is telling them. > ay, there’s the rub! -- Henry Law Manchester, England
[toc] | [prev] | [next] | [standalone]
| From | Cal Dershowitz <cal@example.invalid> |
|---|---|
| Date | 2013-03-14 02:23 -0700 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <beudnRM9qJmGCtzMnZ2dnUVZ_tSdnZ2d@supernews.com> |
| In reply to | #8578 |
On 03/07/2013 12:09 PM, Henry Law wrote: > On 07/03/13 19:09, alexd wrote: > >> I should think that anybody with a passing familiarity with package >> management would be able to work out what this output is telling them. >> > > ay, there’s the rub! > Rub? This is just getting tackled and not knowing why. -- Cal
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-03-07 20:43 +0000 |
| Subject | Re: getting perl and php to talk to each other |
| Message-ID | <khau58$tq4$2@news.albasani.net> |
| In reply to | #8576 |
On 07/03/13 19:09, alexd wrote: > Cal Dershowitz (for it is he) wrote: > >> Struggling. >> >> $ php-config --libs >> No command 'php-config' found, did you mean: >> Command 'pdp-config' from package 'pd-pdp' (universe) >> Command 'php-config5' from package 'php5-dev' (main) >> php-config: command not found > > I should think that anybody with a passing familiarity with package > management would be able to work out what this output is telling them. > a passing familiarity with package management is not a requirement for running PHP or posting in this NG. NOr is installation of php development files and utilities a requirement fora basic LAMP setup. -- Ineptocracy (in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
Back to top | Article view | comp.lang.php
csiph-web