Cannot run PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FilippoLec
    Junior Member
    • Feb 2026
    • 10

    #1

    Cannot run PHP

    I was trying to understand why my crontab jobs were not working and tried to run them manually from console directly with

    HTML Code:
    php -f cron.php
    And even tho it seemed to work (no errors were given) it was not doing anything. Based on some other posts I tried running some jobs with the command.php script with

    HTML Code:
    php command.php <command>
    and got this error:

    HTML Code:
    Error: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for espocrm-db failed: Temporary failure in name resolution
    This is preventing me from exporting tables data since is also doens't run the cron jobs for exporting big amounts of data.
  • jamie
    Senior Member
    • Aug 2025
    • 243

    #2
    That means your system isn't configured correctly, and it can't find the db

    You're not running this indocker your solution is in one of the data/config files

    Looks like you might be running this in Docker? Below is what ChatGPT made up a Docker setup from my very complicated one,

    You'll then need to change data/config-internal.php to use the DB details below. Your host is espo-db as Docker uses its own internal network

    sorry i haven' tested it, but it should work from a quick glance, should help you talk to chatgpt at any rate

    Code:
    ervices:
    db:
    image: mariadb:latest
    container_name: espo-db
    hostname: espo-db-host # ← Added hostname
    environment:
    MYSQL_ROOT_PASSWORD: rootpassword
    MYSQL_DATABASE: espocrm
    MYSQL_USER: espouser
    MYSQL_PASSWORD: espopass
    ports:
    - "3307:3306"
    volumes:
    - db-data:/var/lib/mysql
    restart: unless-stopped
    networks:
    - espocrm-net​
    
    app:
    image: espo-app:latest
    container_name: espo-app
    build: .
    environment:
    ESPOCRM_DATABASE_HOST: espo-db-host # ← Use hostname here
    ESPOCRM_DATABASE_USER: espouser
    ESPOCRM_DATABASE_PASSWORD: espopass
    ESPOCRM_DATABASE_PLATFORM: Mysql
    ESPOCRM_SITE_URL: http://localhost
    ESPOCRM_ADMIN_USERNAME: admin
    ESPOCRM_ADMIN_PASSWORD: admin123
    ports:
    - "80:80"
    volumes:
    - ./:/var/www/html
    depends_on:
    - db
    restart: unless-stopped
    networks:
    - espocrm-net​
    
    volumes:
    db-data:​
    
    networks:
    espocrm-net:
    driver: bridge
    ​
    ​

    Comment

    Working...