[GH-ISSUE #555] Warn about missing dependency (was: Nothing sent with compose method "markdown") #403

Open
opened 2026-02-25 21:34:56 +03:00 by kerem · 16 comments
Owner

Originally created by @smitgd on GitHub (Feb 23, 2022).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/555

Originally assigned to: @IrAlfred on GitHub.

🐛 Bugreport

I sent a plain text message ok and it arrived at the destination. Then I wanted to see if the markdown setting under Site/General would work. After composing the message and clicking send, the screen goes completely blank and nothing is sent and nothing received. I went back to plain text mode and it sent again ok. Tried markdown mode sending couple more times and still wouldn't send and screen went blank. Didn't try html.

Version & Environment

Rev: [not sure, got it around Feb 7 using the install script]

OS: [linux]

Originally created by @smitgd on GitHub (Feb 23, 2022). Original GitHub issue: https://github.com/cypht-org/cypht/issues/555 Originally assigned to: @IrAlfred on GitHub. ## 🐛 Bugreport <!-- Describe your issue in detail. Include screenshots if needed. Give us as much information as possible. --> I sent a plain text message ok and it arrived at the destination. Then I wanted to see if the markdown setting under Site/General would work. After composing the message and clicking send, the screen goes completely blank and nothing is sent and nothing received. I went back to plain text mode and it sent again ok. Tried markdown mode sending couple more times and still wouldn't send and screen went blank. Didn't try html. ### Version & Environment <!-- Paste Git-Commit ID or Tag-Name here --> Rev: [not sure, got it around Feb 7 using the install script] <!-- Specify your OS and OS Version here if the issue is (most likely) platform dependent. --> OS: [linux]
Author
Owner

@jasonmunro commented on GitHub (Feb 23, 2022):

Sounds like a bug, let me try to reproduce and I will let you know. Thanks for the report!

<!-- gh-comment-id:1049219478 --> @jasonmunro commented on GitHub (Feb 23, 2022): Sounds like a bug, let me try to reproduce and I will let you know. Thanks for the report!
Author
Owner

@jasonmunro commented on GitHub (Feb 24, 2022):

I was able to send with markdown without issue. I did find a bug after send causing a 500 error/blank page however I just pushed a fix for that and it was happening after send so probably not what you are seeing.

We use a third party library called parsedown to convert the message body markdown to html on send (clients don't normally natively render markdown), since your site is failing before sending I suspect something want wrong with the "composer install" step of the installation. When you get a blank page it's almost always a server side 500 error and there maybe a clue in your webserver log about what is going wrong. I would try rerunning the composer step and checking the logs if it still fails.

<!-- gh-comment-id:1050324058 --> @jasonmunro commented on GitHub (Feb 24, 2022): I was able to send with markdown without issue. I did find a bug after send causing a 500 error/blank page however I just pushed a fix for that and it was happening after send so probably not what you are seeing. We use a third party library called parsedown to convert the message body markdown to html on send (clients don't normally natively render markdown), since your site is failing before sending I suspect something want wrong with the "composer install" step of the installation. When you get a blank page it's almost always a server side 500 error and there maybe a clue in your webserver log about what is going wrong. I would try rerunning the composer step and checking the logs if it still fails.
Author
Owner

@kk6mrp commented on GitHub (Feb 24, 2022):

I'm getting this error when trying to reply to messages:

/usr/local/share/cypht/modules/core/message_functions.php(38): HTMLToText->__construct()\n#1 /usr/local/share/cypht/modules/core/message_functions.php(318): convert_html_to_text()\n#2 /usr/local/share/cypht/modules/core/message_functions.php(274): format_reply_as_text()\n#3 /usr/local/share/cypht/modules/core/message_functions.php(382)
: reply_format_body()\n#4 /usr/local/share/cypht/modules/smtp/modules.php(925): format_reply_fields()\n#5 /usr/local/share/cypht/lib/module.php(526): Hm_Output_compose_form_content->output()\n#6 /usr/local/share/cypht/lib/modules_exec.php(101): Hm_Output_Module->output_content()\n#7 /usr/local/share/cypht/lib/modules_exec.php(83): Hm_Module_Exec->process_result()\n#8 /usr/local/share/cypht/lib/modules_exec.php(44):Hm_Module_Exec->run_output_module()\n#9 /usr/local/share/cypht/lib/dispatch.php(236): Hm_Module_Exec->run_o...'```
<!-- gh-comment-id:1050356966 --> @kk6mrp commented on GitHub (Feb 24, 2022): I'm getting this error when trying to reply to messages: ```bash AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Class "DOMDocument" not found in /usr/local/share/cypht/modules/core/message_functions.php:427\nStack trace:\n#0 /usr/local/share/cypht/modules/core/message_functions.php(38): HTMLToText->__construct()\n#1 /usr/local/share/cypht/modules/core/message_functions.php(318): convert_html_to_text()\n#2 /usr/local/share/cypht/modules/core/message_functions.php(274): format_reply_as_text()\n#3 /usr/local/share/cypht/modules/core/message_functions.php(382) : reply_format_body()\n#4 /usr/local/share/cypht/modules/smtp/modules.php(925): format_reply_fields()\n#5 /usr/local/share/cypht/lib/module.php(526): Hm_Output_compose_form_content->output()\n#6 /usr/local/share/cypht/lib/modules_exec.php(101): Hm_Output_Module->output_content()\n#7 /usr/local/share/cypht/lib/modules_exec.php(83): Hm_Module_Exec->process_result()\n#8 /usr/local/share/cypht/lib/modules_exec.php(44):Hm_Module_Exec->run_output_module()\n#9 /usr/local/share/cypht/lib/dispatch.php(236): Hm_Module_Exec->run_o...'```
Author
Owner

@smitgd commented on GitHub (Feb 24, 2022):

I'm assuming this is what you mean by "composer" and I'm pretty sure I did this before since the errors/warnings look familiar:

gene@xps17lt:/usr/local/share/cypht$ sudo composer install
[sudo] password for gene: 
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Nothing to install or update
Generating optimized autoload files

Not sure who to run it as if not sudo, anyhow, then I updated:

gene@xps17lt:/usr/local/share/cypht$ sudo composer update
[sudo] password for gene: 
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Updating dependencies (including require-dev)
Package operations: 0 installs, 3 updates, 0 removals
  - Updating paragonie/random_compat (v2.0.19 => v2.0.21): Downloading (100%)         
  - Updating ezyang/htmlpurifier (v4.13.0 => v4.14.0): Downloading (100%)         
  - Updating codeitnowin/barcode (3.0.5 => 3.0.6): Downloading (100%)         
Writing lock file
Generating optimized autoload files

I didn't try to update to "composer 2". Do I need it? Anyhow, before and after this it still doesn't work and I get this error in /var/log/apache2/error.log:

[Thu Feb 24 18:10:52.039806 2022] [proxy_fcgi:error] [pid 709011] [client 127.0.0.1:49764] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Class 'DOMDocument' not found in /usr/local/share/cypht/modules/core/message_functions.php:427\nStack trace:\n#0 /usr/local/share/cypht/modules/core/message_functions.php(38): HTMLToText->__construct()\n#1 /usr/local/share/cypht/modules/smtp/hm-mime-message.php(244): convert_html_to_text()\n#2 /usr/local/share/cypht/modules/smtp/hm-mime-message.php(92): Hm_MIME_Msg->prep_message_body()\n#3 /usr/local/share/cypht/modules/smtp/modules.php(686): Hm_MIME_Msg->get_mime_msg()\n#4 /usr/local/share/cypht/lib/modules_exec.php(175): Hm_Handler_process_compose_form_submit->process()\n#5 /usr/local/share/cypht/lib/modules_exec.php(153): Hm_Module_Exec->run_handler_module()\n#6 /usr/local/share/cypht/lib/dispatch.php(220): Hm_Module_Exec->run_handler_modules()\n#7 /usr/local/share/cypht/lib/dispatch.php(190): Hm_Dispatch->process_request()\n#8 /usr/local/share/cypht/site/index.php(50): Hm_Dispatch->__construct()\n#9 {main}\n  thrown in /usr/local/share/cypht/modules/core/mess...'

Not sure any of this is relevant.

<!-- gh-comment-id:1050365417 --> @smitgd commented on GitHub (Feb 24, 2022): I'm assuming this is what you mean by "composer" and I'm pretty sure I did this before since the errors/warnings look familiar: ``` gene@xps17lt:/usr/local/share/cypht$ sudo composer install [sudo] password for gene: Do not run Composer as root/super user! See https://getcomposer.org/root for details Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`. Nothing to install or update Generating optimized autoload files ``` Not sure who to run it as if not sudo, anyhow, then I updated: ``` gene@xps17lt:/usr/local/share/cypht$ sudo composer update [sudo] password for gene: Do not run Composer as root/super user! See https://getcomposer.org/root for details Loading composer repositories with package information Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/ Updating dependencies (including require-dev) Package operations: 0 installs, 3 updates, 0 removals - Updating paragonie/random_compat (v2.0.19 => v2.0.21): Downloading (100%) - Updating ezyang/htmlpurifier (v4.13.0 => v4.14.0): Downloading (100%) - Updating codeitnowin/barcode (3.0.5 => 3.0.6): Downloading (100%) Writing lock file Generating optimized autoload files ``` I didn't try to update to "composer 2". Do I need it? Anyhow, before and after this it still doesn't work and I get this error in /var/log/apache2/error.log: ``` [Thu Feb 24 18:10:52.039806 2022] [proxy_fcgi:error] [pid 709011] [client 127.0.0.1:49764] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /usr/local/share/cypht/modules/core/message_functions.php:427\nStack trace:\n#0 /usr/local/share/cypht/modules/core/message_functions.php(38): HTMLToText->__construct()\n#1 /usr/local/share/cypht/modules/smtp/hm-mime-message.php(244): convert_html_to_text()\n#2 /usr/local/share/cypht/modules/smtp/hm-mime-message.php(92): Hm_MIME_Msg->prep_message_body()\n#3 /usr/local/share/cypht/modules/smtp/modules.php(686): Hm_MIME_Msg->get_mime_msg()\n#4 /usr/local/share/cypht/lib/modules_exec.php(175): Hm_Handler_process_compose_form_submit->process()\n#5 /usr/local/share/cypht/lib/modules_exec.php(153): Hm_Module_Exec->run_handler_module()\n#6 /usr/local/share/cypht/lib/dispatch.php(220): Hm_Module_Exec->run_handler_modules()\n#7 /usr/local/share/cypht/lib/dispatch.php(190): Hm_Dispatch->process_request()\n#8 /usr/local/share/cypht/site/index.php(50): Hm_Dispatch->__construct()\n#9 {main}\n thrown in /usr/local/share/cypht/modules/core/mess...' ``` Not sure any of this is relevant.
Author
Owner

@jasonmunro commented on GitHub (Feb 26, 2022):

Last bit is the problem, you need the DOMDocument PHP class which I think is part of the php-xml package depending on your distro. On debian unstable I have:

jason [ ~/cypht ]$ dpkg -l | grep php | grep xml
ii  php7.4-xml                                  7.4.26-1                              amd64        DOM, SimpleXML, XML, and XSL module for PHP
<!-- gh-comment-id:1051421513 --> @jasonmunro commented on GitHub (Feb 26, 2022): Last bit is the problem, you need the DOMDocument PHP class which I think is part of the php-xml package depending on your distro. On debian unstable I have: ``` jason [ ~/cypht ]$ dpkg -l | grep php | grep xml ii php7.4-xml 7.4.26-1 amd64 DOM, SimpleXML, XML, and XSL module for PHP ```
Author
Owner

@jasonmunro commented on GitHub (Feb 26, 2022):

@kk6mrp not sure about your error it seems to be cut off before the actual important bit.

<!-- gh-comment-id:1051421997 --> @jasonmunro commented on GitHub (Feb 26, 2022): @kk6mrp not sure about your error it seems to be cut off before the actual important bit.
Author
Owner

@kk6mrp commented on GitHub (Feb 26, 2022):

@jasonmunro What do you suggest to see the important part?

<!-- gh-comment-id:1051429038 --> @kk6mrp commented on GitHub (Feb 26, 2022): @jasonmunro What do you suggest to see the important part?
Author
Owner

@smitgd commented on GitHub (Feb 26, 2022):

Last bit is the problem, you need the DOMDocument PHP class which I think is part of the php-xml package depending on your distro. On debian unstable I have:

Yes, installing php7.4-xml on ubuntu 20.04 fixed it. Now it accepts markdown and sends OK.
I guess the INSTALL file needs an addition:

On Debian based systems you can bring in the dependencies this way;
$ sudo apt install php php-fpm php-mbstring php-curl composer php-xml

Thanks!

<!-- gh-comment-id:1051450328 --> @smitgd commented on GitHub (Feb 26, 2022): > Last bit is the problem, you need the DOMDocument PHP class which I think is part of the php-xml package depending on your distro. On debian unstable I have: Yes, installing php7.4-xml on ubuntu 20.04 fixed it. Now it accepts markdown and sends OK. I guess the INSTALL file needs an addition: On Debian based systems you can bring in the dependencies this way; $ sudo apt install php php-fpm php-mbstring php-curl composer **php-xml** Thanks!
Author
Owner

@jasonmunro commented on GitHub (Feb 26, 2022):

noted that the install doc needs work! glad this fixed it for you!

<!-- gh-comment-id:1051571030 --> @jasonmunro commented on GitHub (Feb 26, 2022): noted that the install doc needs work! glad this fixed it for you!
Author
Owner

@jasonmunro commented on GitHub (Feb 26, 2022):

@kk6mrp the final part of the traceback is cut off so we don't have the actual error here just a trail of crumbs that gets us close :) Some webservers like nginx cap log messages at a max character count, might be the situation here

<!-- gh-comment-id:1051571926 --> @jasonmunro commented on GitHub (Feb 26, 2022): @kk6mrp the final part of the traceback is cut off so we don't have the actual error here just a trail of crumbs that gets us close :) Some webservers like nginx cap log messages at a max character count, might be the situation here
Author
Owner

@kk6mrp commented on GitHub (Feb 28, 2022):

I needed php-dom in Alpine Linux. My issue is resolved. Thank you!

<!-- gh-comment-id:1054725332 --> @kk6mrp commented on GitHub (Feb 28, 2022): I needed php-dom in Alpine Linux. My issue is resolved. Thank you!
Author
Owner

@marclaporte commented on GitHub (May 9, 2022):

To do:

<!-- gh-comment-id:1120586503 --> @marclaporte commented on GitHub (May 9, 2022): To do: - Update https://cypht.org/install.html - Add dependency check within Cypht
Author
Owner

@ElvisAns commented on GitHub (Sep 9, 2022):

What else can i add here https://github.com/jasonmunro/cypht-website/pull/35?

<!-- gh-comment-id:1241823774 --> @ElvisAns commented on GitHub (Sep 9, 2022): What else can i add here https://github.com/jasonmunro/cypht-website/pull/35?
Author
Owner

@marclaporte commented on GitHub (May 6, 2024):

@smitgd

Please retest, as a lot has changed since you reported this issue. Notably, we now have 3 active branches and recently released Cypht 2.0.0

<!-- gh-comment-id:2097116286 --> @marclaporte commented on GitHub (May 6, 2024): @smitgd Please retest, as a lot has changed since you reported this issue. Notably, we now have 3 active branches and recently released Cypht 2.0.0 - https://github.com/cypht-org/cypht/releases/tag/v2.0.0 - https://github.com/cypht-org/cypht/wiki/Lifecycle
Author
Owner

@marclaporte commented on GitHub (Sep 28, 2024):

@smitgd Please retest with latest stable: https://github.com/cypht-org/cypht/releases/

<!-- gh-comment-id:2380410743 --> @marclaporte commented on GitHub (Sep 28, 2024): @smitgd Please retest with latest stable: https://github.com/cypht-org/cypht/releases/
Author
Owner

@marclaporte commented on GitHub (Sep 1, 2025):

@smitgd I am persistent because I want to make Cypht better!

FYI: The monthly Cypht community meetings are a great opportunity to show bugs: https://github.com/cypht-org/cypht/wiki/Monthly-Community-Meetings

<!-- gh-comment-id:3242044652 --> @marclaporte commented on GitHub (Sep 1, 2025): @smitgd I am persistent because I want to make Cypht better! FYI: The monthly Cypht community meetings are a great opportunity to show bugs: https://github.com/cypht-org/cypht/wiki/Monthly-Community-Meetings
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#403
No description provided.