### Setup: Get Session Token Source: https://docs.dreamfactory.com/api-reference/system-api-examples This example demonstrates how to obtain a session token by logging in with administrative credentials. It shows how to write the JSON payload to a file to avoid shell quoting issues and then uses `curl` to make the POST request. ```APIDOC ## POST /api/v2/system/admin/session ### Description Obtains a session token for administrative access by providing email and password. ### Method POST ### Endpoint /api/v2/system/admin/session ### Parameters #### Request Body - **email** (string) - Required - The administrative email address. - **password** (string) - Required - The administrative password. ### Request Example ```json { "email": "admin@example.com", "password": "yourpassword" } ``` ### Response #### Success Response (200) - **session_token** (string) - The obtained session token. ``` -------------------------------- ### Download Composer Installer Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Navigates to the user's home directory, creates a bin directory, and downloads the Composer setup script. ```bash cd ~ mkdir bin php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" ``` -------------------------------- ### Enable and Start MariaDB Service on Clear Linux Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Enable the MariaDB service to start on boot and start it immediately. Also, verify the installed MariaDB version. ```bash sudo systemctl enable --now mariadb mysql --version ``` -------------------------------- ### Enable and Start Nginx Service Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Enables Nginx to start on boot and starts the Nginx service. ```bash sudo systemctl enable nginx sudo systemctl start nginx ``` -------------------------------- ### Start MCP Daemon Server on Windows Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/windows-installation Use this PowerShell script to start the MCP daemon server. It installs dependencies and starts the daemon in the background. ```powershell cd {dreamfactory path}\vendor\dreamfactory\df-mcp-server\scripts .\start-daemon-win.ps1 ``` -------------------------------- ### Install Elasticsearch Source: https://docs.dreamfactory.com/system-settings/logstash Installs the Elasticsearch package after adding its repository. This command should be run after completing the repository setup. ```bash sudo apt install -y elasticsearch ``` -------------------------------- ### Install Cassandra Client Dependencies Source: https://docs.dreamfactory.com/upgrades-and-migrations/upgrading-to-php-8.1 Installs necessary development libraries for compiling the Cassandra driver. ```bash sudo apt install -y --no-install-recommends libgmp-dev libpcre3-dev libssl-dev libuv1-dev cmake ``` -------------------------------- ### Run DreamFactory Setup Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Execute the Artisan command to complete the DreamFactory installation process. This step finalizes the setup based on the configured environment. ```bash php artisan df:setup ``` -------------------------------- ### Start Development Server Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/windows-installation Run this command to start a local Laravel development server for testing your DreamFactory installation. Access it via http://127.0.0.1:8000. ```bash php artisan serve ``` -------------------------------- ### Run DreamFactory Installer Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/linux-installation Execute the DreamFactory installer script with sudo privileges to begin the installation process. ```bash sudo ./dfsetup.run ``` -------------------------------- ### Install Informix Client SDK Source: https://docs.dreamfactory.com/upgrades-and-migrations/upgrading-to-php-8.1 Extracts and installs the Informix Client SDK. Replace 'your_archive' with the actual downloaded tar file name. ```bash sudo -s tar -xvf your_archive ./installclientsdk ``` -------------------------------- ### Start and Enable Grafana Server Source: https://docs.dreamfactory.com/system-settings/logstash Reloads the systemd daemon, enables the Grafana server to start on boot, and starts the Grafana server service. ```bash sudo systemctl daemon-reload sudo systemctl enable grafana-server sudo systemctl start grafana-server ``` -------------------------------- ### Install Node.js 20.x on Ubuntu Source: https://docs.dreamfactory.com/AI/mcp-server-deployment Installs Node.js version 20.x and npm on Ubuntu systems. Verifies the installation by printing the versions. ```bash curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt-get install -y nodejs node -v && npm -v ``` -------------------------------- ### Install System Packages Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Install essential system packages like git, curl, zip, and unzip. ```bash sudo apt-get install git curl zip unzip ``` -------------------------------- ### Start and Enable Elasticsearch Service Source: https://docs.dreamfactory.com/system-settings/logstash Reloads the systemd daemon, enables Elasticsearch to start on boot, and starts the service. Verify the status afterward. ```bash sudo systemctl daemon-reload sudo systemctl enable elasticsearch sudo systemctl start elasticsearch ``` -------------------------------- ### Start and Enable Firewalld Source: https://docs.dreamfactory.com/system-settings/config/cors-and-ssl Start the Firewalld service and configure it to launch automatically on system boot. This ensures the firewall is active after reboots. ```bash sudo systemctl start firewalld sudo systemctl enable firewalld ``` -------------------------------- ### System Info: Get DF Version and Environment Source: https://docs.dreamfactory.com/api-reference/system-api-examples This example shows how to retrieve the DreamFactory version and environment details using the system environment endpoint. ```APIDOC ## GET /api/v2/system/environment ### Description Retrieves the DreamFactory version and environment details. ### Method GET ### Endpoint /api/v2/system/environment ### Response #### Success Response (200) - **platform** (object) - Information about the platform. - **version** (string) - The DreamFactory version. - **is_hosted** (boolean) - Indicates if the instance is hosted. ### Response Example ```json { "platform": { "version": "7.4.2", "is_hosted": false } } ``` ``` -------------------------------- ### Install Nginx Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Installs the Nginx web server on a Raspberry Pi. This command updates the package list and then installs Nginx. ```bash sudo apt update sudo apt install -y nginx ``` -------------------------------- ### Install libncurses for Informix Source: https://docs.dreamfactory.com/upgrades-and-migrations/upgrading-to-php-8.1 Installs the libncurses5 library, which may be required by the Informix Client SDK. ```bash sudo add-apt-repository universe sudo apt update sudo apt install libncurses5 libncurses5:i386 ``` -------------------------------- ### Install DreamFactory on Debian Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/linux-installation Download the DreamFactory installer script, make it executable, and run it with sudo privileges. This process is identical to the Ubuntu installation. ```bash wget https://github.com/dreamfactorysoftware/dreamfactory/raw/master/installers/dfsetup.run chmod +x dfsetup.run sudo ./dfsetup.run ``` -------------------------------- ### Install Grafana Source: https://docs.dreamfactory.com/system-settings/logstash Installs the Grafana package on the system. ```bash sudo apt install -y grafana ``` -------------------------------- ### Install Oracle Client Packages Source: https://docs.dreamfactory.com/upgrades-and-migrations/upgrading-to-php-8.1 Installs Oracle Instant Client using alien to convert RPM packages. This step is required before installing the oci8 extension. ```bash sudo alien -i oracle-instantclient-basic-21.9.0.0.0-1.el8.x86_64.rpm sudo alien -i oracle-instantclient-devel-21.9.0.0.0-1.el8.x86_64.rpm ``` -------------------------------- ### Make Installer Executable Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/linux-installation Grant execute permissions to the downloaded installer script using chmod. ```bash chmod +x dfsetup.run ``` -------------------------------- ### Install MariaDB Server Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Installs the MariaDB server package, which will serve as the default MySQL database for the system. ```bash sudo apt-get install mariadb-server -y ``` -------------------------------- ### Install snapd on Ubuntu/Debian Source: https://docs.dreamfactory.com/system-settings/config/cors-and-ssl Installs the snapd package manager, which is required to install Certbot as a snap. Run this on Ubuntu and Debian-based systems. ```bash sudo apt update sudo apt install snapd ``` -------------------------------- ### Download and Run DreamFactory Installer on Ubuntu Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/linux-installation Download the DreamFactory installer script, make it executable, and run it with sudo privileges on Ubuntu systems. ```bash # Download the installer wget https://github.com/dreamfactorysoftware/dreamfactory/raw/master/installers/dfsetup.run # Make it executable chmod +x dfsetup.run # Run as root/sudo sudo ./dfsetup.run ``` -------------------------------- ### Install Certbot using Snap Source: https://docs.dreamfactory.com/system-settings/config/cors-and-ssl Installs the Certbot client in classic confinement mode using the snap package manager. This command is used after snapd is installed and configured. ```bash sudo snap install --classic certbot ``` -------------------------------- ### Install Memcached on Ubuntu/Debian Source: https://docs.dreamfactory.com/api-generation-and-connections/api-types/cache/memcached Installs Memcached and related tools on Ubuntu/Debian systems and enables/starts the service. ```bash sudo apt update sudo apt install memcached libmemcached-tools sudo systemctl enable memcached sudo systemctl start memcached ``` -------------------------------- ### Install Composer Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Installs Composer globally to the specified directory and filename. Ensure to replace '' with your actual username. ```bash php composer-setup.php --install-dir=/home//bin --filename=composer ``` -------------------------------- ### Install DataStax PHP Driver for Cassandra Source: https://docs.dreamfactory.com/upgrades-and-migrations/upgrading-to-php-8.1 Checks out a specific version of the DataStax PHP Driver, compiles it, and installs the extension. ```bash # Currently, we are using a specific version of the repository that is still functional, # as the recent efforts to enhance the installation process do not work properly. git checkout 1cf12c5ce49ed43a2c449bee4b7b23ce02a37bf0 && pushd ext && phpize && popd && mkdir build && pushd build && ../ext/configure && make && sudo make install && popd ``` -------------------------------- ### Install Infinity Plugin for Grafana Source: https://docs.dreamfactory.com/system-settings/logstash Installs the Infinity data source plugin using the Grafana CLI and restarts the Grafana server to apply changes. ```bash sudo grafana-cli plugins install yesoreyeram-infinity-datasource ``` ```bash sudo systemctl restart grafana-server ``` -------------------------------- ### Install PHP 8.3 and Extensions Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Install PHP 8.3 along with a comprehensive set of required extensions for DreamFactory. ```bash sudo apt-get install -y php8.3-common \ php8.3-xml \ php8.3-cli \ php8.3-curl \ php8.3-mysqlnd \ php8.3-sqlite \ php8.3-soap \ php8.3-mbstring \ php8.3-zip \ php8.3-bcmath \ php8.3-dev \ php8.3-ldap \ php8.3-pgsql \ php8.3-interbase \ php8.3-gd \ php8.3-sybase ``` -------------------------------- ### Install Java 11 Source: https://docs.dreamfactory.com/system-settings/logstash Installs OpenJDK 11, a prerequisite for Elasticsearch. Run this command on your Ubuntu server. ```bash sudo apt update sudo apt install -y openjdk-11-jdk ``` -------------------------------- ### Install Redis Server on Ubuntu/Debian Source: https://docs.dreamfactory.com/api-generation-and-connections/api-types/cache/redis Installs and enables the Redis server on Ubuntu/Debian-based systems. Ensure you have sudo privileges. ```bash sudo apt update sudo apt install redis-server sudo systemctl enable redis-server sudo systemctl start redis-server ``` -------------------------------- ### Install PDO_INFORMIX using PECL Source: https://docs.dreamfactory.com/upgrades-and-migrations/upgrading-to-php-8.1 Installs the PDO_INFORMIX extension using the PECL package manager. This method may have limited success. ```bash sudo pecl install PDO_INFORMIX ``` -------------------------------- ### Download DreamFactory Installer Script Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/linux-installation Use wget to download the automated installation script from the DreamFactory GitHub repository. ```bash wget https://github.com/dreamfactorysoftware/dreamfactory/raw/master/installers/dfsetup.run ``` -------------------------------- ### Install Oracle Dependencies Source: https://docs.dreamfactory.com/upgrades-and-migrations/upgrading-to-php-8.1 Installs necessary dependencies for Oracle Instant Client on Debian-based systems. Ensure you have the correct RPM packages downloaded. ```bash sudo apt install -y alien libaio1 ``` -------------------------------- ### Configure Kerberos Client (`/etc/krb5.conf`) Source: https://docs.dreamfactory.com/Security/sqlsrv-config Sets up the Kerberos client configuration. Replace `EXAMPLE.COM` with your Active Directory realm and `dc01.example.com` with your domain controller hostname. ```ini [libdefaults] default_realm = EXAMPLE.COM dns_lookup_realm = true dns_lookup_kdc = true ticket_lifetime = 24h renew_lifetime = 7d forwardable = true [realms] EXAMPLE.COM = { kdc = dc01.example.com admin_server = dc01.example.com } [domain_realm] .example.com = EXAMPLE.COM example.com = EXAMPLE.COM ``` -------------------------------- ### Verify OCI8 Extension Installation Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/windows-installation Use the PHP command-line interface to verify that the oci8 extension has been successfully installed and loaded. ```bash php -m ``` -------------------------------- ### Install Nginx and PHP-FPM Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Install the Nginx web server and PHP-FPM (FastCGI Process Manager) for handling PHP requests. ```bash sudo apt-get install -y nginx php8.3-fpm ``` -------------------------------- ### Make Script Executable and Run Source: https://docs.dreamfactory.com/system-settings/the-system-api/service-management Set execute permissions on the deployment script and then run it to create the service. The output indicates the ID of the created service. ```bash $chmod u+x create-service.sh $ ./create-service.sh ``` ```json {"resource":[{"id":196}]} ``` -------------------------------- ### Build Cassandra Client Library Source: https://docs.dreamfactory.com/upgrades-and-migrations/upgrading-to-php-8.1 Compiles and installs the Cassandra client library from source. ```bash mkdir build && pushd build && cmake .. && make && sudo make install && popd ``` -------------------------------- ### Get OpenAPI Spec for a Service Source: https://docs.dreamfactory.com/api-reference/system-api-examples Retrieve the OpenAPI 3.0 specification for a given service. This example shows how to get the spec for the 'world' service, which includes schema and table operations. ```bash curl -s http://your-df-host/api/v2/api_docs/world \ -H "X-DreamFactory-API-Key: $APIKEY" \ -H "X-DreamFactory-Session-Token: $TOKEN" ``` -------------------------------- ### System Environment API Response Example Source: https://docs.dreamfactory.com/getting-started/dreamfactory-configuration/date-and-time-configuration Example JSON response from the system environment API showing configured date and time formats. ```json { "db": { "date_format": "l jS \of F Y", "time_format": "h:i A", "datetime_format": "m/d/y h:i:s A", "timestamp_format": "l, d-M-Y H:i:s T", "max_records_returned": 1000 } } ``` -------------------------------- ### Install PostgreSQL PDO Driver on CentOS/RHEL Source: https://docs.dreamfactory.com/api-generation-and-connections/api-types/database/postgresql Installs the PHP PostgreSQL driver using yum and restarts the web server. Use the appropriate systemctl command for your setup (httpd or php-fpm). ```bash sudo yum install php-pgsql sudo systemctl restart httpd # or php-fpm ``` -------------------------------- ### Create App Source: https://docs.dreamfactory.com/api-reference/system-api Registers a new application. ```bash POST /api/v2/system/app ``` -------------------------------- ### Download and Run DreamFactory Installer on RHEL/CentOS Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/linux-installation Download the DreamFactory installer script, make it executable, and run it with sudo privileges on RHEL/CentOS systems. ```bash wget https://github.com/dreamfactorysoftware/dreamfactory/raw/master/installers/dfsetup.run chmod +x dfsetup.run sudo ./dfsetup.run ``` -------------------------------- ### Contour Ingress Setup Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/helm-installation Configure ingress for DreamFactory using Contour. This example includes specific Contour annotations for connection limits and timeouts. ```yaml dreamfactory: ingress: enabled: true ingressClass: contour annotations: ingress.kubernetes.io/force-ssl-redirect: "true" projectcontour.io/max-connections: "1024" projectcontour.io/response-timeout: 30s projectcontour.io/websocket-routes: "/" hosts: - df.example.com tls: true pathType: Prefix ``` -------------------------------- ### Install MariaDB and Utilities on Clear Linux Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Use these commands to install the MariaDB server, client, and essential database utilities on Clear Linux OS. ```bash sudo swupd bundle-add mariadb sudo swupd bundle-add database-basic ``` -------------------------------- ### Configure .env File Settings Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Uncomment database charset and collation lines, and set APP_DEBUG to true, APP_LOG_LEVEL to debug, and DF_INSTALL to rpi in the .env file. ```ini ##DB_CHARSET=utf8 ##DB_COLLATION=utf8_unicode_ci APP_DEBUG=true APP_LOG_LEVEL=debug DF_INSTALL=rpi ``` -------------------------------- ### Retrieve System Environment API Source: https://docs.dreamfactory.com/getting-started/dreamfactory-configuration/date-and-time-configuration Example GET request to the DreamFactory system environment API to access date and time format settings. ```http GET https://{your-dreamfactory-url}/api/v2/system/environment ``` -------------------------------- ### Install PHP Basic Bundle on Clear Linux Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Install the 'php-basic' bundle on Clear Linux to ensure PHP can connect to MariaDB via the MySQL extension. ```bash sudo swupd bundle-add php-basic ``` -------------------------------- ### Install PHP 8.1 and Dependencies Source: https://docs.dreamfactory.com/upgrades-and-migrations/upgrading-to-php-8.1 Install PHP 8.1 along with essential extensions required for DreamFactory. This command installs common, XML, CLI, FPM, cURL, MySQL, SQLite, SOAP, Mbstring, Zip, Bcmath, Dev, LDAP, PostgreSQL, Interbase, GD, and Sybase extensions. ```bash sudo apt-get install -y php8.1-common \ php8.1-xml \ php8.1-cli \ php8.1-fpm \ php8.1-curl \ php8.1-mysqlnd \ php8.1-sqlite \ php8.1-soap \ php8.1-mbstring \ php8.1-zip \ php8.1-bcmath \ php8.1-dev \ php8.1-ldap \ php8.1-pgsql \ php8.1-interbase \ php8.1-gd \ php8.1-sybase ``` -------------------------------- ### Enable Ingress in values.yaml Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/helm-installation Configure the ingress section in your values.yaml file to enable external access to DreamFactory. This example shows a basic NGINX ingress setup. ```yaml dreamfactory: ingress: enabled: true ingressClass: nginx # or your preferred ingress controller annotations: # Add any required annotations for your ingress controller kubernetes.io/ingress.class: nginx cert-manager.io/cluster-issuer: letsencrypt-prod # if using cert-manager hosts: - your-domain.example.com tls: true ``` -------------------------------- ### Initialize DreamFactory Environment on Windows Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/windows-installation Run this command to set up the system database for DreamFactory. It's recommended to start with SQLite for easier troubleshooting. ```bash php artisan df:env --df_install=Windows ``` -------------------------------- ### Pagination and Sorting Example Source: https://docs.dreamfactory.com/api-generation-and-connections/api-types/database/querying-and-filtering Retrieve records from the 'products' table, limiting results to 10, starting from the first record (offset 0), and sorting by 'name' in ascending order. ```http GET /api/v2/db/_table/products?limit=10&offset=0&order=name ASC ``` -------------------------------- ### AWS ALB Ingress Setup Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/helm-installation Configure ingress for DreamFactory using AWS Application Load Balancer (ALB). Ensure AWS Load Balancer Controller is installed. ```yaml dreamfactory: ingress: enabled: true ingressClass: alb annotations: alb.ingress.kubernetes.io/scheme: internet-facing alb.ingress.kubernetes.io/target-type: ip alb.ingress.kubernetes.io/ssl-redirect: '443' alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]' alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-TLS-1-2-2017-01 alb.ingress.kubernetes.io/certificate-arn: '' # Certificate needs to exist in AWS Certificate Manager hosts: - df.example.com tls: false pathType: Prefix ``` -------------------------------- ### Call MySQL Get Tables Tool Source: https://docs.dreamfactory.com/AI/mcp-server Example of using an API-prefixed tool to interact with a specific service, such as calling 'mysql_get_tables' on a MySQL service. Requires the 'MCP-Session-Id' header. ```curl curl -X POST https://your-dreamfactory-host/mcp/{service-name} \ -H "Content-Type: application/json" \ -H "MCP-Session-Id: YOUR_SESSION_ID" \ -d '{ "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "mysql_get_tables", "arguments": {} } }' ``` -------------------------------- ### Retrieve MCP Endpoint Source: https://docs.dreamfactory.com/AI/mcp-service-creation This example demonstrates how to retrieve the MCP endpoint by making a GET request to the API Docs. The 'mcp_endpoint' field is crucial for AI Agent configuration. ```http GET /api-docs/mcp-server ``` -------------------------------- ### Extract and Install Oracle Instant Client Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/installing-additional-drivers Extracts the downloaded Oracle Instant Client archives, organizes the files, and creates a symbolic link for the client library. ```bash docker-compose exec web bash -c "mkdir -p /opt/oracle && cd /opt/oracle && unzip -q /tmp/instantclient-basic-linux.x64-23.5.0.24.07.zip && unzip -o -q /tmp/instantclient-sdk-linux.x64-23.5.0.24.07.zip && mv $(ls -d /opt/oracle/instantclient_*) /opt/oracle/instantclient && cd /opt/oracle/instantclient && rm -f jdbc occi mysql *jar *.zip && ln -sf $(ls libclntsh.so.*.* | head -1) libclntsh.so" ``` -------------------------------- ### Retrieve Configuration Details for a Specific Service Type Source: https://docs.dreamfactory.com/system-settings/the-system-api/service-management To view the detailed configuration schema for a particular service type, append the service type name to the URL. This example shows how to get details for the 'mysql' service type. ```bash GET http://{url}/api/v2/system/service_type/mysql ``` -------------------------------- ### Combined Command for Oracle Driver Installation Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/installing-additional-drivers Executes all steps for installing Oracle Instant Client and the PHP OCI8 extension as a single, continuous command within the Docker container. ```bash docker-compose exec -T web bash -c " apt-get update && \ apt-get install -y wget unzip libaio1t64 php8.3-dev php-pear build-essential && \ cd /tmp && \ wget --header='Cookie: oraclelicense=accept-securebackup-cookie' https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-basic-linux.x64-23.5.0.24.07.zip && \ wget --header='Cookie: oraclelicense=accept-securebackup-cookie' https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-sdk-linux.x64-23.5.0.24.07.zip && \ mkdir -p /opt/oracle && \ cd /opt/oracle && \ unzip -q /tmp/instantclient-basic-linux.x64-23.5.0.24.07.zip && \ unzip -o -q /tmp/instantclient-sdk-linux.x64-23.5.0.24.07.zip && \ mv $(ls -d /opt/oracle/instantclient_*) /opt/oracle/instantclient && \ cd /opt/oracle/instantclient && \ rm -f jdbc occi mysql *jar *.zip && \ ln -sf $(ls libclntsh.so.*.* | head -1) libclntsh.so && \ echo /opt/oracle/instantclient > /etc/ld.so.conf.d/oracle-instantclient.conf && \ ldconfig && \ ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 && \ ldconfig && \ echo 'instantclient,/opt/oracle/instantclient' | pecl install oci8 && \ echo 'extension=oci8.so' > /etc/php/8.3/mods-available/oci8.ini && \ phpenmod oci8 && \ service php8.3-fpm restart && \ php -m | grep oci8 && \ php -r \"echo 'OCI8 Version: ' . phpversion('oci8') . PHP_EOL;\" && \ php -r \"echo 'Oracle Client Version: ' . oci_client_version() . PHP_EOL;\" ``` -------------------------------- ### Install Oracle Dependencies and Instant Client in Dockerfile Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/installing-additional-drivers This snippet installs necessary system dependencies, downloads and installs Oracle Instant Client and SDK, configures the library path, and enables the PHP OCI8 extension. It is designed for Ubuntu 24.04 with PHP 8.3 and aims for dynamic compatibility with future Oracle Instant Client versions. ```dockerfile # Install Oracle dependencies RUN apt-get update && apt-get install -y wget unzip libaio1t64 php8.3-dev php-pear build-essential && rm -rf /var/lib/apt/lists/* # Download and install Oracle Instant Client RUN mkdir -p /opt/oracle && cd /tmp && wget --header="Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-basic-linux.x64-23.5.0.24.07.zip && wget --header="Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-sdk-linux.x64-23.5.0.24.07.zip && unzip -q instantclient-basic-linux.x64-23.5.0.24.07.zip -d /opt/oracle && unzip -o -q instantclient-sdk-linux.x64-23.5.0.24.07.zip -d /opt/oracle && mv $(ls -d /opt/oracle/instantclient_*) /opt/oracle/instantclient && cd /opt/oracle/instantclient && rm -f jdbc occi mysql *jar *.zip && ln -sf $(ls libclntsh.so.*.* | head -1) libclntsh.so && rm -f /tmp/instantclient*.zip # Configure Oracle library path RUN echo /opt/oracle/instantclient > /etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig # Fix Ubuntu 24.04 libaio compatibility RUN ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 && ldconfig # Install and enable PHP OCI8 extension RUN echo 'instantclient,/opt/oracle/instantclient' | pecl install oci8 && echo 'extension=oci8.so' > /etc/php/8.3/mods-available/oci8.ini && phpenmod oci8 ``` -------------------------------- ### Authenticate and Get Session Token Source: https://docs.dreamfactory.com/api-reference/system-api-examples This example shows how to authenticate with the DreamFactory API using an admin API key and retrieve a session token. It demonstrates writing the payload to a file to avoid shell quoting issues, which is the recommended approach. ```shell APIKEY="your-admin-app-api-key" # Write payload to file — avoids shell quoting issues cat > /tmp/login.json << 'EOF' {"email":"admin@example.com","password":"yourpassword"} EOF TOKEN=$(curl -s -X POST http://your-df-host/api/v2/system/admin/session \ -H "Content-Type: application/json" \ -H "X-DreamFactory-API-Key: $APIKEY" \ -d @/tmp/login.json | python3 -c "import sys,json; print(json.load(sys.stdin)['session_token'])") ``` -------------------------------- ### Full Admin Login Example (curl) Source: https://docs.dreamfactory.com/api-reference/authentication A complete curl command to authenticate as a system administrator. Replace placeholders with your actual host and API key. ```bash curl -s -X POST http://your-df-host/api/v2/system/admin/session \ -H "Content-Type: application/json" \ -H "X-DreamFactory-API-Key: YOUR_ADMIN_APP_API_KEY" \ -d '{"email":"admin@example.com","password":"yourpassword"}' ``` -------------------------------- ### Install DreamFactory Dependencies with Composer Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/windows-installation Install DreamFactory's PHP dependencies using Composer. Ensure you are in the DreamFactory installation directory and use the provided flags for a production-ready installation. ```bash composer install --no-dev --ignore-platform-reqs --verbose ``` -------------------------------- ### Create Service Source: https://docs.dreamfactory.com/api-reference/system-api Registers a new service. ```bash POST /api/v2/system/service ``` -------------------------------- ### Install Logstash Source: https://docs.dreamfactory.com/system-settings/logstash Installs the Logstash package on your Ubuntu system. This command should be run after the Elasticsearch installation is complete. ```bash sudo apt install -y logstash ``` -------------------------------- ### Create User Source: https://docs.dreamfactory.com/api-reference/system-api Creates a new user account. ```bash POST /api/v2/system/user ``` -------------------------------- ### List Available PHP Bundles on Clear Linux Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install If 'php-basic' does not meet your needs, use this command to list all available PHP-related bundles and identify alternatives. ```bash swupd bundle-list --all | grep php ``` -------------------------------- ### Force Install PECL Extension Source: https://docs.dreamfactory.com/upgrades-and-migrations/upgrading-to-php-8.1 Use this command to force the installation of a PECL extension if the `pecl install` command fails with an 'already installed' message. Replace `` with the actual extension name. ```bash pecl install -f ``` -------------------------------- ### Create PHP Source List File Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Create a new source file in apt sources list to include the Sury PHP repository. ```bash echo "deb [signed-by=/usr/share/keyrings/suryphp-archive-keyring.gpg] https://packages.sury.org/php/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/sury-php.list ``` -------------------------------- ### Start and Enable Logstash Service Source: https://docs.dreamfactory.com/system-settings/logstash Reloads the systemd daemon, enables Logstash to start on boot, and starts the Logstash service. ```bash sudo systemctl daemon-reload sudo systemctl enable logstash sudo systemctl start logstash ``` -------------------------------- ### Install Composer Dependencies Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/windows-installation Run this command from the DreamFactory installation directory to install Composer dependencies and fix 'Class not found' errors. ```bash cd C:\inetpub\wwwroot\dreamfactory composer install --no-dev --ignore-platform-reqs ``` -------------------------------- ### Backup .env File Source: https://docs.dreamfactory.com/upgrades-and-migrations/upgrading-and-migrating-dreamfactory Create a backup of the .env file before performing an upgrade. This file contains critical environment configuration and credentials. ```bash cp /opt/dreamfactory/.env /opt/dreamfactory/.env.backup.$(date +%Y%m%d) ``` -------------------------------- ### Install IBM Db2 Driver Package Source: https://docs.dreamfactory.com/upgrades-and-migrations/upgrading-to-php-8.1 Installs the IBM Db2 driver package and its dependencies. Ensure ksh is installed on your system. ```bash sudo -s \ && tar -xvf ibm_data_server_driver_package_linuxx64_v11.5.tar.gz -C /opt/ \ && cd /opt/dsdriver \ && apt install -y ksh \ && ./installDSDriver ``` -------------------------------- ### Install snapd on RHEL/CentOS/Fedora Source: https://docs.dreamfactory.com/system-settings/config/cors-and-ssl Installs the snapd package manager on RHEL-based systems using dnf. This is a prerequisite for installing Certbot as a snap. ```bash sudo dnf install snapd ``` -------------------------------- ### Install and refresh core snap Source: https://docs.dreamfactory.com/system-settings/config/cors-and-ssl Installs the 'core' snap, which provides essential runtime components for other snaps. It also refreshes the core snap to the latest version. ```bash sudo snap install core sudo snap refresh core ``` -------------------------------- ### Example MCP Client Configuration Source: https://docs.dreamfactory.com/AI/mcp-server-deployment This JSON snippet shows how to configure an MCP client, specifying the server type and the URL to connect to. Ensure there is no trailing slash in the URL. ```json { "servers": { "df-poc": { "type": "http", "url": "https://df.example.com/mcp/poc" } } } ``` -------------------------------- ### Manage Configuration Packages Source: https://docs.dreamfactory.com/api-reference/system-api Export or import system configuration packages. ```bash GET/POST /api/v2/system/package ``` -------------------------------- ### Install PHP OCI8 Extension Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/installing-additional-drivers Installs the PHP OCI8 extension using PECL, specifying the Instant Client path for the installation process. ```bash docker-compose exec web bash -c "echo 'instantclient,/opt/oracle/instantclient' | pecl install oci8" ``` -------------------------------- ### Download Oracle Instant Client Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/installing-additional-drivers Downloads the Oracle Instant Client basic and SDK packages from the official Oracle website. Requires accepting the license agreement via a cookie. ```bash docker-compose exec web bash -c "cd /tmp && wget --header='Cookie: oraclelicense=accept-securebackup-cookie' https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-basic-linux.x64-23.5.0.24.07.zip && wget --header='Cookie: oraclelicense=accept-securebackup-cookie' https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-sdk-linux.x64-23.5.0.24.07.zip" ``` -------------------------------- ### Download and Install AlloyDB Auth Proxy Source: https://docs.dreamfactory.com/api-generation-and-connections/api-types/database/alloydb Download the AlloyDB Auth Proxy binary, make it executable, and move it to your system's PATH. This is the first step to enabling external connections. ```bash # Download the Auth Proxy curl -o alloydb-auth-proxy https://storage.googleapis.com/alloydb-auth-proxy/v1.4.0/alloydb-auth-proxy.linux.amd64 chmod +x alloydb-auth-proxy sudo mv alloydb-auth-proxy /usr/local/bin/ ``` -------------------------------- ### Install Dependencies for Oracle Drivers Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/installing-additional-drivers Installs necessary packages like wget, unzip, and PHP development tools required for installing Oracle drivers. ```bash docker-compose exec web bash -c "apt-get update && apt-get install -y wget unzip libaio1t64 php8.3-dev php-pear build-essential" ``` -------------------------------- ### Install SAP SQL Anywhere PHP Driver Source: https://docs.dreamfactory.com/upgrades-and-migrations/upgrading-to-php-8.1 Installs the Sybase module for PHP 8.1, providing the php8.1-pdo-dblib extension. This is done by adding a PPA and installing the package. ```bash sudo apt install php8.1-sybase ``` -------------------------------- ### Install Memcached on CentOS/RHEL Source: https://docs.dreamfactory.com/api-generation-and-connections/api-types/cache/memcached Installs Memcached on CentOS/RHEL systems and enables/starts the service. ```bash sudo yum install memcached sudo systemctl enable memcached sudo systemctl start memcached ``` -------------------------------- ### ChatGPT Agent Command Example Source: https://docs.dreamfactory.com/AI/mcp-service-creation This is an example command to be used within a ChatGPT Agent to query the MCP server for database tables. Ensure your Agent is configured with the MCP server's endpoint, OAuth Client ID, and OAuth Client Secret. ```text Show me tables in my database/list tables ``` -------------------------------- ### 400 Bad Request Example Source: https://docs.dreamfactory.com/api-reference/error-codes An example of a 400 Bad Request error response, typically indicating a malformed request or invalid data. This specific example shows an invalid JSON syntax error. ```json { "error": { "code": 400, "message": "Invalid JSON: Syntax error" } } ``` -------------------------------- ### Install LSB Release Package Source: https://docs.dreamfactory.com/getting-started/installing-dreamfactory/raspberrypi-install Install the lsb-release package, which is necessary for adding PHP repositories. ```bash sudo apt install lsb-release ```