¿Problemas con tu sitio web?

4,7/5 · Opiniones Google reviews

Hacer un update de código Php 5.2 a Php 7 u 8

No lo dejará perfecto, pero nos ahorrará un montón de trabajo, reemplaza por fuerza bruta y de forma forzada las funciones típicas que ya no están disponibles en versiones Php > 7 y que probablemente están llenando tu sitio web público con errores.

A parte de ejecutar estos comandos es probable que requieres reemplazar más variables y funciones, más abajo tienes ejemplo de como hacerlo.

NOTA; No ejecutar estos comandos sin la supervisión de un profesional, sirven como guía, y sirven para remplazar cadenas de texto dentro de archivos.  No nos hacemos responsables de nada. Estos scripts pueden romper por completo tu proyecto u otros archivos que tengas en tu máquina, si no sabes lo que estás haciendo. 

Funciones de MYSQL a actualizar

Teniendo en cuenta que estamos usando las variables $myDB, $conn, $myServer, $myUser y $myPass. Idealmente estas estarán seteadas en un archivo a parte que se incluye en todos los demás archivos donde se haga conexión con la base de datos.

mysql_ => mysqli_

👉Abrir terminal y acceder a la carpeta del proyecto, luego ejecutar uno por uno:

find . -type f -name «*.php» -exec sed -i» -e ‘s/mysql_select_db($myDB, $conn);/ /g’ {} +find . -type f -name «*.php» -exec sed -i» -e ‘s/mysql_connect($myServer , $myUser , $myPass);/mysql_connect($myServer , $myUser , $myPass, $myDB);/g’ {} +

find . -type f -name «*.php» -exec sed -i» -e ‘s/mysql_connect($myServer , $myUser , $myPass, $myDB);/mysqli_connect($myServer , $myUser , $myPass, $myDB);/g’ {} +

find . -type f -name «*.php» -exec sed -i» -e ‘s/mysql_query($sql)/mysqli_query($conn,$sql)/g’ {} +
find . -type f -name «*.php» -exec sed -i» -e ‘s/mysql_query($sql, $conn)/mysqli_query($conn,$sql)/g’ {} +

find . -type f -name «*.php» -exec sed -i» -e ‘s/mysql_num_rows/mysqli_num_rows/g’ {} +
find . -type f -name «*.php» -exec sed -i» -e ‘s/mysql_result/mysqli_result/g’ {} +
find . -type f -name «*.php» -exec sed -i» -e ‘s/mysql_fetch/mysqli_fetch/g’ {} +
find . -type f -name «*.php» -exec sed -i» -e ‘s/mysql_error/mysqli_error/g’ {} +
find . -type f -name «*.php» -exec sed -i» -e ‘s/mysql_query($query)/mysqli_result/g’ {} +

Para cambiar otras cadenas/variables:

find . -type f -name «*.php» -exec sed -i» -e ‘s/[Cadena a buscar]/[cadena de reemplazo]/g’ {} +
– break => exit();

Contacta con programadores expertos si deseas actualizar tu código antiguo php o ya has perdido demasiado tiempo intentando que funcione pero sigues viendo errores por pantalla.

5/5

Php Ninja - Expertos en WordPress y Prestashop

Somos un equipo de programadores web expertos en PHP, WordPress y Prestashop, con más de 20 años de experiencia, 100% especializados en mantenimiento y arreglos, lo que nos permite ofrecer un servicio muy completo y único de mantenimiento y reparación de páginas web. Conoce más sobre nosotros

Stack técnico

Programadores con más de 20 años de experiencia

Especialistas en WordPress, PrestaShop, PHP, JavaScript y operación de infraestructura web.

PHP Logo
Javascript Logo
Apache Logo
WordPress Logo
Prestashop Logo
Linux Logo
Cloudflare Logo
Git Logo
Docker Logo
Ansible Logo
MYSQL Logo
Codeception Logo

HTML · PHP · JS · CSS · MYSQL · WORDPRESS · PRESTASHOP · LINUX · CLOUDFLARE · GIT · GOOGLE SERVICES · ANSIBLE · CODECEPTION

Opiniones

¿Qué han dicho nuestros clientes?

  • Our website was blocked and we contacted Ninja who solved the problem in a very short time. We trust that they will always remain there and we will assign them more work, this time we hope without emergencies.

    Susan Wolf Avatar Susan Wolf
    22/04/2025

    The company made a very good work for me. Very professional team, rapidly done, and we had a good feedback during the duties. The team has a high expertise with php. I do recommend them.

    Vicente Celada Gonzalez Avatar Vicente Celada Gonzalez
    19/06/2025

    Nuestra web se nos bloqueó y contactamos con Ninja que nos resolvió el problema en muy poco tiempo. Confiamos que sigan siempre ahí y les encargaremos mas trabajos, esta vez esperamos que sin urgencias.

    Susan Wolf Avatar Susan Wolf
    22/04/2025
  • Very positive experience due to professionalism, knowledge and relationship with the client.

    Francisco Bargiela Avatar Francisco Bargiela
    21/03/2025

    Very professional, totally recommended.

    joaquin sariñena Avatar joaquin sariñena
    01/03/2025

    Very happy with the service, whenever I have a problem they solve it quickly and efficiently! And the treatment is excellent. A hug!

    Sara Teller Avatar Sara Teller
    05/10/2025
  • I had a problem with the WordPress website blocking access. I contacted them and they very quickly gave me a quote, with an immediate execution time. I couldn't be happier with the choice, especially when I had no direct references from the company. The solution was clean, professional and without data loss.

    Daniel Martin Avatar Daniel Martin
    22/04/2025

    I had a complicated problem with my website and I am very happy with the result, since they gave me a pack of hours, and it was solved quickly and at a very reasonable price. Since they had a little time left, they still fixed a couple of things that needed to be touched up. I would repeat with them without hesitation. Super professionals in my point of view.

    Natural Channel Avatar Natural Channel
    24/10/2025

    Beto did a great job with optimizing our WordPress website! It was very slow in the beginning, but thanks to his efforts now runs really fast and smoothly. Outstanding professional, great communication & superb results! We’ll definitely hire him again for future projects. Thanks Beto!

    Verena Nyc Avatar Verena Nyc
    19/11/2025
  • Fast, effective and humane!

    Robert Hunter Avatar Robert Hunter
    01/01/1970
Imagina no tener más problemas con tu página web

Te respondemos rápidamente

  Recibir Asistencia
icono whatsapp programador web