phpbb ไม่ RUN tasks โปรแกรม อัตโนมัติให้

สำหรับผู้ที่ เริ่มต้น Programming - PHP มีอะไร แนะนำ หรือข้อสงสัยต้องบอร์ด นี้ คนที่มีความรู้ แบ่งปันคนอื่นบ้างนะ ปัญหาการเขียนโปรแกรม แบบ OOP Session Cookies php network

Moderator: mindphp, ผู้ดูแลกระดาน

ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

phpbb ไม่ RUN tasks โปรแกรม อัตโนมัติให้

โพสต์ที่ยังไม่ได้อ่าน โดย thatsawan »

โค้ด: เลือกทั้งหมด

  public function run() { #ปัญหา funtion นี้ไม่ทำงาน
        global $phpbb_log;
        $phpbb_log->add('admin', '2', '127.0.0.1', 'Running cron task', time());
    }

    public function is_runnable() {   #ตรงนี้ทำงานปกติ 
        return (bool) TRUE;
    }

    function should_run() {
    #ตรงนี้ทำงานปกติ 
        return $this->config['time_package_pm_last_gc'] < time() - $this->config['time_package_pm_gc'];
//        return True;
    }

ตัวอย่าง
https://github.com/ForumHulp/Delete-Inactive-Users
Programming - PHP-1.png
Programming - PHP-2.png
Programming - PHP-2.png (38.79 KiB) Viewed 1157 times
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41131
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: phpbb ไม่ RUN tasks โปรแกรม อัตโนมัติให้

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

รัน command
php part-to-bin/phpbbcli.php cron.run
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

Re: phpbb ไม่ RUN tasks โปรแกรม อัตโนมัติให้

โพสต์ที่ยังไม่ได้อ่าน โดย thatsawan »

php C:/xampp/htdocs/code/bin/phpbbcli.php cron.run


[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "cron.run" is not defined.

Did you mean this?
cron:run


เจอ Error แบบนี้
ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

Re: phpbb ไม่ RUN tasks โปรแกรม อัตโนมัติให้

โพสต์ที่ยังไม่ได้อ่าน โดย thatsawan »

โค้ด: เลือกทั้งหมด

php bin/phpbbcli.php list

phpBB Console version 3.2.9

Usage:
command [options] [arguments]

Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--safe-mode Run in Safe Mode (without extensions).
-e, --env=ENV The Environment name.
-s, --shell Launch the shell.
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
help Displays help for a command
list Lists commands
cache
cache:purge Purge the cache
config
config:delete Deletes a configuration option
config:get Gets a configuration option’s value
config:increment Increments a configuration option’s integer value
config:set Sets a configuration option’s value
config:set-atomic Sets a configuration option’s value only if the old matches the current value
cron
cron:list Prints a list of ready and unready cron jobs.
cron:run Runs all ready cron tasks.
db
db:list List all installed and available migrations.
db:migrate Updates the database by applying migrations.
db:revert Revert a migration.
dev
dev:migration-tips Finds migrations that are not depended upon.
extension
extension:disable Disables the specified extension.
extension:enable Enables the specified extension.
extension:purge Purges the specified extension.
extension:show Lists all extensions in the database and on the filesystem.
fixup
fixup:fix-left-right-ids Repairs the tree structure of the forums and modules.
fixup:recalculate-email-hash Recalculates the user_email_hash column of the users table.
fixup:update-hashes Updates outdated password hashes to be hashed with bcrypt.
reparser
reparser:list Lists the types of text that can be reparsed.
reparser:reparse Reparses stored text with the current text_formatter services.
thumbnail
thumbnail:delete Delete all existing thumbnails.
thumbnail:generate Generate all missing thumbnails.
thumbnail:recreate Recreate all thumbnails.
update
update:check Check if the board is up to date.
user
user:activate Activate (or deactivate) a user account.
user:add Add a new user.
user:delete Delete a user account.
user:reclean Re-clean usernames.


จากนั้นเรา รัน

โค้ด: เลือกทั้งหมด

C:\xampp\htdocs\thaivi_code>php bin/phpbbcli.php cron


[RuntimeException]
Could not obtain cron lock.



[phpbb\exception\runtime_exception]
CRON_LOCK_ERROR



cron:run [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--safe-mode] [-e|--env ENV] [--] <command> [<name>]
ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

Re: phpbb ไม่ RUN tasks โปรแกรม อัตโนมัติให้

โพสต์ที่ยังไม่ได้อ่าน โดย thatsawan »

cron lock หมายถึงอะไรค่ะ
ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

Re: phpbb ไม่ RUN tasks โปรแกรม อัตโนมัติให้

โพสต์ที่ยังไม่ได้อ่าน โดย thatsawan »

ถ้าเราจะรันบน hosting เราจะเข้าไปรันคำสั่งได้ยังไงคะ
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41131
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: phpbb ไม่ RUN tasks โปรแกรม อัตโนมัติให้

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

Re: phpbb ไม่ RUN tasks โปรแกรม อัตโนมัติให้

โพสต์ที่ยังไม่ได้อ่าน โดย thatsawan »

โค้ด: เลือกทั้งหมด

D:\xampp\htdocs\xxxx>php bin/phpbbcli.php cron:run
ลองรันอีกเครื่อง


PHP Warning: Module 'pgsql' already loaded in Unknown on line 0
Warning: Module 'pgsql' already loaded in Unknown on line 0
ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

Re: phpbb ไม่ RUN tasks โปรแกรม อัตโนมัติให้

โพสต์ที่ยังไม่ได้อ่าน โดย thatsawan »

รันเเล้วไม่เจอ error เหมือนจะทำงานได้เเล้วค่ะ
ตอบกลับโพส
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 58