{"id":19196705,"url":"https://github.com/codewithsushil/temp-server","last_synced_at":"2025-12-25T23:43:04.308Z","repository":{"id":217244778,"uuid":"743377088","full_name":"CodeWithSushil/TEMP-Server","owner":"CodeWithSushil","description":"TEMP Server only for Termux/Android users.","archived":false,"fork":false,"pushed_at":"2025-02-21T07:06:03.000Z","size":967,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T19:51:12.989Z","etag":null,"topics":["mariadb","nginx","php","server","temp","temp-server","tempserver","termux","webserver"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodeWithSushil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"codewithsushil","patreon":"code_with_sushil","open_collective":"codewithsushil","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"codewithsushil","thanks_dev":null,"custom":null}},"created_at":"2024-01-15T05:15:12.000Z","updated_at":"2025-02-21T07:06:07.000Z","dependencies_parsed_at":"2024-01-15T07:59:54.562Z","dependency_job_id":"e7370722-6c88-4673-b1a3-1a603fde739c","html_url":"https://github.com/CodeWithSushil/TEMP-Server","commit_stats":null,"previous_names":["codewithsushil/temp-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeWithSushil%2FTEMP-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeWithSushil%2FTEMP-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeWithSushil%2FTEMP-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeWithSushil%2FTEMP-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeWithSushil","download_url":"https://codeload.github.com/CodeWithSushil/TEMP-Server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249881703,"owners_count":21339519,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mariadb","nginx","php","server","temp","temp-server","tempserver","termux","webserver"],"created_at":"2024-11-09T12:14:19.399Z","updated_at":"2025-12-25T23:43:04.298Z","avatar_url":"https://github.com/CodeWithSushil.png","language":"PHP","readme":"![TEMP Server](./temp.png)\n\n### What is TEMP Server:-\n* This TEMP Server only for Android users or Termux users.\n* If you didn't know what is termux than you read [here](https://en.m.wikipedia.org/wiki/Termux).\n* T for [Termux](https://termux.dev) App.\n* E for [Nginx](https://www.nginx.com) Web Server.\n* M for [MariaDB](https://mariadb.com) Database Server.\n* P for [PHP](https://www.php.net) Language.\n\n### Termux Installation \n* If you install Termux app from Google [Play Store](https://play.google.com/store/apps/details?id=com.termux) maybe faced many problem in installation time.\n* So you go to download termux App from [F-Droid](https://f-droid.org/repo/com.termux_118.apk) or [Github](https://github.com/termux/termux-app/releases/download/v0.118.0/termux-app_v0.118.0+github-debug_universal.apk) (Recommended).\n* After install termux app than you follow this commands.\n\n### TEMP Server Installation Commands:-\n1. Update your Termux Repositorie.\n\n```bash\n pkg update\n     or\n apt update\n```\n2. Update your Termux Packages.\n\n```bash\npkg upgrade -y \n     or\napt upgrade -y\n```\n3. Install PHP Language and PHP-FPM (FastCGI Process Manager) for PHP.\n\n```bash\npkg install php php-fpm -y\n            or\napt install php php-fpm -y\n```\n\n4. Install MariaDB Database Server.\n\n```bash\npkg install mariadb -y\n         or\napt install mariadb -y\n```\n\n5. Install Nginx Web Server.\n\n```bash\npkg install nginx -y\n        or\napt install nginx -y\n```\n\n6. Install [PhpMyAdmin](https://www.phpmyadmin.net) for Mariadb/MySQL Client.\n\n```bash\npkg install phpmyadmin -y\n          or\napt install phpmyadmin -y\n```\n7. [Composer](https://getcomposer.org) is a [Dependency Manager](https://packagist.org) for PHP programming language so if you need composer than go to this command.\n\n```bash\npkg install composer -y\n         or\napt install composer -y # (Optional)\n\n```\n8. Install msmtp a lightweight SMTP (Simple Mail Transfer Protocol) client.\n\n```bash\npkg install msmtp -y\n       or \napt install msmtp -y\n```\n\n### PHP and Nginx Configuration\n* Set your project path\n* `cd $PREFIX/etc/nginx` edit nginx.conf file `nano nginx.conf`.\n```nginx\nroot /data/data/com.termux/files/usr/share/nginx/html;  #Default Set\n# root /sdcard/your_project_path\nindex index.php index.html index.htm; # Set index\n```\n* Configuration PHP Script and PHP-FPM.\n\n```nginx\nlocation ~ \\.php$ {\n    fastcgi_split_path_info ^(.+\\.php)(/.+)$;\n    fastcgi_pass unix:/data/data/com.termux/files/usr/var/run/php-fpm.sock;  # Set PHP-FPM for php script\n    fastcgi_index index.php;\n    include fastcgi_params;\n    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n    fastcgi_param SCRIPT_NAME $fastcgi_script_name;\n}\n```\n* Save nginx.conf file\n\n### PHP-FPM Configuration\n* Open php-fpm.d folder and edit www.conf file.\n* `cd $PREFIX/etc/php-fpm.d` and open www.conf file on nano text editor `nano www.conf`.\n* Set your user name if you didn't know than run this command `whoami` and copy your termux user name.\n```cnf\n28 user = www-data   # Set your termux user name\n29 group = www-data   # Set your termux user name\n41 listen = /data/data/com.termux/files/usr/var/run/php-fpm.sock\n53 listen.owner = www-data   # Set your termux user name\n54 listen.owner = www-data   # Set your termux user name\n116 pm = dynamic\n```\n* Save www.conf file.\n\n### PHP.ini Configuration\n* Go to etc directory `cd $PREFIX/etc/php`.\n* Create a php.ini file run this command `touch php.ini`.\n* Open php.ini file on your vim Editor or Nano Editor.\n* `nano php.ini`.\n```ini\nsendmail_path = \"/data/data/com.termux/files/usr/bin/msmtp -t\"\n```\n* Save your php.ini file.\n\n### My.ini\n* Go to etc directory `cd $PREFIX/etc/php`.\n* Create `conf.d` directory inside of php directory.\n* Run this command `mkdir conf.d`\n* Go to conf.d directory `cd conf.d`\n* Create my.ini file for MySQL or Mariadb configuration.\n* Run this command `touch my.ini \u0026\u0026 vi my.ini`\n```ini\nerror_reporting = E_ALL\ndisplay_errors = on\ndate.timezone = \"Asia/Kolkata\"  # Replace with your timezone\nmemory_limit = 128M\nupload_max_filesize = 10M\npost_max_size = 20M \n```\n\n### MySQL's my.cnf file\n\n```cnf\n# my.cnf\n[mysqld]\nport=3306\nsocket=/data/data/com.termux/files/usr/tmp/mysql.sock\ndatadir=/data/data/com.termux/files/usr/var/lib/mysql\nlog-error=/data/data/com.termux/files/usr/var/log/mysql.err\npid-file=/data/data/com.termux/files/usr/var/run/mysqld/mysqld.pid\nskip-external-locking\n\n[client]\nport=3306\nsocket=/data/data/com.termux/files/usr/tmp/mysql.sock\n\n[mysqldump]\nquick\nquote-names\nmax_allowed_packet=16M\n\ninnodb_buffer_pool_size=256M\nkey_buffer_size=64M\nmax_connections=200\n```\n\n### MSMTP Configuration\n* First Create a .msmtprc file.\n* `touch .msmtprc`\n* Open .msmtprc file on your Nano Editor.\n* `nano .msmtprc`\n\n```bashrc\naccount default\nhost smtp.mail.com\nport 587\nfrom      # Your Email id\nauth on\nuser      # Your Email id\npassword  # Your Email Password\ntls on\ntls_starttls on\ntls_trust_file /data/data/com.termux/files/usr/etc/tls/cert.pem\n```\n* Save your .msmtprc file.\n\n### Check Configuration Status\n* Create a index.php file.\n* `nano index.php`\n```php\n\u003c?php\nphpinfo();\n?\u003e\n```\n* Run this command `nginx` and `php-fpm`. \n\n```bash\nnginx \u0026\u0026 php-fpm\n```\n\n* Open This URL  “[http://localhost:8080](http://localhost:8080)” on your Mobile [Chrome](https://play.google.com/store/apps/details?id=com.android.chrome) Browser.\n\n![TEMP Result](./temp.jpg)\n\n---\n\n## MariaDB Config with PDO (socket)\nIf you getting error when you try to a connection with mariadb database. So you try this socket connection with MariaDB because MariaDB provide us socket for better experience and fast and secure connection. Before the established a connection with MariaDB, please config your `php.ini` file.\n\n```ini\n; php.ini\nmysqli.default_socket=\"/usr/var/run/mysqld.sock\"\npdo_mysql.default_socket=\"/usr/var/run/mysqld.sock\"\n```\n\n```php\n// MySQL way\n$pdo = new PDO(\"mysql:host=localhost;dbname=test;\",'root','');\n\nif($pdo){\n    echo \"Database connection success!\";\n}\n\n// MariaDB's socket way\n$mariadb = ini_get('pdo_mysql.default_socket');\n\n$pdo = new PDO(\"mysql:unix_socket=$mariadb;dbname=test\", 'root', '');\n\nif($pdo){\n    echo \"Database connection success!\";\n}\n\n```\n---\n","funding_links":["https://github.com/sponsors/codewithsushil","https://patreon.com/code_with_sushil","https://opencollective.com/codewithsushil","https://buymeacoffee.com/codewithsushil"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithsushil%2Ftemp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewithsushil%2Ftemp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithsushil%2Ftemp-server/lists"}