{"id":21933364,"url":"https://github.com/ishaqadhel/deploy-codeigniter-nginx","last_synced_at":"2025-10-09T19:30:47.893Z","repository":{"id":141544907,"uuid":"311445048","full_name":"ishaqadhel/Deploy-CodeIgniter-Nginx","owner":"ishaqadhel","description":"How To Deploy CodeIgniter PHP Framework to Nginx Linux VPS Server","archived":false,"fork":false,"pushed_at":"2021-04-27T03:46:00.000Z","size":264,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T06:51:10.817Z","etag":null,"topics":["codeigniter","nginx","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ishaqadhel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","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}},"created_at":"2020-11-09T19:34:30.000Z","updated_at":"2024-10-02T21:33:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"ac87a3a6-f0e4-493d-b987-80376566f2a7","html_url":"https://github.com/ishaqadhel/Deploy-CodeIgniter-Nginx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ishaqadhel/Deploy-CodeIgniter-Nginx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ishaqadhel%2FDeploy-CodeIgniter-Nginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ishaqadhel%2FDeploy-CodeIgniter-Nginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ishaqadhel%2FDeploy-CodeIgniter-Nginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ishaqadhel%2FDeploy-CodeIgniter-Nginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ishaqadhel","download_url":"https://codeload.github.com/ishaqadhel/Deploy-CodeIgniter-Nginx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ishaqadhel%2FDeploy-CodeIgniter-Nginx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001975,"owners_count":26083244,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["codeigniter","nginx","php"],"created_at":"2024-11-29T00:10:12.743Z","updated_at":"2025-10-09T19:30:47.886Z","avatar_url":"https://github.com/ishaqadhel.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploy CodeIgniter On NGINX\n\n## Whats is CodeIgniter?\nCodeIgniter is a powerful PHP framework with a very small footprint, built for developers who need a simple and elegant toolkit to create full-featured web applications. [official site](http://codeigniter.com).\n\n## Requirements\n\nApp : \n- Install Nginx or Apache Server\n- Install PHP-fpm (FastCGI Process Manager)\n- Install Mysql (Optional)\n- Install Composer\n\nPHP version 7.2 or higher is required, with the following extensions installed: \n\n- [intl](http://php.net/manual/en/intl.requirements.php)\n- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\\CURLRequest library\n\nAdditionally, make sure that the following extensions are enabled in your PHP:\n\n- json (enabled by default - don't turn it off)\n- [mbstring](http://php.net/manual/en/mbstring.installation.php)\n- [mysqlnd](http://php.net/manual/en/mysqlnd.install.php)\n- xml (enabled by default - don't turn it off)\n\n## Step by Step How To Install NGINX , PHP\n\n- Install NGINX Server : \n\n` sudo apt update`\n\n` sudo apt install nginx`\n\n- Adjusting Firewall :\n\n` sudo ufw app list`\n  \n` sudo ufw allow 'Nginx HTTP'`\n  \n` sudo ufw status`\n \n- Check Server : \n\n` systemctl status nginx`\n\n![Image of status nginx](/img/capture1.png)\n\n*if Nginx is already running, the status will appear as shown above\n\n- If Nginx has not started yet  : \n\n` sudo systemctl start nginx`\n\n- Install PHP-fpm :\n\n` sudo apt update`\n\n` sudo apt install php-fpm`\n\n` sudo systemctl restart nginx.service`\n\n- Change Access to folder `var/www/` : \n\n` sudo chmod -R 755 /var/www/`\n\n- Change config on file `/etc/nginx/sites-available/default` :\n\nAdd this line on Server block : `index index.php index.html index.htm index.nginx-debian.html;`\n\nPUse this Line below on PHP Block : \n\n```php\nlocation ~ \\.php$ {\n    include snippets/fastcgi-php.conf;  \n    fastcgi_pass unix:/run/php/php7.4-fpm.sock; \n}\n```\n\n- To check whether the PHP is running or not, go to `/var/www/html/` :\n\nThen create info.php file :\n\n```php\n\u003c?php\n  phpinfo();\nphp?\u003e\n```\n\nIf PHP is already running, there is an info for your php on your nginx server on `localhost/info.php`\n\n## Step by Step to Deploy / Install CodeIgniter on NGINX\n\n- install composer : \n\n`sudo apt install composer`\n\n`sudo apt install php-curl`\n\n`sudo apt install php-intl`\n\n- Create Config file on `/etc/nginx/sites-available/codeigniter.conf` : \n\n```php\n\nserver { listen 8080 default_server; listen [::]:8080 default_server;\n\nroot /var/www/codeigniter/public;\n\n# Add index.php to the list if you are using PHP\nindex index.php index.html index.htm index.nginx-debian.html;\n\nserver_name _;\n\nlocation / {\n\t# First attempt to serve request as file, then\n\t# as directory, then fall back to displaying a 404.\n\ttry_files $uri $uri/ /index.php;\n}\n\n# pass PHP scripts to FastCGI server\n#\nlocation ~ \\.php$ {\n\tinclude snippets/fastcgi-php.conf;\n\n#\t# With php-fpm (or other unix sockets):\n\tfastcgi_pass unix:/var/run/php/php7.4-fpm.sock;\n#\t# With php-cgi (or other tcp sockets):\n#\tfastcgi_pass 127.0.0.1:9000;\n}\n\n```\n\n- Create Link to sites-enabled :\n\n`sudo ln -s /etc/nginx/sites-available/codeigniter.conf /etc/nginx/sites-enabled/`\n\n`sudo nginx -t`\n\n`sudo systemctl restart nginx`\n\n- Install CodeIgniter using composer : \n\nOpen Directory Root :\n\n`cd /var/www/`\n\nInstall CodeIgniter : \n\n`composer create-project codeigniter4/appstarter [your-project-name]`\n\n\n`composer update`\n\n\n![Image of berhasil deploy](/img/capture2.PNG)\n\n\n## Reference\n\nhttps://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04\n\nhttps://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-ubuntu-18-04\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fishaqadhel%2Fdeploy-codeigniter-nginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fishaqadhel%2Fdeploy-codeigniter-nginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fishaqadhel%2Fdeploy-codeigniter-nginx/lists"}