Davide Gullo, Consulente web

08.02.2012
04:54 (+00:00)
06a settimana
38o giorno

  "E il mare il web concederà ad ogni uomo nuove speranze, come il sonno i sogni..." Cristoforo Colombo

Impostare mysql.sock in Zend Framework tramite file .ini

martedì, 23 febbraio 2010

Zend Framework Logo

Come ambiente di sviluppo PHP utilizzo Zend Server Community Edition (installato su OSX). Dal giorno in cui l’ho installato le applicazioni sviluppate in Zend Framework hanno smesso di funzionare. Il problema che veniva segnalato era:

Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)' in /usr/local/zend/apache2/htdocs/mySite/library/Zend/Db/Adapter/Pdo/Abstract.php:144

In pratica Zend_DB_Adapter non trova il socket per la connessione al database MySQL.

Da quando è stato inserito il modulo Zend_Application io preferisco impostare ogni cosa nel file di configurazione .ini pertanto, per risolvere il problema, ed impostare il corretto mysql socket, basta aggiungere la seguente riga tra i parametri del DB:

resources.db.params.unix_socket = "/usr/local/zend/mysql/tmp/mysql.sock"

cSQL, lite tool to manage MySQL database (for PHP5)

lunedì, 20 luglio 2009


cSQL is a PHP-based MySQL database manager tool developed by Acvanta.
How does it differ form other ones? It is very small. It’s the only little file. It’s fast. It’s easy to learn. It’s secure.

Some features are:

  • The script is the only one PHP file — 15kb only, it’s so small and easy to upload everywhere!
  • Once logged in, you may make and download a SQL dump of whole database – tables structures only, or full dump – including all records of the database.
  • Easy command line — knowing SQL, you will quickly learn how to use it — it gives you full control on the database.
  • And other more

I added a small improvement to the code:

  • make it functional on PHP5
  • changed calls to files with PHP_SELF (this way you can easily rename – for more security – the file before you upload)

The original file by Acvanta: cSQL.zip
My changed file: cSQL-2.gz

Connettere PHP (su Linux) al database MS SQL Express

venerdì, 12 dicembre 2008

Sono iniziati i lavori per Anchegiochi.it e il primo passo è interfacciare il server di sviluppo ad un database SQL Express 2005, piattaforma sul quale poi risiederà l’intero sistema in fase di produzione. Dopo aver ricompilato il PHP con le librerie MSSQL (grazie all’ottimo FreeTDS driver) siamo riusciti a connettere il PHP.

Segnalo l’ottimo articolo guida che ci ha aiutato nell’impresa: Making a PHP Site on Linux Work with a Microsoft SQL Server Database.

 

Pinguino imperatore

Aptenodytes forsteri,
descritto da G. R. Gray nel 1844, Mari Antartici.

Tux è la mascotte ufficiale del kernel Linux. Creato da Larry Ewing nel 1996, è un pinguino paffuto dall'aria contenta. L'idea che la mascotte di Linux dovesse essere un pinguino venne da Linus Torvalds, il creatore del kernel Linux.
[FSF Associate Member]
Free Software Foundation
Associate Member
Join!
Davide Gullo
   Crea il tuo badge