Viernes Abril 26 , 2024
Text Size
   

PHP, MySQL y Tiger Server PROBLEMAS

manuales - MacOs X

Si has instalado cualquier apli web que trabaje con estos dos elementos, habrás apreciado que no estan funcionando correctamente, también es la solución a poder modificar valores de php, tales como el tamaño de subida de los archivos a través de formularios..

Fuente: eScriptorium
http://www.escriptorium.com/articulos/php-y-mysql-en-mac-os-x-104-tiger/


Habilitar PHP:

Abrimos el Terminal y tecleamos:

cd /etc/httpd
sudo nano httpd.conf

nos pedirá nuestra contraseña y se la damos. Dentro del archivo buscamos las siguientes líneas que ya anticipo no están seguidas:

# LoadModule php4_module libexec/httpd/libphp4.so
# AddModule mod_php4.c

y las descomentamos (borramos la almohadilla inicial). Ya podemos guardar y salir del archivo (Ctrl+X).

Ya está. Ahora apagamos y volvemos a poner en marcha el servidor web Apache (vía Preferencias del Sistema) o simplemente tecleamos en el Terminal:

sudo apachectl restart

Instalar MySQL

Nos descargamos el software necesario (el indicado es el actual en la fecha de este artículo):

  • MySQL Standard 4.1.14
  • MySQL Administrator La descarga del administrador es opcional aunque recomendable, a menos que se prefiera utilizar phpMyAdmin, el administrador nos será muy útil, tanto para crear bases de datos como para mantenimiento de MySQL.

Instalamos los tres elementos que hay en la imagen de disco que nos hemos descargado, por este orden:

  1. mysql-standard-4.1.14…pkg
  2. MySQLStartupItem.pkg
  3. MySQL.prefPane

Abrimos el Terminal y tecleamos en nuestro directorio de usuario (home):

touch .profile
nano .profile

Se nos abrirá el editor con el archivo creado previamente con touch (.profile) y añadimos esta línea:

PATH=”/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/mysql/bin”

Guardamos el archivo, cerramos el editor y reiniciamos el ordenador.

Una vez arrancado de nuevo el ordenador volvemos a abrir el terminal y escribirmos:

mysql_secure_installation

y obtendremos (en negrita pongo las respuestas que hay que proporcionar):

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here.

Enter current password for root (enter for none): [pulsamos enter]
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation.

Set root password? [Y/n] y
New password: [nuestra contraseña]
Re-enter new password: [la repetimos]
Password updated successfully!
Reloading privilege tables..
… Success!

By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.

Remove anonymous users? [Y/n] y
… Success!

Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
… Success!

By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.

Remove test database and access to it? [Y/n] y
- Dropping test database…
… Success!
- Removing privileges on test database…
… Success!

Reloading the privilege tables will ensure that all changes made so far will take effect immediately.

Reload privilege tables now? [Y/n] y
… Success!

Cleaning up...

All done! If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

Bien, ya tenemos PHP y MySQL instalados y en marcha, sólo nos queda un pequeño detalle para finalizar. Este detalle será el que permitirá que MySQL reconozca el antiguo formato de contraseña (necesario para PHP, y programas relativos como phpMyAdmin, WordPress, etc.)

En el Terminal escribimos:

mysql -u root –p

nos pedirá la contraseña y luego aparecerá el prompt (mysql>):

mysql> SET PASSWORD FOR
-> 'root'@'localhost' = OLD_PASSWORD('la contraseña que elegimos');
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye

Trabajo finalizado.

Nota: el usuario de la base de datos es: root y la contraseña, la que hayamos elegido.

Vale.

Usar puntuación: / 1
MaloBueno