{"id":19854732,"url":"https://github.com/phwoolcon/demo","last_synced_at":"2026-06-03T20:31:42.651Z","repository":{"id":57041315,"uuid":"67777914","full_name":"phwoolcon/demo","owner":"phwoolcon","description":"Demostration module for Phwoolcon","archived":false,"fork":false,"pushed_at":"2017-08-28T10:53:18.000Z","size":2246,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T23:38:48.516Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://phwoolcon.org/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phwoolcon.png","metadata":{"files":{"readme":"README-zh.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-09T07:45:05.000Z","updated_at":"2018-01-05T12:15:16.000Z","dependencies_parsed_at":"2022-08-23T23:31:10.322Z","dependency_job_id":null,"html_url":"https://github.com/phwoolcon/demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phwoolcon/demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phwoolcon%2Fdemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phwoolcon%2Fdemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phwoolcon%2Fdemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phwoolcon%2Fdemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phwoolcon","download_url":"https://codeload.github.com/phwoolcon/demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phwoolcon%2Fdemo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33878990,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","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":[],"created_at":"2024-11-12T14:10:14.512Z","updated_at":"2026-06-03T20:31:42.626Z","avatar_url":"https://github.com/phwoolcon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 安装\n下文以 Ubuntu 安装为例。\n\n## 1. 安装 php7\n```bash\nadd-apt-repository ppa:ondrej/php\napt-get update\napt-get install php7.0-fpm php7.0-gd php7.0-cli php7.0-curl php7.0-dev php7.0-json php7.0-mbstring php7.0-mysql php7.0-xml php7.0-zip php-redis\n```\n\n## 2. 安装 phalcon\n```bash\ncurl -s https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh | bash\napt-get install php7.0-phalcon\n```\n\n## 3. 安装 swoole\n```bash\npecl install swoole\nvim /etc/php/7.0/mods-available/swoole.ini\n```\n\n```ini\n[swoole]\nextension = swoole.so\n```\n\n```bash\nln -s /etc/php/7.0/mods-available/swoole.ini /etc/php/7.0/cli/conf.d/20-swoole.ini\nln -s /etc/php/7.0/mods-available/swoole.ini /etc/php/7.0/fpm/conf.d/20-swoole.ini\n```\n\n## 4. 安装 composer\n```bash\nwget -c https://getcomposer.org/composer.phar -O /usr/bin/composer\nchmod +x /usr/bin/composer\n```\n\n## 5. 安装 nginx\n```bash\nadd-apt-repository ppa:nginx/stable\napt-get update\napt-get install nginx\n```\n\n## 5.1. 增加 nginx upstream php7\n```bash\nvim /etc/nginx/conf.d/upstream.conf\n```\n\n```conf\nupstream php7 {\n    #this should match value of \"listen\" directive in php-fpm pool\n    server unix:/run/php/php7.0-fpm.sock;\n}\n```\n\n## 5.2. 配置 nginx 入口\n```bash\nvim /etc/nginx/sites-available/yoursite.dev\n```\n\n```conf\nserver {\n    listen 80;\n    server_name     yoursite.dev;\n    root /srv/http/yoursite.dev/public;\n    index  index.php index.html index.htm;\n\n    access_log off;\n    error_log /var/log/nginx/yoursite.dev_error.log;\n\n    location / {\n        try_files $uri $uri/ /index.php?$query_string;\n    }\n\n    location ~ \\.php$ {\n        include snippets/fastcgi-php.conf;\n        fastcgi_pass php7;\n        access_log /var/log/nginx/yoursite.dev_access.log;\n        fastcgi_param USE_SERVICE 1;\n    }\n\n    location ~ /^\\. { deny all; }\n\n    location ~* \\.(js|css|swf|eot|ttf|otf|woff|woff2)$ {\n        add_header 'Cache-Control' 'public';\n        add_header 'X-Frame-Options' 'ALLOW-FROM *';\n        add_header 'Access-Control-Allow-Origin' '*';\n        add_header 'Access-Control-Allow-Credentials' 'true';\n        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';\n        add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';\n        expires +1w;\n    }\n}\n```\n\n## 5.3. 启用新入口\n```bash\nln -s /etc/nginx/sites-available/yoursite.dev /etc/nginx/sites-enabled/yoursite.dev\nnginx -t\nnginx -s reload\n```\n\n## 6. 安装 phwoolcon 框架\n```bash\ncd /srv/http\ngit clone git@github.com:phwoolcon/bootstrap.git yoursite.dev\n```\n\n## 7. 安装 phwoolcon/demo 模块\n```bash\ncd yoursite.dev\nbin/import-package phwoolcon/demo\ncomposer update\n```\n\n## 8. 安装数据库\n```bash\napt-get install mysql-server-5.6 mysql-client-5.6\n```\n\n### 8.1. 创建数据库和用户\n```bash\nmysql -uroot -p\ncreate database your_db_name;\nGRANT ALL PRIVILEGES ON your_db_name.*  To 'your_db_user'@'%' IDENTIFIED BY 'your_db_pass';\n```\n\n## 9. 修改项目配置\n\n```bash\nvim app/config/production/database.php\n```\n\n```php\n\u003c?php\nreturn [\n    'default' =\u003e 'mysql',\n    'connections' =\u003e [\n        'mysql' =\u003e [\n            'host'       =\u003e '127.0.0.1',    // Use real server\n            'username'   =\u003e 'your_db_user', // Use real username\n            'password'   =\u003e 'your_db_pass', // Use real password\n            'dbname'     =\u003e 'your_db_name', // Use real db name\n        ],\n    ],\n    'distributed' =\u003e [\n        'node_id' =\u003e '001',\n    ],\n    'query_log' =\u003e false,\n];\n```\n\n```bash\nvim app/config/production/payment.php\n```\n\n```php\n\u003c?php\nreturn [\n    'gateways' =\u003e [\n        'alipay' =\u003e [\n            // 填写真实商户资料\n            'partner' =\u003e 'PARTNER_ID',\n            'seller_id' =\u003e 'seller@phwoolcon.com',\n            'private_key' =\u003e '-----BEGIN RSA PRIVATE KEY-----\nYOUR_PRIVATE_KEY_HERE\n-----END RSA PRIVATE KEY-----',\n            'ali_public_key' =\u003e '-----BEGIN PUBLIC KEY-----\nALI_PUBLIC_KEY_HERE\n-----END PUBLIC KEY-----',\n        ],\n    ],\n];\n```\n\n## 10. 安装项目数据库\n```bash\nbin/dump-autoload\nbin/cli migrate:up\nbin/dump-autoload\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphwoolcon%2Fdemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphwoolcon%2Fdemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphwoolcon%2Fdemo/lists"}