Re: PHP: mysql_connect() undefined function

2006-08-17 Thread Roberto C. Sanchez
On Thu, Aug 17, 2006 at 12:17:11PM +0200, Paolo Pantaleo wrote:
> 
> Well,
> 
> on my toy hosting service I haven't python or ruby, only mysql and
> php. I konw Python and I like it very much, but I think I cannot use

Then find a better web host :-)

Seriously, there are many web hosting providers out there providing
Python and other server side scripting languages that are not PHP.
Same thing on PostgreSQL versus MySQL.

> any templating system (PSP or Cheetah, or whatever). Any idea about
> that?
> 
I know that Django works quite nicely for Python, but it requires the
presence of a database, which may or may not be a problem for some
people.  There are many other excellent templating solutions for Python
(I have heard), though I have not had much first hand experience with
them.

> Moreover I want something that just works in little time, so PHP seems
> quite good.
> 
And I would argue that Python would work even better if you already know
it. :-)

> Greetings
> PAolo
> 
Regards,

-Roberto

-- 
Roberto C. Sanchez
http://familiasanchez.net/~roberto


signature.asc
Description: Digital signature


Re: PHP: mysql_connect() undefined function

2006-08-17 Thread Jan Dinger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Stephen wrote:
> On Thu, Aug 17, 2006 at 12:28:22PM +0200 or thereabouts, Paolo Pantaleo wrote:
> 
> [...]
> 
>> I think the error says that PHP doesn't know the function, not that
>> there is an error executing the function.
>>
>> So, finally googling around I found the solution:
>>
>> in /etc/php/apache2/php.in
>>
>> I uncommented the line
>>
>> extension=mysql.so
>>
>> This is because [so I read] the mysql support is bult-in for version
>> 4, but not for version 5.

Take a look in your phpinfo. make a file with the follow code:



There you can see your PHP-Configuration and which modules are enabled.
You can also see the path of the modules. Check the path for your mysql
extension and the socket path.

PHP is connecting over the mysql.sock with the function mysql_connect().

PHPmyAdmin is connecting directly with the mysql.sock.

i hope this can help you.

Sorry my English is not the best :(

Jan

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE5GVRFxoGn/ckUGURAqliAJ9vDs3Dq48KJO1dspqBrz2lYSD3HgCfTLNV
5UpPsb8LX2uBQVaoKD5bQLs=
=wxUi
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: PHP: mysql_connect() undefined function

2006-08-17 Thread Stephen
On Thu, Aug 17, 2006 at 12:28:22PM +0200 or thereabouts, Paolo Pantaleo wrote:

[...]

> I think the error says that PHP doesn't know the function, not that
> there is an error executing the function.
> 
> So, finally googling around I found the solution:
> 
> in /etc/php/apache2/php.in
> 
> I uncommented the line
> 
> extension=mysql.so
> 
> This is because [so I read] the mysql support is bult-in for version
> 4, but not for version 5.

Exactly. My Google search on your behalf originally, stated such in much
of the responses.

Like I said previously, it wasn't enabled. The only difference is that
you are using PHP 5, which you didn't detail in your original post.

Anywho, good you've got it sorted. I still don't understand how
PHPMyAdmin could have connected to it, if it wasn't enabled in the first
place, web-server side.

-- 
Regards
Stephen
+
There is always one thing to remember: writers are always selling somebody out.
-- Joan Didion, "Slouching Towards Bethlehem"
+


signature.asc
Description: Digital signature


Re: PHP: mysql_connect() undefined function

2006-08-17 Thread Paolo Pantaleo

2006/8/16, Stephen <[EMAIL PROTECTED]>:

On Wed, Aug 16, 2006 at 05:52:46PM +0200 or thereabouts, Paolo Pantaleo wrote:
> 2006/8/16, Stephen <[EMAIL PROTECTED]>:
> >On Wed, Aug 16, 2006 at 05:24:44PM +0200 or thereabouts, Paolo Pantaleo

> >> Any suggestion?
> >
> >I suspect that php4-mysql isn't installed and/or activated.
> >
> >Therefore try 'aptitude install php4-mysql' or 'apt-get install
> >php4-mysql'.
>
> Well I installed php5 (and php5-mysql), should I use php4 (I have testing) ?

No.

I find it very strange that PHPMyAdmin will connect to the same host though.
This error you've received is indicative of PHP not able to connect to the
MySQL socket, so it's very strange that it works with PHPMyAdmin connecting
to the same host. Is the database on the same server as Apache ?

Sorry, I'm out of ideas.

--
Regards
Stephen



I think the error says that PHP doesn't know the function, not that
there is an error executing the function.

So, finally googling around I found the solution:

in /etc/php/apache2/php.in

I uncommented the line

extension=mysql.so

This is because [so I read] the mysql support is bult-in for version
4, but not for version 5.

[I think another solution is to use php4, then]

I hope this it could help Kevin too.

Thnx everybody for the help
PAolo


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: PHP: mysql_connect() undefined function

2006-08-17 Thread Paolo Pantaleo

2006/8/16, Roberto C. Sanchez <[EMAIL PROTECTED]>:

On Wed, Aug 16, 2006 at 05:24:44PM +0200, Paolo Pantaleo wrote:
> Hi,
> I am quite a newbie with PHP...
>
> I get this error message:
>
> Fatal error: Call to undefined function mysql_connect() in
> /home/paolo/webs/mypic/s_page/guestbook.php on line 19
>
> but  I can use phpMyAdmin
>
> The same page works ok on another Apache serve.
>
> Any suggestion?
>
Yes.  Please don't use PHP.  Unless you are a very experienced and very
disciplined programmer, it is far too easy to hack together some
unmaintainable crap.  Please use something more sane like Python or
maybe even Ruby (though I know many people who do not care for the Ruby
style).  Second, please don't use MySQL (or at least MySQL-specific
code).  If you use Python, I would recommend you make use of the DB-API
which allows you access any standard databse from your program (similar
to ODBC, which is also an option in Python, though DB-API is actually
included in the language now, IIRC).  That way your app stays portable
across database implementations.

Regards,

-Roberto



Well,

on my toy hosting service I haven't python or ruby, only mysql and
php. I konw Python and I like it very much, but I think I cannot use
any templating system (PSP or Cheetah, or whatever). Any idea about
that?

Moreover I want something that just works in little time, so PHP seems
quite good.

Greetings
PAolo


--
if you have a minute to spend please visit my photogrphy site:
http://mypic.co.nr


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: PHP: mysql_connect() undefined function

2006-08-16 Thread Roberto C. Sanchez
On Wed, Aug 16, 2006 at 05:24:44PM +0200, Paolo Pantaleo wrote:
> Hi,
> I am quite a newbie with PHP...
> 
> I get this error message:
> 
> Fatal error: Call to undefined function mysql_connect() in
> /home/paolo/webs/mypic/s_page/guestbook.php on line 19
> 
> but  I can use phpMyAdmin
> 
> The same page works ok on another Apache serve.
> 
> Any suggestion?
> 
Yes.  Please don't use PHP.  Unless you are a very experienced and very
disciplined programmer, it is far too easy to hack together some
unmaintainable crap.  Please use something more sane like Python or
maybe even Ruby (though I know many people who do not care for the Ruby
style).  Second, please don't use MySQL (or at least MySQL-specific
code).  If you use Python, I would recommend you make use of the DB-API
which allows you access any standard databse from your program (similar
to ODBC, which is also an option in Python, though DB-API is actually
included in the language now, IIRC).  That way your app stays portable
across database implementations.

Regards,

-Roberto

-- 
Roberto C. Sanchez
http://familiasanchez.net/~roberto


signature.asc
Description: Digital signature


Re: PHP: mysql_connect() undefined function

2006-08-16 Thread Kevin Veroneau
Hello,

I seem to be having this same error with my VPS(Virtual Private Server) which 
runs Debian Sarge.  It uses the Apache2 Web Server and PHP4.  Yet, I have 
another VPS located at a different hosting company which hasn't given me any 
problems with this.  Plus the VPS which is having the very same problem which 
your experiencing can also use PHPMyAdmin but cannot connect to the MySQL 
server in anyother scripts.

I have been using PHP for awhile now, and just now I have found a problem which 
I cannot debug.  Only because it's not related to PHP coding.  I'm also more 
fluent in Apache1.3 than I am in the Next generation Apache Servers.  I am 
guessing it must be related to Apache2 and the way it handles php4.  If I ever 
figure out how to fix this problem on my VPS, I will be sure to drop you an 
Email on how I fixed this problem.

Kevin.

On Wed, 16 Aug 2006 12:33:26 -0400
Stephen <[EMAIL PROTECTED]> wrote:

> On Wed, Aug 16, 2006 at 05:52:46PM +0200 or thereabouts, Paolo Pantaleo wrote:
> > 2006/8/16, Stephen <[EMAIL PROTECTED]>:
> > >On Wed, Aug 16, 2006 at 05:24:44PM +0200 or thereabouts, Paolo Pantaleo 
> 
> > >> Any suggestion?
> > >
> > >I suspect that php4-mysql isn't installed and/or activated.
> > >
> > >Therefore try 'aptitude install php4-mysql' or 'apt-get install
> > >php4-mysql'.
> > 
> > Well I installed php5 (and php5-mysql), should I use php4 (I have testing) ?
> 
> No. 
> 
> I find it very strange that PHPMyAdmin will connect to the same host though. 
> This error you've received is indicative of PHP not able to connect to the 
> MySQL socket, so it's very strange that it works with PHPMyAdmin connecting 
> to the same host. Is the database on the same server as Apache ?
> 
> Sorry, I'm out of ideas.
> 
> -- 
> Regards
> Stephen
> +
> Hell is empty and all the devils are here.
>   -- Wm. Shakespeare, "The Tempest"
> +
> 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: PHP: mysql_connect() undefined function

2006-08-16 Thread Stephen
On Wed, Aug 16, 2006 at 05:52:46PM +0200 or thereabouts, Paolo Pantaleo wrote:
> 2006/8/16, Stephen <[EMAIL PROTECTED]>:
> >On Wed, Aug 16, 2006 at 05:24:44PM +0200 or thereabouts, Paolo Pantaleo 

> >> Any suggestion?
> >
> >I suspect that php4-mysql isn't installed and/or activated.
> >
> >Therefore try 'aptitude install php4-mysql' or 'apt-get install
> >php4-mysql'.
> 
> Well I installed php5 (and php5-mysql), should I use php4 (I have testing) ?

No. 

I find it very strange that PHPMyAdmin will connect to the same host though. 
This error you've received is indicative of PHP not able to connect to the 
MySQL socket, so it's very strange that it works with PHPMyAdmin connecting 
to the same host. Is the database on the same server as Apache ?

Sorry, I'm out of ideas.

-- 
Regards
Stephen
+
Hell is empty and all the devils are here.
-- Wm. Shakespeare, "The Tempest"
+


signature.asc
Description: Digital signature


Re: PHP: mysql_connect() undefined function

2006-08-16 Thread Paolo Pantaleo

2006/8/16, Stephen <[EMAIL PROTECTED]>:

On Wed, Aug 16, 2006 at 05:24:44PM +0200 or thereabouts, Paolo Pantaleo wrote:
> Hi,
> I am quite a newbie with PHP...

We all were at one time.

> I get this error message:
>
> Fatal error: Call to undefined function mysql_connect() in
> /home/paolo/webs/mypic/s_page/guestbook.php on line 19

In the future, you may wish to Google the error syntax directly.

Well I thought it was a packages problem



> but  I can use phpMyAdmin

For the same host ?

Yes... I can use phpMyAdmin on the same apache server that give me the error.



> The same page works ok on another Apache serve.

Not really relevant, unless you set up both. Then you should know what
you did on the working one in order to duplicate. ;)

> Any suggestion?

I suspect that php4-mysql isn't installed and/or activated.

Therefore try 'aptitude install php4-mysql' or 'apt-get install
php4-mysql'.


Well I installed php5 (and php5-mysql), should I use php4 (I have testing) ?


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: PHP: mysql_connect() undefined function

2006-08-16 Thread Stephen
On Wed, Aug 16, 2006 at 05:24:44PM +0200 or thereabouts, Paolo Pantaleo wrote:
> Hi,
> I am quite a newbie with PHP...

We all were at one time.

> I get this error message:
> 
> Fatal error: Call to undefined function mysql_connect() in
> /home/paolo/webs/mypic/s_page/guestbook.php on line 19

In the future, you may wish to Google the error syntax directly.

> but  I can use phpMyAdmin

For the same host ?

> The same page works ok on another Apache serve.

Not really relevant, unless you set up both. Then you should know what
you did on the working one in order to duplicate. ;)

> Any suggestion?

I suspect that php4-mysql isn't installed and/or activated.

Therefore try 'aptitude install php4-mysql' or 'apt-get install
php4-mysql'.

-- 
Regards
Stephen
+
Why is it that we rejoice at a birth and grieve at a funeral?  It is because we
are not the person involved.
-- Mark Twain, "Pudd'nhead Wilson's Calendar"
+


signature.asc
Description: Digital signature


PHP: mysql_connect() undefined function

2006-08-16 Thread Paolo Pantaleo

Hi,
I am quite a newbie with PHP...

I get this error message:

Fatal error: Call to undefined function mysql_connect() in
/home/paolo/webs/mypic/s_page/guestbook.php on line 19

but  I can use phpMyAdmin

The same page works ok on another Apache serve.

Any suggestion?

Thnx
PAolo

--
if you have a minute to spend please visit my photogrphy site:
http://mypic.co.nr


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]