diff --git a/.gitattributes b/.gitattributes index bed0738c7eeb449bca98b5d2f33c89a1ee56349a..a9d7eade7e71de392a70c444ff10843377679788 100644 --- a/.gitattributes +++ b/.gitattributes @@ -58,3 +58,191 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text # Video files - compressed *.mp4 filter=lfs diff=lfs merge=lfs -text *.webm filter=lfs diff=lfs merge=lfs -text +php/chunk0.nt filter=lfs diff=lfs merge=lfs -text +php/chunk1.nt filter=lfs diff=lfs merge=lfs -text +php/chunk10.nt filter=lfs diff=lfs merge=lfs -text +php/chunk100.nt filter=lfs diff=lfs merge=lfs -text +php/chunk101.nt filter=lfs diff=lfs merge=lfs -text +php/chunk102.nt filter=lfs diff=lfs merge=lfs -text +php/chunk103.nt filter=lfs diff=lfs merge=lfs -text +php/chunk104.nt filter=lfs diff=lfs merge=lfs -text +php/chunk105.nt filter=lfs diff=lfs merge=lfs -text +php/chunk106.nt filter=lfs diff=lfs merge=lfs -text +php/chunk107.nt filter=lfs diff=lfs merge=lfs -text +php/chunk108.nt filter=lfs diff=lfs merge=lfs -text +php/chunk109.nt filter=lfs diff=lfs merge=lfs -text +php/chunk11.nt filter=lfs diff=lfs merge=lfs -text +php/chunk110.nt filter=lfs diff=lfs merge=lfs -text +php/chunk111.nt filter=lfs diff=lfs merge=lfs -text +php/chunk112.nt filter=lfs diff=lfs merge=lfs -text +php/chunk113.nt filter=lfs diff=lfs merge=lfs -text +php/chunk114.nt filter=lfs diff=lfs merge=lfs -text +php/chunk115.nt filter=lfs diff=lfs merge=lfs -text +php/chunk116.nt filter=lfs diff=lfs merge=lfs -text +php/chunk117.nt filter=lfs diff=lfs merge=lfs -text +php/chunk118.nt filter=lfs diff=lfs merge=lfs -text +php/chunk119.nt filter=lfs diff=lfs merge=lfs -text +php/chunk12.nt filter=lfs diff=lfs merge=lfs -text +php/chunk120.nt filter=lfs diff=lfs merge=lfs -text +php/chunk121.nt filter=lfs diff=lfs merge=lfs -text +php/chunk122.nt filter=lfs diff=lfs merge=lfs -text +php/chunk123.nt filter=lfs diff=lfs merge=lfs -text +php/chunk124.nt filter=lfs diff=lfs merge=lfs -text +php/chunk125.nt filter=lfs diff=lfs merge=lfs -text +php/chunk126.nt filter=lfs diff=lfs merge=lfs -text +php/chunk127.nt filter=lfs diff=lfs merge=lfs -text +php/chunk128.nt filter=lfs diff=lfs merge=lfs -text +php/chunk129.nt filter=lfs diff=lfs merge=lfs -text +php/chunk13.nt filter=lfs diff=lfs merge=lfs -text +php/chunk130.nt filter=lfs diff=lfs merge=lfs -text +php/chunk131.nt filter=lfs diff=lfs merge=lfs -text +php/chunk132.nt filter=lfs diff=lfs merge=lfs -text +php/chunk133.nt filter=lfs diff=lfs merge=lfs -text +php/chunk134.nt filter=lfs diff=lfs merge=lfs -text +php/chunk135.nt filter=lfs diff=lfs merge=lfs -text +php/chunk136.nt filter=lfs diff=lfs merge=lfs -text +php/chunk137.nt filter=lfs diff=lfs merge=lfs -text +php/chunk138.nt filter=lfs diff=lfs merge=lfs -text +php/chunk139.nt filter=lfs diff=lfs merge=lfs -text +php/chunk14.nt filter=lfs diff=lfs merge=lfs -text +php/chunk140.nt filter=lfs diff=lfs merge=lfs -text +php/chunk141.nt filter=lfs diff=lfs merge=lfs -text +php/chunk142.nt filter=lfs diff=lfs merge=lfs -text +php/chunk143.nt filter=lfs diff=lfs merge=lfs -text +php/chunk144.nt filter=lfs diff=lfs merge=lfs -text +php/chunk145.nt filter=lfs diff=lfs merge=lfs -text +php/chunk146.nt filter=lfs diff=lfs merge=lfs -text +php/chunk147.nt filter=lfs diff=lfs merge=lfs -text +php/chunk148.nt filter=lfs diff=lfs merge=lfs -text +php/chunk149.nt filter=lfs diff=lfs merge=lfs -text +php/chunk15.nt filter=lfs diff=lfs merge=lfs -text +php/chunk150.nt filter=lfs diff=lfs merge=lfs -text +php/chunk151.nt filter=lfs diff=lfs merge=lfs -text +php/chunk152.nt filter=lfs diff=lfs merge=lfs -text +php/chunk153.nt filter=lfs diff=lfs merge=lfs -text +php/chunk154.nt filter=lfs diff=lfs merge=lfs -text +php/chunk155.nt filter=lfs diff=lfs merge=lfs -text +php/chunk156.nt filter=lfs diff=lfs merge=lfs -text +php/chunk157.nt filter=lfs diff=lfs merge=lfs -text +php/chunk158.nt filter=lfs diff=lfs merge=lfs -text +php/chunk159.nt filter=lfs diff=lfs merge=lfs -text +php/chunk16.nt filter=lfs diff=lfs merge=lfs -text +php/chunk160.nt filter=lfs diff=lfs merge=lfs -text +php/chunk161.nt filter=lfs diff=lfs merge=lfs -text +php/chunk162.nt filter=lfs diff=lfs merge=lfs -text +php/chunk163.nt filter=lfs diff=lfs merge=lfs -text +php/chunk164.nt filter=lfs diff=lfs merge=lfs -text +php/chunk165.nt filter=lfs diff=lfs merge=lfs -text +php/chunk166.nt filter=lfs diff=lfs merge=lfs -text +php/chunk167.nt filter=lfs diff=lfs merge=lfs -text +php/chunk168.nt filter=lfs diff=lfs merge=lfs -text +php/chunk169.nt filter=lfs diff=lfs merge=lfs -text +php/chunk17.nt filter=lfs diff=lfs merge=lfs -text +php/chunk170.nt filter=lfs diff=lfs merge=lfs -text +php/chunk171.nt filter=lfs diff=lfs merge=lfs -text +php/chunk172.nt filter=lfs diff=lfs merge=lfs -text +php/chunk173.nt filter=lfs diff=lfs merge=lfs -text +php/chunk174.nt filter=lfs diff=lfs merge=lfs -text +php/chunk175.nt filter=lfs diff=lfs merge=lfs -text +php/chunk176.nt filter=lfs diff=lfs merge=lfs -text +php/chunk177.nt filter=lfs diff=lfs merge=lfs -text +php/chunk178.nt filter=lfs diff=lfs merge=lfs -text +php/chunk179.nt filter=lfs diff=lfs merge=lfs -text +php/chunk18.nt filter=lfs diff=lfs merge=lfs -text +php/chunk180.nt filter=lfs diff=lfs merge=lfs -text +php/chunk181.nt filter=lfs diff=lfs merge=lfs -text +php/chunk182.nt filter=lfs diff=lfs merge=lfs -text +php/chunk183.nt filter=lfs diff=lfs merge=lfs -text +php/chunk184.nt filter=lfs diff=lfs merge=lfs -text +php/chunk185.nt filter=lfs diff=lfs merge=lfs -text +php/chunk186.nt filter=lfs diff=lfs merge=lfs -text +php/chunk187.nt filter=lfs diff=lfs merge=lfs -text +php/chunk19.nt filter=lfs diff=lfs merge=lfs -text +php/chunk2.nt filter=lfs diff=lfs merge=lfs -text +php/chunk20.nt filter=lfs diff=lfs merge=lfs -text +php/chunk21.nt filter=lfs diff=lfs merge=lfs -text +php/chunk22.nt filter=lfs diff=lfs merge=lfs -text +php/chunk23.nt filter=lfs diff=lfs merge=lfs -text +php/chunk24.nt filter=lfs diff=lfs merge=lfs -text +php/chunk25.nt filter=lfs diff=lfs merge=lfs -text +php/chunk26.nt filter=lfs diff=lfs merge=lfs -text +php/chunk27.nt filter=lfs diff=lfs merge=lfs -text +php/chunk28.nt filter=lfs diff=lfs merge=lfs -text +php/chunk29.nt filter=lfs diff=lfs merge=lfs -text +php/chunk3.nt filter=lfs diff=lfs merge=lfs -text +php/chunk30.nt filter=lfs diff=lfs merge=lfs -text +php/chunk31.nt filter=lfs diff=lfs merge=lfs -text +php/chunk32.nt filter=lfs diff=lfs merge=lfs -text +php/chunk33.nt filter=lfs diff=lfs merge=lfs -text +php/chunk34.nt filter=lfs diff=lfs merge=lfs -text +php/chunk35.nt filter=lfs diff=lfs merge=lfs -text +php/chunk36.nt filter=lfs diff=lfs merge=lfs -text +php/chunk37.nt filter=lfs diff=lfs merge=lfs -text +php/chunk38.nt filter=lfs diff=lfs merge=lfs -text +php/chunk39.nt filter=lfs diff=lfs merge=lfs -text +php/chunk4.nt filter=lfs diff=lfs merge=lfs -text +php/chunk40.nt filter=lfs diff=lfs merge=lfs -text +php/chunk41.nt filter=lfs diff=lfs merge=lfs -text +php/chunk42.nt filter=lfs diff=lfs merge=lfs -text +php/chunk43.nt filter=lfs diff=lfs merge=lfs -text +php/chunk44.nt filter=lfs diff=lfs merge=lfs -text +php/chunk45.nt filter=lfs diff=lfs merge=lfs -text +php/chunk46.nt filter=lfs diff=lfs merge=lfs -text +php/chunk47.nt filter=lfs diff=lfs merge=lfs -text +php/chunk48.nt filter=lfs diff=lfs merge=lfs -text +php/chunk49.nt filter=lfs diff=lfs merge=lfs -text +php/chunk5.nt filter=lfs diff=lfs merge=lfs -text +php/chunk50.nt filter=lfs diff=lfs merge=lfs -text +php/chunk51.nt filter=lfs diff=lfs merge=lfs -text +php/chunk52.nt filter=lfs diff=lfs merge=lfs -text +php/chunk53.nt filter=lfs diff=lfs merge=lfs -text +php/chunk54.nt filter=lfs diff=lfs merge=lfs -text +php/chunk55.nt filter=lfs diff=lfs merge=lfs -text +php/chunk56.nt filter=lfs diff=lfs merge=lfs -text +php/chunk57.nt filter=lfs diff=lfs merge=lfs -text +php/chunk58.nt filter=lfs diff=lfs merge=lfs -text +php/chunk59.nt filter=lfs diff=lfs merge=lfs -text +php/chunk6.nt filter=lfs diff=lfs merge=lfs -text +php/chunk60.nt filter=lfs diff=lfs merge=lfs -text +php/chunk61.nt filter=lfs diff=lfs merge=lfs -text +php/chunk62.nt filter=lfs diff=lfs merge=lfs -text +php/chunk63.nt filter=lfs diff=lfs merge=lfs -text +php/chunk64.nt filter=lfs diff=lfs merge=lfs -text +php/chunk65.nt filter=lfs diff=lfs merge=lfs -text +php/chunk66.nt filter=lfs diff=lfs merge=lfs -text +php/chunk67.nt filter=lfs diff=lfs merge=lfs -text +php/chunk68.nt filter=lfs diff=lfs merge=lfs -text +php/chunk69.nt filter=lfs diff=lfs merge=lfs -text +php/chunk7.nt filter=lfs diff=lfs merge=lfs -text +php/chunk70.nt filter=lfs diff=lfs merge=lfs -text +php/chunk71.nt filter=lfs diff=lfs merge=lfs -text +php/chunk72.nt filter=lfs diff=lfs merge=lfs -text +php/chunk73.nt filter=lfs diff=lfs merge=lfs -text +php/chunk74.nt filter=lfs diff=lfs merge=lfs -text +php/chunk75.nt filter=lfs diff=lfs merge=lfs -text +php/chunk76.nt filter=lfs diff=lfs merge=lfs -text +php/chunk77.nt filter=lfs diff=lfs merge=lfs -text +php/chunk78.nt filter=lfs diff=lfs merge=lfs -text +php/chunk79.nt filter=lfs diff=lfs merge=lfs -text +php/chunk8.nt filter=lfs diff=lfs merge=lfs -text +php/chunk80.nt filter=lfs diff=lfs merge=lfs -text +php/chunk81.nt filter=lfs diff=lfs merge=lfs -text +php/chunk82.nt filter=lfs diff=lfs merge=lfs -text +php/chunk83.nt filter=lfs diff=lfs merge=lfs -text +php/chunk84.nt filter=lfs diff=lfs merge=lfs -text +php/chunk85.nt filter=lfs diff=lfs merge=lfs -text +php/chunk86.nt filter=lfs diff=lfs merge=lfs -text +php/chunk87.nt filter=lfs diff=lfs merge=lfs -text +php/chunk88.nt filter=lfs diff=lfs merge=lfs -text +php/chunk89.nt filter=lfs diff=lfs merge=lfs -text +php/chunk9.nt filter=lfs diff=lfs merge=lfs -text +php/chunk90.nt filter=lfs diff=lfs merge=lfs -text +php/chunk91.nt filter=lfs diff=lfs merge=lfs -text +php/chunk92.nt filter=lfs diff=lfs merge=lfs -text +php/chunk93.nt filter=lfs diff=lfs merge=lfs -text +php/chunk94.nt filter=lfs diff=lfs merge=lfs -text +php/chunk95.nt filter=lfs diff=lfs merge=lfs -text +php/chunk96.nt filter=lfs diff=lfs merge=lfs -text +php/chunk97.nt filter=lfs diff=lfs merge=lfs -text +php/chunk98.nt filter=lfs diff=lfs merge=lfs -text +php/chunk99.nt filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ccac67624ccf1580adb499d5db991da7a8fb9c97 --- /dev/null +++ b/README.md @@ -0,0 +1,132 @@ +--- +tags: + - knowledge-graph + - rdf + - n-triples + - sparql + - semantic-web + - stackoverflow + - question-answering +pretty_name: StackOverflow Knowledge Graph - PHP +license: cc-by-sa-4.0 +size_categories: + - 100M { + ?s ?p ?o + } +} +LIMIT 100 +``` + +## 5. Automatic Download And KG Setup + +You do not need to rebuild triples from XML to use this dataset. + +In the Stack2Graph repository, you can use the automation script +`experiment/load_hf_datasets_into_services.py` to download dataset artifacts +and prepare the knowledge graph service state automatically. + +Typical workflow: + +1. Clone and configure Stack2Graph (`.env` with HF token and service paths). +1. Start required local services: + +```bash +docker compose up -d +``` + +1. Run the loader script: + +```bash +python -m experiment.load_hf_datasets_into_services +``` + +For manual usage without automation, you can directly load `schema.nt` and all +triples from `php/` into your RDF store. + +## 6. Quality Notes And Caveats + +- A Stack Overflow question may belong to multiple language shards when tagged with multiple languages. +- Vote information is represented as aggregates, not raw individual vote events. +- As with community-generated data, content may include noise, bias, and temporal drift. + +## 7. Intended Use + +- retrieval and question-answering systems +- RAG and hybrid retriever experiments +- knowledge graph benchmarking and diagnostics +- language-scoped developer tooling research + +## 8. Limitations + +- Not a complete mirror of all Stack Overflow content. +- Not all moderation context or full revision history is represented. +- Best used with graph infrastructure that supports named graphs and SPARQL. + +## 9. Licensing And Attribution + +This dataset inherits Stack Overflow source licensing and attribution requirements. +Ensure compliant attribution and redistribution practices in all derived artifacts. + +## 10. Suggested Citation + +If you use this dataset, cite the Stack2Graph work: + +- Stack2Graph: A Structured Knowledge Representation of Stack Overflow Data for Retrieval-based Question Answering diff --git a/php/chunk0.nt b/php/chunk0.nt new file mode 100644 index 0000000000000000000000000000000000000000..5025801434952f450e797de6285f9ace1cd89b8e --- /dev/null +++ b/php/chunk0.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00412699e7265f4040cd33272481a01b43a4ea2e4cdbee2d7d6734889a31c1c7 +size 101279764 diff --git a/php/chunk1.nt b/php/chunk1.nt new file mode 100644 index 0000000000000000000000000000000000000000..0a5f4e1d66787be222e5d15a37e2c7687e4bc6bd --- /dev/null +++ b/php/chunk1.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9fdef90e2ac8d6d0559415acc6b52087e2d682787d7af4b7fea1c6507c4dadc +size 81672879 diff --git a/php/chunk10.nt b/php/chunk10.nt new file mode 100644 index 0000000000000000000000000000000000000000..411335a9bb4cd90559ab8ee48a7b731f79e79c64 --- /dev/null +++ b/php/chunk10.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c05f3563297761d8bfed877f33503a78a7c9b327702e805be70ae63ed1075dfe +size 97167430 diff --git a/php/chunk100.nt b/php/chunk100.nt new file mode 100644 index 0000000000000000000000000000000000000000..f19decf2b254ddabf850c7b6fe1c55c567756eef --- /dev/null +++ b/php/chunk100.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aea2e47454f944eba4f97543dd9ddbb566530eb8afaf14452b41f1b092c48665 +size 88115593 diff --git a/php/chunk101.nt b/php/chunk101.nt new file mode 100644 index 0000000000000000000000000000000000000000..5262730434d5ad803af8082e168b5deedf140f29 --- /dev/null +++ b/php/chunk101.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0c1a214e514c14f0f841ca63ef9b9e84f863c7fd26cdbbd1d012116f4930be1 +size 86475314 diff --git a/php/chunk102.nt b/php/chunk102.nt new file mode 100644 index 0000000000000000000000000000000000000000..371d1905da8f2146e56ace914af1211873f125b1 --- /dev/null +++ b/php/chunk102.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8dbb15a1578a307abf0a23eecc051d79c934f42071f989da49072f30ddc893c +size 99374554 diff --git a/php/chunk103.nt b/php/chunk103.nt new file mode 100644 index 0000000000000000000000000000000000000000..73346dd79be698d0423b3acd97d2932388004f3b --- /dev/null +++ b/php/chunk103.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d4e566d64252f15f7d5b1754e353a89e8acfa1e86460cdcc57bd68fb27c5606 +size 91244286 diff --git a/php/chunk104.nt b/php/chunk104.nt new file mode 100644 index 0000000000000000000000000000000000000000..4082efc1f0b378ea2623a5dc3f0027ed67573374 --- /dev/null +++ b/php/chunk104.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42bff5808edc048ac985109a03c9a546261f39958eb4f35d5ad7c28e6e5691b7 +size 92750216 diff --git a/php/chunk105.nt b/php/chunk105.nt new file mode 100644 index 0000000000000000000000000000000000000000..7708955efb0a41893b92511ffca112ad154896d3 --- /dev/null +++ b/php/chunk105.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2eb9ce20c22f62af5d3509586e5dbb7a6ce62f0fcd1fcd4048b753cae29254a3 +size 89469579 diff --git a/php/chunk106.nt b/php/chunk106.nt new file mode 100644 index 0000000000000000000000000000000000000000..dda12d7fae00aee7e417557cfde89e1d42ed83fc --- /dev/null +++ b/php/chunk106.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25e53c62d5680cfa081341955c6fb2337e0ea460ede81914921d08702f60de0d +size 84523045 diff --git a/php/chunk107.nt b/php/chunk107.nt new file mode 100644 index 0000000000000000000000000000000000000000..ee20a607eaf7bff9cb417fbb036e1a5beb8f7639 --- /dev/null +++ b/php/chunk107.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d054d87c171c60b881d82609c9879e64d2019858c7393b4d6f2c68ef9cb9000 +size 82564869 diff --git a/php/chunk108.nt b/php/chunk108.nt new file mode 100644 index 0000000000000000000000000000000000000000..b51b8f87ad85463d6ae42a63c514102fe7098f66 --- /dev/null +++ b/php/chunk108.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25dee3e929e89bb1f67954f9bfb9fbe1ae236ff16ab51e73c1b3089d3c7a59fc +size 85180498 diff --git a/php/chunk109.nt b/php/chunk109.nt new file mode 100644 index 0000000000000000000000000000000000000000..e9428919af857fd4664527d56a0e10530f1f1bf8 --- /dev/null +++ b/php/chunk109.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0792eaff0cd9dbbbbec8f499f038639738b45c5df491a61c32676432986ace5 +size 83753589 diff --git a/php/chunk11.nt b/php/chunk11.nt new file mode 100644 index 0000000000000000000000000000000000000000..6ff88c5f2f270855948f5e2458d27663e57d0d74 --- /dev/null +++ b/php/chunk11.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b16a56b7ef9857eed41a4c50e867286353d9f1d116dc2f96e9781246bcd19dc0 +size 93188932 diff --git a/php/chunk110.nt b/php/chunk110.nt new file mode 100644 index 0000000000000000000000000000000000000000..8c43643bd5cc1ce9c00ec72375bd82e6b515d18e --- /dev/null +++ b/php/chunk110.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f4d44323581358bc7a7f85125e7af6adbd24c6a69ff8f53d9f16414e74a7eb1 +size 84646885 diff --git a/php/chunk111.nt b/php/chunk111.nt new file mode 100644 index 0000000000000000000000000000000000000000..46838dcd361467424568aa9f151a6ccd82fc589a --- /dev/null +++ b/php/chunk111.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65a441d0c5b8f18b4b1c21ab35ec24806ab4c60f70be91e0a695de62d2274c8d +size 86693704 diff --git a/php/chunk112.nt b/php/chunk112.nt new file mode 100644 index 0000000000000000000000000000000000000000..26cab7f7207d6b3c94b7fa94ae3715437e8d8116 --- /dev/null +++ b/php/chunk112.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:300ca70ac69e70a6bec4ebd0384c2eecd19caeb346c615814a74003ba5d03748 +size 85620072 diff --git a/php/chunk113.nt b/php/chunk113.nt new file mode 100644 index 0000000000000000000000000000000000000000..420c4bcd3103d54882129bb9504e41e3273d8846 --- /dev/null +++ b/php/chunk113.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:351837fc4f63db373dbe799205e4347a333bb34b3cb0d59855782c4bbd47655d +size 81628279 diff --git a/php/chunk114.nt b/php/chunk114.nt new file mode 100644 index 0000000000000000000000000000000000000000..9886cdeefd9d3e439d1652d287dc427d3350d9ec --- /dev/null +++ b/php/chunk114.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff5f707ac46bc09fd8b68c7609bf2e33d2059f28212c098bc678a4e0bbe8bb97 +size 81939838 diff --git a/php/chunk115.nt b/php/chunk115.nt new file mode 100644 index 0000000000000000000000000000000000000000..281255a5103a710867054c2c4c07f3bbcead1020 --- /dev/null +++ b/php/chunk115.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:591ff5732342cccf5a660224ba50f227b5a5372a0784142b287d8544dec21602 +size 81166838 diff --git a/php/chunk116.nt b/php/chunk116.nt new file mode 100644 index 0000000000000000000000000000000000000000..b749111047228f73c5c14f0bb9d4fdd601ed33fd --- /dev/null +++ b/php/chunk116.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:015119e4caed9d4585d643d3a4ab2477300ef7834191ee1d017846339a72f8e4 +size 80610185 diff --git a/php/chunk117.nt b/php/chunk117.nt new file mode 100644 index 0000000000000000000000000000000000000000..95c5054e76a73d08dc24b95ea30575850c92e593 --- /dev/null +++ b/php/chunk117.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4708cc8db49da4efcb7a8d658cf7c486eb01cdd36f1c019403280cfc1904b6d9 +size 80529851 diff --git a/php/chunk118.nt b/php/chunk118.nt new file mode 100644 index 0000000000000000000000000000000000000000..cfbb00515719377eaae21563649aa59f841157e7 --- /dev/null +++ b/php/chunk118.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91aec4193e9a9b5f931146fa23c6bb24ac81a5bead45f35cb9b7639e57f283fd +size 78444605 diff --git a/php/chunk119.nt b/php/chunk119.nt new file mode 100644 index 0000000000000000000000000000000000000000..dc015a31b1e0637e9dc338201d98c0788b25f257 --- /dev/null +++ b/php/chunk119.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e552894fdc6d3ce1644b9b8f67e10e57b6b7b7f65c2baf4f4bdca9a49c05ae9f +size 79261343 diff --git a/php/chunk12.nt b/php/chunk12.nt new file mode 100644 index 0000000000000000000000000000000000000000..a673a605ecff533adc3883baad17d07a8444995e --- /dev/null +++ b/php/chunk12.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:488af4d4679d37c7060dfe1ceca584cb50aeb8ac57512bf0de0cffe809f91b82 +size 95491194 diff --git a/php/chunk120.nt b/php/chunk120.nt new file mode 100644 index 0000000000000000000000000000000000000000..1dbf148a0ae16553873226f14d596acf3e92a7b7 --- /dev/null +++ b/php/chunk120.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6adb41cdd00494d79f940f5148bfa82761497cc14f370a337e63b867fdd8a809 +size 77228719 diff --git a/php/chunk121.nt b/php/chunk121.nt new file mode 100644 index 0000000000000000000000000000000000000000..3ed057e50cb760ede9968c67fba4794071d103d2 --- /dev/null +++ b/php/chunk121.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8974799c4217ee76df8d813f3683640ffd2704e21f8b35d9f877e009819c6225 +size 74157076 diff --git a/php/chunk122.nt b/php/chunk122.nt new file mode 100644 index 0000000000000000000000000000000000000000..808aaa1ea2aac4942f77e63c1acef8adcef4f650 --- /dev/null +++ b/php/chunk122.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f92ffe9588235b3b4373a6726af27c663a4ae0989560978246495fa7c63b492 +size 75855380 diff --git a/php/chunk123.nt b/php/chunk123.nt new file mode 100644 index 0000000000000000000000000000000000000000..e7218383477ce90330ff3f2cd0dcd9e51261bd62 --- /dev/null +++ b/php/chunk123.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:064408e5a9b024f505d4d5efed9a6e07aeba915a5ef2424a4d914d4320093b42 +size 77784463 diff --git a/php/chunk124.nt b/php/chunk124.nt new file mode 100644 index 0000000000000000000000000000000000000000..28b3dc65e5c1e8bcc29f4bde234cb4130c26aa1c --- /dev/null +++ b/php/chunk124.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:767c7133bd50d65bfa7ec9cbd8de232a959b5e2c545e28f31a21677e428b32b8 +size 83762598 diff --git a/php/chunk125.nt b/php/chunk125.nt new file mode 100644 index 0000000000000000000000000000000000000000..bf43a4a76dff519fe65e6b03eb8d8d0453ed73aa --- /dev/null +++ b/php/chunk125.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9de15c94c10fab026bf50599c523aec1938e2ce04b53f5e6a59f8cdfafb845c2 +size 78254680 diff --git a/php/chunk126.nt b/php/chunk126.nt new file mode 100644 index 0000000000000000000000000000000000000000..683199844ccc5de09d56497ee324719c607c0bd9 --- /dev/null +++ b/php/chunk126.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e256617ed2d6d27ea36c708fb1d065624bb6b0c716128ee8e711cf4ecfec171a +size 77067282 diff --git a/php/chunk127.nt b/php/chunk127.nt new file mode 100644 index 0000000000000000000000000000000000000000..1b06ffe29c561ae0a7285ee6123804ea99857fa4 --- /dev/null +++ b/php/chunk127.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:534a5b2ceb3256f4eb48b338e78e30ccf95663f5916e7cd1959aef729d2117b6 +size 79249560 diff --git a/php/chunk128.nt b/php/chunk128.nt new file mode 100644 index 0000000000000000000000000000000000000000..bbd49dbc01d1c806a7f38270ebb9bf578dd0e4f0 --- /dev/null +++ b/php/chunk128.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:231b9399dfcdf48ceaff99b1340c529671108d3e637ceac732ce1009e0471ab7 +size 77506570 diff --git a/php/chunk129.nt b/php/chunk129.nt new file mode 100644 index 0000000000000000000000000000000000000000..6e4cbae1879730badb6733da728f6bd015f30019 --- /dev/null +++ b/php/chunk129.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b67926769f1a40208b177cf013fdc8662dec25fc9dfd7f14b23f0028ee68ea6 +size 76089849 diff --git a/php/chunk13.nt b/php/chunk13.nt new file mode 100644 index 0000000000000000000000000000000000000000..19e09a6d1774d56d196ebd124e3f2e5769ab1775 --- /dev/null +++ b/php/chunk13.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da045d33251b803a596d7e704ab5cfae6fd2996dc43577a5fa886c80800a5546 +size 96628849 diff --git a/php/chunk130.nt b/php/chunk130.nt new file mode 100644 index 0000000000000000000000000000000000000000..271a416017189bf938168210dce7f18121dae9dc --- /dev/null +++ b/php/chunk130.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5539ceb5e5dfc66a5072424fabf428d84fd2454b9f730667b45e58a591b46f9 +size 79250785 diff --git a/php/chunk131.nt b/php/chunk131.nt new file mode 100644 index 0000000000000000000000000000000000000000..5cafc6891c5d0de929d401ac39cd01ffee839699 --- /dev/null +++ b/php/chunk131.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fde2f1fd16e0289bec8b59d68de8d9f59a66b0815c5f29244ed72ae18f6b992 +size 78105092 diff --git a/php/chunk132.nt b/php/chunk132.nt new file mode 100644 index 0000000000000000000000000000000000000000..4ef7c217b37d86f4b0a878fff5d8dea13c9c0c1f --- /dev/null +++ b/php/chunk132.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f7a4fbea55e010ab89b0e65952c42f6adf49e22e9e2cb826fefae161185e949 +size 78647505 diff --git a/php/chunk133.nt b/php/chunk133.nt new file mode 100644 index 0000000000000000000000000000000000000000..35d585a4933d9ea93eb3fe03c2045a2ce35fff5e --- /dev/null +++ b/php/chunk133.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc4cad489c31071e8201939b64f63d61577e3198833e8c9ba01aaac2a5962107 +size 77634198 diff --git a/php/chunk134.nt b/php/chunk134.nt new file mode 100644 index 0000000000000000000000000000000000000000..32ed2d761c1dcc40bbfdf11d3550019fbdedb4bc --- /dev/null +++ b/php/chunk134.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95a971b9f5ddfe6a57c029bd983616c87bde3824eef96904b5475ea2f1c2e6d0 +size 74086658 diff --git a/php/chunk135.nt b/php/chunk135.nt new file mode 100644 index 0000000000000000000000000000000000000000..f55fa53d03d42af2070099fb50c092ada2505bd0 --- /dev/null +++ b/php/chunk135.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d21f391acb096f6c6e23bfceb69bbb8c33f3849790e50d0bd30a018f5a62a503 +size 77359748 diff --git a/php/chunk136.nt b/php/chunk136.nt new file mode 100644 index 0000000000000000000000000000000000000000..664c4eedea2683cdf59a63a25bd877df6027d839 --- /dev/null +++ b/php/chunk136.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33ce732371235342ee9e1840ddd7ab743f035ea1240ba58df0745ef553a6c8b1 +size 74300592 diff --git a/php/chunk137.nt b/php/chunk137.nt new file mode 100644 index 0000000000000000000000000000000000000000..633deebbb0ea36a45f5bf6fead7b477e896055a2 --- /dev/null +++ b/php/chunk137.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b6674056b2c4bc1c0b714cbae17386a330ecbdfe3a6700d820b75d609df8259 +size 76862892 diff --git a/php/chunk138.nt b/php/chunk138.nt new file mode 100644 index 0000000000000000000000000000000000000000..0c4f95e758d29cd2e30e26bc03781ce501b90f31 --- /dev/null +++ b/php/chunk138.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0efbad3f373e96ba5a88e7e1f26ab42e971d036349584ab076dbf0b3276c6577 +size 76923922 diff --git a/php/chunk139.nt b/php/chunk139.nt new file mode 100644 index 0000000000000000000000000000000000000000..145634c52af6030c496fdd487b435723c78e0868 --- /dev/null +++ b/php/chunk139.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43d190ffa231501982355e9147755cece837ef922050faba695b0d8ee741e983 +size 75132733 diff --git a/php/chunk14.nt b/php/chunk14.nt new file mode 100644 index 0000000000000000000000000000000000000000..1387f83b3d9993cce4a15b7ed2703ef8e82240c2 --- /dev/null +++ b/php/chunk14.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f988d3809bba8bf38cb55fa38feab3ae2b732e5abe370be69a20b43be7595d6 +size 95599842 diff --git a/php/chunk140.nt b/php/chunk140.nt new file mode 100644 index 0000000000000000000000000000000000000000..b6f5d4f5db7aec7bf91a066d6a426554177a9db9 --- /dev/null +++ b/php/chunk140.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2489cd5a880bdd7a8a90966eb3d9e37c20020167b726cc0aea80a97df3310699 +size 74607005 diff --git a/php/chunk141.nt b/php/chunk141.nt new file mode 100644 index 0000000000000000000000000000000000000000..1ff0d90fe31984a61a6f5f3f8131255d61018c0b --- /dev/null +++ b/php/chunk141.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e11cfd86ec5227940c5e9cbc77a13196bf771598f41d0c047c502d2a3c9f6ba3 +size 72416294 diff --git a/php/chunk142.nt b/php/chunk142.nt new file mode 100644 index 0000000000000000000000000000000000000000..a8d89c3cbc7293558df3c80eadc21a773c3a7fd1 --- /dev/null +++ b/php/chunk142.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cde8d3ff65c010f5249ed50005be49cab18ff4eb043aa06bbb75716be5636606 +size 69977903 diff --git a/php/chunk143.nt b/php/chunk143.nt new file mode 100644 index 0000000000000000000000000000000000000000..49b2db6f7525628dcad03655010deff0d19e5627 --- /dev/null +++ b/php/chunk143.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3629be97ced45b1550997b31aa9116a0d435921a128e6a2bc9e66e7080dcbe5f +size 104278563 diff --git a/php/chunk144.nt b/php/chunk144.nt new file mode 100644 index 0000000000000000000000000000000000000000..1f276a8c9249c919bd18e126c16ef659a69e55ff --- /dev/null +++ b/php/chunk144.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b35fd71bd4d94e70d02b102ed74d3fb3e939135e648fa9913d12b1a08816df7 +size 71471988 diff --git a/php/chunk145.nt b/php/chunk145.nt new file mode 100644 index 0000000000000000000000000000000000000000..dbfcb087b5f7517be6b005d9087d6430bee69924 --- /dev/null +++ b/php/chunk145.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d36549eb05efbb9dfee61102b72d7af08a7b1614370c3a16a4e06b192341dc82 +size 72018505 diff --git a/php/chunk146.nt b/php/chunk146.nt new file mode 100644 index 0000000000000000000000000000000000000000..c9cd694b7a6f7701c880894d1e078d24e288dec0 --- /dev/null +++ b/php/chunk146.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:527546b5da221a9ee192cf4096da20d947b2551e3292c780371fe156191dafe3 +size 72507284 diff --git a/php/chunk147.nt b/php/chunk147.nt new file mode 100644 index 0000000000000000000000000000000000000000..5b7b0aa415a6ddc98fb99835a874320857922d7e --- /dev/null +++ b/php/chunk147.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:595ad757b1506447524f1e258e20e7bceffb757c13885e037393006f616ed08d +size 99856032 diff --git a/php/chunk148.nt b/php/chunk148.nt new file mode 100644 index 0000000000000000000000000000000000000000..640887586bc6abd0c995c0e0b64b09c8df06cccf --- /dev/null +++ b/php/chunk148.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1754aa9810b4eae68fb6883d847f927ae465b30f46f425d5c2e0dd95e838f550 +size 99249721 diff --git a/php/chunk149.nt b/php/chunk149.nt new file mode 100644 index 0000000000000000000000000000000000000000..2d6688499acfb9f55e573d7e925e0043b45c082a --- /dev/null +++ b/php/chunk149.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5c10e3f66c14c105fbfaa3df03f0b99ed83f48a6432c2774d74004bb69c00e6 +size 93924193 diff --git a/php/chunk15.nt b/php/chunk15.nt new file mode 100644 index 0000000000000000000000000000000000000000..f3fc94a8a65bea5f9baa9c1d84ad2e7a5d38d934 --- /dev/null +++ b/php/chunk15.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abc1a375e881849ea08ecd0e09f16beb2f54f710404cbfa7b43bdb07ee810caf +size 101524707 diff --git a/php/chunk150.nt b/php/chunk150.nt new file mode 100644 index 0000000000000000000000000000000000000000..9914d31601be2a4b6febab60b7d9c49158df9093 --- /dev/null +++ b/php/chunk150.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebef65b2782080f7235842b4bb82f986c0a51a54f4c3b470f771801a1055d3de +size 95228388 diff --git a/php/chunk151.nt b/php/chunk151.nt new file mode 100644 index 0000000000000000000000000000000000000000..f8beaeb2ec88117f1d9826f51137e205a3c628cf --- /dev/null +++ b/php/chunk151.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3bef90581ec1bc03db0335295b26119b422ed5b26a9eb16836dedd350a595ed5 +size 95109240 diff --git a/php/chunk152.nt b/php/chunk152.nt new file mode 100644 index 0000000000000000000000000000000000000000..d9a296c95d7db200039260c9cf88cde900b2b106 --- /dev/null +++ b/php/chunk152.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a06e9a616f9906776a56783423632ca145fdebfc04c024cb94f0303808b20147 +size 91675089 diff --git a/php/chunk153.nt b/php/chunk153.nt new file mode 100644 index 0000000000000000000000000000000000000000..c569a523022523dcbbf260991b7ca28ca7d52ffc --- /dev/null +++ b/php/chunk153.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a9049784fa3ef81aebfcee850e2837186ccb136b5d04cd32959615fbc300023 +size 92412454 diff --git a/php/chunk154.nt b/php/chunk154.nt new file mode 100644 index 0000000000000000000000000000000000000000..fd7fcc541d765be3c02c05fc1e889d9202903382 --- /dev/null +++ b/php/chunk154.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:561076e4548744bbcae2c4283ac21d3b9c7dbcdee2236515edf6f8fe5247d8fe +size 91640172 diff --git a/php/chunk155.nt b/php/chunk155.nt new file mode 100644 index 0000000000000000000000000000000000000000..dfcbbdc4309106151f91b4a59f84fcdf6c5f4bdf --- /dev/null +++ b/php/chunk155.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:276bc206e6e335cb6c67cecef95623d68c68a4f9b26b251ba1e3343971cf197a +size 87279189 diff --git a/php/chunk156.nt b/php/chunk156.nt new file mode 100644 index 0000000000000000000000000000000000000000..1cfddadc7f9c53418024cdabc1a7803c0d7274a0 --- /dev/null +++ b/php/chunk156.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8cdedca89b42aa88cd7d463ab2c9fe99887710fde43d3fd4cd7503877f3dc95f +size 84030518 diff --git a/php/chunk157.nt b/php/chunk157.nt new file mode 100644 index 0000000000000000000000000000000000000000..efa80d77cd730a5b1357b0e46fd5612e197ebe28 --- /dev/null +++ b/php/chunk157.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:493b1db99b9f96f534ca2c9fd3a15d46b209c7451878f04bbda9b9700001115b +size 77991007 diff --git a/php/chunk158.nt b/php/chunk158.nt new file mode 100644 index 0000000000000000000000000000000000000000..94a8965ec3a19be6bb0ca3317a8acb9690130e53 --- /dev/null +++ b/php/chunk158.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1506fc03c97a1f68481f1a3d4e954b2d4f51a2725332f4a3669a262f0e4c1e1 +size 82196188 diff --git a/php/chunk159.nt b/php/chunk159.nt new file mode 100644 index 0000000000000000000000000000000000000000..fa9a2da1789435e353d4217634a00161c71839f3 --- /dev/null +++ b/php/chunk159.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab6d748c6e13e3a3a4119eaa8b975c458dccd50a733094f971cca76dfbbc43e8 +size 84002675 diff --git a/php/chunk16.nt b/php/chunk16.nt new file mode 100644 index 0000000000000000000000000000000000000000..ed69ba4e4ada23ccd0980c488e4e05f1a93a112d --- /dev/null +++ b/php/chunk16.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:483a43cb6af85aae5307ae5e8b306334c1716fb7e729efa2617326f239092fa2 +size 99392572 diff --git a/php/chunk160.nt b/php/chunk160.nt new file mode 100644 index 0000000000000000000000000000000000000000..3eb7d0bfe5543c92bce05441a2acefe71ac9c342 --- /dev/null +++ b/php/chunk160.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29e984fd5f0e8d7355018e1334eb491859cdb518418800a59e2b5398cc318473 +size 84793135 diff --git a/php/chunk161.nt b/php/chunk161.nt new file mode 100644 index 0000000000000000000000000000000000000000..d65dce834b0470a5410882c0ed3044139e0226a1 --- /dev/null +++ b/php/chunk161.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92fc3d165ddbeaf72c10d789557c54f7db46205c92941e98a0994ec4a8f4bd15 +size 80240664 diff --git a/php/chunk162.nt b/php/chunk162.nt new file mode 100644 index 0000000000000000000000000000000000000000..153479f1273b2bea93e4ce5613f96558eee4a273 --- /dev/null +++ b/php/chunk162.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b73ccb010a8e81e1d4a3e6e9c2c2cf249b77227249cde45f21af3ad07e4405c2 +size 99907570 diff --git a/php/chunk163.nt b/php/chunk163.nt new file mode 100644 index 0000000000000000000000000000000000000000..4896df29601f2efbd89be21784b6d07a9f65bf0a --- /dev/null +++ b/php/chunk163.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0563912caf4bdcb9e93ed90d14d0974b5ccd6deedc6dd057047d771981d31bb9 +size 96477722 diff --git a/php/chunk164.nt b/php/chunk164.nt new file mode 100644 index 0000000000000000000000000000000000000000..6c316b9d8d60164bc16243086dfa085eb02494dd --- /dev/null +++ b/php/chunk164.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ec77d4e5fa11a1c9b9b51214a427a7b7b4fd3caff9be565677b030b7296a28e +size 96627193 diff --git a/php/chunk165.nt b/php/chunk165.nt new file mode 100644 index 0000000000000000000000000000000000000000..19c7aadcd207f5b6edf905a841142c500ff61cbd --- /dev/null +++ b/php/chunk165.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d32a538eabe93328fb3eb5e7555989457615ad3667c61e329b11c90283fc32e +size 90493375 diff --git a/php/chunk166.nt b/php/chunk166.nt new file mode 100644 index 0000000000000000000000000000000000000000..6e6b3bbadce0656e35e1b34f6ea1fe74e9839b37 --- /dev/null +++ b/php/chunk166.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32765b0415677b3dfd085a8f7f9ad57deacaf935504eb5bcf91fcdccf4b45ae3 +size 87527920 diff --git a/php/chunk167.nt b/php/chunk167.nt new file mode 100644 index 0000000000000000000000000000000000000000..34c478ada2dae769025e07ccca6060329e006e3d --- /dev/null +++ b/php/chunk167.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a7728ceed05ceca25838f91b47919eebfe7509610b1003b8921a288f18f52b9 +size 88446163 diff --git a/php/chunk168.nt b/php/chunk168.nt new file mode 100644 index 0000000000000000000000000000000000000000..98671ea37f7bfcc72b0caabfd1c589fa0f1f01bd --- /dev/null +++ b/php/chunk168.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c825bf44fb5fc4ef15eb157ca510593226978f761a27413bc3d92b355e13a1a2 +size 87775171 diff --git a/php/chunk169.nt b/php/chunk169.nt new file mode 100644 index 0000000000000000000000000000000000000000..5b5ab8d1d9c8ded213844ecc6cd44247e9b5e531 --- /dev/null +++ b/php/chunk169.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:627b3e9685da201d7f0ecab66861a14d281774d186cf4a3300e3096e3062b58f +size 102669274 diff --git a/php/chunk17.nt b/php/chunk17.nt new file mode 100644 index 0000000000000000000000000000000000000000..4f3e3ec073a10da50eb4a125b034437e0dbf5225 --- /dev/null +++ b/php/chunk17.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4c11bd8c3cb61641bf637ba7e6065b8891f8c724e798e43ad90fb8b47a4393b +size 98121180 diff --git a/php/chunk170.nt b/php/chunk170.nt new file mode 100644 index 0000000000000000000000000000000000000000..57f27a336b2871a8fa1211366129ae3ee12021e9 --- /dev/null +++ b/php/chunk170.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:acf713db969089c8b1846f7431f53fcd8cadac4286322b68f78d7302f3ddabe2 +size 93795608 diff --git a/php/chunk171.nt b/php/chunk171.nt new file mode 100644 index 0000000000000000000000000000000000000000..5edacd14006c0958381b0b7c8888e8e6565bd11d --- /dev/null +++ b/php/chunk171.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a44adcd07445f062fbffe25f1c29f7866e5a0ee2ee17da3bf46fffaa395d9eb7 +size 87388064 diff --git a/php/chunk172.nt b/php/chunk172.nt new file mode 100644 index 0000000000000000000000000000000000000000..769f82138e5427469fed6aa199ce7b167d5cde78 --- /dev/null +++ b/php/chunk172.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb4f6a4c1428a1efe251685520375be7ecef48ea41e7dc44f1f8d90ddb4949b3 +size 96440197 diff --git a/php/chunk173.nt b/php/chunk173.nt new file mode 100644 index 0000000000000000000000000000000000000000..8ab86fc014c70d5595db841497a447ad6ba12319 --- /dev/null +++ b/php/chunk173.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:afedc3d396b732b54df39ef7072970062e87a26cd655293bbb3eaf67b13d1dcc +size 92011788 diff --git a/php/chunk174.nt b/php/chunk174.nt new file mode 100644 index 0000000000000000000000000000000000000000..adf65a6347fec6007c728fda21821bd7e3316c74 --- /dev/null +++ b/php/chunk174.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bc8ca946154394d2c1b3bed376d6e530a4419df8595838e176fdc555afcf6ae +size 87897197 diff --git a/php/chunk175.nt b/php/chunk175.nt new file mode 100644 index 0000000000000000000000000000000000000000..ef10958546f8b34a67633918eb964f06bf27f710 --- /dev/null +++ b/php/chunk175.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cde6ea0a9eb24afa7aa73b27c18964a2a1f0bcbfe2a8134b86cd6829747a47e5 +size 93471050 diff --git a/php/chunk176.nt b/php/chunk176.nt new file mode 100644 index 0000000000000000000000000000000000000000..6b23ad2f9ded10c73e1cab549f4c9d401a93a4aa --- /dev/null +++ b/php/chunk176.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8712cb4b530ad0de883231423054b14e153fe522f50e0cbc643f1e99b1a0d33 +size 104766640 diff --git a/php/chunk177.nt b/php/chunk177.nt new file mode 100644 index 0000000000000000000000000000000000000000..88e532d29b51ce9c1f0432d9859a42c207f01d4a --- /dev/null +++ b/php/chunk177.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f84db550c815b68e50698aefd3de05419da27b021327ee3c36cc84ffd320d67 +size 102099748 diff --git a/php/chunk178.nt b/php/chunk178.nt new file mode 100644 index 0000000000000000000000000000000000000000..e09c44ad7dcc212b69ce92d9709705ef25ac9809 --- /dev/null +++ b/php/chunk178.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02702acabc0cea119bc5e58eae5271d74d94a8f2ff7141be5e1612c7af00ef32 +size 99983992 diff --git a/php/chunk179.nt b/php/chunk179.nt new file mode 100644 index 0000000000000000000000000000000000000000..a6707e9bda51da8ce3eb0bca1fada0173c9a53ca --- /dev/null +++ b/php/chunk179.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc2385cfc1cc808217b0de80bfeab07bc8720a94d64c6860fcaedb20b9943cbd +size 96518711 diff --git a/php/chunk18.nt b/php/chunk18.nt new file mode 100644 index 0000000000000000000000000000000000000000..e9df473cc1336d116c04e509e935123cdde2371d --- /dev/null +++ b/php/chunk18.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c83f2f4c1972049787d5d074e94ca3bb7bebd16513f5919cf7143193f51cd4f +size 89662102 diff --git a/php/chunk180.nt b/php/chunk180.nt new file mode 100644 index 0000000000000000000000000000000000000000..2fed52b422ab05bfa38d9ae14847639730f6ab26 --- /dev/null +++ b/php/chunk180.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3e705071a056f59301d3a4a0da418a2a10e302b05d7b4dfddf94bed0ad22968 +size 93357414 diff --git a/php/chunk181.nt b/php/chunk181.nt new file mode 100644 index 0000000000000000000000000000000000000000..8fc6e5d031c52bc17af62e59365833b3ca9bb42b --- /dev/null +++ b/php/chunk181.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4f90fd7bb447b5b8a7ca727f6023fcfbe1cee13176ac8021907e80c7d62c13e +size 99704076 diff --git a/php/chunk182.nt b/php/chunk182.nt new file mode 100644 index 0000000000000000000000000000000000000000..ebdcbb56424600fcdb0be3993fe812be39d63fca --- /dev/null +++ b/php/chunk182.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0bb16f570a1b3d6643702377f7b563feef5d0f3b99b2cc64b753d53360d2a80 +size 101858162 diff --git a/php/chunk183.nt b/php/chunk183.nt new file mode 100644 index 0000000000000000000000000000000000000000..0ce6bca9a40817a376a5c40c3d3bb6b9946e9905 --- /dev/null +++ b/php/chunk183.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fccf6e135043f01bf72a25002d8717780a82d7e535e7910f5aa12563d64a568 +size 100299945 diff --git a/php/chunk184.nt b/php/chunk184.nt new file mode 100644 index 0000000000000000000000000000000000000000..4ffca9e0496eca0325f0eaea35ed302b7cbce9dd --- /dev/null +++ b/php/chunk184.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63d511a8d74508e9cd203242b25301fd0ae3585a03a587ef931dc428f4d1f95c +size 93716364 diff --git a/php/chunk185.nt b/php/chunk185.nt new file mode 100644 index 0000000000000000000000000000000000000000..d80f7bdeff8cf81f322e4cd12387b3d98a599f76 --- /dev/null +++ b/php/chunk185.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3803c9361d1a9002d70d8b7a3253b6754b4befa3cd150f6c9756cf4bd1535f3 +size 99761226 diff --git a/php/chunk186.nt b/php/chunk186.nt new file mode 100644 index 0000000000000000000000000000000000000000..b533222cfab77d3434b00614a0be7491bd42f620 --- /dev/null +++ b/php/chunk186.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:882cf2b9d71583dd657a5a267aa87aab832631a8158e140fb6583ed3ef5bd58f +size 92447345 diff --git a/php/chunk187.nt b/php/chunk187.nt new file mode 100644 index 0000000000000000000000000000000000000000..6a38f59a27532977593f691798d419f1565dc064 --- /dev/null +++ b/php/chunk187.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ed4e8607651bc1fa8a452f97ebf1480282591effa9ab085c56c0e6261d7cf3a +size 102224564 diff --git a/php/chunk188.nt b/php/chunk188.nt new file mode 100644 index 0000000000000000000000000000000000000000..a64c976e7e940e00f843f14d215fde4672265650 --- /dev/null +++ b/php/chunk188.nt @@ -0,0 +1,33017 @@ + "3"^^ . + . + . + . + . + "symfony4"^^ . + . + . + "wordpress-shortcode"^^ . + . + . + . + . + "Microsoft Graph API v2 - Upload and Downlod files from / to OneDrive using PHP"^^ . + "1"^^ . + . + "<p>as the title says, I'm trying to hook into Elementor's exisiting CTA-widget and turn the existing input field into a WYSIWYG-field by looking at the widget's structure etc. within elementor pro directory. But somehow nothing happens. If I change it in the plugins source file it works, but sure I want to override it through my functions.php.</p>\n<p>I've done this for the slides Widget before and that worked well. What am I missing here?</p>\n<pre class="lang-php prettyprint-override"><code>/*\n * Set Elementor &gt; CTA widget description as wysiwyg Text Editor\n */\nadd_action( 'elementor/element/call-to-action/section_content/before_section_end', function( $widget, $args ) {\n $cta_control = \\Elementor\\Plugin::instance()-&gt;controls_manager-&gt;get_control_from_stack( $widget-&gt;get_unique_name(), 'call-to-action' );\n\n if ( is_wp_error( $cta_control ) ) {\n return;\n }\n\n $cta_control['fields']['description']['type'] = \\Elementor\\Controls_Manager::WYSIWYG;\n\n $widget-&gt;update_control( 'call-to-action', $cta_control );\n},10 ,2 );\n</code></pre>\n<p>Any help appreciated. Thank you.</p>\n"^^ . + . + . + . + . + "<p>I've got the weirdest of problems. im using laravel 10.x and fimanent 3 and im having this issue where the filament routes work just fine but the routes ive created and have on web.php return <code>404</code>. This is my file:</p>\n<pre><code>\nuse App\\Livewire\\Cart;\nuse App\\Livewire\\CheckoutStatus;\nuse App\\Livewire\\ProductInfo;\nuse App\\Livewire\\StoreFront;\nuse App\\Livewire\\ViewOrder;\nuse App\\Models\\About;\nuse App\\Models\\Contact;\nuse App\\Models\\FAQdata;\nuse App\\Models\\Help;\nuse App\\Models\\Privacy;\nuse App\\Models\\Support;\nuse App\\Models\\Terms;\nuse Illuminate\\Support\\Facades\\Route;\n\n/*\n|--------------------------------------------------------------------------\n| Web Routes\n|--------------------------------------------------------------------------\n|\n| Here is where you can register web routes for your application. These\n| routes are loaded by the RouteServiceProvider and all of them will\n| be assigned to the &quot;web&quot; middleware group. Make something great!\n|\n*/\nRoute::get('/', function () {\n return view('publicPage');\n})-&gt;name('home');\n\n\n\nRoute::get('/faq', function () {\n return view('footer.FAQ', ['faq' =&gt; FAQdata::get()]);\n})-&gt;name('faq');\n\nRoute::get('/help', function () {\n return view('footer.help', ['help' =&gt; Help::get()]);\n})-&gt;name('help');\n\nRoute::get('/support', function () {\n return view('footer.support', ['support' =&gt; Support::get()]);\n})-&gt;name('support');\n\nRoute::get('/privacy', function () {\n return view('footer.privacy', ['privacy' =&gt; Privacy::get()]);\n})-&gt;name('privacy');\n\nRoute::get('/terms', function () {\n return view('footer.terms', ['terms' =&gt; Terms::get()]);\n})-&gt;name('terms');\n\nRoute::get('/contact', function () {\n return view('footer.contact', ['contact' =&gt; Contact::get()]);\n})-&gt;name('contact');\n\nRoute::get('/about', function () {\n return view('footer.about', ['about' =&gt; About::get()]);\n})-&gt;name('about');\n//Route::middleware(['auth', 'auth.session'])-&gt;group(function () {\n// Route::get('preview', function (){\n// $order = \\App\\Models\\Order::first();\n// return new \\App\\Mail\\OrderConfirmation($order);\n// $cart = \\App\\Models\\User::first()-&gt;cart;\n// return new \\App\\Mail\\AbandonedCartReminder($cart);\n// });\n//});\n//Route::middleware('public-page-check')-&gt;group(function () {\n Route::get('/shop', StoreFront::class)-&gt;name('shop');\n\n Route::get('/product/{product}',ProductInfo::class)-&gt;name('productInfo');\n\n Route::get('/cart',Cart::class)-&gt;name('cart');\n\n Route::get('/checkout-status',CheckoutStatus::class)-&gt;name('checkout-status');\n\n Route::get('/order/{orderId}',ViewOrder::class)-&gt;name('view-order');\n//});\nRoute::redirect('/login', '/admin/login')-&gt;name('redirectedLogin');\n</code></pre>\n<p>they used to work before but i have absolutely no idea what happened. Any help is highly appreciated. The issue persists in production aswell.</p>\n<p>i've went through the web.php file over and over and cant find any issue. i also disabled one of my middlewares and still the same problem. Checked all the filenames related to the routes and they all match.I've cleared all caches just in case and still the same thing.</p>\n"^^ . + . + . + . + . + "2"^^ . + . + "Looks like you put only the values into double quotes, but not the keys. It needs to be done with the keys as well, see https://sdk.invoicing.eta.gov.eg/document-serialization-approach/#algorithm-overview - they have an example input JSON data structure there, and what the resulting serialization string before hashing should look like. So use their example input, and then make sure your serialization result matches theirs exactly."^^ . + . + . + . + "<p>In magento 2 the image types seem to function as radio buttons, I however want to change one of the types (a custom one) to function as a checkbox, so basically allow multiple images to have this attribute. And then be able to filter them out of the image gallery. I have been looking for a solution and trying out multiple things, but I cant seem to get it done. In magento 2 I have created the type 'Certificate' and I want to be able to assign it to multiple images under a product.</p>\n<p><a href="https://i.sstatic.net/jtmt0rfF.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/jtmt0rfF.png" alt="enter image description here" /></a></p>\n<pre class="lang-php prettyprint-override"><code> /**\n * @inheritdoc\n */\n public function apply(): self\n {\n $this-&gt;moduleDataSetup-&gt;getConnection()-&gt;startSetup();\n\n $eavSetup = $this-&gt;eavSetupFactory-&gt;create(['setup' =&gt; $this-&gt;moduleDataSetup]);\n $eavSetup-&gt;addAttribute(\n Product::ENTITY,\n 'certificate_image',\n [\n 'type' =&gt; 'text',\n 'label' =&gt; 'Certificate',\n 'input' =&gt; 'media_image',\n 'frontend' =&gt; 'Magento\\Catalog\\Model\\Product\\Attribute\\Frontend\\Image',\n 'global' =&gt; ScopedAttributeInterface::SCOPE_STORE,\n 'filterable' =&gt; false,\n 'visible_on_front' =&gt; false,\n 'used_in_product_listing' =&gt; false,\n 'sort_order' =&gt; 100,\n 'required' =&gt; false,\n 'is_user_defined' =&gt; true,\n ]\n );\n\n\n $this-&gt;moduleDataSetup-&gt;getConnection()-&gt;endSetup();\n return $this;\n }\n</code></pre>\n"^^ . + "PHP Leaf framework - db()->lastInsertId() returns "0""^^ . + . + . + . + "1"^^ . + . + "Then you'll need to implement your own O/S while you're at it, and solder your own hardware, design your own CPU, RAM, motherboard and so on so there's no 3rd party firmware that you're relying on. Then you can remove all dependencies on anyone else's work and finally be free. See you in 200 years when you've re-invented computer science, and also finished your app."^^ . + . + "1"^^ . + . + "1"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + "Feel free to add all clarification **to your question** by editing it, and share more details about the differences between the two systems"^^ . + . + "superglobals"^^ . + . + . + "Well that is incredibly disheartening if true... wonder why it would be that way when I'd imagine if I wasn't HPOS, it would be possible... right?"^^ . + "0"^^ . + . + "0"^^ . + "Platform.sh CLI Login Fails with HTTP 500 Error and Symfony Console Error"^^ . + "1"^^ . + "Wouldn't it be easier to simply ignore the upload if no image was selected and just show the default as fallback when rendering the page if none was uploaded?"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + "I believe the code where the error occurs at is [here](https://github.com/laravel/framework/blob/57af5c39ea95d92a42f1f2c1bc9a4c2753614725/src/Illuminate/Http/Middleware/ValidatePostSize.php) in case that helps troubleshoot. Though normally I would expect that it wouldn't even reach the Laravel code because Apache would catch it first. You could try removing the `ValidatePostSize` middleware and see if it works. If it does, then at least you know where the problem is."^^ . + . + "laravel-5.8"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + "<p>I have this trait</p>\n<p><em>HasExtendedRoles.php</em></p>\n<pre class="lang-php prettyprint-override"><code>trait HasExtendedRoles\n{\n use HasRoles;\n use HasExtendedPermissions {\n HasExtendedPermissions::getPermissionClass insteadof HasRoles;\n HasExtendedPermissions::scopePermission insteadof HasRoles;\n HasExtendedPermissions::permissions insteadof HasRoles;\n }\n\n protected ?Form $currentForm = null;\n\n public function forForm(string|int|Form $form): self\n {\n if (!$form instanceof Form) {\n $form = Form::when(\n is_numeric($form),\n fn(Builder $q) =&gt; $q-&gt;where('id', $form),\n fn(Builder $q) =&gt; $q-&gt;where('slug', $form)\n )-&gt;firstOrFail();\n }\n\n $this-&gt;currentForm = $form;\n\n return $this;\n }\n}\n</code></pre>\n<p>I also have this trait</p>\n<p><em>HasExtendedPermissions.php</em></p>\n<pre class="lang-php prettyprint-override"><code>trait HasExtendedPermissions\n{\n use HasPermissions;\n\n protected ?Form $currentForm = null;\n\n public function forForm(string|int|Form $form): self\n {\n if (!$form instanceof Forsm) {\n $form = Form::when(\n is_numeric($form),\n fn(Builder $q) =&gt; $q-&gt;where('id', $form),\n fn(Builder $q) =&gt; $q-&gt;where('slug', $form)\n )-&gt;firstOrFail();\n }\n\n $this-&gt;currentForm = $form;\n\n return $this;\n }\n}\n</code></pre>\n<p>And in my User model</p>\n<pre class="lang-php prettyprint-override"><code>class User extends Authenticatable\n{\n use HasExtendedRoles;\n}\n</code></pre>\n<p>And in my controller, I do</p>\n<pre class="lang-php prettyprint-override"><code>dd($user-&gt;forForm($form)-&gt;permissions);\n</code></pre>\n<p>Now the <code>HasExtendedPermissions</code> trait doesn't seam to inherit <code>$this-&gt;currentForm</code>.</p>\n<p>But when I do:</p>\n<pre class="lang-php prettyprint-override"><code>dd($user-&gt;forForm($form)-&gt;roles);\n</code></pre>\n<p>Which is available through the HasExtendedRoles trait, it works perfectly, I was thinking about creating another <code>forForm</code> method inside the <code>HasExtendedPermissions</code> trait with a diffrent name but I hope to minimize code duplication as much as possible.</p>\n<p>What could I possibly be doing wrongly?</p>\n"^^ . + . + "What does your project folder structure look like (where are the image files located relative to the php files)? Is this html file being included from another php file? And what do the image paths in the database look like?"^^ . + "Sorry for not being more specific. You do have a seeder with a Restaurant factory, but "valid data" is not "having 7 opening hours with "day" attributes in sequence from 1 to 7", that is what a seeder has to do, the factory only has to give you a correct day, and opening time, that's it, the factory is and should be agnostic of what existing data already exists, that is what a seeder has to do (it is seeding data, so it can be known). Your seeder has to call the factory with the right data, I will try to write a quick seed for you, I may have small errors on it"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + "web-services"^^ . + "About the error "Could not resolve: api.x.com (Could not contact DNS servers)""^^ . + . + "sorting"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + . + "<p>In the archive page, I would like to show in a loop grid widget ONLY the posts that belong either to the displayed archive category and also to a specific category which slug is &quot;special-one&quot;, meaning that they have to be from both categories (operator AND). So I have set up an archive page template in Elementor theme builder. Just in that single loop and not as default for the archive page.</p>\n<p>I Used the following code:</p>\n<pre><code>add_action( 'elementor/query/special_archive_filter', function( query )\n if ( is_category() )\n $category_id = get_queried_object_id();\n $special_category_id = special-one;\n $categorie query-&gt;set( 'tax_query', array(\n array(\n 'taxonomy' =&gt; 'category',\n 'field' =&gt; 'id',\n 'terms' =&gt; array( category_id,special_category_id ),\n 'operator' =&gt; 'AND',\n ),\n ));\n }\n});\n</code></pre>\n<p>But this code is not giving me the expected result.\nWhat I am doing wrong?</p>\n"^^ . + "0"^^ . + . + . + . + . + . + "I have tested your code, and it works, hiding a targeted menu item if the current user has at least posted a post from a specific custom post type. [You should enable WP debug](https://stackoverflow.com/questions/14541989/how-do-i-debug-a-wordpress-plugin) adding inside your function `error_log('Posts count: ' . print_r($posts, true));` after the user posts count line, to check if there is a positive count for the current user."^^ . + . + "1"^^ . + . + "URL didn't respond with value of challenge parameter in Events API in Slack"^^ . + "What do you mean by "pixel code is executed"? If that happens through any frontend code (be it direct HTML or JS), how is PHP related?"^^ . + . + "I have adjusted it as recommended but there is no feedback. I don't even get an error, no echo. @ADyson, yes you are right. The team table also has a column with ClubID"^^ . + . + . + "0"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + "@Topaco The first two examples in the first link in my post."^^ . + . + "Why is there no type declaration for the parameter in your method? https://laravel.com/docs/11.x/routing#parameters-and-dependency-injection"^^ . + . + "@user1934428 you right, the answer is wrong.\nIf I execute shopt command in git bash, I can see that expand_aliases is on. But why it does not work?"^^ . + . + . + . + . + . + . + . + "3"^^ . + "0"^^ . + "The PHP version of the one that works, is 8.0.30. The PHP version of the one that doesn't, is 8.3.10. The version of OpenSSL that works is OpenSSL/1.0.2k-fips and the version of OpenSSL that doesn't is OpenSSL/3.0.8."^^ . + "0"^^ . + . + "1"^^ . + . + . + . + . + "1"^^ . + . + "0"^^ . + "<p>Check the latest Hubleto release (links below) which contains many bugfixes and possibly this problem is also resolved.</p>\n<p><a href="https://developer.hubleto.com/download-and-install" rel="nofollow noreferrer">https://developer.hubleto.com/download-and-install</a></p>\n<p><a href="https://www.hubleto.com/en/install" rel="nofollow noreferrer">https://www.hubleto.com/en/install</a></p>\n"^^ . + "0"^^ . + "0"^^ . + "<p>I have the following script and it is adding the directory name into the database, I need to stop it adding the directory name:</p>\n<pre><code> $key = array();\n $dp = opendir($dir);\n while ($file = readdir($dp)) {\n if ($file != '.' &amp;&amp; $file != '..') {\n $last = substr($file, 4);\n $number = substr($last, 0, -6);\n $number = str_replace(&quot;x&quot;, &quot;&quot;, $number);\n if ($number == $_SESSION[job_id]) {\n $index_str = substr($last, 0, -4);\n $where_x = strpos($index_str, 'x');\n $where_x++;\n $index = substr($index_str, $where_x);\n $key[$index] = $index;\n }\n }\n }\n $number_key = 1;\n foreach ($key as $value) {\n $url = &quot;&quot; . $_SESSION[job_id] . &quot;x&quot; . $value . &quot;.webp&quot;;\n $insert = &quot; insert into photos ( job_id, number, url, update_date, file_nr ) values ( '$_SESSION[job_id]', '$number_key', '$url', CURDATE(), $value )&quot;;\n</code></pre>\n"^^ . + . + "traits"^^ . + . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + "@ChrisHaas yeah after looking all through teh log file there are only a couple of instances where there is another line in between which I never spotted before.\nGood shout about checking for 1st line then doing the 2nd ... might be easier"^^ . + . + . + . + . + . + "Docusign Rest API: Creating an Envelope Using JWT Credentials"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "zip"^^ . + . + "1"^^ . + "0"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + . + "<p>livewire docs make it quite clear how you can custom your own pagination links Blade view, I think.</p>\n<p><a href="https://laravel-livewire.com/docs/2.x/pagination#custom-pagination-view" rel="nofollow noreferrer">https://laravel-livewire.com/docs/2.x/pagination#custom-pagination-view</a></p>\n<pre class="lang-php prettyprint-override"><code>class ShowPosts extends Component\n{\n use WithPagination;\n \n ...\n \n public function paginationView()\n {\n return 'custom-pagination-links-view';\n }\n \n ...\n}\n</code></pre>\n"^^ . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + "@C3roe trying to make basket for small e-shop, where is form. I would like to remember fields before it continues or even if the client go back and than return. If I save it in PHP on an external page, the page flashes as it reloads."^^ . + "How to debug Laravel project using PhpStorm"^^ . + "0"^^ . + . + "Most people would just use the library that already does the job, rather than trying to re-write it without an obvious reason for doing so. But you never know, maybe someone did exactly this already. You didn't explain why you don't want to use external packages, or why you couldn't at least just copy what the existing code does for now, even if you don't have dependency on the original package."^^ . + . + "In your question, could you show the full pathname of your web root, and the permissions/groups you have there using `ls -l`? Also have a look at your web server using `ps aux` to see what user group it runs under."^^ . + "0"^^ . + . + . + . + . + "1"^^ . + "1"^^ . + . + "0"^^ . + . + . + "<p>I'm facing an issue when trying to invoke a Vertex AI-generated Python script to generate text from a PHP page, triggered via a browser URL. While the Python script works perfectly on Windows when invoked from PHP, it doesn't work on a Linux or macOS server when triggered through PHP in a browser. Interestingly, the script works fine when executed directly in the terminal.</p>\n<p>Here's the PHP code I am using to invoke the Vertex AI Python script:</p>\n<p>$Output = shell_exec(&quot;python3 vertex.py&quot;);</p>\n<p>print($Output);</p>\n<p>The script runs as expected in the terminal, but when invoked from the browser through PHP, it does not produce the desired output. I am looking for a way to ensure that the Python script runs correctly when called from the browser via the PHP script on a Linux or macOS server.</p>\n<p>Potential Issues:</p>\n<p>Google Authentication for Vertex AI:\nOne possible issue might be how Google login/authentication is handled when the script is invoked through the browser. Does the authentication work properly when invoked from PHP, and how do I handle Google authentication in this context?</p>\n<p>Virtual Environment Handling:\nAnother potential issue could be related to managing the Python virtual environment in the PHP script. When running the script from the browser, it might not be invoking the correct Python environment or dependencies, causing the script to fail.</p>\n<p>I would appreciate any insights or suggestions on how to address these issues, specifically with regard to handling the virtual environment and authentication in the context of calling the Python script from PHP.</p>\n"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + "2"^^ . + . + "0"^^ . + "<p>I use this way:</p>\n<p>1- add custom class to body by language:</p>\n<pre><code>&lt;body class=&quot;&lt;?php echo(ICL_LANGUAGE_CODE) ?&gt;&quot;&gt;\n</code></pre>\n<p>or use</p>\n<pre><code>\nadd_filter( 'body_class', 'custom_class' );\nfunction custom_class( $classes ) {\n $classes[] = ICL_LANGUAGE_CODE;\n return $classes;\n}\n</code></pre>\n<p>2- then in css :</p>\n<pre><code>body.en .nav_home::before {\n content: 'en val';\n}\nbody.fr .nav_home::before {\n content: 'fr val';\n}\n</code></pre>\n"^^ . + . + . + "0"^^ . + . + "hook-woocommerce"^^ . + . + . + . + "1"^^ . + . + . + . + . + "Laravel call another method of the same controller"^^ . + . + . + . + . + . + "_"my impression is that it's failing on the 'require'. "_ - check the server error logs. That will tell you exactly what problem PHP has encountered. Debugging your impression will likely have you chasing wild geese. Don't forget to post the complete text of any error message in your question."^^ . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + "1"^^ . + "0"^^ . + . + "<p>I'm using Amphp version 2.6 to create asynchronous socket connections to a Minecraft server. During this connection I send integers, strings and bytes to the server in order to retrieve info from a plugin which is running on the Minecraft server.</p>\n<p>The connection process is as follows:</p>\n<ol>\n<li>Initiate the socket connection to the server and send a byte</li>\n<li>The Java plugin reads the byte and generates a random integer and writes it out as an integer.</li>\n<li>The PHP side reads the integer and gets the server's secret key and adds it to the integer it just received and hashes it with SHA512</li>\n<li>The PHP side sends that hashed string out to the Java plugin to read</li>\n<li>If the received hash matches the hash the plugin created on it's own it marks success as true</li>\n<li>The Java plugin checks the incoming connection's IP address and if it's in the allowed list it writes out integer 1, to let the PHP side know that the server has accepted the connection (This is where the problem comes in)</li>\n<li>Once the connection has been accepted, the PHP code sends a byte to the server to retrieve the info it needs</li>\n<li>After the info has been received it sends a byte 3 to the server to close the connection</li>\n</ol>\n<p>My problem is that sometimes the PHP code fails to read the server response (step 6), I have confirmed with logging that this is where the script times out. When the script fails to read the server response it won't send another byte to the Java plugin and that causes the EOFException I'm pretty sure.\nThe error I get is the following:</p>\n<pre><code>[11:31:01 INFO]: StatusMC &gt; Random code: 726462011\n[11:31:01 INFO]: StatusMC &gt; 119f9fcfa7e8d56002e755598950a130bbf999004445ce28e070f5d639157ac9757450bb50744e9552bde50e3a2fdc584f468351248854acc72c1c3c36ee931e\n[11:31:03 INFO]: StatusMC &gt; Successfully connected to the server!\n[11:31:03 INFO]: StatusMC &gt; IO exception 1: null\n[11:31:03 WARN]: java.io.EOFException\n[11:31:03 WARN]: at java.base/java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)\n[11:31:03 WARN]: at java.base/java.io.DataInputStream.readByte(DataInputStream.java:268)\n[11:31:03 WARN]: at StatusMCv1.3.7-dev.jar//net.statusmc.utils.SocketServer.run(SocketServer.java:99)\n</code></pre>\n<p>My PHP code:</p>\n<pre><code>function asyncTask(string $server_identifier, string $monitor_id, string $page_id, string $host, string $secret_key, int $port, int $timeout, int $writeTimeout): Promise {\nreturn call(function () use ($server_identifier, $monitor_id, $page_id, $host, $secret_key, $port, $timeout, $writeTimeout) {\n $tpsCompleted = false;\n try {\n $cstatus = new Status();\n $tpsDouble = 0;\n $message = &quot;N/A&quot;;\n // Create an asynchronous socket connection using Amphp\n /** @var \\Amp\\Socket\\ClientSocket $socket */\n $socket = yield timeout(Socket\\connect(&quot;tcp://{$host}:{$port}&quot;), $timeout);\n //Olen lisanud järgmisele kahele reale timeouti, sest isegi kui connection ei timeouti ja connectib edukalt, siis\n //on võimalik, et serverilt data kätte saamisega võib tekkida probleeme, nt on pandud Serveri port mitte StatusMC plugina port\n //ja kui siin timeoute pole, siis see võib kogu scripti timeoutida ja tekib Gateway time-out\n //teistel ridadel pole seda pannud, sest tõenäoliselt ta timeoutib kohe alguses\n //https://chatgpt.com/c/67767b7d-a7c8-8010-a4e5-679615fbf5ca\n yield timeout($socket-&gt;write(chr(1)), $writeTimeout);\n $randomInt = yield timeout(readRawInt($socket), $writeTimeout);\n $cstatus-&gt;log(&quot;TPS MONITOR ERROR&quot;, 'admin', 'Random int has been read. Random int: '.$randomInt.' Monitor ID: '.$monitor_id);\n\n //Stringi writimine, secret key saatmine koos random Intiga\n $message = hash(&quot;SHA512&quot;, $randomInt . $secret_key);\n $stringSize = 0;\n // Write the length of the hash (as an integer)\n yield $socket-&gt;write(pack(&quot;N&quot;, strlen($message)));\n\n // Write the hash itself\n yield timeout($socket-&gt;write($message), $writeTimeout);\n $cstatus-&gt;log(&quot;TPS MONITOR ERROR&quot;, 'admin', 'Message has been written. Message: '.$message.' Monitor ID: '.$monitor_id);\n $serverResponse = yield timeout(readRawInt($socket), $writeTimeout);\n $cstatus-&gt;log(&quot;TPS MONITOR ERROR&quot;, 'admin', 'Server response has been read. Server response: '.$serverResponse.' Monitor ID: '.$monitor_id);\n if($serverResponse == 1) {\n $cstatus-&gt;log(&quot;TPS MONITOR ERROR&quot;, 'admin', 'Server response 1. Monitor ID: '.$monitor_id);\n yield timeout($socket-&gt;write(chr(2)), $writeTimeout);\n $tps = yield timeout(readRawDouble($socket), $writeTimeout);\n $cstatus-&gt;log(&quot;TPS MONITOR ERROR&quot;, 'admin', 'TPS double has beenr read. TPS: '.$tps. ' Monitor ID: '.$monitor_id);\n\n if($tps == 404500) { //This is a fail-safe, if we receive a double 404500 it means that we didn't get a correct TPS, trying again\n yield timeout($socket-&gt;write(chr(2)), $writeTimeout);\n $tps = yield timeout(readRawDouble($socket), $writeTimeout);\n if($tps&lt;0) {\n //Kogume data API-le, et saata hiljem kõikide monitoride data koos\n $result = [\n 'server_identifier' =&gt; $server_identifier, //Minu enda välja mõeldud mingi pikk jada, millega verifyme, et request tuli just sellelt API-lt\n 'page_id' =&gt; $page_id,\n 'monitor_id' =&gt; $monitor_id,\n 'tps' =&gt; $tps,\n 'status' =&gt; 'invalid_data'\n ];\n } else {\n //Kogume data API-le, et saata hiljem kõikide monitoride data koos\n $result = [\n 'server_identifier' =&gt; $server_identifier, //Minu enda välja mõeldud mingi pikk jada, millega verifyme, et request tuli just sellelt API-lt\n 'page_id' =&gt; $page_id,\n 'monitor_id' =&gt; $monitor_id,\n 'tps' =&gt; $tps,\n 'status' =&gt; 'successful'\n ];\n } \n } else { //Kui saadud TPS ei ole 404500, siis toimime tavapäraselt\n if($tps&lt;0) {\n //Kogume data API-le, et saata hiljem kõikide monitoride data koos\n $result = [\n 'server_identifier' =&gt; $server_identifier, //Minu enda välja mõeldud mingi pikk jada, millega verifyme, et request tuli just sellelt API-lt\n 'page_id' =&gt; $page_id,\n 'monitor_id' =&gt; $monitor_id,\n 'tps' =&gt; $tps,\n 'status' =&gt; 'invalid_data'\n ];\n } else {\n //Kogume data API-le, et saata hiljem kõikide monitoride data koos\n $result = [\n 'server_identifier' =&gt; $server_identifier, //Minu enda välja mõeldud mingi pikk jada, millega verifyme, et request tuli just sellelt API-lt\n 'page_id' =&gt; $page_id,\n 'monitor_id' =&gt; $monitor_id,\n 'tps' =&gt; $tps,\n 'status' =&gt; 'successful'\n ];\n } \n }\n \n\n } else { //Kui $serverResponse pole 1 ehk ei connectinud ära, siis\n $cstatus-&gt;log(&quot;TPS MONITOR ERROR&quot;, 'admin', 'Server response not 1. Monitor ID: '.$monitor_id.' Server response: '.$serverResponse);\n //Kogume data API-le, et saata hiljem kõikide monitoride data koos\n $result = [\n 'server_identifier' =&gt; $server_identifier, //Minu enda välja mõeldud mingi pikk jada, millega verifyme, et request tuli just sellelt API-lt\n 'page_id' =&gt; $page_id,\n 'monitor_id' =&gt; $monitor_id,\n 'tps' =&gt; 0,\n 'status' =&gt; 'connection_error'\n ];\n }\n yield timeout($socket-&gt;write(chr(3)), $writeTimeout);\n //Annan Javale veidi aega, et closida connection\n yield new \\Amp\\Delayed(100); // 100ms delay\n $socket-&gt;close();\n\n } catch (TimeoutException $e) {\n $cstatus = new Status();\n $cstatus-&gt;log(&quot;TPS MONITOR ERROR&quot;, 'admin', 'TPS Monitor timeout exception occured. Monitor ID: '.$monitor_id.' Exception: '.$e);\n\n //Kogume data API-le, et saata hiljem kõikide monitoride data koos\n $result = [\n 'server_identifier' =&gt; $server_identifier, //Minu enda välja mõeldud mingi pikk jada, millega verifyme, et request tuli just sellelt API-lt\n 'page_id' =&gt; $page_id,\n 'monitor_id' =&gt; $monitor_id,\n 'tps' =&gt; 0,\n 'status' =&gt; 'connection_error'\n ];\n } catch (\\Exception $e) {\n $cstatus = new Status();\n $cstatus-&gt;log(&quot;TPS MONITOR ERROR&quot;, 'admin', 'TPS Monitor exception occured. Monitorid ID: '.$monitor_id.' Exception: '.$e);\n if (isset($socket)) {\n yield timeout($socket-&gt;write(chr(3)), $writeTimeout);\n //Annan Javale veidi aega, et closida connection\n yield new \\Amp\\Delayed(100); // 100ms delay\n $socket-&gt;close();\n }\n \n //Kogume data API-le, et saata hiljem kõikide monitoride data koos\n $result = [\n 'server_identifier' =&gt; $server_identifier, //Minu enda välja mõeldud mingi pikk jada, millega verifyme, et request tuli just sellelt API-lt\n 'page_id' =&gt; $page_id,\n 'monitor_id' =&gt; $monitor_id,\n 'tps' =&gt; 0,\n 'status' =&gt; 'connection_error'\n ];\n }\n return $result;\n});\n</code></pre>\n<p>}</p>\n<pre><code>// Method to read an integer from the socket's response\nfunction readRawInt($socket): Promise {\n return Amp\\call(function () use ($socket) {\n $buffer = '';\n\n while (strlen($buffer) &lt; 4) {\n $chunk = yield $socket-&gt;read();\n if ($chunk === null) {\n throw new \\Exception(&quot;Socket closed before reading 4 bytes.&quot;);\n }\n $buffer .= $chunk;\n }\n\n // Convert the first 4 bytes of the buffer to an integer\n $intData = unpack('N', substr($buffer, 0, 4))[1];\n\n return $intData;\n });\n}\n\nfunction readRawDouble(ResourceSocket $socket): \\Amp\\Promise {\nreturn \\Amp\\call(function () use ($socket) {\n // Read 8 bytes from the socket\n $data = yield $socket-&gt;read(8);\n\n // Ensure we got exactly 8 bytes\n if ($data === null || strlen($data) !== 8) {\n throw new \\RuntimeException(&quot;Expected 8 bytes for the double, got &quot; . (strlen($data) ?: 0) . &quot; bytes.&quot;);\n }\n\n // Reverse the data if the machine is little-endian\n if (pack('L', 1) === pack('V', 1)) { // Detect little-endian\n $data = strrev($data);\n }\n\n // Unpack the data as a double\n $unpacked = unpack('d', $data);\n\n // Validate the unpacked result\n if ($unpacked === false || !isset($unpacked[1])) {\n throw new \\RuntimeException(&quot;Failed to unpack the double. Data: &quot; . bin2hex($data));\n }\n\n echo &quot;Raw data: &quot; . bin2hex($data) . PHP_EOL; // Print the raw bytes read\n echo &quot;Unpacked double: &quot; . $unpacked[1] . PHP_EOL; // Print the resulting double\n\n return $unpacked[1]; // Return the unpacked double\n});\n</code></pre>\n<p>}</p>\n<p>My Java plugin code:</p>\n<pre><code> @Override\npublic void run(){\n try{\n //msptCalculator = new SocketOnGetMSPTEvent(); // Initialize the MSPTCalculator instance\n listenSock = new ServerSocket(port);\n\n while(true){\n sock = listenSock.accept();\n in = new DataInputStream(sock.getInputStream());\n out = new DataOutputStream(sock.getOutputStream());\n this.connect_status = true;\n InetAddress addr = sock.getInetAddress();\n try{\n\n if(in.readByte() == 1){\n int random_code = new SecureRandom().nextInt();\n \n //See on lisatud siia juhuks, kui random_code peaks olema negatiivne. See funktsioon võtab random_codeist\n //absoluutväärtuse, mis on alati positiivne. See on vajalik sellepärast kuna veebipoolel tekib int-i lugemisega\n //probleeme kui arv on negatiivne\n int random_code_processed = Math.abs(random_code);\n Utils.log(Level.INFO, &quot;Random code: &quot;+random_code_processed);\n\n out.writeInt(random_code_processed);\n boolean success = Utils.readString(in, false).equals(Utils.hash(random_code_processed + ServerConfig.secretKey));\n if(success){ //Kui secret key-ga on korras, \n //Kontrollib, kas IP, mis üritab connectida on minu API whitelistis olemas\n //Teeme seda siin, et tagada, et IP kontroll oleks alati tehtud, hiljem on võimalik seda bypassida\n String incomingIP = addr.getHostAddress();\n //Saab incoming connectioni hostnamei\n String incomingHostname = addr.getHostName();\n if(APIRequest.checkIP(incomingIP, incomingHostname)) { //Kui function returnib true, siis käivitub see kood\n //Kõik on korras\n out.writeInt(1);\n out.flush();\n Utils.log(Level.INFO, Utils.format(ServerConfig.successfulLogin));\n } else { //Kui connection tuleb teiselt IPlt, siis\n //Kui function returnib false ehk vale IP üritab connectida, siis käivitub see kood\n Utils.log(Level.ERROR, &quot;A connection from an unknown IP was refused. Please report this to the StatusMC Support staff. Blocked IP: &quot; + addr.getHostAddress() + &quot; Blocked hostname: &quot;+ addr.getHostName());\n out.writeInt(0);\n out.flush();\n this.connect_status = false;\n }\n }else{\n out.writeInt(0);\n out.flush();\n Utils.log(Level.INFO, Utils.format(ServerConfig.wrongSecretKey));\n this.connect_status = false;\n }\n }else{\n out.writeInt(0);\n out.flush();\n Utils.log(Level.INFO, Utils.format(ServerConfig.unexpectederror));\n this.connect_status = false;\n }\n\n while(this.connect_status){\n final byte packetNumber = in.readByte();\n\n if(packetNumber == 2) { //GET TPS FUNCTION\n double tps = Math.round(SocketOnGetTPSEvent.getTPS() * 100.0D) / 100.0D;\n out.writeDouble(tps);\n if(ServerConfig.log_performance_metrics.equals(true)) {\n Utils.log(Level.INFO, &quot;The current TPS is &quot; + tps + &quot;.&quot;);\n }\n \n } else if(packetNumber == 4) { //Saab min MSPT\n double minMSPTValue = SocketOnGetMSPTEvent.getMinMSPT();\n out.writeDouble(minMSPTValue);\n if(ServerConfig.log_performance_metrics.equals(true)) {\n Utils.log(Level.INFO, &quot;Min MSPT for the last 1 minute: &quot;+minMSPTValue);\n }\n \n } else if(packetNumber == 5) { //Saab avg MSPT\n double avgMSPTValue = SocketOnGetMSPTEvent.getAvgMSPT();\n out.writeDouble(avgMSPTValue);\n if(ServerConfig.log_performance_metrics.equals(true)) {\n Utils.log(Level.INFO, &quot;Average MSPT for the last 1 minute: &quot;+avgMSPTValue);\n }\n \n } else if(packetNumber == 6) { //Saab max MSPT\n double maxMSPTValue = SocketOnGetMSPTEvent.getMaxMSPT();\n out.writeDouble(maxMSPTValue);\n if(ServerConfig.log_performance_metrics.equals(true)) {\n Utils.log(Level.INFO, &quot;Max MSPT for the last 1 minute: &quot;+maxMSPTValue);\n }\n \n } else if(packetNumber == 3){ // CLOSE_CHANNEL\n Utils.log(Level.INFO, &quot;Socket packet 3 close&quot;);\n out.flush();\n closeConnectionGracefully();\n \n } else {\n Utils.log(Level.INFO, &quot;Packet not found! Packet: &quot; + packetNumber + &quot; Please contact StatusMC Support staff.&quot;);\n \n }\n }\n\n }catch(IOException ex){\n out.writeDouble(404500); //Kui tekib IO Exception 1, siis writein doublei 404500\n //Kui PHP saab tpsi/mspt-d lugeda üritades doublei 404500, siis teeb uue katse lugeda serveri TPSi, sest TPS tekkis viga TPSi \n //saamisel. Valisin 404500 sellepärast, et MC serveri TPS JA MSPT ei saa kunagi olla nii suur\n out.flush();\n /*closeConnectionGracefully();*/\n Utils.log(Level.INFO, &quot;IO exception 1: &quot;+ex.getMessage());\n ex.printStackTrace();\n }\n \n }\n }catch(IOException ex){\n Utils.log(Level.INFO, &quot;IO exception 2: &quot;+ex.getMessage());\n ex.printStackTrace();\n }\n}\n\nprivate void closeConnectionGracefully() {\n try {\n in.close();\n out.close();\n sock.close();\n this.connect_status = false;\n } catch (IOException e) {\n Utils.log(Level.WARNING, &quot;Error while closing socket connection: &quot;+e.getMessage());\n }\n}\n</code></pre>\n"^^ . + . + . + . + "deepl"^^ . + . + "Hi HEXALIX, yes i have tried using edge & chrome, nothing else"^^ . + "yes, that's one way to implement it. Whether you include the token in the body or in the headers depends on how/where you want to validate it."^^ . + . + "@ Charlieface - Partition worked! `SELECT *, COUNT(name) OVER (PARTITION BY name) AS nameCounter FROM names...`. Then `echo $row["nameCounter"];`. Awesome! I'll have to read up more on Partition.\nNow... to work out how to put nameCounter only on the 1st instance of each name."^^ . + . + "Please learn about SQL injection, and use parameterized statements instead of concatenating values into a query string."^^ . + . + . + . + . + . + "I would need the full working code to accept any answer."^^ . + "0"^^ . + "Asserting a method call on a Facade not the underlying proxied class"^^ . + . + . + . + . + "Why is my docker not working. 403 forbidden"^^ . + "0"^^ . + . + "<p>You should better use <a href="https://developer.wordpress.org/reference/functions/get_the_terms/" rel="nofollow noreferrer"><code>get_the_terms()</code></a> which <a href="https://developer.wordpress.org/reference/functions/wp_get_post_terms/#user-contributed-notes" rel="nofollow noreferrer">is cached</a> instead of <a href="https://developer.wordpress.org/reference/functions/wp_get_post_terms/" rel="nofollow noreferrer"><code>wp_get_post_terms()</code></a>, avoiding multiple heavy queries.</p>\n<p>Then you can <strong>use the term link only on single product pages</strong> targeting the related hook.</p>\n<p>Try the following:</p>\n<pre class="lang-php prettyprint-override"><code>// Common utility function to get the product brand term object\nfunction get_the_brand_term() {\n $terms = get_the_terms(get_the_ID(), 'product_brand');\n\n return $terms &amp;&amp; !is_wp_error($terms) ? reset($terms) : false;\n}\n\n// On loop product archives (just the term)\nfunction single_product_brand() {\n if ( $term = get_the_brand_term() ) {\n printf('&lt;div class=&quot;product_brand %s&quot;&gt;&lt;a href=&quot;%s&quot;&gt;%s&lt;/a&gt;&lt;/div&gt;',\n esc_attr($term-&gt;slug), esc_url( get_term_link($term) ), esc_html($term-&gt;name) );\n }\n}\nadd_action( 'woocommerce_single_product_summary', 'single_product_brand', 10 );\n\n// On single product pages (linked term)\nfunction loop_product_brand() {\n if ( $term = get_the_brand_term() ) {\n printf('&lt;div class=&quot;product_brand %s&quot;&gt;%s&lt;/div&gt;',\n esc_attr($term-&gt;slug), esc_html($term-&gt;name) );\n }\n}\nadd_action( 'woocommerce_shop_loop_item_title', 'loop_product_brand', 5 );\n</code></pre>\n<p>It should work.</p>\n<hr />\n<h4>Edit:</h4>\n<p>CSS styling for loop archives <strong>and</strong> single product pages.</p>\n<p>Replace:</p>\n<pre class="lang-css prettyprint-override"><code>.product_brand a { font-size: 13px; font-weight: bold; }\n</code></pre>\n<p>with:</p>\n<pre class="lang-css prettyprint-override"><code>.product_brand, .product_brand a { font-size: 13px; font-weight: bold; }\n</code></pre>\n"^^ . + . + "0"^^ . + "2"^^ . + "1"^^ . + . + . + "1"^^ . + ""Body size limit exceeded" error when installing FilePond via importmap:install in Symfony"^^ . + "<p>Every time you call <code>push()</code> Firebase will automatically create a new child.</p>\n<p>If you don't want this, call <code>set()</code> as shown in the documentation on <a href="https://firebase-php.readthedocs.io/en/7.16.1/realtime-database.html#saving-data" rel="nofollow noreferrer">saving data</a>.</p>\n<p>Something like:</p>\n<pre><code>$database-&gt;getReference($ref_table . $platenumber)-&gt;set($postData)\n</code></pre>\n"^^ . + "I tested it with https://webhook.site/ and it’s responding correctly. Could the website be blocking requests from Telegram?"^^ . + . + "<p>I am trying to get data using the Ebay API and a keyword for my items. For example, I used to be able to enter this...</p>\n<p><code>https://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords&amp;SECURITY-APPNAME=MYAPPNAME&amp;keywords=CHEESE&amp;itemFilter.name=Seller&amp;itemFilter.value=MY_USER_ID</code></p>\n<p>Each of my titles is unique, so if I wanted to search the titles of my items and find the one that had the word &quot;cheese&quot; in it, entering the URL above would show me data for that item. I'd get xml code showing the full title, selling price, itemID, etc.</p>\n<p>Just recently, this stopped working. I don't think you can use the FindingAPI anymore, and I don't think you can enter this on a URL. Can I somehow use PHP and cURL to get the item data based on a keyword?</p>\n"^^ . + . + "@LoicTheAztec I'm already using reCAPTCHA. It doesn't seem to catch all the bots. I'm sure it helps but there are still a few that get through."^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + "Multiple select element not submitting to POST array upon form submission"^^ . + . + . + "0"^^ . + . + . + "Login system wont login, I tried debugging it by echoing sql errors but to no avail. It just redirects me back to the login page"^^ . + . + . + "Could you just chain them? I.e. `->whereHas(/* logic for closed/scheduled */)->whereDoesntHave(/* logic for open/in-progress */)`? (might need to scope those two then also chain a `->orWhereDoesntHave(/* logic for any Job */)`. Otherwise you're getting into comparing count of Jobs vs count of Closed/Scheduled Jobs, which could be complicated ‍♂️"^^ . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + "3"^^ . + . + "Use nested while loops with a Advanced Custom Fields repeaster field?"^^ . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + . + . + "4"^^ . + . + . + . + . + . + . + . + "function get ($month, $year) {\n $vehicle_id = $_GET['vehicle_id'];\n // (F1) DATE RANGE CALCULATIONS\n $month = $month<10 ? "0$month" : $month ;\n $daysInMonth = cal_days_in_month(CAL_GREGORIAN, $month, $year);\n $dateYM = "{$year}-{$month}-";\n $start = $dateYM . "01 00:00:00";\n $end = $dateYM . $daysInMonth . " 23:59:59";\n \n // (F2) GET EVENTS\n // s & e : start & end date\n // c & b : text & background color\n // t : event text\n $this->query("SELECT * FROM `bookings` WHERE vehicle_id = '" . $_GET['app_id'] . "' AND (..."^^ . + . + . + . + . + "@IMSoP So it's mean that if OpCache is enabled ther results will be different and class will be the same?"^^ . + "0"^^ . + "@Olivier some DMBS also cache *query plans* and same prepared queries share same cached query plans, so they don't have to be calculated. Though I have no idea how much does it gain."^^ . + "What is the `--force` being used for? And please run the composer diagnose function and put the command as well as the result into your question by [edit]ing it."^^ . + . + . + "1"^^ . + . + "<p>Using the master laravel apl I have successfully created directory. Unzipped the project using Process into the newly created directory. Wrote .env file dynamically from the code. And created a migration file for adding base user. Created database on the server for this new projet. Username and password are same for master app and deployed app. My problem is with running artisan commands.</p>\n<p>When I use</p>\n<pre><code>Process::path($deploymentPath)-&gt;run(&quot;php artisan migrate --force&quot;);\n</code></pre>\n<p>or</p>\n<pre><code>Process-&gt;run(&quot;php &quot; . $deploymentPath . &quot;/artisan migrate --force&quot;);\n</code></pre>\n<p>It fails. It says client table already exists. This is not true as the database is empty. If I migrate manually to the deployed project folder, and run the migrate command. It works without any issues.</p>\n<p>My theory is that the artisan command is migrating my master program and not the one being deployed. Even though everything else works alright. Gow do I fix this.</p>\n<p>And yes, I am on Ubuntu 24.04 and laravel 11, using mysql 8.</p>\n"^^ . + "1"^^ . + . + "1"^^ . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "@YourCommonSense I know that $GLOBALS is available in ALL scopes, Just wonder why the definition doesn't say it in that explicit way. And its' not only the pages that put " all scopes" and "global scope" words in the same sentence or neighboring sentences implicitly promting a reader to think that there is such a thinkg like a "global scope" and such a thin like "all scopes" and if something is available in global scope its' not necessarily should be available in other scopes.. But never mind. If the question is really confusing, maybe it worth to be removed.."^^ . + . + . + . + . + . + . + . + . + "I think you'll find this much easier to configure and debug if you separate the new site onto a second vhost like v2.mydomain.com instead of trying to cram it into a subdir. The two apps will be completely isolated from each other and then your "go live" will be nothing more than changing the ServerName line."^^ . + "@IłyaBursov If you post that as an answer I will accept it. (You don't need to post any code, I can do that myself.)"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + . + "@NicoHaase when i click the button that reset the number table and return the view of the form i get an error becouse the db data is empty and my contorller get an empty value and the error say error "Attempt to read property id on null"."^^ . + . + . + "it's now edited"^^ . + . + "0"^^ . + . + "0"^^ . + "<p>I am creating a website for a gaming server. One of the pages on the site is a photo gallery. I've created the gallery layout in a page called PhotoGallery.php. There are 3 options. The 1st is a radio input choosing either Photo or Video. The 2nd is a drop down menu that gets populated through a php function. This function locates the directory names in either /Images/Photo_Gallery/Pictures/ or /Video/Video_Gallery/Video/and echo back the directory names and option tags for the drop down. This menu is also hidden until the radio menu choice is made. This is done in a javascript function. This choice is then passed back to php to get the sub directories of the chosen path. The 3rd option another drop down menu that takes the value of the radio and the 1st drop down menu is populated with the directory names of the category folder if any. Then once all choices are made the gallery then displays all the pictures or videos Thumbnails found in that folder.</p>\n<p>I have worked on this for 2 weeks now and can't seem to get it working properly to populate the menus. I get the menu to show up but no option inside of it. Is there something wrong with my syntax or logic or is there a better cleaner approach?</p>\n<pre><code>PhotoGallery.php // code &lt;!DOCTYPE html&gt; &lt;html lang=&quot;en-US&quot;&gt; &lt;head&gt; &lt;meta charset=&quot;UTF-8&quot;&gt; &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt; &lt;title&gt;Photo Gallery&lt;/title&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;../../CSS/styles.css&quot;&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;../../CSS/photo_gallery.css&quot;&gt; &lt;script src=&quot;../../Javascript/photo_gallery_functions.js&quot;&gt;&lt;/script&gt; &lt;/head&gt; &lt;header&gt; &lt;?php include &quot;../../Website_Pages/Element_Pages/header.php&quot; ?&gt; &lt;/header&gt; &lt;body&gt; &lt;div class=&quot;photo_gallery_main_background_container&quot;&gt; &lt;div class=&quot;left_nav_container&quot;&gt; &lt;?php include &quot;../../Website_Pages/Element_Pages/leftmenu.php&quot; ?&gt; &lt;/div&gt; &lt;div class=&quot;photo_gallery_main_container&quot;&gt; &lt;h1&gt;COMMUNE GALLERY&lt;/h1&gt; &lt;div class=&quot;background_container&quot;&gt; &lt;div class=&quot;gallery_header&quot; id=&quot;gallery_header&quot;&gt; &lt;h2&gt;&quot;Collection&quot;&lt;/h2&gt; &lt;div class=&quot;drop_down_menu_container&quot; id=&quot;drop_down_menu_container&quot;&gt; &lt;form action=&quot;../../PHP/photo_gallery_functions.php&quot; method= &quot;post&quot;&gt; &lt;input type=&quot;radio&quot; id=&quot;media_type_photo&quot; name=&quot;media_type&quot; value=&quot;Photo&quot; checked=&quot;checked&quot; onclick= showDropdown()&gt; &lt;label for=&quot;media_type_photo&quot;&gt;Photo&lt;/label&gt; &lt;br&gt; &lt;input type=&quot;radio&quot; id=&quot;media_type_video&quot; name=&quot;media_type&quot; value=&quot;Video&quot; onclick= showDropdown()&gt; &lt;label for=&quot;media_type_video&quot;&gt;Video&lt;/label&gt; &lt;br&gt; &lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt; &lt;/form&gt; &lt;br&gt; &lt;form action=&quot;../../PHP/photo_gallery_functions&quot; method=&quot;get&quot;&gt; &lt;select id=&quot;collection_menu&quot; name=&quot;collection&quot; style=&quot;display: none;&quot;&gt; &lt;?php include &quot;photo_gallery_functions.php&quot;; media_type_choice ($media_type); ?&gt; &lt;/select&gt; &lt;/form&gt; &lt;br&gt; &lt;form action=&quot;../../PHP/photo_gallery_functions.php&quot; method=&quot;get&quot;&gt; &lt;select id=&quot;gallery_menu&quot; name=&quot;gallery&quot; style=&quot;display:none;&quot;&gt; &lt;?php include &quot;photo_gallery_functions.php&quot;; collection_choice ($collection, media_type_gallery: $media_type_gallery) ?&gt; &lt;/select&gt; &lt;/form&gt; &lt;br&gt; &lt;/div&gt; &lt;div class =&quot;image_scrollbox_continer&quot;&gt; &lt;div class=&quot;image_scrollbox&quot; style=&quot;overflow: auto;&quot;&gt; &lt;ul class = &quot;image_gallery&quot; id=&quot;image.gallery&quot; style=&quot;display: none;&quot;&gt; &lt;?php include &quot;photo_gallery_functions.php&quot;; thumbnailPreview ($media_type_gallery, $collection_gallery, $gallery_choice_gallery); ?&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;footer&gt; &lt;?php include &quot;../../Website_Pages/Element_Pages/footer.php&quot; ?&gt; &lt;/footer&gt; &lt;/html&gt; // photo_gallery_funxtions.php &lt;?php $media_type_gallery = &quot;$media_type&quot;; function media_type_choice ($media_type) { if ($media_type == &quot;Photo&quot;) { $directoryPath= &quot;/Images/Photo_Gallery/Pictures/&quot;; $contents = scandir($directoryPath); $directories= array_filter ($contents, function ($item) use ($directoryPath) { return is_dir($directoryPath.&quot;/&quot;. $item) &amp;&amp; $item !== &quot;.&quot; &amp;&amp; $item !==&quot;..&quot;;}); foreach ($directories as $directory) { echo &quot;&lt;option id='photo_collection' name='photo_collection' value='$directory' onclick= showDropdownGallery()&gt;&lt;/option&gt;&quot;; } } else if ($media_type == &quot;Video&quot;); { $directoryPath= &quot;/Video/Video_Gallery/Video&quot;; $contents = scandir($directoryPath); $directories= array_filter ($contents, function ($item) use ($directoryPath) { return is_dir($directoryPath.&quot;/&quot;. $item) &amp;&amp; $item !== &quot;.&quot;&amp;&amp; $item !== &quot;..&quot;;}); foreach ($directories as $directory) { echo &quot;&lt;option id='video_collection' name='video_collection' value='$directory' onclick= showDropdownGallery()&gt;&lt;/option&gt;&quot;; } } } function collection_choice ($collection, $media_type_gallery) { if ($media_type_gallery == &quot;Photo&quot;) { $directoryPathGallery= &quot;/Images/Photo_Gallery/$collection/&quot;; } else if ($media_type_gallery == &quot;Video&quot;); { $directoryPathGallery= &quot;/Video/Video_Gallery/$collection/&quot;; } $contents = scandir($directoryPathGallery); $directoriesGallery= array_filter ($contents, function ($item) use ($directoryPathGallery) { return is_dir($directoryPathGallery.&quot;/&quot;. $item) &amp;&amp; $item !== &quot;.&quot;&amp;&amp; $item !== &quot;..&quot;;}); foreach ($directoriesGallery as $directoryGallery) { echo &quot;&lt;option id='gallery_choice' name='gallery_choice' value='$directoryGallery' onclick=showThumbnails()&gt;$directoryGallery&lt;/option&gt;&quot;; } } function thumbnailPreview ($media_type_gallery, $collection_gallery, $gallery_choice_gallery) { if ($media_type_gallery == &quot;Photo&quot;) { $gallery_type = &quot;/Images/Photo_Gallery/&quot;; } else if ($media_type_gallery == &quot;Video&quot;); { $gallery_type= &quot;/Video/Video_Gallery/&quot;; } $directoryPathImage= &quot;$gallery_type/Thumbnails/$collection_gallery/$gallery_choice_gallery/&quot;; $contentsImage= scandir($directoryPathImage); $directoriesImage= array_filter ($contentsImage, function ($item) use ($directoryPathImage) { return is_file($directoryPathImage.&quot;/&quot;. $item) &amp;&amp; $item !== &quot;.&quot;&amp;&amp; $item !== &quot;..&quot;;}); foreach ($directoriesImage as $directoryImage) { if ($media_type_gallery == &quot;Photo&quot;) { $thumbnail = &quot;&lt;img src='/Images/Photo_Gallery/Thumbnails/$collection_gallery/$gallery_choice_gallery/$directoryImage.png' alt='$directoryImage' width='100px' height='100px'&gt;&quot;; echo &quot;&lt;a href='/Images/Photo_Gallery/Pictures/$collection_gallery/$gallery_choice_gallery/$directoryImage.png' target='_blank'&gt;$thumbnail&lt;/a&gt;&quot;; } else if ($media_type_gallery == &quot;Video&quot;); { $videoThumbnail = &quot;&lt;img src='/Video/Video_Gallery/Thumbnails/$collection_gallery/$gallery_choice_gallery/$directoryImage.png' alt='$directoriesImage' width='100px' height='100px'&gt;&quot;; echo &quot;&lt;li id='thumbnail'&gt;&lt;a href='/Video/Video_Gallery/Video/$collection_gallery/$gallery_choice_gallery/$directoriesImage.mp4 target='_blank'&gt;$thumbnail&lt;/a&gt;&lt;/li&gt;&quot;; } } } ?&gt;\n</code></pre>\n<hr />\n"^^ . + "0"^^ . + . + . + "Because when you call `session_regenerate_id(true)` it regenerates the session ID and deletes the old session data, including all the session variables. While, `session_regenerate_id(false)` or `session_regenerate_id()` regenerates the session ID without deleting the old session data. All these approaches prevent session fixation. You don't need to manually copy session variables if you use `session_regenerate_id(false)` or `session_regenerate_id()` as they already preserve the session data."^^ . + . + "0"^^ . + . + . + . + "I have updated my answer with the implicit binding possibly being the issue and a solution. Also, if you could respond to my answer with a comment rather than through a revision message on an edit, that would be appreciated as I don't get notifications from edits."^^ . + . + . + . + . + . + "Questions seeking debugging help ("why isn't this code working?") must \ninclude the desired behavior, a specific problem or error and the shortest code necessary to \nreproduce it in the question itself. Questions without a clear problem statement are not useful \nto other readers. See: [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve)."^^ . + . + . + "0"^^ . + . + "zen-cart"^^ . + . + . + . + "0"^^ . + . + . + "Tried also runkit7, yet as of yet, no luck: https://stackoverflow.com/questions/79469776/how-to-install-runkit7"^^ . + . + . + . + "2"^^ . + . + "2"^^ . + . + . + "<pre><code>&lt;?php \n $adminToken = &quot;&quot;; \n $slug = &quot;dish-washing-powder&quot;; \n $url = &quot;example.com/rest/V1/…&quot;; \n $ch = curl_init(); \n curl_setopt($ch, CURLOPT_URL, $url); \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_HTTPHEADER, [ &quot;Authorization: Bearer $adminToken&quot;, &quot;Content-Type:application/json&quot; ]); \n $response = curl_exec($ch); \n curl_close($ch);\n $products = json_decode($response, true); echo &quot;&lt;pre&gt;&quot;; \n print_r($products); echo &quot;&lt;/pre&gt;&quot;; \n?&gt;\n</code></pre>\n<p>Not fetching the product details.</p>\n<p>Output look like this. I need to use slug instead of sku.</p>\n<p>Below is the json I'm getting while running on Postman.</p>\n<p>Any help would be appreciated. Thanks in advance</p>\n<pre><code>{\n &quot;items&quot;: [],\n &quot;search_criteria&quot;: {\n &quot;filter_groups&quot;: [\n {\n &quot;filters&quot;: [\n {\n &quot;field&quot;: &quot;url_key&quot;,\n &quot;value&quot;: &quot;dish-washing-powder/&quot;,\n &quot;condition_type&quot;: &quot;eq&quot;\n }\n ]\n }\n ]\n },\n &quot;total_count&quot;: 0\n}\n</code></pre>\n<p>Any help would be appreciated.</p>\n<p>My expected output is like the below</p>\n<pre><code>{\n &quot;id&quot;: 391,\n &quot;sku&quot;: &quot;abc-1&quot;,\n &quot;name&quot;: &quot;dish washing powder&quot;,\n &quot;attribute_set_id&quot;: 4,\n &quot;price&quot;: 12.68,\n &quot;status&quot;: 2,\n &quot;visibility&quot;: 4,\n &quot;type_id&quot;: &quot;simple&quot;,\n &quot;created_at&quot;: &quot;2020-10-27 11:30:00&quot;,\n &quot;updated_at&quot;: &quot;2024-12-03 04:19:58&quot;,\n &quot;weight&quot;: 0.7,\n &quot;extension_attributes&quot;: {\n &quot;website_ids&quot;: [\n 1\n ],\n \n</code></pre>\n<p>Note: I was able to get it as a sku by fetching like this.\n<a href="https://example.com/rest/V1/products/%7Bsku%7D" rel="nofollow noreferrer">https://example.com/rest/V1/products/{sku}</a></p>\n<p>For slug this seems to work - <a href="https://example.com/rest/V1/products?searchCriteria%5BfilterGroups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bfield%5D=url_key&amp;searchCriteria%5BfilterGroups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bvalue%5D=my-product-name&amp;searchCriteria%5BfilterGroups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bcondition_type%5D=eq" rel="nofollow noreferrer">https://example.com/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=url_key&amp;searchCriteria[filterGroups][0][filters][0][value]=my-product-name&amp;searchCriteria[filterGroups][0][filters][0][condition_type]=eq</a></p>\n<p>But can I simplify it more like the sku url.</p>\n"^^ . + . + "<p>I have the following requirements for url patterns:</p>\n<ol>\n<li><code>.com/CPT/</code> (archive of custom post type)</li>\n<li><code>.com/CPT/post-name</code> (single post in custom post type)</li>\n<li><code>.com/CPT/category-name</code> (archive of cpt category)</li>\n<li><code>.com/CPT/category-name/post-name</code> (single post in custom post type category)</li>\n</ol>\n<p>Those are the structures I need. So far 1, 3, and 4 are working properly - but I cannot get 2 to do anything but throw a 404.</p>\n<p>When I modify the rewrite rules to accommodate #2, 3 or 4 breaks and either throws 404 or redirects to the home page. Is this possible to correct so all four permalinks are functional?</p>\n<p>I tried using the CPT permalinks plugin - but I was unsuccessful at getting the <code>.com/CPT/post-name</code> to work in conjunction with the other permalink structures I need (3 &amp; 4).</p>\n<p>I read through and attempted the use of another solution here - but again, these ignored the need for the structure of <code>.com/cpt/post-name</code>.</p>\n<p>Basically, I need to ensure that the slug for the custom post type and the slug for the custom post type custom category is the same - here are some specific examples of meaningful urls:</p>\n<ul>\n<li><code>.com/services</code> (archive of custom post type)</li>\n<li><code>.com/services/botox</code> (single post of custom post type)</li>\n<li><code>.com/services/injectables</code> (archive of custom post type custom taxonomy)</li>\n<li><code>.com/services/injectables/botox</code> (single post of custom post type custom taxonomy)</li>\n</ul>\n<p>Below is the code I currently have in place that is working with the exception of #2 structure:</p>\n<pre><code>// Register the Custom Post Type\nfunction register_custom_post_type() {\n $args = array(\n 'labels' =&gt; array(\n 'name' =&gt; 'Services',\n 'singular_name' =&gt; 'Service',\n ),\n 'public' =&gt; true,\n 'has_archive' =&gt; true,\n 'rewrite' =&gt; array(\n 'slug' =&gt; 'services', // Base slug for your CPT\n 'with_front' =&gt; false,\n 'hierarchical' =&gt; true, // Allows for /services/category/post\n ),\n 'show_in_rest' =&gt; true, // Enable Gutenberg editor if needed\n 'supports' =&gt; array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields' ),\n 'taxonomies' =&gt; array('services_category'), // Attach custom taxonomy if needed\n );\n\n register_post_type('services', $args);\n}\nadd_action('init', 'register_custom_post_type');\n\n// Register Custom Taxonomy for the Custom Post Type\nfunction register_custom_taxonomy() {\n $args = array(\n 'labels' =&gt; array(\n 'name' =&gt; 'Services Categories',\n 'singular_name' =&gt; 'Services Category',\n ),\n 'public' =&gt; true,\n 'rewrite' =&gt; array(\n 'slug' =&gt; 'services', // This will make the taxonomy appear under /services/category-name/\n 'with_front' =&gt; false,\n 'hierarchical' =&gt; true, // Ensure categories are hierarchical (like regular categories)\n ),\n 'hierarchical' =&gt; true,\n );\n\n register_taxonomy('services_category', 'services', $args);\n}\nadd_action('init', 'register_custom_taxonomy');\n\n**// Custom Rewrite Rules to Match the Permalink Structure\nfunction custom_rewrite_rules($rules) {\n $new_rules = array(\n // CPT Archive: /services/\n 'services/?$' =&gt; 'index.php?post_type=services',\n\n // Single CPT Post: /services/post-name/\n 'services/([^/]+)/?$' =&gt; 'index.php?post_type=services&amp;name=$matches[1]',\n\n // Custom Taxonomy Archive: /services/category-name/\n // This rule should be placed *after* the CPT single post rule to avoid conflicts\n 'services/([^/]+)/?$' =&gt; 'index.php?taxonomy=services_category&amp;term=$matches[1]',\n\n // Single CPT Post within a Category: /services/category-name/post-name/\n 'services/([^/]+)/([^/]+)/?$' =&gt; 'index.php?post_type=services&amp;services_category=$matches[1]&amp;name=$matches[2]',\n );\n\n return $new_rules + $rules;\n}\nadd_filter('rewrite_rules_array', 'custom_rewrite_rules');\n\n// Add rewrite tag for custom taxonomy (to ensure taxonomy permalinks work)\nfunction add_custom_rewrite_tags() {\n add_rewrite_tag('%services_category%', '([^&amp;]+)');\n}\nadd_action('init', 'add_custom_rewrite_tags');\n</code></pre>\n"^^ . + . + . + "0"^^ . + . + . + "1"^^ . + "0"^^ . + "React App Not Serving Static Files Correctly - MIME Type Issues"^^ . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + "<p>I'm trying to use the <code>Dom\\HtmlDocument</code> that's new in PHP 8.4.</p>\n<p>Let's say I just need to count all divs:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\n$html = &lt;&lt;&lt;HTML\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n &lt;meta charset=&quot;UTF-8&quot;&gt;\n &lt;title&gt;Example&lt;/title&gt;\n&lt;/head&gt;\n&lt;body&gt;\n &lt;div&gt;Hello&lt;/div&gt;\n&lt;/body&gt;\n&lt;/html&gt;\nHTML;\n\n$doc = Dom\\HTMLDocument::createFromString($html);\n$xpath = new Dom\\XPath($doc);\n\n// No divs found:\n$divs = $xpath-&gt;query('//div');\necho $divs-&gt;count(); // 0\n\n// 6 elements found, including the div:\n$anyTags = $xpath-&gt;query('//*');\necho $anyTags-&gt;count(); // 6\n</code></pre>\n<p>As you can see, when I use <code>*</code> to grab any element, it works as expected and even the div is found.</p>\n<p>Why can't I use tag selectors? I tried some fancier selectors with classnames etc. and it works properly, as long as I use <code>*</code> instead of specific tags.</p>\n"^^ . + . + . + . + "Is it possible to enqueue script only when block variation is active/present"^^ . + . + "0"^^ . + . + . + . + . + . + . + "1"^^ . + . + . + . + "ms-word"^^ . + . + . + . + "How is a database related to the code shown? When you debug, what *specifically* is "returning NULL"?"^^ . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "<p>I gets zip archive content with ZipArchive class in PHP. I need to display compressed and uncompressed size for each file in it. How to do this?</p>\n<pre><code> $zip = new ZipArchive;\n $zip-&gt;open('download/' . $results[0]['filename']);\n $i = 0;\n while($name = $zip-&gt;getNameIndex($i)) {\n $files[] = array(\n 'filename' =&gt; $name,\n 'compressed_size' =&gt; ???,\n 'uncompressed_size' =&gt; ???);\n $i++;\n }\n $zip-&gt;close();\n</code></pre>\n"^^ . + . + . + . + . + "Hi. You must close all `foreach-endforeach` statements with a semicolon: `<?php endforeach; ?>`."^^ . + . + . + "When use the Conversion Filters convert.base64-encode between php://filter and data://, data loss may occur in versions up to PHP7"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "Opentelemetry Collector isn't able to send PHP application logs/metrics/traces to Grafana"^^ . + . + . + "0"^^ . + "Why chmod() in Laravel Nova does not work with GeeseFS?"^^ . + "I tried logging ALL requests, including headers. They are not even hitting the endpoint."^^ . + "OK - so I managed to get it working with a slight workaround (Yes, without any java or ajax scripts :-)). Preliminary test output is good. Will test it in more detail by evening & update it here. Unfortunate that the question is closed, so no more contributions may come in. But unfortunately that's what SO is :-((. (@NicoHaase)"^^ . + . + "So the testers should really be telling _why_ they think this response indicates a vulnerability, based on their observations."^^ . + . + "You are running home.html also via localhost, not directly by clicking it in Windows Explorer?"^^ . + "1"^^ . + . + . + . + . + . + "1"^^ . + "string"^^ . + . + . + . + "PHP - convert XML to array with all attributes"^^ . + "@hakre Perhaps I, and others to follow this, have a misunderstanding of why the namespace and why it would resolve blank here. Can you clarify for those of us trying to understand?"^^ . + . + . + . + . + . + "0"^^ . + "pcntl"^^ . + "Try to output the stderr `PHP_VERSION=$(php -r 'echo PHP_VERSION;' 2>&1)`"^^ . + . + . + . + "0"^^ . + . + "simple-machines-forum"^^ . + . + "One of the problems is when you explode with '} {'. this will remove most of the {'s, but the first and last items will still have the opening and closing {}'s."^^ . + . + . + . + . + . + . + . + . + "Error with Nginx (ERR_TOO_MANY_REDIRECTS) in VPS Hostinger default config WordPress"^^ . + "@ADyson I'm not looking to rewrite, I'm looking to have only the code for what I need, not a million more lines of code that slow down my project. This is a platform for building news websites, so everything must be as easy as possible, as fast as possible, as secure as possible, and as up-to-date as possible."^^ . + "0"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + "How can we block access to a website from HTTPS clients like Postman and cURL?"^^ . + . + "Please share your code? I don't see any"^^ . + "mykaf, plain URL is included, please refer to "SMF forum" link above."^^ . + . + . + . + . + . + "Which version of PHP?"^^ . + "Laravel Route Not Found (404) for POST request"^^ . + "This line `return pll_the_languages(['hide_current' => 1, 'echo' => 0]);` does the magic. Thank you all."^^ . + . + . + . + . + . + "wild-guess: Have you tried adding an operator? `LiveProducts::where('code', '=', $code)->first();` if you want directions on the upgrade to 11 feel free to reach out. It's pretty straight forward, but there's a couple nuances."^^ . + "0"^^ . + . + "reference"^^ . + "`I don't want to use external packages because I don't want to put any code that isn't mine in my project`...but **why**? In the modern world that's an unrealistic expectation I think, unless you actively _want_ to have to learn everything about every aspect or functionality a modern app might use - some of which is extremely complex, as you're discovering. Leave it to the experts (especially stuff like security and encryption which is easy to screw up without even realising) - it's not even like you're paying for these packages, so money isn't a motivation."^^ . + . + "1"^^ . + "0"^^ . + "2"^^ . + "0"^^ . + . + "<p>I have a couple of pages that upload files to a database. I was on php 8.3 but had to downgrade to php 8.2 for Imagick. Before I could load up to 64MB files.\nI'm trying to upload a file of 2MB now with PHP 8.2.27 but it fails showing</p>\n<pre class="lang-php prettyprint-override"><code>echo $_FILES['userfile']['error'] \n</code></pre>\n<pre><code>2\n</code></pre>\n<p>This means MAX_FILE_SIZE has been exceeded (see <code>UPLOAD_ERR_FORM_SIZE</code> in <a href="https://www.php.net/manual/en/filesystem.constants.php#constant.upload-err-cant-write" rel="nofollow noreferrer">PHP File Upload Constants</a>)\n.</p>\n<p>I don't have MAX_FILE_SIZE set in my script.</p>\n<p>In my php.ini I have</p>\n<pre><code>php_value post_max_size 128M\nphp_value upload_max_filesize 128M\nphp_value memory_limit = 128M\n</code></pre>\n<p>I don't have an .htaccess file and the phpinfo() shows the same values as the php.ini plus the same path as the php.ini file I changed.</p>\n<p>I have been at this for 2 days but to no avail and all answers come back to setting the values in PHP.ini, restart the services and check other files so the values are not overwritten. Still I can't get it to work. Any guru vibes are welcome.</p>\n"^^ . + "Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/259207/discussion-between-razvan-zamfir-and-soneye-oluwasina)."^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + "Laravel route returning "No response data for this request" when accessing an image file"^^ . + "0"^^ . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "<p>I'm using CodeIgniter 4 and having an issue with my model. I'm using first() and findAll() to retrieve data as objects or arrays, but for some functions, I get this error:</p>\n<blockquote>\n<p>Unknown column 'adresses_facturation.suppression' in 'where clause'</p>\n</blockquote>\n<p>In my database, I have a column named suppression of type DATETIME.</p>\n<pre><code>public function getAdresse(int $idAdresse): ?object\n{\n return $this-&gt;where(['idFacturation' =&gt; $idAdresse, 'suppression' =&gt; null])-&gt;first();\n}\n\n</code></pre>\n<p>my model :</p>\n<pre><code>class AdressesFacturationModel extends Model\n{\n protected $DBGroup = 'default';\n protected $table = 'adresses_facturation'; //Nom de la table\n protected $primaryKey = 'idFacturation'; //Clé primaire de la table\n protected $useAutoIncrement = true;\n protected $returnType = 'object'; // ou array ou object\n protected $useSoftDeletes = true;\n protected $allowedFields = [\n 'idFacturation',\n 'civilite',\n 'nom',\n 'prenom',\n 'entreprise',\n 'adresse',\n 'complement',\n 'postal',\n 'ville',\n 'telephone',\n 'email',\n 'idPays',\n 'defaut',\n 'utilisateurs_idUtilisateur'\n ];\n protected $useTimestamps = true;\n protected $createdField = 'creation';\n protected $updatedField = 'modification';\n protected $deletedField = 'suppression';\n protected $validationRules = [];\n protected $validationMessages = [];\n protected $skipValidation = false;\n protected $dateFormat = 'datetime';\n</code></pre>\n<p>For now I have done as code :</p>\n<pre><code> public function getAdresse(int $idAdresse): ?object\n {\n return $this-&gt;where(['idFacturation' =&gt; $idAdresse, 'suppression' =&gt; null])-&gt;get()-&gt;getRow();\n }\n</code></pre>\n<p>but I would like to understand why I have the error with the first</p>\n"^^ . + . + . + "0"^^ . + . + "0"^^ . + "<blockquote>\n<p>Meanwhile, I tried with <code>static</code> [instead of <code>: self</code>] and it indeed works, why?</p>\n</blockquote>\n<p>This boils down in the PHP language (PhpStorm's IntelliSense, better <em>Code completion</em> tries to mimic it):</p>\n<p><code>self</code> is the class itself, that is always <em>concrete</em>:</p>\n<pre class="lang-php prettyprint-override"><code>abstract class Transaction\n{\n ...\n public function setPaymentMethodId(?int $value): self \n {\n ...\n return $this;\n }\n}\n</code></pre>\n<p>When <em>chaining</em>, the code completion resolves <code>self</code> to <code>Transaction</code>:</p>\n<pre><code>$invoice = (new Invoice)\n -&gt;setSubscription(...)\n -&gt;setPaymentMethodId(...) # resolves to Transaction\n -&gt;setDueDate(...); # Transaction has no such method\n</code></pre>\n<p>Now with <code>static</code> this turns into what is called <a href="https://www.php.net/manual/en/language.oop5.late-static-bindings.php" rel="nofollow noreferrer" title="PHP: Late Static Bindings - Manual (php.net)"><em>Late Static Bindings</em></a>.</p>\n<p>Late means late (when it happens), and binding means to associate the <em>concrete</em> class. As an abstract class cannot be instantiated, the class actually never is purely <code>self</code> but one that extends from it and that is not abstract:</p>\n<pre class="lang-php prettyprint-override"><code>class Invoice extends Transaction\n{\n ...\n public function setDueDate(?string $value): self\n {\n ...\n }\n}\n</code></pre>\n<p>Again with the <em>chaining</em> and <code>: static</code> on <em>setPaymentMethodId()</em>, the <em>concrete</em> class <em>Invoice</em> is being resolved for code completion:</p>\n<pre class="lang-php prettyprint-override"><code>$invoice = (new Invoice)\n -&gt;setSubscription(...)\n -&gt;setPaymentMethodId(...) # resolves to Invoice\n -&gt;setDueDate(...); # Invoice has such a method\n</code></pre>\n<p>This to this point is just about <code>static</code> vs. <code>self</code> for the <em>late static binding</em> in PHP.</p>\n<p>Now what the IDE needs to do during chaining (as compared to individual <em>$object-&gt;method()</em> calls), is to resolve it one after the other in the chain. This adds complexity and my educated guess is, that the analyzer has a certain depth for which it resolves and if it sees <code>self</code> it is reducing the overhead for a best quick result.</p>\n<p>There are also other guess-mechanisms on special classes as they work like decorators (e.g. the traversable IteratorIterator) and if you hint towards generics (or as pointed out in the comment for <em>traits</em>).</p>\n<p>In general you can also benefit from using interfaces as they are easy to look-up both for the IDE and for PHP. You also go away from diverse abstract or non-abstract implementations (by making them pure abstract classes, known as interfaces in PHP).</p>\n"^^ . + . + . + . + "0"^^ . + "odbc"^^ . + . + "0"^^ . + . + "And fetchAll() sounds counter-intuitive if you are really concerned about memory."^^ . + . + "0"^^ . + . + "0"^^ . + . + . + "<p>Is it enought to check whether user input conforms to an expected value, before I embed it into executed code? E.g.:</p>\n<pre><code>$fruits = array(\n &quot;Orange&quot;,\n &quot;Banana&quot;\n);\n\nif(isset($_GET['fruit']) &amp;&amp; in_array($_GET['fruit'], $fruits)) {\n // embed user input in HTML page:\n echo $_GET['fruit'];\n // embed user input in shell command:\n shell_exec(&quot;script.sh $_GET['fruit']&quot;);\n // query database with user input:\n mysqli_stmt_bind_param($stmt, 's', $_GET['fruit']);\n}\n</code></pre>\n<p>Or do I need to escape it with <code>htmlspecialchars</code>, <code>escapeshellcmd</code> etc. before output anyway?</p>\n"^^ . + "0"^^ . + "1"^^ . + "4"^^ . + "1"^^ . + "laravel-passport"^^ . + "1"^^ . + "Why do you expect that large files (over 2GB) should be processed and returned?"^^ . + . + "1"^^ . + . + "Use convert.php, it's the one I am tying to fix before I convert code to reusable functions."^^ . + "1"^^ . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + "I can't reproduce your problem https://i.sstatic.net/gQ7CVwIz.png"^^ . + . + . + "-1"^^ . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + "Updated the question title."^^ . + "0"^^ . + . + . + "0"^^ . + . + "@mrmcwolf *"not exactly, the prepared query will be cached by the server, which can improve performance"* Only if executed several times on the same connection, which is very unlikely here."^^ . + "heartbeat"^^ . + . + . + "If your application created that folder then you can use drve.file if it was created outside your application then you cant access it with that scope"^^ . + . + "<p>I manage an old Wordpress Multisite Network (there are 5 sites) and I want to update WP core (from 6.6.2 to 6.7.2), themes and plugins.\nFirst step: update obsolete php version 7.3\nIf I update php from 7.3 to 7.4, the main site detect the new version but other 4 sites detect 7.3.\nThe .htaccess file is standard (like WP declares) and there is only one .htaccess.\nI try to add this code to htaccess to force WP:</p>\n<p><code>&lt;IfModule mod_rewrite.c&gt; AddHandler application/x-httpd-ea-php74 .php .php7 .phtml RewriteEngine On &lt;/IfModule&gt;</code></p>\n<p>but doesn't work.\nI don't understand where is the problem.\nSomebody can tell me why?</p>\n"^^ . + . + . + . + . + "0"^^ . + . + . + . + "<p>I have a component using Laravel + livewire. I'm newbie in this but I get an example from<br />\n<a href="https://diarioprogramador.com/crear-crud-con-laravel-8-y-livewire/" rel="nofollow noreferrer">https://diarioprogramador.com/crear-crud-con-laravel-8-y-livewire/</a></p>\n<p>When I execute php artisan serve I get this error&gt;</p>\n<p>Livewire\\Exceptions\\ComponentNotFoundException\nUnable to find component: [Productos]\nGET 127.0.0.1:8000\nPHP 8.2.12 — Laravel 12.1.1</p>\n<p>Last reference to my source is : resources\\views\\welcome.blade.php\nLine 278:</p>\n<pre><code> &lt;div class=&quot;container mx-auto p-4&quot;&gt;\n\n @livewire('Productos')\n\n &lt;/div&gt;\n</code></pre>\n<p>I have tried making again (php artisan make:livewire productos), ensure livewire is installed (composer require livewire/livewire), cleaning cache and migrate (php artisan optimize:clear &amp; php artisan migrate), adding to app.blade.php the annotations (@livewireStyles @livewireScripts), check if component is added in view (@livewire('productos')), restarting server and project, changing the name of component 'productos' to 'Productos' and the error remains. AI also doesn't help.</p>\n<p>This is my Controller (app/Http/Controllers/ProductoController.php):</p>\n<pre><code>&lt;?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Http\\Request;\nuse App\\Services\\ProductoService;\n\nclass ProductoController extends Controller\n{\n protected $productoService;\n\n public function __construct(ProductoService $productoService)\n {\n $this-&gt;productoService = $productoService;\n }\n\n public function store(Request $request)\n {\n $status = $this-&gt;productoService-&gt;insertarProducto($request-&gt;all());\n return response()-&gt;json(['success' =&gt; $status == 1]);\n }\n\n public function update(Request $request, $id)\n {\n $status = $this-&gt;productoService-&gt;actualizarProducto($id, $request-&gt;all());\n return response()-&gt;json(['success' =&gt; $status == 1]);\n }\n\n public function show($id)\n {\n return response()-&gt;json($this-&gt;productoService-&gt;obtenerProducto($id));\n }\n\n public function destroy($id)\n {\n $status = $this-&gt;productoService-&gt;borrarProducto($id);\n return response()-&gt;json(['success' =&gt; $status == 1]);\n }\n}\n</code></pre>\n<p>The livewire class (app/Livewire/Productos.php):</p>\n<pre><code> &lt;?php\n\n namespace App\\Http\\Livewire;\n\n use Livewire\\Component;\n use Illuminate\\Support\\Facades\\DB;\n\n class Productos extends Component\n {\n public $productos, $producto_id, $nombre, $descripcion, $precio;\n\n public function render()\n {\n $this-&gt;productos = DB::select(&quot;CALL obtenerTodosLosProductos()&quot;);\n return view('livewire.productos');\n }\n\n public function guardarProducto()\n {\n if ($this-&gt;producto_id) {\n DB::statement(&quot;CALL actualizarProducto(?, ?, ?, ?, @p_status)&quot;, \n [$this-&gt;producto_id, $this-&gt;nombre, $this-&gt;descripcion, $this-&gt;precio]);\n } else {\n DB::statement(&quot;CALL insertarProducto(?, ?, ?, @p_status)&quot;, \n [$this-&gt;nombre, $this-&gt;descripcion, $this-&gt;precio]);\n }\n\n $this-&gt;resetCampos();\n }\n\n public function editarProducto($id)\n {\n $producto = DB::select(&quot;CALL obtenerProducto(?)&quot;, [$id])[0];\n $this-&gt;producto_id = $producto-&gt;id;\n $this-&gt;nombre = $producto-&gt;nombre;\n $this-&gt;descripcion = $producto-&gt;descripcion;\n $this-&gt;precio = $producto-&gt;precio;\n }\n\n public function eliminarProducto($id)\n {\n DB::statement(&quot;CALL borrarProducto(?, @p_status)&quot;, [$id]);\n }\n\n public function cancelarEdicion()\n {\n $this-&gt;resetCampos();\n }\n\n private function resetCampos()\n {\n $this-&gt;producto_id = null;\n $this-&gt;nombre = '';\n $this-&gt;descripcion = '';\n $this-&gt;precio = '';\n }\n }\n</code></pre>\n<p>My view (resources/views/livewire/productos.blade.php):</p>\n<pre><code> &lt;div&gt;\n &lt;h2 class=&quot;text-2xl font-bold mb-4&quot;&gt;Gestión de Productos&lt;/h2&gt;\n\n {{-- Formulario para agregar y editar productos --}}\n &lt;form wire:submit.prevent=&quot;guardarProducto&quot;&gt;\n &lt;div class=&quot;mb-2&quot;&gt;\n &lt;label class=&quot;block text-gray-700&quot;&gt;Nombre:&lt;/label&gt;\n &lt;input type=&quot;text&quot; wire:model=&quot;nombre&quot; class=&quot;w-full p-2 border rounded&quot;&gt;\n &lt;/div&gt;\n\n &lt;div class=&quot;mb-2&quot;&gt;\n &lt;label class=&quot;block text-gray-700&quot;&gt;Descripción:&lt;/label&gt;\n &lt;textarea wire:model=&quot;descripcion&quot; class=&quot;w-full p-2 border rounded&quot;&gt;&lt;/textarea&gt;\n &lt;/div&gt;\n\n &lt;div class=&quot;mb-2&quot;&gt;\n &lt;label class=&quot;block text-gray-700&quot;&gt;Precio:&lt;/label&gt;\n &lt;input type=&quot;number&quot; step=&quot;0.01&quot; wire:model=&quot;precio&quot; class=&quot;w-full p-2 border rounded&quot;&gt;\n &lt;/div&gt;\n\n &lt;button type=&quot;submit&quot; class=&quot;bg-blue-500 text-white p-2 rounded&quot;&gt;\n {{ $producto_id ? 'Actualizar Producto' : 'Agregar Producto' }}\n &lt;/button&gt;\n\n @if($producto_id)\n &lt;button type=&quot;button&quot; wire:click=&quot;cancelarEdicion&quot; class=&quot;bg-gray-500 text-white p-2 rounded ml-2&quot;&gt;\n Cancelar\n &lt;/button&gt;\n @endif\n &lt;/form&gt;\n\n {{-- Tabla de productos --}}\n &lt;table class=&quot;table-auto w-full mt-4 border-collapse border border-gray-200&quot;&gt;\n &lt;thead&gt;\n &lt;tr class=&quot;bg-gray-100&quot;&gt;\n &lt;th class=&quot;border p-2&quot;&gt;ID&lt;/th&gt;\n &lt;th class=&quot;border p-2&quot;&gt;Nombre&lt;/th&gt;\n &lt;th class=&quot;border p-2&quot;&gt;Descripción&lt;/th&gt;\n &lt;th class=&quot;border p-2&quot;&gt;Precio&lt;/th&gt;\n &lt;th class=&quot;border p-2&quot;&gt;Acciones&lt;/th&gt;\n &lt;/tr&gt;\n &lt;/thead&gt;\n &lt;tbody&gt;\n @foreach($productos as $producto)\n &lt;tr&gt;\n &lt;td class=&quot;border p-2&quot;&gt;{{ $producto-&gt;id }}&lt;/td&gt;\n &lt;td class=&quot;border p-2&quot;&gt;{{ $producto-&gt;nombre }}&lt;/td&gt;\n &lt;td class=&quot;border p-2&quot;&gt;{{ $producto-&gt;descripcion }}&lt;/td&gt;\n &lt;td class=&quot;border p-2&quot;&gt;${{ number_format($producto-&gt;precio, 2) }}&lt;/td&gt;\n &lt;td class=&quot;border p-2&quot;&gt;\n &lt;button wire:click=&quot;editarProducto({{ $producto-&gt;id }})&quot; class=&quot;bg-yellow-500 text-white p-1 rounded&quot;&gt;\n Editar\n &lt;/button&gt;\n &lt;button wire:click=&quot;eliminarProducto({{ $producto-&gt;id }})&quot; class=&quot;bg-red-500 text-white p-1 rounded&quot;&gt;\n Eliminar\n &lt;/button&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n @endforeach\n &lt;/tbody&gt;\n &lt;/table&gt;\n &lt;/div&gt;\n</code></pre>\n<p>And the welcome view (resources/views/welcome.blade.php):</p>\n<pre><code> ...\n @livewireStyles\n @livewireScripts\n &lt;/body&gt;\n &lt;/html&gt;\n</code></pre>\n<p>Another way I did:</p>\n<pre><code> @if (Route::has('login'))\n &lt;div class=&quot;h-14.5 hidden lg:block&quot;&gt;&lt;/div&gt;\n &lt;div class=&quot;container mx-auto p-4&quot;&gt;\n @livewire('productos')\n &lt;/div&gt;\n @endif\n\n @livewireScripts\n &lt;/body&gt;\n</code></pre>\n"^^ . + "0"^^ . + . + . + "1"^^ . + "loops"^^ . + . + . + . + "0"^^ . + "php-8"^^ . + "Laravel app slows down on select pages after PHP 8 upgrade (VPS with Webmin)"^^ . + "2"^^ . + . + . + "php-gd"^^ . + "1"^^ . + . + "0"^^ . + . + "ah it's probably tcsh"^^ . + . + "0"^^ . + . + . + "Probably your version of Laravel is incompatible with your version of PHP. Check the Laravel documentation for the version you're running, to see what PHP version(s) it works with. See the duplicate question for more details too. In future, google your error messages first. See also [ask] for further guidance on asking a useful question on Stackoverflow (including doing the appropriate amount of research before posting, thus avoiding unnecessary duplication). Thanks"^^ . + . + "1"^^ . + . + . + "Okay, you ask about some PHP code and mention briefly HTTP, but what you are actually having a problem with is configuring nginx because you want it, but you don't need it, as you have a working Apache setup. Sorry, I'm out then, this is out of scope of SO which is about programming and you're looking for assistance while getting started with Nginx. I'd suggest you look for some community resources in the Laragon community because what you comment seems to be similar miles far-away like you asked your question."^^ . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + "Tabula doesn't have an option to extract colour. Doesn't need to be Tabula, any other packages I could use will be helpful too."^^ . + "1"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + "[That's correct](https://stackoverflow.com/q/79423259/15167500#comment140069433_79423259). For testing, extract the generated hash without storing it, and then compare it with the stored value. You can also paste it into the following small playground; the verify function should work fine: [`password_verify()` playground](https://onlinephp.io/c/51c82)"^^ . + "2"^^ . + . + "0"^^ . + "<p>I am working on a <strong>blogging application</strong> (link to GitHub repo) in Laravel 8.</p>\n<p>I have put together a way to add and edit tags to articles.</p>\n<p><a href="https://i.sstatic.net/369OtKlD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/369OtKlD.png" alt="enter image description here" /></a></p>\n<p>I ran into a bug whose cause and solution I have been unable to find: updating the article's list of tags fails after one or more (but not all) tags are deleted. By contrast, if I only <em>select</em> new tags, the update operation works fine.</p>\n<p>In the ArticleController controller, I have the below methods for editing and updating an article:</p>\n<pre><code>public function edit($id)\n {\n $article = Article::find($id);\n $attached_tags = $article-&gt;tags()-&gt;get()-&gt;pluck('id')-&gt;toArray();\n \n return view(\n 'dashboard/edit-article',\n [\n 'categories' =&gt; $this-&gt;categories(),\n 'tags' =&gt; $this-&gt;tags(),\n 'attached_tags' =&gt; $attached_tags,\n 'article' =&gt; $article\n ]\n );\n }\n\n public function update(Request $request, $id)\n {\n $validator = Validator::make($request-&gt;all(), $this-&gt;rules, $this-&gt;messages);\n\n if ($validator-&gt;fails()) {\n return redirect()-&gt;back()-&gt;withErrors($validator-&gt;errors())-&gt;withInput();\n }\n\n $fields = $validator-&gt;validated();\n $article = Article::find($id);\n\n // If a new image is uploaded, set it as the article image\n // Otherwise, set the old image...\n if (isset($request-&gt;image)) {\n $imageName = md5(time()) . Auth::user()-&gt;id . '.' . $request-&gt;image-&gt;extension();\n $request-&gt;image-&gt;move(public_path('images/articles'), $imageName);\n } else {\n $imageName = $article-&gt;image;\n }\n\n $article-&gt;title = $request-&gt;get('title');\n $article-&gt;short_description = $request-&gt;get('short_description');\n $article-&gt;category_id = $request-&gt;get('category_id');\n $article-&gt;featured = $request-&gt;has('featured');\n $article-&gt;image = $request-&gt;get('image') == 'default.jpg' ? 'default.jpg' : $imageName;\n $article-&gt;content = $request-&gt;get('content');\n // Save changes to the article\n $article-&gt;save();\n\n //Attach tags to article\n if ($request-&gt;has('tags')) {\n $article-&gt;tags()-&gt;sync($request-&gt;tags);\n } else {\n $article-&gt;tags()-&gt;sync([]);\n }\n\n return redirect()-&gt;route('dashboard.articles')-&gt;with('success', 'The article titled &quot;' . $article-&gt;title . '&quot; was updated');\n } \n</code></pre>\n<p>In <code>views\\dashboard\\edit-article.blade.php</code> I have this code got the pat of the interface that deals with the tags:</p>\n<pre><code>&lt;div class=&quot;row mb-2&quot;&gt;\n &lt;label for=&quot;tags&quot; class=&quot;col-md-12&quot;&gt;{{ __('Tags') }}&lt;/label&gt;\n\n &lt;div class=&quot;position-relative&quot;&gt;\n &lt;span id=&quot;tagSelectorToggler&quot; class=&quot;tag-toggler&quot; onclick=&quot;toggleTagSelector(event)&quot;&gt;\n &lt;i class=&quot;fas fa-chevron-up&quot;&gt;&lt;/i&gt;\n &lt;/span&gt;\n &lt;ul id=&quot;tagsList&quot; class=&quot;form-control tags-list mb-1&quot; onclick=&quot;toggleTagSelector(event)&quot;&gt;\n &lt;li class=&quot;text-muted&quot;&gt;\n Use [Ctrl] + [Click] to select one or more tags from the list\n &lt;/li&gt;\n &lt;/ul&gt;\n &lt;/div&gt;\n\n &lt;div id=&quot;tagActions&quot; class=&quot;tag-actions&quot;&gt;\n &lt;input oninput=&quot;filterTags(event)&quot; type=&quot;search&quot; class=&quot;form-control mb-1&quot;\n placeholder=&quot;Filter available tags&quot; /&gt;\n\n @php $selectedTags = old('tags', $attached_tags) @endphp\n\n &lt;select name=&quot;tags[]&quot; id=&quot;tags&quot; class=&quot;form-control tag-select&quot; multiple&gt;\n @foreach ($tags as $tag)\n &lt;option value=&quot;{{ $tag-&gt;id }}&quot;\n {{ in_array($tag-&gt;id, $selectedTags) ? 'selected' : '' }}&gt;\n {{ $tag-&gt;name }}\n &lt;/option&gt;\n @endforeach\n &lt;/select&gt;\n &lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n<p>In <code>resources\\js\\tags.js</code>, I have:</p>\n<pre><code>const tagsList = document.querySelector(&quot;.tags-list&quot;)\nconst tagActions = document.getElementById(&quot;tagActions&quot;)\nconst tagSelector = document.getElementById(&quot;tags&quot;)\nconst tagToggler = document.getElementById(&quot;tagSelectorToggler&quot;)\nif (tagSelector) {\n var preSelectedTags = Array.from(tagSelector.options)\n .filter((option) =&gt; option.selected)\n .map((option) =&gt; option.text)\n var selectedTags = new Set()\n}\n\nwindow.filterTags = (event) =&gt; {\n var query = event.target.value\n var availableTags = Array.from(tagSelector.options)\n\n availableTags.forEach(function (option) {\n if (!option.text.toLowerCase().includes(query.toLowerCase())) {\n option.classList.add(&quot;d-none&quot;)\n } else {\n option.classList.remove(&quot;d-none&quot;)\n }\n })\n}\n\nwindow.toggleTagSelector = (event) =&gt; {\n let tagActionsVisibility = tagActions.checkVisibility()\n if (event.target.tagName !== &quot;BUTTON&quot; &amp;&amp; event.target.tagName !== &quot;SPAN&quot;) {\n if (tagActionsVisibility) {\n tagActions.style.display = &quot;none&quot;\n tagToggler.classList.add(&quot;active&quot;)\n } else {\n tagActions.style.display = &quot;block&quot;\n tagToggler.classList.remove(&quot;active&quot;)\n }\n }\n}\n\nwindow.renderTags = () =&gt; {\n tagsList.innerHTML =\n [...selectedTags]\n .sort()\n .map(\n (tag) =&gt;\n `&lt;li class=&quot;tag&quot;\n &gt;&lt;span class=&quot;value&quot;&gt;${tag}&lt;/span&gt;\n &lt;button&gt;&amp;times;&lt;/button&gt;\n &lt;/li&gt;`,\n )\n .join(&quot;&quot;) ||\n `&lt;li class=&quot;text-muted&quot;&gt;Use [Ctrl] + [Click] to select one or more tags from the list&lt;/li&gt;`\n for (const option of tagSelector.options) {\n option.selected = selectedTags.has(option.textContent)\n }\n}\n\nif (preSelectedTags) {\n window.addPreselectedTags = () =&gt; {\n preSelectedTags.forEach(selectedTags.add.bind(selectedTags))\n renderTags()\n }\n}\n\nif (tagsList) {\n tagsList.addEventListener(&quot;click&quot;, function (event) {\n if (event.target.tagName !== &quot;BUTTON&quot;) return\n let tagToRemove = event.target.closest(&quot;LI&quot;).children[0].textContent\n let optionToDeselect = Array.from(tagSelector.options).find((option) =&gt; {\n return option.innerText == tagToRemove\n })\n optionToDeselect.removeAttribute('selected')\n selectedTags.delete(tagToRemove)\n console.log(selectedTags); \n renderTags()\n })\n}\n\nif (tagSelector) {\n tagSelector.addEventListener(&quot;change&quot;, function () {\n selectedTags = new Set(\n Array.from(tagSelector.options)\n .filter((option) =&gt; option.selected)\n .map((option) =&gt; option.textContent),\n )\n renderTags()\n console.log(selectedTags);\n })\n}\n\nif (tagSelector) {\n window.addPreselectedTags();\n}\n</code></pre>\n<p>If I click a tag's close button and then update the article, it loses <em>all</em> the tags (not only the deleted one).</p>\n<p>There is a working fiddle <strong><a href="https://jsfiddle.net/Ajax30/2ugeyLzv/" rel="nofollow noreferrer">HERE</a></strong>, with JavaScript and HTML.</p>\n<p>Where is my mistake?</p>\n"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "AWS Elasticache - PHP Memcached - Multiple Tab Log-out"^^ . + "he Symfony application is unable to connect to the database. `doctrine:fixtures:load`"^^ . + "Auth check return false in middleware, but should return true with Log Viewer"^^ . + "1"^^ . + . + . + . + "1"^^ . + . + "2"^^ . + . + "0"^^ . + "1"^^ . + . + "1"^^ . + . + "Echoing @gview here. You're load testing your application - whether that's happening on a remote host, locally, or the specs of the machine are all unknown - and you're wondering about an error you're seeing during 15k concurrent requests. What exactly are you trying to achieve? How many concurrent requests are you expecting in production? Every host machine has an upper limit, and unless you start looking into load balancing your requests and horizontally scaling your application across multiple nodes, it's hard to know what solution there is for you that would adequately solve your problem."^^ . + . + "then here we have two problems. 1. migration for newly created tenant_db and 2. db creation for tenant.\n\nEarlier tenant db was ok, did you change anything else? we should see that too.\nand need to solve this error you had in question `[2025-02-18 13:28:18] local.ERROR: Error during deployment creation: SQLSTATE[42S01]: Base table or view already exists`\nlets do that, \n1. verify migrations for tenant is in `database/migrations/tenant directory\n` \n2. verify that your jobpipeline in `TenancyServiceProvider` being triggered during `Deployment::create[...]` \nlet me know i am here to help."^^ . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + "Scripts don't work in foreach when making a GET request"^^ . + "Issue with Multiple Laravel API Requests via cURL on Nginx in Laragon"^^ . + . + "2"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + "`it is supposed to show an error code such as 422`...is that what _you_ expect to happen in this case, or is that what the testers told you they expected?"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + "@YourCommonSense What else do you call it when I escape user input with `htmlspecialchars` before embedding it in a webpage? I have read and understand https://stackoverflow.com/a/130323/25634160."^^ . + "<p>I want to create a routine function in my project.\nI've created it in Laravel 10 with Alpine, Tailwind, Livewire and Flowbite.</p>\n<p><a href="https://i.sstatic.net/7ow6nJJe.png" rel="nofollow noreferrer">enter image description here</a></p>\n<p><a href="https://i.sstatic.net/6HXipqhB.png" rel="nofollow noreferrer">enter image description here</a></p>\n<p><a href="https://i.sstatic.net/kED6Hr8b.png" rel="nofollow noreferrer">enter image description here</a></p>\n<p>Which Laravel object do I use for this?</p>\n<p>Thank you for the reply and have a nice day. Viviane Le Hegaret</p>\n<p>None,I don't know to do that</p>\n"^^ . + . + . + . + "2"^^ . + . + . + . + "what did you try already? where are you stuck exactly"^^ . + "I needed `apt-get install php8.0-dev` as well, https://serverfault.com/a/213618/101107"^^ . + . + . + . + "1"^^ . + . + . + . + "3"^^ . + . + "1"^^ . + . + . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + "Your question is unclear, and the screenshot doesn't show as much as it could to be helpful. You say "there comes no new page" which doesn't make sense, but I assume you mean a new page isn't created... except that can't be the case, because your screenshot clearly shows a new page under what looks like the bottom of page 4. Are you simply saying you want the textbox to jump entirely to the new page if it overlaps the current page/footer?"^^ . + "1"^^ . + "Well I seem to have fixed this, but I am still a little short of answering my own question. I noticed that I had not included the PHP.ini file in the directory that included this script, and I'm not sure whether it was that change or including some error_log() statements in the file that suddenly made it start reporting the issues, which seemed to be down to attempting to use mysqli_free_result on two statements at once, and possibly also php 8+ being stricter on explicity declaring the data type for variables? Not sure about that bit though they may just have been warnings."^^ . + . + . + "0"^^ . + "Yes i want passing data from controller $datasubmit to the 'targetupload' select sheet '0' and then to 'targetheaderimport'"^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + "How does ASN.1 work in terms of encoding?"^^ . + . + . + . + . + . + . + . + "How to use the pagination in Laravel Livewire with the Functional version not class"^^ . + . + . + . + "0"^^ . + . + . + "Your question is unclear and it seems that you didn't really search… See: [Adding Fields to a Taxonomy Term](https://www.advancedcustomfields.com/resources/adding-fields-taxonomy-term/#categoryphp), [ACF get image from product term](https://stackoverflow.com/q/67675741/3730754) and [Display ACF field/image below the product title in WooCommerce archive pages](https://stackoverflow.com/a/52247896/3730754)"^^ . + . + "Sounds to me like this is a feature from Facebook. As your customers are using Facebook, you should keep it this way because it's none of your business. You may however give Facebook customers the tip that it's easier to login with Google, in case they are looking for options."^^ . + "<p>hmmm, there must be some issue with your traits of polices try the below solutions</p>\n<p><strong>Check If Policies or Gates Are Set Up Correctly</strong></p>\n<pre><code>dd(Auth::user()-&gt;can('view_permission_categories'));\n</code></pre>\n<p><strong>Ensure You're Using Laravel's Built-In Permission Handling</strong><br />\nIf you're using <strong>Spatie's Laravel Permissions Package</strong>, make sure you've set up your permissions correctly:</p>\n<pre><code>use Spatie\\Permission\\Traits\\HasRoles;\n\nclass User extends Authenticatable\n{\n use HasRoles;\n}\n</code></pre>\n<p><strong>Make sure permissions are registered in <code>app/Providers/AuthServiceProvider.php</code>:</strong></p>\n<pre><code>use Illuminate\\Support\\Facades\\Gate;\n\npublic function boot()\n{\n $this-&gt;registerPolicies();\n\n Gate::before(function ($user, $ability) {\n return $user-&gt;hasPermissionTo($ability) ? true : null;\n });\n}\n</code></pre>\n<p><strong>Check If Your Permission Syncing Is Correct</strong></p>\n<pre><code>dd(Auth::user()-&gt;getAllPermissions());\n</code></pre>\n<p><strong>Explicitly Check the Role (If Using Role-Based Permissions)</strong></p>\n<pre><code>@hasanyrole('admin|editor')\n &lt;li&gt;\n &lt;x-nav-link href=&quot;/permissioncategories&quot; :active=&quot;request()-&gt;is('permissioncategories')&quot;&gt;Permission Categories&lt;/x-nav-link&gt;\n &lt;/li&gt;\n@endhasanyrole\n</code></pre>\n<p>I hope from above you get your solution</p>\n<hr />\n"^^ . + . + . + . + . + "I'm guessing the problem on local is probably that you are accessing this via `localhost/mydomain.com/`, with an additional folder in the path. mod_dir's `DirectorySlash` is probably set to `on`, so it will try to redirect you from `localhost/mydomain.com` to `localhost/mydomain.com/` again."^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "<p>I setup TCExam ver. 16.3.7 in a server. There is no issue when config it with domain. E.g:</p>\n<p><code> define('K_PATH_HOST', 'http://localhost');</code></p>\n<p>). But when i would like to change it to IP, i could not login to it at all, no error displays as well. E.g:</p>\n<p><code> define('K_PATH_HOST', 'http://192.168.5.101');</code></p>\n<p>I take a look in the TCexam codes. It seems that all $_SESSIONS is lost when login then redirect to same page then still show login page:</p>\n<pre><code>File /tcexam/public/code/index.php includes tce_authorization.php file\n// Here is some parts of tce_authorization.php that i think has issue\n....\nif (! isset($pagelevel)) {\n // set default page level\n $pagelevel = 0;\n}\n.....\n// check user's level\n// pagelevel=0 means access to anonymous user\n// pagelevel &gt;= 1 // default 0 in this case\n// $_SESSION['session_user_level'] is lost change, always 0, should 10\nif ($pagelevel &amp;&amp; $_SESSION['session_user_level'] &lt; $pagelevel) {\n //check user level\n // To gain access to a specific resource, the user's level must be equal or greater to the one specified for the requested resource.\n F_login_form();\n //display login form\n}\n</code></pre>\n<p><strong>Updated</strong>: I found this ticket: <a href="https://github.com/tecnickcom/tcexam/issues/429" rel="nofollow noreferrer">https://github.com/tecnickcom/tcexam/issues/429</a>\nIt seem that is actually issue but i havent found the way to add workaround solution to resolve the issue yet.</p>\n<p>Anyone can help on this?</p>\n<p>Thanks,\nQuang.</p>\n"^^ . + . + "0"^^ . + . + . + . + . + . + "1"^^ . + "Disabling SSL is not an option, and AFACIS although OpCace gives error messages, it wasn't enabled to begin with. At least, adding `opcache.enable=0` didn't change anything."^^ . + "_Transaction_'s public function _setPaymentMethodId_ is missing the _return $this_ statement. PhpStorm resolves _return_ statements. If you would run that code in a test it should also throw as `: self` return type is violated on `void` return."^^ . + "1"^^ . + . + . + "@rozsazoltan it is not the best practice for retrieving data from the api i do use 1 request but for the purpuse of setting data per entry row there needs to be an request the external api doesnt allow bulk imports. also thanks for your quick response. the larger question is why does it give me the 503"^^ . + "twilio"^^ . + "Hi, nothing in the console.what kind of requests should i look for in network tab, for the requests that get the css styles, yes they are being made and data is coming, these css files are populated so i dont get why these styles aren't applying, i will attach these screenshots in the original post at the bottom"^^ . + "2"^^ . + . + . + "Thanks, this step-by-step but was what had me muddled."^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + "yes of course, recomended tag was php, so i added to mysql also. Opencart has to register options, account/register and checkout/register. mysql telephone cell is limited to 16 characters in customer table. I can validate telephone number in account/register without problem. but i can not use the same codes for validation in checkout/register (non numeric character and length of 10 digits). so customer can add non numeric characters to telephone cell by passing validation. to use preg_match, want to validate (non numeric character and length of 10 digits) in checkout/register"^^ . + . + "`php` and `php-cli` can be defined per-user, so it might help to figure out what those means when run by the web SAPI. Try running `var_dump(exec('which php'));` through this to see where it points, and maybe try it with `php-cli`, too"^^ . + "In API response some keys values are not coming as expected"^^ . + "Symfony and Doctrine: CreateQuery with LEFT JOIN from SUBQUERY"^^ . + . + "0"^^ . + . + "Do you mean you literally have `Andr\\xc3\\xa9` in the database? First, that's weird, second, it has nothing to do with Latin encoding."^^ . + . + "markdown"^^ . + . + . + "0"^^ . + . + . + . + "Are you sure this problem is related to PHP or Symfony? If you dump the query (or read it from the profiler) and run it directly in MySQL (or whichever database you use), is it also running slow? If yes, please share the execution plan"^^ . + . + . + . + "0"^^ . + . + "1"^^ . + "<p>I was able to resolve this. When i was disabling my anti-virus it was not disabling my HTTPS protection. once i went in and turned the <em><strong>HTTPS protection</strong></em> off every started working again.</p>\n<p>So in short check to see if your antivirus uses <em><strong>HTTPS protection</strong></em> if so make sure you disable or turn off then test.</p>\n"^^ . + . + . + "1"^^ . + "0"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + "<p>I'm working on come code that uses Smarty for templating. I have a php function that creates an array of strings, and this function is called from a Smarty { } block. Within that Smarty block I need to <em>separately</em> translate each string in the array (using <code>|@translate</code>) and then join/combine the elements of the array into a single comma-delimited string. I'd prefer to do this in a compact way.</p>\n<p>So, for example, if I have a php array containing <code>[&quot;Hello&quot;, &quot;beautiful&quot;, &quot;world&quot;]</code> and the translation is to French then the output string should be <code>&quot;Bonjour,beau,monde&quot;</code>.</p>\n<p>I'm sure this is simple but I'm new to php/smarty and I'm struggling to find a compact way to do this. I'd appreciate some help. Thanks!</p>\n"^^ . + . + . + "0"^^ . + . + "Your error message is to do with the view not seeing the variable `$count`, not the calling of the function `count()`."^^ . + "Please can you run `uname -a` and show the output?"^^ . + . + . + . + . + "web"^^ . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + "<p>I'm trying to rewrite this command (which works in phpMyAdmin) into Symfony and Doctrine.</p>\n<p><code>SELECT stand.name, if(count(checkins.id)&gt;0,true,false) as pocet_navstev FROM stand left join (select * from checkin where checkin.nickname_id=10) as checkins on (stand.id=checkins.stand_id) GROUP by stand.id;</code></p>\n<p>I tried writing it like this:</p>\n<pre><code> $mycheckins = $entityManager-&gt;createQueryBuilder(&quot;sub&quot;)\n -&gt;select(&quot;checkin.id, checkin.Nickname, checkin.Stand&quot;)\n -&gt;from(&quot;App\\Entity\\Checkin&quot;, &quot;checkin&quot;)\n -&gt;where(&quot;checkin.Nickname=10&quot;); \n \n $stands = $entityManager-&gt;createQueryBuilder(&quot;main&quot;)\n -&gt;select(&quot;stand.id&quot;, &quot;stand.Name&quot;, &quot;count(checkin.id)&quot;)\n -&gt;from(&quot;App\\Entity\\Stand&quot;, &quot;stand&quot;)\n -&gt;leftJoin(sprintf(&quot;(%s)&quot;, $mycheckins-&gt;getDQL()), &quot;checkins&quot;, &quot;WITH&quot;, &quot;stand.id=checkins.Stand&quot;) \n -&gt;groupBy(&quot;stand.id&quot;)\n -&gt;getQuery()\n -&gt;getResult();\n</code></pre>\n<p>But after running I get an error:</p>\n<p><code>[Semantical Error] line 0, col 80 near 'JOIN (SELECT': Error: Subquery is not supported here</code></p>\n<p>If I don't call -&gt;getQuery(), but pull the SQL using getDQL(), I get this:</p>\n<p><code>SELECT stand.id, stand.Name, count(checkin.id) FROM App\\Entity\\Stand stand LEFT JOIN (SELECT checkin.id, checkin.Nickname, checkin.Stand FROM App\\Entity\\Checkin checkin WHERE checkin.Nickname=10) checkins WITH stand.id=checkins.Stand GROUP BY stand.id</code></p>\n<p>How can I please rewrite my PHP code to make it work?</p>\n"^^ . + . + "<p>You have jumped over a few hoops.</p>\n<p>Let's catch up:</p>\n<p>You get the query from a folder: <a href="https://www.php-imap.com/api/folder" rel="nofollow noreferrer">https://www.php-imap.com/api/folder</a></p>\n<p>And you get folder/s from a client: <a href="https://www.php-imap.com/api/client" rel="nofollow noreferrer">https://www.php-imap.com/api/client</a></p>\n<p>The client you have already. &lt;- you are here</p>\n"^^ . + . + . + . + "Why can't I geo-localise a page from my website with functions.php in Wordpress?"^^ . + . + . + . + . + . + . + "0"^^ . + "<p>I want to convert my mysql database to handle emojis. I first ran the command:</p>\n<p>ALTER TABLE my_table CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;</p>\n<p>I then ran 3 experiments on the varchar field my_text_field of my_table:</p>\n<ol>\n<li><p>I executed: mysql_query(&quot;UPDATE my_table set my_text_field = '' where id = 1&quot;) -- from my own php script</p>\n</li>\n<li><p>I executed: mysql_query(&quot;UPDATE my_table set my_text_field = '' where id = 2&quot;) -- from inside myphpadmin</p>\n</li>\n<li><p>I made a form with a text field, pasted the character into it, submitted it, and executed:</p>\n</li>\n</ol>\n<p>mysql_query(&quot;UPDATE my_table set my_text_field = '{$_POST[&quot;message&quot;]}' where id = 3&quot;);</p>\n<p>When I now look at the 3 rows in phpmyadmin, I see 3 different results:</p>\n<p>For row 1, I see: ????<br />\nFor row 2, I see: <br />\nFor row 3, I see: &amp; #128512; (without the space after the &amp;)</p>\n<p>When I run my own php script to display the text field of the 3 rows:</p>\n<p>For row 1, I see: ????<br />\nFor row 2, I see: ?<br />\nFor row 3, I see: </p>\n<p>When I run a php script to tell me the length of each:</p>\n<p>For row 1, I get: 4<br />\nFor row 2, for LENGTH I get 4; for CHAR_LENGTH I get 1<br />\nFor row , I get: 9</p>\n<p>Any explanation of the differing results would be welcome. In particular:</p>\n<ol>\n<li>What do I need to do to make # 1 store the successfully?</li>\n<li>What do I need to do to make my php script display # 2 successfully?</li>\n<li>What is the difference between # 2 and # 3? What exactly is stored in # 2, in contrast to # 3? Is there a preference of one over the other? Why the different values for # 2, depending on LENGTH vs CHAR_LENGTH?</li>\n</ol>\n<p>EDIT: I added mysql_query(&quot;SET NAMES utf8mb4&quot;); and this has solved issues 1 and 2.</p>\n<p>So the emoji stored in rows 1 and 2 is the 4 utf8 characters: 240, 159, 152, 128 (the grinning face). Is there any difference between storing it that way and storing it as &amp; #128512; ? Are both acceptable? Is there any preference?</p>\n"^^ . + . + . + . + . + . + . + "3"^^ . + . + . + . + . + . + . + . + . + . + "sftp"^^ . + "<p>I am working on a blogging application in Laravel 8.</p>\n<p>There is the option to add tags to articles. There is a many-to-many relationship between articles and tags. I have an <code>article_tag</code> pivot table.</p>\n<p>In the <code>Tag</code> model I have:</p>\n<pre><code>class Tag extends Model\n{\n use HasFactory;\n\n protected $fillable = ['name'];\n\n public function articles()\n {\n return $this-&gt;belongsToMany(Article::class);\n } \n}\n</code></pre>\n<p>To the <code>Article</code> model I have added the <code>tags()</code> method</p>\n<pre><code>public function tags()\n{\n return $this-&gt;belongsToMany(Tag::class)-&gt;as('tags');\n}\n</code></pre>\n<p>I the ArticleController controller, I have two methods for editing and updating an article:</p>\n<pre><code>public function edit($id)\n {\n $article = Article::find($id);\n $attached_tags = $article-&gt;tags()-&gt;get()-&gt;pluck('id')-&gt;toArray();\n \n return view(\n 'dashboard/edit-article',\n [\n 'categories' =&gt; $this-&gt;categories(),\n 'tags' =&gt; $this-&gt;tags(),\n 'attached_tags' =&gt; $attached_tags,\n 'article' =&gt; $article\n ]\n );\n}\n\npublic function update(Request $request, $id)\n{\n $validator = Validator::make($request-&gt;all(), $this-&gt;rules, $this-&gt;messages);\n\n if ($validator-&gt;fails()) {\n return redirect()-&gt;back()-&gt;withErrors($validator-&gt;errors())-&gt;withInput();\n }\n\n $fields = $validator-&gt;validated();\n $article = Article::find($id);\n\n // If a new image is uploaded, set it as the article image\n // Otherwise, set the old image...\n if (isset($request-&gt;image)) {\n $imageName = md5(time()) . Auth::user()-&gt;id . '.' . $request-&gt;image-&gt;extension();\n $request-&gt;image-&gt;move(public_path('images/articles'), $imageName);\n } else {\n $imageName = $article-&gt;image;\n }\n\n $article-&gt;title = $request-&gt;get('title');\n $article-&gt;short_description = $request-&gt;get('short_description');\n $article-&gt;category_id = $request-&gt;get('category_id');\n $article-&gt;tags[] = $request-&gt;get('tags[]');\n $article-&gt;featured = $request-&gt;has('featured');\n $article-&gt;image = $request-&gt;get('image') == 'default.jpg' ? 'default.jpg' : $imageName;\n $article-&gt;content = $request-&gt;get('content');\n // Save changes to the article\n $article-&gt;save();\n\n //Attach tags to article\n if (isset($request-&gt;tags)) {\n $article-&gt;tags()-&gt;sync($request-&gt;tags);\n } else {\n $article-&gt;tags()-&gt;sync([]);\n }\n\n return redirect()-&gt;route('dashboard.articles')-&gt;with('success', 'The article titled &quot;' . $article-&gt;title . '&quot; was updated');\n}\n</code></pre>\n<p>In <code>edit-article.blade.php</code>, I use a <em>multiselect</em> element to assign tags to articles:</p>\n<pre><code>&lt;div class=&quot;row mb-2&quot;&gt;\n &lt;label for=&quot;tags&quot; class=&quot;col-md-12&quot;&gt;{{ __('Tags') }}&lt;/label&gt;\n\n &lt;select name=&quot;tags[]&quot; id=&quot;tags&quot; class=&quot;form-control&quot; multiple=&quot;multiple&quot;&gt;\n @foreach ($tags as $tag)\n &lt;option value=&quot;{{ $tag-&gt;id }}&quot;\n {{ in_array($tag-&gt;id, $attached_tags) ? 'selected' : '' }}&gt;{{ $tag-&gt;name }}&lt;/option&gt;\n @endforeach\n &lt;/select&gt;\n&lt;/div&gt;\n</code></pre>\n<p>The problem I am faced with is that when I edit the tags list, the <code>&lt;select&gt;</code> element above does not keep the selected tags if the form is invalid because of validation errors on <em>other</em> form fields.</p>\n<p>Where is my mistake?</p>\n"^^ . + . + . + . + "How to Run WebSocket server.php on VPS"^^ . + . + . + "0"^^ . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + . + "<p>GeeseFS allows to mount S3 as unix filesystem but with Laravel Nova it does not work.</p>\n<p>After turning on throwing filesystem exceptions in Laravel config/filesystems.php, parameter throw =&gt; true</p>\n<p>Chrome debugger showed that exception is was thrown after call to chmod(). GeeseFS documentation says that chmod is not supported. Big Problem.</p>\n<p>However, I found that I can remove 'visibility' parameter in this config file config and problematic chmod() will not be called!</p>\n<p>In GeeseFS access rights in are specified when you mount filesystem anyway.</p>\n"^^ . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + "0"^^ . + "jwt"^^ . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + "If that's working, my recommendation is to try just redownloading 7.4 and see if it just magically starts working. I'd strongly recommend against trying to share a php.ini file. The little amount that that should need to change doesn't outweigh the potential badness from sharing that could occur, at least in my mind. If you need to override a ini setting for site, there's often a local equivalent you can use, either in .htaccess or .user.ini or similar."^^ . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "2"^^ . + "0"^^ . + "@ewokx I edited my question with this information."^^ . + "1"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + "PHP page crashes when pulling an email from my sql table"^^ . + . + "Can you try to see if provding the correct environment variables manually [as described here](https://laravel.com/docs/11.x/processes#environment-variables) has a different outcome?"^^ . + . + . + . + "I have successfully run the "Hello World" program from PHP. It is only when the my other c program trys to access the MYSQL database it fails with no output except the error code."^^ . + "Modify the Laravel Herd configuration to automatically resolve requests without the .php extension"^^ . + . + "PHP was born as a templating engine (and it still is), that's why you have `<?php` tag in the first place: the PHP interpreter returns as-is any stream of bytes it's fed with, and only when it detects a PHP code block it starts executing PHP code. PHP has [dedicated extensions to generate valid XML](https://www.php.net/manual/en/refs.xml.php). If you choose to generate XML via string concatenation you need to handle all the logic yourself."^^ . + . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + "<p>This looks like a known issue and is undergoing active development</p>\n<h3><a href="https://make.wordpress.org/core/2024/10/21/i18n-improvements-6-7/" rel="nofollow noreferrer">Internationalization improvements in 6.7</a></h3>\n<ul>\n<li><a href="https://core.trac.wordpress.org/ticket/62175" rel="nofollow noreferrer">#62175 closed defect (bug) (duplicate) PHP Notice in WP 6.7: _load_textdomain_just_in_time was called incorrectly</a></li>\n<li><a href="https://core.trac.wordpress.org/ticket/44937" rel="nofollow noreferrer">#44937 closed enhancement (fixed)\nAdd _doing_it_wrong to load_plugin_textdomain</a></li>\n</ul>\n"^^ . + "1"^^ . + "0"^^ . + "0"^^ . + . + "Add a custom field to Woocommerce Checkout Blocks and get the value"^^ . + . + . + "Cannot get laravel 7.0 + mongodb + jensseger to work"^^ . + "Your approach could have worked but you misplaces braces. This one would work `while (($data = fgetcsv($openCsv)) !== FALSE && ($valid !== true))` but what you really need is `break`."^^ . + . + "`Another post said definitively`...what was that post, and why? Let us take a look for ourselves. Maybe that had a specific reason. Or maybe they're just very opinionated. We don't know. And we don't know your use cases so we can't decide for you. There's nothing wrong with storing the data in HTML format _if that's what you find useful_"^^ . + "2"^^ . + . + . + "1"^^ . + . + . + . + . + . + . + . + "2"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + "product-variations"^^ . + . + "shopify"^^ . + . + "1"^^ . + "3"^^ . + "`nowadays any artificial intelligence can build something like this for you`...possibly, but equally it makes a lot of silly mistakes which people then come here to get real experts to fix for them. It's not really production-ready, just yet. The internet is awash with short PHP scripts for building emails already, even without AI, and they may appear to fulfil their specific purpose..."^^ . + "How to deploy a PHP application from XAMPP to a public domain with HTTPS?"^^ . + . + . + . + . + "1"^^ . + "0"^^ . + . + "Laravel and Javascript: strange bug while updating article-tags many-to-many relationship"^^ . + "If you can give us example code and data which does what you're claiming, we'll be more than happy to try and help you fix it. You say this is happening in your own code, so it should not be that tricky to boil it down to enough code in a phpize sandbox to make the same thing happen, so we can see it. But until we have that code to work with, there's nothing for us to fix. Thanks."^^ . + . + "1"^^ . + "1"^^ . + . + . + . + "Please post a [mcve] instead of what looks like minimised php/html"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + "i experiment your codes, why (?i)[a-z](?:[a-z '.,-]*) without $ at the end allow other special characters?"^^ . + "<p>I managed to create a front-end using svelte, and I have a backend which includes an api.php file, a db.php file (accesses the database) and my create.sql. that's it.</p>\n<p>I cannot for the life of me get apache to serve both of these things simultaneously.</p>\n<p>Currently, if i go to my domain/backend/api.php, I'm just getting a database connection failed issue, and then a dump of my php code. this file is being interpreted as html/text</p>\n<pre><code>Database connection failed2', 'details' =&gt; $e-&gt;getMessage() ]); exit; } // Determine the path $request_uri = $_SERVER['REQUEST_URI']; $script_name = $_SERVER['SCRIPT_NAME']; // Remove query string $request_uri = strtok($request_uri, '?'); // Remove the script name from the URI $path_info = substr($request_uri, strlen($script_name)); // etc etc it goes for a while\n</code></pre>\n<p>Before you say anything, yes my db is accessible. I created the right user, my credentials are in order, I've tested accessing it (3306) from my sites ip and domain and it does work. Furthermore, if I go to my public ip/backend/api.php, it gives me the correct response. But if I just go to my ip, where my front-end homepage should be, its just the apache test home page.</p>\n<p>So basically, my domain cannot host any backend files, and my public ip cannot host any front-end files.</p>\n<p>Yes I'm using cloud flare, it was proxying my domain name, I have since turned it off and no change has occurred.</p>\n<p>I've tweaked with my vhost configuration 1000 times with no success, I have no idea if this is the culprit or not.</p>\n<p>I've allowed sql connections both in my firewall and in my oracle security lists, and like I said everything works perfectly fine when I use my public ip, so it must be the difference in how I'm serving files or something? I really don't know. I've been trying to fix this for 3 days</p>\n<p>furthermore originally in my svelte config file i was using adapter static but I have since changed to the node one.</p>\n<p>My relevant file structure is below:</p>\n<pre><code>HTML [SSH: my public ip]\n├── svelte-kit\n├── backend\n│ └── database\n│ ├── create.sql\n│ ├── api.php (M)\n│ └── db.php\n├── src\n│ ├── lib\n│ └── routes\n│ ├── backend\n│ ├ └─ api.php\n│ ├ └── +server.ts (U)\n│ ├── about\n│ ├── login\n│ ├── +page.svelte (U)\n│ ├── navigation\n│ ├── projects\n│ ├── +layout.js\n│ ├── +layout.svelte\n│ └── +page.svelte (M)\n│ ├── app.css\n│ ├── app.html\n├── svelte.config.js (M)\n└── vite.config.ts (M)\n</code></pre>\n<p>Im aware I have two backend directories, one contains a server.ts which is supposed to create some sort of alias or something for /backend to help apache recognize it and serve it separately? I don't really know the specifics im just trying everything that's recommended to me.</p>\n<p>Below is my vhost configuration:</p>\n<pre><code>&lt;VirtualHost *:80&gt;\n ServerName mydomain.com\n ServerAlias www.mydomain.com\n\n # Redirect all HTTP traffic to HTTPS\n RewriteEngine On\n RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]\n\n ErrorLog /var/log/httpd/http_error_log\n CustomLog /var/log/httpd/http_access_log combined\n&lt;/VirtualHost&gt;\n\n&lt;VirtualHost *:443&gt;\n ServerName mydomain.com\n ServerAlias www.mydomain.com\n\n SSLEngine on\n SSLCertificateFile /etc/httpd/ssl/server.crt\n SSLCertificateKeyFile /etc/httpd/ssl/server.key\n\n SSLProtocol -all +TLSv1.2 +TLSv1.3\n SSLCipherSuite &quot;IDK IF THIS IS SENSITIVE INFORMATION&quot;\n SSLHonorCipherOrder off\n\n DocumentRoot /var/www/html\n\n &lt;Directory &quot;/var/www/html&quot;&gt;\n Options -Indexes +FollowSymLinks\n AllowOverride All\n Require all granted\n &lt;/Directory&gt;\n\n # Lock down /backend before the catch-all\n &lt;Location /backend&gt;\n ProxyPass !\n &lt;/Location&gt;\n\n # Alias /backend/ to the actual backend folder so Apache can serve PHP files\n Alias /backend/ /var/www/html/backend/\n &lt;Directory &quot;/var/www/html/backend&quot;&gt;\n Options Indexes FollowSymLinks\n AllowOverride All\n Require all granted\n &lt;FilesMatch &quot;\\.php$&quot;&gt;\n SetHandler application/x-httpd-php\n &lt;/FilesMatch&gt;\n &lt;/Directory&gt;\n\n # Proxy remaining requests (i.e., the frontend) to the SvelteKit server\n ProxyPreserveHost On\n ProxyRequests Off\n ProxyPass / http://127.0.0.1:5173/\n ProxyPassReverse / http://127.0.0.1:5173/\n\n # WebSocket configuration for SvelteKit (if needed)\n RewriteEngine On\n RewriteCond %{HTTP:Upgrade} websocket [NC]\n RewriteCond %{HTTP:Connection} upgrade [NC]\n RewriteRule ^/?(.*) &quot;ws://127.0.0.1:5173/$1&quot; [P,L]\n\n ErrorLog /var/log/httpd/ssl_error_log\n CustomLog /var/log/httpd/ssl_access_log combined\n&lt;/VirtualHost&gt;\n</code></pre>\n<p>Someone said the issue was cause svelte is trying to take care of the files instead of apache which makes it break cause svelte can't handle php, so I tried making it so svelte apache handles the php, but it's not working.</p>\n<p>Below is the way I deploy my script:</p>\n<pre><code>[opc@portfolio-web-server html]$ sudo cat ../../../deploy.sh\n#!/bin/bash\ncd /var/www/html\nsudo pm2 stop all\nsudo pm2 delete all\nsudo npm run build\nsudo pm2 start npm -- run preview -- --host 0.0.0.0 --port 5173\nsudo pm2 save\n[opc@portfolio-web-server html]$ \n</code></pre>\n<p>It may also be cause I'm deploying with npm run preview? But I was told this is fine for super small projects and stuff.</p>\n<p>Please help me fix this.</p>\n"^^ . + "0"^^ . + . + . + . + . + . + . + "It works. Happy to see a detailed explanation and accept an answer"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + "laravel-10"^^ . + . + . + . + . + . + . + "General style comment: Use `elseif ...` rather than `else { if ... }` so you don't get such deep nesting."^^ . + . + . + "0"^^ . + . + . + . + . + "2"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + . + . + "@ADyson I have adjusted the text of my answer in order to avoid such an assumption. But the question is still valid, because even if the op did not provide us the info whether the file was actually uploaded, we know that it needs to be double-checked, the situation needs to be treated as a potential security issue of allowing malicious uploads until it is double-checked, in which case it may turn out to be a false alarm. The reason for my original interpretation (with which I still personally agree) is that the testers claimed that it's penetrable."^^ . + . + . + . + . + "well that's what i've concluded i think, i just need to store it and retrieve it so serialize must be the answer right? what's var_export for anyway? i thought maybe i could export to a php file as a variable and just load that file with require or include"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + "if postman is working than there is something different on the slack request. try to log the headers sent from both sources, and what HTTP method is being used"^^ . + . + . + "1"^^ . + "<p>In my Wordpress site, each user has a meta data key (i.e., &quot;saved&quot;) which contains a list of post IDs stored as an array. The list is updated everytime the user clicks the &quot;save&quot; button of a post. The saving process is done using AJAX request.</p>\n<p>The problem is that when I click the &quot;save&quot; buttons of multiple posts at the same time (without waiting each request to finish), I find that only the post ID of last clicked button is added to the list, despite that the other buttons have properly finished their requests without errors.</p>\n<p>How to solve this confusing problem?</p>\n<p>below is the php function</p>\n<pre><code>function add_postID_to_user_saved_list($post_id) {\n $saved = get_user_meta( get_current_user_id(), 'saved', true );\n if ( empty($saved) ) {\n $saved = [$post_id];\n } else {\n $saved[] = $post_id;\n }\n if ( !update_user_meta( get_current_user_id(), 'saved', $saved ) ) {\n add_user_meta( get_current_user_id(), 'saved', $saved, true );\n }\n}\n</code></pre>\n"^^ . + "@KIKOSoftware Unlike anonymous _functions_, which can be passed around as objects which have "invokable" behaviour, _classes_ in PHP are identified by their name throughout the internal implementation, so "anonymous" classes do in fact have a name generated for them by the compiler - [here's the implementation of `zend_generate_anon_class_name`](https://heap.space/xref/php-src/Zend/zend_compile.c?r=2042fd34#8997)."^^ . + . + . + "0"^^ . + . + "0"^^ . + . + "2"^^ . + . + . + "This can't come from HTML or CSS changes..."^^ . + . + "The code I pasted is the version I was provided with. I already added XSS protection using htmlspecialchars to print the content of database in table like this :\n`echo "<td>" . htmlspecialchars($row['id']) . "</td>";`\nI also added some handling of connection and query errors but last part of assignment I was left with that confused me was "Add protection against SQL Injection." Guess I will point out that the code is already SQL Injection proof and prepare modified example to show that I can use prepared statements if that is what they whanted to check."^^ . + "1"^^ . + "0"^^ . + . + . + "+1 to highlight the array notation for form fields. this way is also much easier to filter inputs with and other things -- apart from the sum operation."^^ . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + "0"^^ . + "Thanks. So you're using the php "mail" function. A simple Google search for "php mail bcc" gets you the answer from many many places. The nominated duplicate question is just one. What research did you do before posting?"^^ . + . + . + "If http://localhost:8000/ is working then that is your working base-url Set that in the configuration."^^ . + . + "0"^^ . + . + . + . + "0"^^ . + "Since you're dealing with valid HTML, why would you want to use a regex?"^^ . + . + . + "1"^^ . + . + "<p>You are making - maybe unintentionally - multiple replacements in the same string, which also includes replacements that already took place. This behavior is even mentioned in the <a href="https://www.php.net/manual/en/function.str-replace.php#refsect1-function.str-replace-notes" rel="nofollow noreferrer">documentation of <code>str_replace()</code></a>:</p>\n<blockquote>\n<p><em>Caution</em></p>\n<p><strong>Replacement order gotcha</strong></p>\n<p>Because <code>str_replace()</code> replaces left to right, it might replace a previously inserted value when doing multiple replacements. See also the examples in this document.</p>\n</blockquote>\n<p>Check the following source code:</p>\n<pre><code>$healthy = array(&quot;strasse&quot;, &quot;straße&quot;,&quot;.&quot;, &quot;str&quot; );\n$yummy = array(&quot;str. &quot;, &quot;str. &quot;, &quot;&quot;, &quot;str. &quot;);\n$tmp = str_replace($healthy, $yummy, 'südendstrasse');\n\n</code></pre>\n<p>In the first run, it will replace the <code>&quot;strasse&quot;</code> with <code>&quot;str. &quot;</code>:</p>\n<pre><code> &quot;südendstrasse&quot; -&gt;\n &quot;südendstr. &quot;\n</code></pre>\n<p>Then it replaces the <code>&quot;.&quot;</code> with an empty string, removing it:</p>\n<pre><code> &quot;südendstr. &quot; -&gt;\n &quot;südendstr &quot;\n</code></pre>\n<p>Already there you have a space at the end. And then it replaces <code>&quot;str&quot;</code> with <code>&quot;str. &quot;</code>:</p>\n<pre><code> &quot;südendstr &quot; -&gt;\n &quot;südendstr. &quot;\n</code></pre>\n<p>Now you have the resulting string <code>&quot;südendstr. &quot;</code> with two spaces at the end. And this is not in the input string <code>&quot;südendstr. 13a&quot;</code>:</p>\n<pre><code>&quot;südendstr. 13a&quot;\n&quot;südendstr. &quot;\n ^\n |\n +--- (mismatch, so no position found)\n</code></pre>\n"^^ . + . + . + "How to get custom variable price if bought in bulk?"^^ . + . + "-1"^^ . + . + . + "1"^^ . + "<p>I suggest to describe the recursive part (using named subpatterns) but to replace one condition at once using <code>preg_replace</code> count parameter to control a <em>do...while</em> loop:</p>\n<pre><code>$str = 'IF(1&gt;10, &quot;Large&quot;, &quot;Medium&quot;)\nIF(1&gt;10, IF(44&gt;20, &quot;Large&quot;, &quot;Medium&quot;), &quot;Small&quot;)\nIF(1&gt;10, IF(44&gt;20, &quot;Large&quot;, IF(4&lt;5, &quot;Tiny&quot;, &quot;Medium&quot;)), &quot;Small&quot;)\nIF(A1&gt;10, IF(A1&gt;20, &quot;Large&quot;, IF(A1&lt;5, &quot;Tiny&quot;, &quot;Medium&quot;)), &quot;Small&quot;)';\n\n$pattern =&lt;&lt;&lt;'REGEX'\n~\n# subpatterns\n(?&lt;string&gt; &quot; [^&quot;\\\\]*+ (?s: \\\\. [^&quot;\\\\]* )*+ &quot; ){0}\n(?&lt;nparens&gt; \\( [^&quot;()]*+ (?: \\g&lt;string&gt; [^&quot;()]* | \\g&lt;nparens&gt; [^&quot;()]* )*+ \\) ){0}\n(?&lt;other&gt; [^&quot;()\\s,] (?: [^&quot;(),]* [^&quot;()\\s,])? ){0}\n(?&lt;part&gt; (?: \\g&lt;string&gt; | \\g&lt;nparens&gt; | \\g&lt;other&gt; )* ){0}\n\n# main pattern\nIF\\( \\s* (\\g&lt;part&gt;) \\s* , \\s* (\\g&lt;part&gt;) \\s*, \\s* (\\g&lt;part&gt;) \\s* \\)\n~x\nREGEX;\n\n$replacement = '($5) ? ($6) : ($7)';\n\ndo {\n $str = preg_replace($pattern, $replacement, $str, -1, $count);\n} while ($count);\n\necho $str;\n</code></pre>\n<p><a href="https://3v4l.org/SDYiO#v8.4.5" rel="nofollow noreferrer">demo</a></p>\n"^^ . + . + . + "0"^^ . + "In case you're looking for useful ad-hoc functions for what I mentioned, some references: [PHP: stream_copy_to_stream - Manual (php.net)](https://www.php.net/manual/en/function.stream-copy-to-stream.php) , [PHP: tmpfile - Manual (php.net)](https://www.php.net/manual/en/function.tmpfile.php) and [PHP: rewind - Manual (php.net)](https://www.php.net/manual/en/function.rewind.php) -- this allows you to separate issues that are related to invoking ffmpeg from those that are about the data-transfer to the remote API."^^ . + . + . + "1"^^ . + "1"^^ . + . + "1"^^ . + . + . + "2"^^ . + . + . + . + . + . + "I think I'll have to go back to a previous version, but it sucks that I'll have to do that every time this happens"^^ . + . + . + . + . + . + "2"^^ . + . + . + . + "Anonymous classes do not have names. Therefore an explanation that gives them random names isn't a very good one. Rather, think of a class as having a location in the program, where the class is defined. That location is unique, and if you think about it, names are nothing more than easy placeholders for those locations. This is similar to how domains work for IP addresses."^^ . + "If you check the content of those static files, with your browser, you'll see that you actually get an HTML file, not the requested static files. So, they're probably not located where you think they are."^^ . + . + "My guess is that you found your internal IP, not your public IP. If you want to allow the public to access this, the DNS records need to point to your public IP. If you don't know your public IP, there's a good chance you are on DHCP then, which means it might change over time. The public IP will only point to the router, however, so you then need to tell the router how to route certain requests to a specific computer on your network."^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + "7"^^ . + . + "1"^^ . + "<p>You can do a little postprocessing: if the string ends in a space and a single number, then remove the space. A simple regular expression can do this. If the pattern in the expression doesn't match because there is a space and two numbers then nothing happens.</p>\n<p>The expression is <code>preg_replace('/ (\\d)$/', '\\1', $imploded)</code>, with the pattern <code>/ (\\d)$/</code> which means 'a space, then a match group with one digit <code>\\d</code>, then the end of the string <code>$</code>', and <code>\\1</code> means 'replace the entire pattern with the contents of the first match group', which in this case is the digit that was matched. So the space is matched but not replaced, therefore the space is effectively removed if the pattern matches.</p>\n<p>Example in the terminal:</p>\n<pre><code>$ php -a\nphp &gt; $mystring = &quot;2233444&quot;;\nphp &gt; $imploded = implode(&quot; &quot;, str_split($mystring, 2));\nphp &gt; $combined = preg_replace('/ (\\d)$/', '\\1', $imploded);\nphp &gt; echo $combined;\n22 33 444\nphp &gt; $mystring = &quot;22334455&quot;;\nphp &gt; $imploded = implode(&quot; &quot;, str_split($mystring, 2));\nphp &gt; $combined = preg_replace('/ (\\d)$/', '\\1', $imploded);\nphp &gt; echo $combined;\n22 33 44 55\n</code></pre>\n"^^ . + . + . + . + "1"^^ . + "Please add all clarification **to your question** by editing it. If you insist of skipping JS (which is fine to me), what else did you try? You've shared a `<meta>` tag so far, but haven't explained why this is not working as expected"^^ . + . + . + . + "<p><code>=(.+?)=</code> - the <code>=</code> match the &quot;outer&quot; of the double <code>==</code> here, but then <code>.+</code> still allows <code>=</code> in that position as well.</p>\n<p><a href="https://regex101.com/r/B2xjxj/1" rel="nofollow noreferrer"><code>(?&lt;!=)=([^=]+)=(?!=)</code></a> should do the trick.</p>\n"^^ . + . + "0"^^ . + . + "When you already edited all those services, what prevents you from creating another subclass that extends the original external class (and optionally uses that trait) and have all your services extend from your service base? As your example with the trait show, that would have sufficed in the first place. The new name also makes it easy to keep on replacing things in the future in case you can't get your fixes upstream."^^ . + "Already done a while ago. I have run into a lot of warnings and error back when I was installing laravel. Though I havent created a database yet there was an error about it. In my .env DB_DATABASE I leave it blank. Is that also causing the issue?"^^ . + . + . + . + . + . + "2"^^ . + . + "-1"^^ . + . + . + "0"^^ . + "0"^^ . + "2"^^ . + . + "<p>I would like to count each multiple of the items in an array returned from a SQL query:<br />\n<code>$results = $stmt-&gt;fetchALL(PDO::FETCH_ASSOC);</code>.<br />\nSo if there are 5 instances of John and 3 of Sue in the db, then I can print 5 and 3.\nFor example:</p>\n<pre><code>foreach ($results as $row)\n{\n$name = $row[&quot;name&quot;];\n$age = $row[&quot;age&quot;];\n\necho '&lt;tr&gt;';\necho '&lt;td&gt;' . $name . '&lt;/td&gt;&lt;td&gt;' . $age . '&lt;/td&gt;&lt;td&gt;' . $count . '&lt;/td&gt;';\necho '&lt;/tr&gt;';\n</code></pre>\n<p>The database:</p>\n<pre><code>name: charlie age: 47 \nname: charlie age: 23 \nname: charlie age: 59 \nname: susan age: 44 \nname: chris age: 19 \nname: susan age: 23 \nname: bob age: 50 \n</code></pre>\n<p>For <code>$count</code> I would like the output to be the number of times each name shows up:</p>\n<pre><code>name age count\ncharlie 47 3\ncharlie 23 \ncharlie 59 \nsusan 44 2\nchris 19 1\n</code></pre>\n<p>And so on.</p>\n<p>I tried using <code>print_r array_count_values($results);</code> to ill effect. All that printed back to me was: &quot;array_count_values(): Can only count string and integer values, entry skipped&quot;. I'm not sure exactly why it comes back w/ that message, since the db only has strings and ints. Is it the way <code>$results</code> is made?</p>\n"^^ . + "1"^^ . + "1"^^ . + "<p>It sounds like you need to properly associate the post’s thumbnail (featured image) with the WooCommerce product image when creating the product. Here’s how you can modify your existing code to ensure the post’s featured image is correctly set as the product’s main image:</p>\n<p><strong>Key Fix:</strong>\n• Retrieve the post’s featured image ID using <code>get_post_thumbnail_id($post_id)</code>.\n• Assign it to the WooCommerce product using <code>set_post_thumbnail()</code></p>\n<pre><code>function create_woocommerce_product_on_publish($post_id) {\n// Check if this is a valid save action\nif (wp_is_post_revision($post_id) || wp_is_post_autosave($post_id)) {\n return;\n}\n\n// Get the post type\n$post = get_post($post_id);\nif ($post-&gt;post_type !== 'your_custom_post_type') { // Replace with your actual post type\n return;\n}\n\n// Get the featured image ID\n$thumbnail_id = get_post_thumbnail_id($post_id);\n\n// Check if the product already exists\n$existing_product = get_page_by_title($post-&gt;post_title, OBJECT, 'product');\nif ($existing_product) {\n return; // Prevent duplicate product creation\n}\n\n// Create a new WooCommerce product\n$product = new WC_Product_Simple();\n$product-&gt;set_name($post-&gt;post_title);\n$product-&gt;set_description($post-&gt;post_content);\n$product-&gt;set_regular_price('19.99'); // Set a default price, adjust as needed\n$product-&gt;set_status('publish'); // Publish the product\n$product-&gt;set_catalog_visibility('visible'); // Make it visible in the shop\n\n// Set the product's featured image (if available)\nif ($thumbnail_id) {\n $product-&gt;set_image_id($thumbnail_id);\n}\n\n// Save the product\n$product_id = $product-&gt;save();\n\n// Set the post thumbnail (as WooCommerce product image)\nif ($thumbnail_id) {\n set_post_thumbnail($product_id, $thumbnail_id);\n}\n</code></pre>\n<p>}</p>\n<p>add_action('publish_your_custom_post_type', 'create_woocommerce_product_on_publish');</p>\n"^^ . + "<p>Here is a regex based approach. We can form an alternation of all area codes, then build a regex. Note that more specific (i.e. longer) area codes come first in the alternation.</p>\n<pre class="lang-php prettyprint-override"><code>$area_codes = array(\n '015019',\n '015020',\n '015180',\n '015181',\n '015182',\n '015183',\n '015184',\n '015185',\n '01511',\n '01512',\n '01514',\n '01515',\n '01516',\n '01517'\n);\n$regex = &quot;/^(&quot;.implode(&quot;|&quot;, $area_codes).&quot;)(\\d+)$/&quot;;\n$input = &quot;015169999999&quot;;\npreg_match($regex, $input, $matches);\necho &quot;area code: &quot; . $matches[1] . &quot;\\n&quot;;\necho &quot;number: &quot; . $matches[2];\n</code></pre>\n<p>This prints:</p>\n<pre><code>area code: 01516\nnumber: 9999999\n</code></pre>\n<p><strong>Edit:</strong></p>\n<p>As a workaround in case the resulting alternation might exceed the compiled PCRE limit, we can fallback to checking one prefix/postfix at a time:</p>\n<pre class="lang-php prettyprint-override"><code>$input = &quot;015169999999&quot;;\nforeach ($area_codes as $area_code) {\n $regex = &quot;/^(&quot; . $area_code . &quot;)(\\d+)$/&quot;;\n if (preg_match($regex, $input, $matches)) {\n echo &quot;area code: &quot; . $matches[1] . &quot;\\n&quot;;\n echo &quot;number: &quot; . $matches[2];\n }\n}\n</code></pre>\n"^^ . + . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + "shopware"^^ . + "<p>On my Windows 10 machine, I run some PHP scripts that call API functions on a game, Torn. Torn allows and encourages the call of such API.</p>\n<p>Since a few days, all my command line scripts stopped working from my machine.</p>\n<p>I verified this both running them from the command line, and setting a quick web server with php -s</p>\n<p>Both modalities were working earlier.</p>\n<p>The scripts running on a separate websites still work.</p>\n<p>I suspect the cause may be a recent Windows update.</p>\n<p>What am I doing wrong, and how do I fix this?</p>\n<p>I tried with PHP version 7.4.6 and 8.4.4, CLI, NTS, x64</p>\n<p>Here is the code, and the result:</p>\n<pre><code>&lt;?php\n\n$jsonurl = &quot;https://api.torn.com/faction/16335?selections=basic&amp;key=aaa&quot;;\n$json = file_get_contents( $jsonurl ) ; //gets output of API\n$decodedString = json_decode( $json, true ) ; //parses API JSON output\nprint_r( $decodedString ) ;\n?&gt;\n\n\nPHP Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in C:\\Users\\borre\\OneDrive\\work\\torn\\apitest.php on line 4\n\nWarning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in C:\\Users\\borre\\OneDrive\\work\\torn\\apitest.php on line 4\nPHP Warning: file_get_contents(): Failed to enable crypto in C:\\Users\\borre\\OneDrive\\work\\torn\\apitest.php on line 4\n\nWarning: file_get_contents(): Failed to enable crypto in C:\\Users\\borre\\OneDrive\\work\\torn\\apitest.php on line 4\nPHP Warning: file_get_contents(https://api.torn.com/faction/16335?selections=basic&amp;key=aaa): failed to open stream: operation failed in C:\\Users\\borre\\OneDrive\\work\\torn\\apitest.php on line 4\n\nWarning: file_get_contents(https://api.torn.com/faction/16335?selections=basic&amp;key=aaa): failed to open stream: operation failed in C:\\Users\\borre\\OneDrive\\work\\torn\\apitest.php on line 4\n</code></pre>\n"^^ . + . + "0"^^ . + . + . + . + "1"^^ . + . + "Okay, you manage to bring the server down by that route. As the console is not reporting this, I suspect this triggers a fatal error somehow in the server. I'd try with a step debugger and verify if the /test closure is entered at all and then until which line it executes."^^ . + . + "1"^^ . + "<p>What you show makes no sense. Regardless the Laravel version (as somebody pointed out is way outdated) a variable that equals the text is the same as writing the test.</p>\n<p>If I assume that you have this code in your Controller, both should be in the same function and then send them to the view.</p>\n<p>LiveProductController should look like this (I'd prefer this query instead):</p>\n<pre><code>public function getCode() {\n $code = 'Test123';\n $product = LiveProducts::query()\n -&gt;where('code', $code)\n -&gt;first();\n return view('liveproducts.index', compact('product'));\n}\n</code></pre>\n<p>Then your liveproducts.blade.index should be able to access the variable thru blade</p>\n<pre><code>{{ $product }}\n</code></pre>\n"^^ . + "Default Image for Uploading a File?"^^ . + . + . + . + "2"^^ . + . + . + . + . + . + "There's an error: Syntax error or access violation: 10757 [Microsoft][ODBC SQL Server Driver][SQL Server]The function 'STRING_AGG' may not have a WITHIN GROUP clause."^^ . + "Ok. That isn't quite what you said in the question originally, but at least you have updated it. So then...if your goal is to run it via the subdomain, and you're having trouble with that, then you need to provide some specific details about exactly how you've set it up, and exactly what error / unexpected behaviour occurs when you run it. Unsurprisingly, nobody can fix vaguely-described problems in unseen code/config. See also [ask] and how to proide a [mre] of your issue. Thanks."^^ . + . + "1"^^ . + "Running any Intelephense command results in extremely long node error"^^ . + "0"^^ . + . + . + "0"^^ . + . + "<p>I got a PHP application that has to encrypt a string with a private key. It's a bit uncommon to encrypt with the private key, I know, but that's the way it is.</p>\n<p>The application is PHP5 using a very old version of phpseclib. Now, we have to migrate to PHP8 and need to upgrade phpseclib. I was google-ling the whole day but I was not able to figure out how to migrate the legacy code. The legacy code looks like this:</p>\n<pre><code>define('RSA_PRIV_KEY', &quot;&lt;base64 encoded key&gt;&quot;);\n\n$rsa = new Crypt_RSA();\n$rsa-&gt;loadKey(RSA_PRIV_KEY);\n$result = base64_encode($rsa-&gt;encrypt(&quot;my fancy string&quot;));\n</code></pre>\n<p>I had a look to phpseclib3 but was not able to get it to work at all. Same for openssl.</p>\n<p>Edit best attempt made with phpseclib3</p>\n<pre><code>// this works\n$key = PublicKeyLoader::loadPrivateKey(RSA_PRIV_KEY);\n// this works although my IDE claims that no method named getLoadedFormat() exists. It gives me 'PKCS1'\n$this-&gt;log-&gt;info(&quot;&gt;&gt;&gt;&quot; . $key-&gt;getLoadedFormat());\n// This does not work cause 'Call to undefined method phpseclib3\\Crypt\\RSA\\PrivateKey::encrypt()'\n$this-&gt;log-&gt;info(&quot;&gt;&gt;&gt;&quot; . $key-&gt;encrypt(&quot;my fancy string&quot;));\n</code></pre>\n"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "0"^^ . + "The bug was fixed in version [7.4.14](https://www.php.net/ChangeLog-7.php#7.4.14): *"Fixed bug #77069 (stream filter loses final block of data)."*"^^ . + "@IłyaBursov oh come on. "Slower"! And it is not longer if you already have an array as you should"^^ . + "Sorry, but I still don't get what made you think that you need `from(MyModel::class)` after calling `createQueryBuilder('m')`. Did you follow any strange tutorial for this?"^^ . + . + "wordpress"^^ . + . + "`Presumably steps 1 and 2 can be skipped if the oauth token exists in their session when next they upload a file, or do I do I have to do that anyway to check it hasn't timed out?`...it's a good idea to check, because your next request using that token will fail otherwise. You should be able to use the refresh token to get another access token."^^ . + "<p>A few days ago I implemented Google's recpatcha into my website. It worked perfectly fine.</p>\n<p>Today I started working then I though to myself: &quot;Hmm lets try the contact form (where i use the cpatcha) if it still works.</p>\n<p>Then I got this error in my console:\nHiba: <code>SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data</code></p>\n<p>There is no syntax error in the code. All of this worked a few days ago and since then I didn't touch it.</p>\n<p>I tried these steps:</p>\n<p>1: I fully reverted today's work with Git. (didn't work)</p>\n<p>2: I thought I maybe got blacklisted in the captcha or something. So I made a new account with new keys, etc... (didn't work)</p>\n<p>What can be the problem? Google's reCAPTCHA is down?</p>\n<p>Edit:</p>\n<p>Yes my code isnt the problem, the JSON has some problems.</p>\n<p>The JSON format is sent properly. All of the rows are proper, and there is recaptcha token, and it gives back 200 OK code.\nWhat does my contact_api.php gives back as answer in the network tab? this:</p>\n<blockquote>\n<p>Warning:\nrequire_once(C:\\Users\\Lenovo\\Intello-Weboldal\\intello-web\\includes\\api/vendor/autoload.php):\nFailed to open stream: No such file or directory in\nC:\\Users\\Lenovo\\Intello-Weboldal\\intello-web\\includes\\api\\contact_api.php\non line 3</p>\n<p>Fatal error: Uncaught Error: Failed opening required 'C:\\Users\\Lenovo\\Intello-Weboldal\\intello-web\\includes\\api/vendor/autoload.php'\n(include_path='C:\\xampp\\php\\PEAR') in\nC:\\Users\\Lenovo\\Intello-Weboldal\\intello-web\\includes\\api\\contact_api.php:3\nStack trace: #0 {main} thrown in\nC:\\Users\\Lenovo\\Intello-Weboldal\\intello-web\\includes\\api\\contact_api.php\non line 3</p>\n</blockquote>\n<p>I checked if composer is properly installed (yes), and checked if the autoload.php in the vendor is properly installed (yes).</p>\n<p>Edit 2.0, 3.0:\nHow's my filesystem look (the root direction is <em>intello_web</em>):</p>\n<p>the vendor (and the autoload.php file)is in the root direction</p>\n<pre><code>*intello_web* &gt; vendor &gt; autoload.php\n</code></pre>\n<p>My contact_api.php is in:</p>\n<pre><code>*intello_web* &gt; includes &gt; api &gt; contact_api.php\n</code></pre>\n<p>Here is the connection to the autoload.php file in my contact_api.php:</p>\n<pre><code>require_once __DIR__ . '/../vendor/autoload.php';\n</code></pre>\n"^^ . + . + . + . + "<p>I am using the WebP Express plugin in WordPress, and it correctly replaces elements with tags when the page loads initially. However, when I load additional content via AJAX, the newly added images remain in their original format (.jpg or .png) and are not converted to WebP.</p>\n<p><strong>What I have tried:</strong></p>\n<ol>\n<li>Manually triggering WebP Express after AJAX:</li>\n</ol>\n<pre><code>setTimeout(() =&gt; {\n document.dispatchEvent(new Event('DOMContentLoaded'));\n}, 200);\n</code></pre>\n<ol start="2">\n<li>Using apply_filters('the_content', wp_get_attachment_image(...)) in PHP:</li>\n</ol>\n<pre><code>echo apply_filters('the_content', wp_get_attachment_image($pic['ID'], 'medium_large'));\n</code></pre>\n<p><strong>How AJAX works in my setup:</strong></p>\n<ul>\n<li><p>My WordPress AJAX function (wp_ajax_loadmore_reviews) returns pre-rendered HTML, which is then appended to the page via JavaScript.</p>\n</li>\n<li><p>WebP Express correctly converts images when the page is initially loaded, but does not process images appended dynamically.</p>\n</li>\n</ul>\n<p><strong>My Question:</strong>\nHow can I ensure that WebP Express processes dynamically loaded images after AJAX?\nIs there a way to force WebP Express to recognize and convert newly loaded images without manually modifying src attributes in JavaScript?</p>\n<p>Any guidance would be greatly appreciated!</p>\n"^^ . + "How to write test for Trait"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + "<p>Assuming you're using Windows, you can use the following shortcuts:</p>\n<ul>\n<li><p>Select the next occurrence (while keeping the last selected words): <code>Ctrl + D</code></p>\n</li>\n<li><p>Select all occurrences: <code>Ctrl + Shift + L</code></p>\n</li>\n<li><p>Undo last selection: <code>ctrl + u</code></p>\n</li>\n</ul>\n<p>Now, your cursor will be placed in all occurrences.</p>\n"^^ . + "nelmioapidocbundle"^^ . + . + "Select2 on Modal when hover text is jamble"^^ . + "<p>I have code that needs to support Japanese. Internally my data is all UTF-8, but one rarely-used routine exports a text file for import into PowerPoint. For old versions of PowerPoint, the required encoding was Shift-JIS, and <code>mb_convert_encoding($output, &quot;SJIS&quot;)</code> worked just fine for many years. But now I've discovered that from Office 2016 onward, the encoding needs to be UTF-16 LE (Microsoft just <em>has</em> to be different...sigh!). Fine, I thought, I'll just change the expression to <code>mb_convert_encoding($output, &quot;UTF-16LE&quot;)</code>. But whatever PHP is doing, the resulting file is not recognized as being Unicode at all (and of course looks horrid). Notepad++ thinks it's &quot;GB2312 (Simplified)&quot; and even thinks the line endings are CR only, even though they are definitely CRLF. Anyone have a guess as to why it doesn't work?</p>\n"^^ . + "1"^^ . + . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + "1"^^ . + . + . + "2"^^ . + "1"^^ . + . + "0"^^ . + "1"^^ . + . + "Are you sure this problem is in any way related to PHP?"^^ . + . + . + . + "Okay, I've updated the answer, so it may help others. I'm glad that your issue is finally solved!"^^ . + . + . + . + . + "Disable output buffering for Apache with Nginx in proxy mode"^^ . + . + "<p><code>$_POST['msg']</code> contains the text-field contents as sent by the browser.</p>\n<p>As you have demonstrated logging the input into a text-file, the browser terminates lines in a way that they are preserved by your logging. ¹</p>\n<p>However, you were also able to demonstrate that the browser terminates the whole text-field contents in a way, that is <strong>not</strong> preserved by your logging. (This is the standard behaviour and can be seen/demonstrated with <a href="https://stackoverflow.com/a/8227049/367456">the <em>Simple PHP editor of text files</em> (Q&amp;A)</a> as well.)</p>\n<p>You now had the good idea to insert a terminator where it is missing for your logging, namely as string <code>&quot;*************\\n&quot;</code> or shown inline:</p>\n<pre><code>Hello\nHow are you\nGood bye\n*************\nLet me upload this.\nInform me if you receive it.\n*************\n</code></pre>\n<p>Create that separator and append it to each message:</p>\n<pre><code>$filename = 'posts.txt'; \n$separator = &quot;*************\\n&quot;;\n$msg = (isset($_POST['msg']) ? $_POST['msg'] : null); \n$msg .= &quot;\\r\\n$separator&quot;;\n</code></pre>\n<p>That's all.</p>\n<p>And it will even allow you to preserve empty submissions, which may come in handy to test the behaviour, the file will always grow:</p>\n<pre><code>\n*************\n\n*************\n\n*************\n</code></pre>\n<hr />\n<p>¹ <a href="https://stackoverflow.com/q/14217101/367456">What character represents a new line in a text area</a></p>\n"^^ . + . + . + . + . + "1"^^ . + "1"^^ . + "1"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + "@JKSandhiya `CURLINFO_REFERER` was added with PHP 8.2.0, according to https://www.php.net/manual/en/function.curl-getinfo.php#refsect1-function.curl-getinfo-changelog"^^ . + "1"^^ . + . + . + . + "<p>The relations for the related news are stored in the MM-Table <code>tx_news_domain_model_news_related_mm</code>. The fields <code>related</code> and <code>related_from</code> in the table <code>tx_news_domain_model_news</code> can be used to count the amount of related entries.</p>\n<p>But be aware, that these fields are not reliable, because they are not always updated when adding related news i.e. with custom functions.</p>\n<p>If you only use the backend to add related news, then the entry in the field <code>related</code> should always be uptodate. But the field <code>related_from</code> is only used to show the bidirectional relations. This field will always be 0.</p>\n<p>But if you only want news in your ListView, that are not related to any other news, then this should do the job:</p>\n<pre><code>&lt;?php\nnamespace REDACTED\\NewsExtended\\Hooks;\nuse \\GeorgRinger\\News\\Domain\\Repository\\NewsRepository;\n\nclass Repository\n{\n\n public function modify(array &amp;$params, NewsRepository $newsRepository): void\n {\n $query = $params['query'];\n $params['constraints']['related'] = $query-&gt;equals('related', 0);\n }\n\n}\n</code></pre>\n"^^ . + "WooComerce : Add product to cart when customer add a specific product"^^ . + "<p>I asked Microsoft's Copilot a query to write a sample web-service accepting employee number and return name of the employee against the supplied employee number from database.</p>\n<pre><code>Here is script of the sample table in database. I have added a few records in the database for testing.\n\n CREATE TABLE employees (\n EmpNumber INT PRIMARY KEY,\n EmpName VARCHAR(100)\n );\n</code></pre>\n<p>Here is the code for <code>service.php</code>, a file which is supposted to connect with databse and returns output to the client:</p>\n<pre><code>&lt;?php\n require_once('nusoap/lib/nusoap.php');\n\n // Database credentials\n $host = 'yourHostName';\n $db = 'your_db_ name';\n $user = 'your_database_user';\n $pass = 'your_password';\n\n // Create a new soap server\n $server = new nusoap_server();\n\n // Configure the WSDL\n $server-&gt;configureWSDL('employeeService', 'urn:employeeService');\n $server-&gt;wsdl-&gt;schemaTargetNamespace = 'urn:employeeService';\n\n // Register the method to expose\n $server-&gt;register('getEmployeeName',\n array('employeeNumber' =&gt; 'xsd:int'), // input parameters\n array('return' =&gt; 'xsd:string'), // output parameters\n 'urn:employeeService', // namespace\n 'urn:employeeService#getEmployeeName', // soapaction\n 'rpc', // style\n 'encoded', // use\n 'Returns the name of the employee' // documentation\n );\n\n // Define the method as a PHP function\n function getEmployeeName($employeeNumber) {\n $name = '';\n global $host, $db, $user, $pass;\n\n // Connect to the database\n $conn = new mysqli($host, $user, $pass, $db);\n\n // Check connection\n if ($conn-&gt;connect_error) {\n return 'Database connection failed: ' . $conn-&gt;connect_error;\n }\n\n // Prepare the SQL query\n $sql = &quot;SELECT EmpName FROM employees WHERE EmpNumber = ?&quot;;\n $stmt = $conn-&gt;prepare($sql);\n $stmt-&gt;bind_param(&quot;i&quot;, $employeeNumber);\n $stmt-&gt;execute();\n $stmt-&gt;bind_result($name);\n $stmt-&gt;fetch();\n $stmt-&gt;close();\n $conn-&gt;close();\n\n // Check if the employee was found\n if ($name) {\n return $name;\n } else {\n return 'Employee not found';\n }\n }\n\n // Use the request to (try to) invoke the service\n $server-&gt;service(file_get_contents(&quot;php://input&quot;));\n?&gt;\n</code></pre>\n<p>Here is the code for <code>client.php</code>. I have added <code>try-catch</code> block to capture any exceptions.</p>\n<pre><code>&lt;?php\n # URL of the web service\n $url = 'https://path/to/api/demo/service.php';\n // SOAP request JSON\n $empID = 1;\n $data = '{ &quot;employeeNumber&quot;: '.$empID.' }';\n \n $options = array(\n CURLOPT_URL =&gt; $url,\n CURLOPT_RETURNTRANSFER =&gt; true,\n CURLOPT_ENCODING =&gt; '',\n CURLOPT_MAXREDIRS =&gt; 10,\n CURLOPT_TIMEOUT =&gt; 0,\n CURLOPT_FOLLOWLOCATION =&gt; true,\n CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST =&gt; 'POST',\n CURLOPT_POSTFIELDS =&gt; '{&quot;data&quot;: '.$data.'}',\n CURLOPT_HTTPHEADER =&gt; array(\n &quot;Content-Type: application/json; charset=utf-8&quot;\n )\n );\n\n try{\n $ch = curl_init(); # cURL initialization\n curl_setopt_array($ch, $options);\n $response = curl_exec($ch); # Execute the request\n curl_close($ch); # Close cURL\n echo $response; # Display the response\n } catch (Exception $ex) {\n echo &quot;An exception has occured: &quot;.$ex-&gt;getMessage();\n }\n?&gt;\n</code></pre>\n<p>And finally, below is the XML for <code>employeeService.wsdl</code>.</p>\n<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;definitions name=&quot;employeeService&quot;\n targetNamespace=&quot;urn:employeeService&quot;\n xmlns:tns=&quot;urn:employeeService&quot;\n xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;\n xmlns=&quot;http://schemas.xmlsoap.org/wsdl/&quot;&gt;\n &lt;message name=&quot;getEmployeeNameRequest&quot;&gt;\n &lt;part name=&quot;employeeNumber&quot; type=&quot;xsd:int&quot;/&gt;\n &lt;/message&gt;\n &lt;message name=&quot;getEmployeeNameResponse&quot;&gt;\n &lt;part name=&quot;name&quot; type=&quot;xsd:string&quot;/&gt;\n &lt;/message&gt;\n &lt;portType name=&quot;employeeServicePortType&quot;&gt;\n &lt;operation name=&quot;getEmployeeName&quot;&gt;\n &lt;input message=&quot;tns:getEmployeeNameRequest&quot;/&gt;\n &lt;output message=&quot;tns:getEmployeeNameResponse&quot;/&gt;\n &lt;/operation&gt;\n &lt;/portType&gt;\n &lt;binding name=&quot;employeeServiceBinding&quot; type=&quot;tns:employeeServicePortType&quot;&gt;\n &lt;soap:binding style=&quot;rpc&quot; transport=&quot;http://schemas.xmlsoap.org/soap/http&quot;/&gt;\n &lt;operation name=&quot;getEmployeeName&quot;&gt;\n &lt;soap:operation soapAction=&quot;urn:employeeService#getEmployeeName&quot;/&gt;\n &lt;input&gt;\n &lt;soap:body use=&quot;encoded&quot; namespace=&quot;urn:employeeService&quot; encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;/&gt;\n &lt;/input&gt;\n &lt;output&gt;\n &lt;soap:body use=&quot;encoded&quot; namespace=&quot;urn:employeeService&quot; encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;/&gt;\n &lt;/output&gt;\n &lt;/operation&gt;\n &lt;/binding&gt;\n &lt;service name=&quot;employeeService&quot;&gt;\n &lt;port name=&quot;employeeServicePort&quot; binding=&quot;tns:employeeServiceBinding&quot;&gt;\n &lt;soap:address location=&quot;https://path/to/api/demo/service.php&quot;/&gt;\n &lt;/port&gt;\n &lt;/service&gt;\n&lt;/definitions&gt;\n</code></pre>\n<p>When I execute the script <strong>https://path/to/api/demo/client.php</strong> in the browser, the script displays web-page whose screenshot is as below. There is neither any error log entry nor any exception thrown.</p>\n<p>Is there anything wrong with the script or with the way I am calling the service?</p>\n<p>PS: I have changed input from XML to JSON. This time, an error log has exactly six entries of the line as below:</p>\n<p><code>[17-Feb-2025 19:32:47 Asia/Kolkata] PHP Warning: Cannot modify header information - headers already sent by (output started at /path/to/service/api/demo/service.php:1) in /home2/kbcsurve/public_html/cdn/classes/nusoap/lib/nusoap.php on line 4272</code></p>\n<p>Can the script be fixed now?</p>\n"^^ . + "0"^^ . + . + . + . + "5"^^ . + . + . + . + . + . + "How to invoke a callable stored inside a static property?"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + . + "Use `SameSite=None` and protect the user with a CSRF token on the pages where appropriate. See also https://stackoverflow.com/questions/72223272/what-is-the-point-of-x-csrf-token-or-x-xsrf-token-why-not-just-use-a-strict-sam and https://security.stackexchange.com/questions/272425/is-using-two-cookies-one-lax-and-one-strict-a-way-to-improve-usability-without-c"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + "please add all relevant commands with their output to your question by [edit]ing it."^^ . + . + "Hubleto setup and installation"^^ . + "How to Send data from Controllet to Import Multiple Sheet on Maatwebsite Laravel"^^ . + . + "2"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + "This doesn't do anything different than the OP's original code. The two conditions here are _mutually inclusive_. For the 2nd condition to be successful then the 1st (added) condition must also be successful. In other words, the 2nd condition checks that the URL contains at least 2 slashes and the 1st condition checks that the URL is not a single slash. If the URL contains 2 slashes then it doesn't contain only a single slash!"^^ . + "0"^^ . + "0"^^ . + "<p>Is possible to use Visitor IP directly in cURL to request.</p>\n<p>Getting User IP :</p>\n<pre><code>function getUserIP() {\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n return $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n return trim(explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])[0]); // Get the first IP\n } else {\n return $_SERVER['REMOTE_ADDR'];\n }\n}\n\n$user_ip = getUserIP();\n</code></pre>\n<p>Using with cURL request :</p>\n<pre><code>curl_setopt($ch, CURLOPT_PROXY, $user_ip); \ncurl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);\n//curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);\n</code></pre>\n<p>Above code is not working maybe because ISP is closed the external use. is there any way to find the Open port and use it in cURL to request directly from Visitor IP or any other way to use Visitor IP to make request to cURL website?.</p>\n<p>Let say, i am fetching Example.com through cURL and when it fetch example.com, it fetch through my web server public IP. instead of that, it should fetch directly through Visitor Public IP of their internet provider.</p>\n"^^ . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + "1"^^ . + "0"^^ . + . + . + . + "1"^^ . + "You can check the raw email on gmail by opening the "context" menu (3 dots button on the top-right corner) and selecting download message... then download and old script message and a new script one and you can check the differences."^^ . + "0"^^ . + "0"^^ . + "Get data from page to function sql query"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "2"^^ . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + "Good to know - then you need to ask the ImageMagick maintainers about the problem, as this is not related to programming"^^ . + . + . + . + . + "<p>I would not integrate the S3Client directly because it also makes testing/mocking easier. Above all, the configuration in the service.yaml was too complex not robust enough for me.</p>\n<p>I think <a href="https://flysystem.thephpleague.com/docs/" rel="nofollow noreferrer">File Storage Abstraction for PHP</a> is very good.</p>\n<p>And the most important thing is that you can change the target storage depending on the environment or new requirements.</p>\n<p><strong>services.yaml</strong></p>\n<pre class="lang-yaml prettyprint-override"><code>services:\n\n app.flysystem_adapter:\n class: App\\Service\\Storage\\AwsStorageAdapter\n arguments:\n - '%env(AWS_S3_ACCESS_ID)%'\n - '%env(AWS_S3_ACCESS_SECRET)%'\n - '%env(AWS_S3_BUCKET_NAME)%'\n - '%env(AWS_S3_REGION)%'\n \n \n App\\Service\\StorageService:\n arguments:\n - '@app.flysystem_adapter' \n</code></pre>\n<p><strong>AwsStorageAdapter</strong></p>\n<pre class="lang-php prettyprint-override"><code>use Aws\\Credentials\\Credentials;\nuse Aws\\S3\\S3Client;\nuse League\\Flysystem\\AwsS3V3\\AwsS3V3Adapter;\n\nclass AwsStorageAdapter extends AwsS3V3Adapter\n{\n public function __construct(\n string $accessId,\n string $accessSecret,\n string $bucketName,\n string $region\n ) {\n parent::__construct(\n new S3Client(\n [\n 'region' =&gt; $region,\n 'credentials' =&gt; new Credentials(\n $accessId,\n $accessSecret\n )\n ]\n ),\n $bucketName\n );\n }\n}\n</code></pre>\n<p><strong>StorageService</strong></p>\n<p>Here is a very simplified example of how to save a file.</p>\n<pre class="lang-php prettyprint-override"><code>use League\\Flysystem\\Filesystem;\nuse League\\Flysystem\\FilesystemAdapter;\nuse Symfony\\Component\\HttpFoundation\\File\\UploadedFile;\n\nclass StorageService\n{\n private Filesystem $filesystem;\n\n public function __construct(FilesystemAdapter $adapter)\n {\n $this-&gt;filesystem = new Filesystem($adapter);\n }\n\n public function saveFile(UploadedFile $uploadedFile, string $storePath = '/'): void\n {\n $path = $storePath . '/' . $uploadedFile-&gt;getClientOriginalName());\n $ressource = fopen($uploadedFile-&gt;getPathname(), 'r');\n\n $this-&gt;filesystem-&gt;writeStream(\n $path,\n $ressource\n );\n }\n}\n</code></pre>\n"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + "<p>here is how Superglobals are defined in <a href="https://www.php.net/manual/en/language.variables.superglobals.php" rel="nofollow noreferrer">PHP</a></p>\n<blockquote>\n<p>Superglobals — Built-in variables that are always available in all\nscopes</p>\n</blockquote>\n<p>And here is how $GLOBALS are defined <a href="https://www.php.net/manual/en/reserved.variables.globals.php" rel="nofollow noreferrer">here</a></p>\n<blockquote>\n<p>$GLOBALS — References all variables available in global scope</p>\n</blockquote>\n<p>I'm aware of the existence of 'various' scopes like local, static, closure, namespace and maybe more in PHP and I'm not looking for a reason to nitpick wording inaccuracies in the definitions.\nHowever I wonder why $GLOBALS was defined differently from Superglobals in terms of availability, not this way:</p>\n<blockquote>\n<p>$GLOBALS — References all variables available in all scopes</p>\n</blockquote>\n"^^ . + . + . + . + . + "0"^^ . + "I got my tailwind version by doing the command `npm view tailwindcss version` and it gave me 4.0.14. You are right that the config was for version 3+ and it is the version that is usually installed by default. I don't know if running npm update at some point upgraded to tailwind 4+ or if I messed up a command.\n\nI have ran the command to install 3.2.5^ and after fixing some issues in my own scss files, it is working properly now. I'll make sure to try and lock down the versions I am using so that I don't end up with a mismatch like that.\n\nThank you for your help!"^^ . + . + "0"^^ . + "0"^^ . + "mysql"^^ . + "transactions"^^ . + . + "eloquent-relationship"^^ . + . + . + . + . + . + "<p>Your confusion here is that the <code>use</code> statement in PHP has nothing to do with loading code. Instead, it is part of the feature for <a href="https://www.php.net/manual/en/language.namespaces.php" rel="nofollow noreferrer">Namespaces</a>: a way to have long unambiguous names for your classes and functions, without having to type the whole name each time.</p>\n<p>Specifically, <code>use backend\\models\\Invoice;</code> means &quot;in this file, when I write <code>Invoice</code> as a class name, act as though I wrote <code>\\backend\\models\\Invoice</code> instead&quot;. It's a simple text substitution by the compiler (i.e. the first piece of the PHP engine that looks at your code, before it attempts to run any of it).</p>\n<p>To <em>load</em> a file, you need to use one of <a href="https://www.php.net/include" rel="nofollow noreferrer">include</a>, <a href="https://www.php.net/include_once" rel="nofollow noreferrer">include_once</a>, <a href="https://www.php.net/require" rel="nofollow noreferrer">require</a>, or <a href="https://www.php.net/require_once" rel="nofollow noreferrer">require_once</a>. These run all the PHP code in a file, including any class definitions.</p>\n<p>The reason you don't normally have to do this manually is that PHP has another feature called <a href="https://www.php.net/manual/en/language.oop5.autoload.php" rel="nofollow noreferrer">autoloading</a> - when PHP finds a class name that's not defined, it triggers a function you registered earlier, and that function can do what's needed to define the class. Normally, that autoloader will include/require the right file; and often, that whole thing is defined as part of a framework or tool, so all you have to do is put the file in the right place, and it appears to work &quot;by magic&quot;.</p>\n<p>Just to join the dots fully, writing <code>use backend\\models\\Invoice;</code> will <em>not</em> on its own cause the autoloader to run - at this point, PHP doesn't need a class with that name, it's just doing some find-and-replace in the rest of the file. It's when you actually <em>do something</em> with the class that the autoloader would run - i.e. when it tries to execute the line <code>Invoice::find()</code>, which the compiler has expanded as though you wrote <code>\\backend\\models\\Invoice::find()</code></p>\n<p>What you most likely need to do in your command-line script is manually include some initial &quot;bootstrap&quot; or &quot;startup&quot; file which tells PHP what autoloading function to use. Your example also shows you fetching some data from somewhere, so presumably that file will also need to load configuration to connect to a database of some sort. Since you're using a framework, there may be a specific recommended structure for writing command-line scripts which makes sure everything is set up for you, and gives you some appropriate helpers.</p>\n"^^ . + . + . + . + "it's interesting, but why other routes working? They are presented like that one i've wrote upper?"^^ . + . + "1. mysql_set_charset() but I am horrified to see mysql_query() here which is a bigger problem that all this hassle with emojis. 2. same. 3. A really bad code and unbelievably ancient PHP version explain it all."^^ . + "1"^^ . + "0"^^ . + "Did you create a database called `projectName` in your mysql server? Presumably not."^^ . + . + . + "0"^^ . + . + . + "user-agent"^^ . + . + . + . + "ip"^^ . + "Disguise a php-produced link with JavaScript"^^ . + . + "1"^^ . + . + "0"^^ . + . + . + "<p>You can try to solve the problem, <strong>only if you are using a single product attribute set for variation for your variable product</strong>, by sorting variations from variation attribute terms, like:</p>\n<pre><code>// Get the correct taxonomy for the product attribute set for variation\n$taxonomy = current( array_keys($product-&gt;get_variation_attributes()) ); \n\n// Get the cached attribute sorted term slugs for the variable product\n$attr_slugs = wc_get_product_terms( $product-&gt;get_id(), $taxonomy, ['fields' =&gt; 'slugs'] );\n\n$variations = $product-&gt;get_available_variations(); // Get available variations\n$sorted_variations = array(); // Initializing\n\n// Sorting Loop \nforeach( $variations as $variation ) {\n $attr_slug = reset( $variation['attributes'] ); // Get attribute term slug\n $attr_key = array_search($attr_slug, $attr_slugs); // Get the sorting key from attribute terms array\n \n if ( $attr_key !== false ) {\n $sorted_variations[$attr_key] = $variation; // Add sorted variation\n }\n}\n\nksort($sorted_variations); // Sort by key (ASC)\n\necho '&lt;ul&gt;';\n\n// Loop through sorted Variations\nforeach( $sorted_variations as $variation ) { ?&gt;\n &lt;li&gt;\n &lt;img src=&quot;&lt;?php echo $variation['image']['src']; ?&gt;&quot; /&gt;\n &lt;/li&gt;\n&lt;?php }\n\necho '&lt;/ul&gt;';\n</code></pre>\n<p>It should work, displaying the desired sorted variations.</p>\n<hr />\n<h4>Change product variations menu order based on variation attribute menu order</h4>\n<p>The following will change the variations menu order of a variable product based on the variation attribute <em>(works only on variable products with a unique product attribute set for variations).</em></p>\n<p>Here, we run this function just before your custom display.</p>\n<p>Note that the function that changes the variations menu order <strong>will run just once for each variable product</strong> (when visiting the variable product page).</p>\n<p>Add the following function to your child theme functions.php file:</p>\n<pre><code>// Utility function: Change variations menu order based on variation attribute\nfunction change_variations_menu_order( $product ) {\n // Get the correct taxonomy for the product attribute set for variation\n $taxonomy = current( array_keys($product-&gt;get_variation_attributes()) ); \n\n // Get the cached attribute sorted term slugs for the variable product\n $attr_slugs = wc_get_product_terms( $product-&gt;get_id(), $taxonomy, ['fields' =&gt; 'slugs'] );\n\n $variations = $product-&gt;get_available_variations(); // Get available variations\n $sorted_variations = array(); // Initializing\n\n // Sorting Loop \n foreach( $variations as $variation_data ) {\n $attr_slug = reset( $variation_data['attributes'] ); // Get attribute term slug\n $attr_key = array_search($attr_slug, $attr_slugs); // Get the sorting key from attribute terms array\n \n if ( $attr_key !== false ) {\n $sorted_variations[$attr_key] = $variation_data; // Add sorted variation\n }\n }\n\n ksort($sorted_variations); // Sort by key (ASC)\n\n foreach( $sorted_variations as $key =&gt; $variation_data ) {\n $variation_obj = wc_get_product($variation_data['variation_id']);\n $variation_obj-&gt;set_props( array( 'menu_order' =&gt; $key) );\n $variation_obj-&gt;save();\n }\n $product-&gt;update_meta_data('variations_sorted', true);\n $product-&gt;save();\n}\n</code></pre>\n<p>Use the following code for your custom display on your variable products <em>(it replaces the previous code from this answer)</em>:</p>\n<pre class="lang-php prettyprint-override"><code>if ( ! $product-&gt;get_meta('variations_sorted') ) {\n change_variations_menu_order( $product );\n}\n\necho '&lt;ul&gt;';\n\n// Loop through sorted Variations\nforeach( $product-&gt;get_available_variations() as $variation_data ) { ?&gt;\n &lt;li&gt;\n &lt;img src=&quot;&lt;?php echo $variation_data['image']['src']; ?&gt;&quot; /&gt;\n &lt;/li&gt;\n&lt;?php }\n\necho '&lt;/ul&gt;';\n</code></pre>\n<p>It should work as you asked in your comment.</p>\n"^^ . + . + . + "1"^^ . + . + "Thanks! The examples are helpful and I can see the differences. I simplified the markup `<div class="col"><div class="title">The title</div></div>` for this question, but it is really several hundred lines long. Is there a way to use PHP `continue` or `do-while` to prevent duplicating the markup?"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "<p>You are using the wrong filter. You should instead use the <code>woocommerce_calculate_item_totals_taxes</code> filter. With this filter you don't have to access the cart. This filter will be called for each item in the cart and you will get the cart item in the callback function. Based on this you can calculate the taxes for each cart item.</p>\n<p><strong>Example:</strong></p>\n<pre><code>add_filter('woocommerce_calculate_item_totals_taxes', 'modify_price_for_tax_calculation_v4', 10, 3);\n\n/**\n * Calculate item tax.\n *\n * @param array $taxes\n * @param \\stdClass $item\n * @param \\WC_Cart_Totals $wc_cart_totals\n * @return array\n */\nfunction modify_price_for_tax_calculation_v4( $taxes, $item, $wc_cart_totals ) {\n\n if ( is_admin() &amp;&amp; ! defined( 'DOING_AJAX' ) ) {\n return;\n }\n\n // Check if the product uses the custom tax class\n if ( 'custom-tax-class' === $item-&gt;tax_class ) {\n // Get the purchase price (replace '_purchase_price' with actual meta key)\n $purchase_price = 100;\n\n // Ensure product price is a float\n $product_price = floatval( $item-&gt;price );\n \n $quantity = intval($item-&gt;quantity);\n\n // Calculate the margin (product price - purchase price)\n $margin = max(($product_price - $purchase_price) * $quantity, 0); // Ensure margin is not negative\n\n // Apply tax rates to margin instead of the product price\n foreach ( $item-&gt;tax_rates as $rate_id =&gt; $rate ) {\n \n // Loop through each cart ite\n \n $rate_percentage = floatval( $rate['rate']); // Convert rate to decimal\n $modified_price = round( $margin * $rate_percentage, 2 ); // Apply margin-based tax calculation\n\n // Set modified tax amount\n $taxes[$rate_id] = $modified_price;\n }\n }\n\n return $taxes; // Return the modified tax values\n}\n</code></pre>\n"^^ . + "-1"^^ . + "4"^^ . + "0"^^ . + "<p>It seems that you need to start with a better introduction to ASN.1 which can be found on the ITU-T ASN.1 Project page at <a href="https://www.itu.int/en/ITU-T/asn1/Pages/introduction.aspx" rel="nofollow noreferrer">https://www.itu.int/en/ITU-T/asn1/Pages/introduction.aspx</a>, which also has links to the actual ASN.1 Recommendations which define ASN.1. The X.680 series describe the notation while the X.690 series describe the various encoding rules. In order to &quot;encode&quot;, you need to first select a particular encoding rule and begin with the corresponding recommendation from the X.690 series. Note that these do not necessarily describe the &quot;encoding&quot; or &quot;decoding&quot; process but precisely define what the encoded data should look like. It is up to you to put the data into that particular format as described by the encoding rule.</p>\n"^^ . + "Assign Magento 2 Product image type to multiple images"^^ . + . + . + . + . + "4"^^ . + . + "4"^^ . + "1"^^ . + "0"^^ . + . + "Doesn't the tooltip have something you can click on to implement the simplification? That will show you how to use the shortcut."^^ . + . + . + "Can you share which problem you want to solve? From my POV, you're using a filesystem library to explicitly **not** care about the root directory on your own"^^ . + "0"^^ . + . + . + "iTop - How to Revert iTop UI Behavior to Display Only Essential Options (Like Older Versions)"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + "2"^^ . + "0"^^ . + . + . + . + "Yes you're right apologies, debugging was turned on, I have had a look and I didn't receive any emails regarding the error,\nI can't see any specific errors in the log that relate to my code, just:\nFunction _load_textdomain_just_in_time was called <strong>incorrectly</strong>\nand\nPHP Notice: ob_end_flush(): Failed to send buffer of zlib output compression"^^ . + . + . + . + . + . + "<p>Useragent not working in Edge</p>\n<p>I use the following code to determine whether the site is opened on a PC/tablet or a mobile phone:</p>\n<pre><code> $browser_user_agent = $_SERVER['HTTP_USER_AGENT'];\nif(stristr($browser_user_agent, &quot;Mobile&quot;)) { \n$ganaar = &quot;https://davidbrouwer.nl/indexiPh.php?taal=&quot;;\n} else {\n$ganaar = &quot;https://davidbrouwer.nl/indexDB.php?taal=&quot;;\n};\n</code></pre>\n<p>This works fine, but it turns out that when you use Edge on a mobile phone, it is not recognized as a mobile phone.\nDoes anyone know a solution?</p>\n"^^ . + "<p>I'm trying to improve security on one of my input file validation routines because feedback from our testers says it is still penetrable.</p>\n<p>This was the target URL used. It is a POST request.</p>\n<pre><code>https://exampleweb.com/livewire/upload-file?expires=example&amp;signature=example\n</code></pre>\n<p>Example of the test file and param they used:</p>\n<pre><code>------WebKitFormBoundaryfRqsDnhE1J8zAPZS\nContent-Disposition: form-data; name=&quot;files[]&quot;; filename=&quot;example.php&quot;\nContent-Type: application/octet-stream\n</code></pre>\n<p>I already added file validation on the component and the frontend (blade) however it confuses me how it is still penetrable because when I tried through the app, it seems like it is handled properly.</p>\n<p>But I guess they must have used another app like Burp Suite which uses HTTP requests because in their testing comments is it returning <code>200 OK</code> when the request fired, when it is supposed to show an error code such as <code>422</code>.</p>\n<p>Component validation:</p>\n<pre><code>public function updatingPhoto1($photo)\n{\n $this-&gt;validateOnly('photo_1', [\n 'photo_1' =&gt; 'nullable|file|mimes:jpeg,jpg,png|max:2048',\n ]);\n}\n\npublic function updatedPhoto1()\n{\n try {\n $this-&gt;validateOnly('photo_1', [\n 'photo_1' =&gt; 'nullable|file|mimes:jpeg,jpg,png|max:2048',\n ]);\n } \n catch (\\Illuminate\\Validation\\ValidationException $e) {\n $this-&gt;reset('photo_1');\n $this-&gt;addError('photo_1', $e-&gt;validator-&gt;errors()-&gt;first('photo_1'));\n } \n catch (\\League\\Flysystem\\UnableToRetrieveMetadata $e) {\n $this-&gt;reset('photo_1');\n $this-&gt;addError('photo_1', 'The file uploaded does not appear to be a valid image.');\n }\n}\n</code></pre>\n<p>Can anyone advise me on how to tackle this issue?</p>\n"^^ . + "0"^^ . + "load index.php multiple times"^^ . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + "2"^^ . + . + . + . + . + "<p>As of 2025/02/04, Ebay Finding API is decommissioned. You can check the status of the Ebay API's <a href="https://developer.ebay.com/develop/get-started/api-deprecation-status" rel="nofollow noreferrer">here</a>.</p>\n<p>Instead of the Finding API, you can use the <a href="https://developer.ebay.com/api-docs/buy/browse/overview.html" rel="nofollow noreferrer">Browse API</a>. Specifically you can search items by keyword using the <a href="https://developer.ebay.com/api-docs/buy/browse/resources/item_summary/methods/search" rel="nofollow noreferrer"><code>items_search</code> API end point</a>.</p>\n<p>Example:</p>\n<p><code>https://api.ebay.com/buy/browse/v1/item_summary/search?q=cheese</code></p>\n<p><strong>Update based on the comment</strong></p>\n<p>You can finetune the search by using the <a href="https://developer.ebay.com/api-docs/buy/browse/resources/item_summary/methods/search#h3-uri-parameters" rel="nofollow noreferrer">various parameters</a>. For example you can filter the results by specific sellers using the <code>filter</code> parameter.</p>\n<p>Example:</p>\n<p><code>https://api.ebay.com/buy/browse/v1/item_summary/search?q=cheese&amp;filter=sellers:{seller_1|seller_2}</code></p>\n<p><strong>Full Code</strong></p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\n//generate token with your client_id and client_secret\n$hash = base64_encode($client_id . ':' . $client_secret);\n\n$oauth_url = &quot;https://api.ebay.com/identity/v1/oauth2/token&quot;;\n$post_fields = &quot;grant_type=client_credentials&amp;scope=https%3A%2F%2Fapi.ebay.com%2Foauth%2Fapi_scope&quot;;\n\n// Make the curl request to get the access token\n$ch = curl_init();\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($ch, CURLOPT_URL, $oauth_url);\ncurl_setopt($ch, CURLOPT_POST, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Basic '.$hash));\n\n$exec = curl_exec($ch);\n$x = curl_error($ch);\n\n$access_token = json_decode($exec)-&gt;access_token;\n\n// Now make the request to the Browse API\n$url = 'https://api.ebay.com/buy/browse/v1/item_summary/search?q=cheese&amp;filter=sellers:{lehmans|jaymar718925|goafogo}';\ncurl_setopt($ch, CURLOPT_HTTPGET, 1);\ncurl_setopt($ch, CURLOPT_URL, $url);\ncurl_setopt($ch,CURLOPT_HTTPHEADER, array( 'Authorization:Bearer '.$access_token));\n\n$exec = curl_exec($ch);\n$x = curl_error($ch);\n\necho '&lt;pre&gt;';\nprint_r(json_decode($exec));\n</code></pre>\n"^^ . + "@IainH, I just downloaded the PHP version you linked to above and put it on my desktop. I then CD'd to that folder and ran `cp php.ini-development php.ini` to get a default config file. Lastly I uncommented (with no additional changes) the `extension_dir = "ext"` and `extension=openssl` lines. After these steps I ran `php -r "var_dump(extension_loaded('openssl'));"` and received `bool(true)`. I know you've done this a bunch of times already, but could you try these steps verbatim, one more time?"^^ . + . + . + "0"^^ . + . + . + . + "FWIW, in my experience with WordPress and PHP in general, OOM errors are rarely fixable by changes to the maximum amount of memory after 256MB, and are instead related to some form of infinite loop. I say this knowing that it doesn't help you that much, but I just wanted you to know that chasing `WP_MEMORY_LIMIT` probably won't solve your problem."^^ . + . + "If you mean [this package](https://packagist.org/packages/benjaminfavre/oauth2-http-client), it hasn't been updated in a couple of years so it's almost for sure not ready for PHP/8.4."^^ . + "<p>I was under the impression that middleware runs BEFORE the route functions it wraps around.</p>\n<pre class="lang-php prettyprint-override"><code>Route::middleware([MyMiddleware::class])-&gt;group(function() {\n // routess\n});\n</code></pre>\n<p>But if one of the routes has dependency injection (ie, <code>PATCH</code> function in a controller):</p>\n<pre class="lang-php prettyprint-override"><code>public function update(MyModel $model, Request $request) {}\n</code></pre>\n<p>If the <code>MyModel</code> does not exist, then it throws the error that it doesn't exist without running the middleware.</p>\n<p>The workaround I have done is this in <code>app.php</code> which forces it to run before the functions:</p>\n<pre class="lang-php prettyprint-override"><code>$middleware-&gt;api(prepend: [MyMiddleware::class]);\n</code></pre>\n<p>Is this correct? I feel that this step shouldn't be necessary.</p>\n<p>FYI I am using this type of middleware:</p>\n<pre><code>return $next($request);\n</code></pre>\n"^^ . + . + "1"^^ . + "1"^^ . + "Yup - Adding "\\xFF\\xFE" did the trick!"^^ . + "<pre><code>In Your Controller Change Like this\n\nreturn view('admin.post.index', ['posts' =&gt; $posts['data']]);\n\nIn Your Model Modify the getAll Method\n\nreturn $post-&gt;orderByRaw($sort)-&gt;paginate($itemPerPage);\n\nreturn paginate result directly \n\nLaravel links() method requires Paginator object but your passing an array.\n</code></pre>\n"^^ . + . + "0"^^ . + . + . + . + . + "<p>You have some problems in your code, your $search property cant updated try add <strong>updateOn: 'input'</strong> and symfony cant accessing methods in live component so add $articles property;,</p>\n<pre><code>#[LiveProp(writable: true, updateOn: 'input')]\npublic string $search = '';\n\npublic array $articles = [];\n\npublic function updatedSearch(): void\n{\n $this-&gt;articles = $this-&gt;articleRepository-&gt;findBy(['title' =&gt; $this-&gt;search]);\n}\n</code></pre>\n<p>In your twig your input isnt closed and symfony use data-<strong>live</strong> so replace data-model to <strong>data-live-model</strong></p>\n<pre><code>&lt;input\n type=&quot;search&quot;\n data-live-model=&quot;search&quot;\n/&gt;\n</code></pre>\n"^^ . + "1"^^ . + . + . + . + "1"^^ . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + "2"^^ . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + "<p>We can use scp command for moving files from current to destination directory.</p>\n<pre><code>if ($request-&gt;hasFile('front_picture_path')) {\n $file = $request-&gt;file('front_picture_path');\n $filename = $file-&gt;getClientOriginalName();\n \n // Store temporarily in storage\n $tempPath = $file-&gt;storeAs('temp', $filename);\n\n $remoteUser = 'myusername';\n $remoteHost = 'myhost';\n $remotePath = &quot;mypath&quot;;\n $password = 'mypassword';\n \n $scpCommand = &quot;scp &quot; . storage_path(&quot;app/{$tempPath}&quot;) . &quot; {$remoteUser}@{$remoteHost}:{$remotePath}&quot;;\n shell_exec($scpCommand);\n</code></pre>\n<p>If you are using a password,then create a Pem file and transfer files using pem key without passowrd.</p>\n"^^ . + . + . + . + "php.ini would normally be in a system folder somewhere, not in the same directory as your script file. running `phpinfo();` in an empty page will output lots of details about your configuration, including the location of the php.ini file that's being used (there may be more than one on your machine - there are separate ones for CLI and web, and possibly demo ones or backups too)"^^ . + . + . + . + . + "<p>By default, we store our application's routes in the <code>./routes</code> folder. Within this, the <code>web.php</code> file contains the routes related to the website.</p>\n<ul>\n<li><a href="https://laravel.com/docs/12.x/routing#the-default-route-files" rel="nofollow noreferrer">The Default Route Files</a> - Laravel 12.x Docs</li>\n</ul>\n<h3>Redirect only a URL to homepage (by Laravel)</h3>\n<p><strong>Note:</strong> <em>However, this approach can easily cover 1-2 cases. For multiple cases, this solution requires too much effort and code repetition. See more below: <code>Redirect::fallback()</code></em></p>\n<p>Laravel and calling <code>filename.php</code>? Something's not right here. In any case, if I assume that <code>product.php</code> also returns Laravel's 404 error page, create a Route for it so you can redirect it:</p>\n<ul>\n<li><a href="https://laravel.com/docs/12.x/routing#basic-routing" rel="nofollow noreferrer">Basic Routing - <code>Route::get()</code></a> - Laravel 12.x Docs</li>\n</ul>\n<pre class="lang-php prettyprint-override"><code>Route::get('/product.php', function () {\n return redirect('/');\n});\n</code></pre>\n<p>And there is a shorter method for this solution as well:</p>\n<ul>\n<li><a href="https://laravel.com/docs/12.x/routing#redirect-routes" rel="nofollow noreferrer">Redirect routes - <code>Route::redirect()</code></a> - Laravel 12.x Docs</li>\n</ul>\n<pre class="lang-php prettyprint-override"><code>Route::redirect('/product.php', '/');\n</code></pre>\n<p>And you can also permanently redirect it by either passing a 301 status code as the third attribute to the previous function or by using this function:</p>\n<pre class="lang-php prettyprint-override"><code>// Route::redirect('/product.php', '/', 301); // or:\nRoute::permanentRedirect('/product.php', '/');\n</code></pre>\n<h3>Redirect only a page to homepage (by Apache) - not recommended</h3>\n<p><strong>Note:</strong> <em>I do not recommend this solution. Laravel's routing system is far more sophisticated, offers many more possibilities, and provides much better control over how incoming requests are handled.</em></p>\n<p>In a Laravel application, the <code>.htaccess</code> file is located in <code>./public/.htaccess</code>.</p>\n<ul>\n<li><a href="https://github.com/laravel/laravel/blob/12.x/public/.htaccess" rel="nofollow noreferrer"><code>laravel/laravel</code> <code>./public/.htaccess</code></a> - GitHub</li>\n</ul>\n<p>If <code>product.php</code> is not part of the Laravel project and you only get a plain 404 error page (meaning Laravel is not running and returning its own response), you can solve the problem using <code>.htaccess</code>:</p>\n<pre class="lang-none prettyprint-override"><code>RewriteEngine On\n\n# Redirect product.php to https://example.com\nRewriteCond %{REQUEST_URI} ^/product\\.php$ [NC]\nRewriteRule ^(.*)$ https://example.com [L,R=301]\n</code></pre>\n<h3>Handling non-existent URLs (by Laravel) - recommended</h3>\n<p><strong>Note:</strong> <em>In this case, I recommend this approach because you have multiple such routes. This way, you don't need to declare every incorrect URL individually; you can simply catch all exceptions at once.</em></p>\n<p>Any URL without a declared route can be caught using <code>::fallback</code>. Here, we can interpret the URL, log it, and determine where to redirect the visitor—figuring out what they might have been looking for.</p>\n<ul>\n<li><a href="https://laravel.com/docs/12.x/routing#fallback-routes" rel="nofollow noreferrer">Fallback Routes - <code>Route::fallback()</code></a> - Laravel 12.x Docs</li>\n</ul>\n<p>I injected a handler where I assume that the old and new websites have a roughly similar structure, with the only difference being the removal of <code>.php</code> extensions. If I detect this, I simply remove the extension. Otherwise, if preferred, all caught incorrect requests can be redirected to the homepage.</p>\n<pre class="lang-php prettyprint-override"><code>Route::fallback(function () {\n $requestUri = request()-&gt;path();\n\n // If the URL ends with .php, remove the extension and redirect\n if (str_ends_with($requestUri, '.php')) {\n $newUri = substr($requestUri, 0, -4); // Remove the .php extension\n return redirect($newUri, 301); // Redirect to the new URL without .php\n }\n\n // If no matching route is found, redirect to the homepage\n return redirect('/');\n});\n</code></pre>\n"^^ . + "0"^^ . + . + . + "Thanks for sticking with me on this @Chris Haas \nInteresting and good experiment, and yes, running `extension_loaded('openssl')` from the does indeed get me `bool(true)`, so the php download is good, however... Using the same php.ini that works from the CLI and loading with Apache fails. I'll add to the original post rather than here. Curiouser and curiouser!"^^ . + "As I said, check that EPEL is enabled"^^ . + . + "build"^^ . + "0"^^ . + . + "is_dir(): open_basedir restriction in effect. File(/basepath/web21/web/public/uploads_ext/uploads) is not within the allowed path(s):\n\nI got this error"^^ . + "1"^^ . + . + "Always remember: the webserver has its OWN setting for body size! PHP only comes after the webserver..."^^ . + "-1"^^ . + "0"^^ . + . + . + . + "2"^^ . + . + "<p>Below is the code and link from <a href="https://livewire.laravel.com/docs/uploads#temporary-preview-urls" rel="nofollow noreferrer">Livewire documentation</a>. You can adjust the @if ($photo) and add @else to show default image.</p>\n<blockquote>\n<p><a href="https://livewire.laravel.com/docs/uploads#temporary-preview-urls" rel="nofollow noreferrer">ref</a></p>\n<pre><code>&lt;form wire:submit=&quot;save&quot;&gt;\n @if ($photo) \n &lt;img src=&quot;{{ $photo-&gt;temporaryUrl() }}&quot;&gt;\n @endif\n \n &lt;input type=&quot;file&quot; wire:model=&quot;photo&quot;&gt;\n \n @error('photo') &lt;span class=&quot;error&quot;&gt;{{ $message }}&lt;/span&gt; &gt; @enderror\n \n &lt;button type=&quot;submit&quot;&gt;Save photo&lt;/button&gt;\n&lt;/form&gt;\n</code></pre>\n</blockquote>\n<p>In Filament try using a string not an array for the default banner image:</p>\n<pre><code>-&gt;formatStateUsing(fn($state) =&gt; $state ?: 'banner/banner.png')\n</code></pre>\n<p>You could also try using files :</p>\n<pre><code>-&gt;files(fn($state) =&gt; $state ? [asset('storage/' . $state)] : [asset('storage/banner/banner.png')])\n</code></pre>\n<p>Chat gpt also mentiones that :</p>\n<blockquote>\n<p>&quot;No, using files() alone will NOT store the default image in the database.\n<strong>How files() Works</strong>:\nfiles() only preloads the image in FilePond for the user to see.\nIt does NOT change the actual saved value in the database.\nIf the user does not upload a new image, the database field will remain null or empty.\n<strong>Will the Default Image Be Saved in the Database?</strong>\n❌ No, unless you explicitly store it using formatStateUsing() or default(). &quot;</p>\n</blockquote>\n<p>I hope this helps.</p>\n"^^ . + . + "0"^^ . + "You don't have permissions to access this directory, what kind of server do you have, shared ?"^^ . + . + "<p>Check your <code>.htaccess</code> file or create it if it doesn't exist. It should contain the following code:</p>\n<pre><code>RewriteEngine On\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^(.*)$ index.php/$1 [L]\n</code></pre>\n<p>Save it to your <code>_codeigniter/</code> folder.</p>\n"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + . + "Thank you @droopsnoot. Your suggestion seems perfect. But let's suppose, if any user generates the token first time and then there is no user active till 2-3 hrs then the token will be expired. Then I'll get the same issue."^^ . + . + . + . + "1"^^ . + "I am not sure how it is helpful, but take a look at [Symfony CMF Routing](https://symfony.com/bundles/CMFRoutingBundle/current/index.html)."^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "Let's assume I have 100 such entities, and let's assume I have a project in which I need 80. It's easier for me to list 20x what I don't want than 80x what I want. Secondly, if each is a separate project, then instead of the 1 vendor directory they have, they will have 100x directories + 100 composer.json files + 100 composer.lock files."^^ . + . + "<p>I'm upgrading my project from Flysystem 1.x to 3.x, and I'm having trouble retrieving the root directory (previously accessible via <code>getPathPrefix()</code> in Flysystem 1.x) when working with a <code>FilesystemOperator</code> object.</p>\n<p>In Flysystem 1.x, I could retrieve the root directory of an adapter using code like this:</p>\n<pre class="lang-php prettyprint-override"><code>$adapter = new League\\Flysystem\\Adapter\\Local('/path/to/root');\n$filesystem = new League\\Flysystem\\Filesystem($adapter);\n\necho $adapter-&gt;getPathPrefix(); // Outputs &quot;/path/to/root&quot;\n</code></pre>\n<p>However, in Flysystem 3.x, the <code>FilesystemOperator</code> interface doesn't expose any direct methods to retrieve the root directory, and <code>getPathPrefix()</code> has been removed.</p>\n<p>Here’s an example of how I’m initializing the filesystem in Flysystem 3.x:</p>\n<pre class="lang-php prettyprint-override"><code>use League\\Flysystem\\FilesystemOperator;\nuse League\\Flysystem\\Local\\LocalFilesystemAdapter;\n\n$adapter = new LocalFilesystemAdapter('/path/to/root');\n$filesystem = new Filesystem($adapter);\n</code></pre>\n<p>I need to retrieve the root directory (<code>/path/to/root</code>) from the <code>FilesystemOperator</code> object. After reading the Flysystem 3.x documentation, I see no straightforward way to do this.</p>\n<p><strong>Questions</strong>:</p>\n<ol>\n<li>Is there a recommended way to retrieve the root directory from the <code>FilesystemOperator</code> or the <code>LocalFilesystemAdapter</code> in Flysystem 3.x?</li>\n<li>I see the private <code>$rootLocation</code> property in <code>LocalFilesystemAdapter</code>, but i can't access</li>\n<li>How can I handle this in a way that keeps the code clean and respects Flysystem's new design principles?</li>\n</ol>\n"^^ . + . + . + "<p>I added some data with the function :</p>\n<pre><code>woocommerce_register_additional_checkout_field(\n array(\n 'id' =&gt; 'namespace/newsletter-opt-in',\n 'label' =&gt; 'Subscribe to newsletter ?',\n 'location' =&gt; 'order',\n 'type' =&gt; 'checkbox',\n )\n );\n</code></pre>\n<p>I try to check this checkbox but I can't get the value\nHowever, the data is well returned in my order data column</p>\n<p>I tried :</p>\n<pre><code>$order = wc_get_order($order_id);\n$subscribe = $order-&gt;get_meta('namespace/newsletter-opt-in');\n</code></pre>\n<p>But <code>$subscribe</code> is empty</p>\n"^^ . + . + "0"^^ . + "0"^^ . + . + . + "-2"^^ . + . + . + . + . + . + . + "Custom Post Type Permalinks to Support Multiple URL Structures in WordPress"^^ . + . + "<p>In my program, we can build video using images and audio, collect the images with length and audio file to create the video file. I'm having a problem like <code>Failed to create video: The command &quot;C:\\ffmpeg\\bin\\ffmpeg.EXE -y -f concat -safe 0 -i C:\\xampp\\htdocs\\project\\storage\\app/private\\temp/8eddf84c-690c-4244-ba14-b2070459e32e/filelist.txt -vf scale=1280:720 -r 25 -i C:/xampp/htdocs/project/public/storage/videomakingaudio/1742648144_I2DwaAZKky.mp3 -map 0:v:0 -map 1:a:0 -c:v libx264 -pix_fmt yuv420p -c:a aac -shortest C:\\xampp\\htdocs\\project\\storage\\app/private\\public/videos/video_8eddf84c-690c-4244-ba14-b2070459e32e.mp4&quot; failed.</code></p>\n<p>Please check my code</p>\n<pre><code>`// Create unique folder for this process\n $processId = Str::uuid();\n $tempPath = &quot;temp/{$processId}&quot;;\n $outputPath = &quot;public/videos&quot;;\n \n Storage::makeDirectory($tempPath);\n Storage::makeDirectory($outputPath);\n \n try {\n // Save images to disk\n $imageFiles = [];\n $imageCount = 0;\n \n foreach ($request-&gt;file('images') as $imageFile) {\n $fileName = &quot;{$imageCount}.jpg&quot;;\n $path = $imageFile-&gt;storeAs($tempPath, $fileName);\n $imageFiles[] = Storage::path($path);\n $imageCount++;\n }\n \n // Save audio file if provided\n $audioPath = null;\n if ($request-&gt;hasFile('audio')) {\n $audioFile = $request-&gt;file('audio');\n $audioPath = $audioFile-&gt;storeAs($tempPath, 'audio.' . $audioFile-&gt;getClientOriginalExtension());\n $audioPath = Storage::path($audioPath);\n }\n \n // Create a text file with file paths for ffmpeg\n $fileListPath = Storage::path(&quot;{$tempPath}/filelist.txt&quot;);\n $fileContents = '';\n \n $duration = $request-&gt;input('duration', 2); // Default 2 seconds per image\n \n foreach ($imageFiles as $img) {\n $fileContents .= &quot;file '{$img}'\\n&quot;;\n $fileContents .= &quot;duration {$duration}\\n&quot;;\n }\n \n // Add the last image with a very small duration to avoid issues with certain players\n if (count($imageFiles) &gt; 0) {\n $fileContents .= &quot;file '{$imageFiles[count($imageFiles) - 1]}'\\n&quot;;\n $fileContents .= &quot;duration 0.1\\n&quot;;\n }\n \n file_put_contents($fileListPath, $fileContents);\n \n // Output video name\n $videoFileName = &quot;video_{$processId}.mp4&quot;;\n $outputVideoPath = Storage::path(&quot;{$outputPath}/{$videoFileName}&quot;);\n \n // Command for creating video from images\n $ffmpegCommand = [\n 'ffmpeg',\n '-y', // Overwrite output files\n '-f', 'concat',\n '-safe', '0',\n '-i', $fileListPath,\n '-vsync', 'vfr',\n '-pix_fmt', 'yuv420p'\n ];\n \n // Add audio if provided\n if ($audioPath) {\n $ffmpegCommand = array_merge($ffmpegCommand, [\n '-i', $audioPath,\n '-c:v', 'libx264',\n '-c:a', 'aac',\n '-shortest' // End when the shortest input stream ends\n ]);\n } else {\n $ffmpegCommand = array_merge($ffmpegCommand, [\n '-c:v', 'libx264',\n ]);\n }\n \n // Complete the command with output file\n $ffmpegCommand[] = $outputVideoPath;\n \n // Execute ffmpeg command\n $process = new Process($ffmpegCommand);\n $process-&gt;setTimeout(300); // 5 minutes timeout\n $process-&gt;run();` \n</code></pre>\n<p>Uploaded the photographs, created a file, and included the image path in the file content. I verified the file, the path is correct, and I also checked the audio path, which is correct, but I am still facing that issue.</p>\n"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + "Yes, thanks, I used 777 only temporarily, to be absolutely sure to not have permission issues.\nBTW, I have solved the problem. Now I will write the solution in a response."^^ . + . + "1"^^ . + . + . + "0"^^ . + "2"^^ . + . + . + . + . + . + "global-variables"^^ . + . + "1"^^ . + "2"^^ . + . + . + . + . + . + "0"^^ . + "issue with UABB plugin, i cant see licence box to add and cant be istalled"^^ . + "I wonder about one thing. You add one user, so you have his data in variables. Why do you query for this data after adding him to the database? After all, you have them in variables, wouldn't it be better to use those from variables instead of redundant query?"^^ . + . + "1"^^ . + . + "0"^^ . + "Don't do this with doctrine. I had the same problem and used doctrine. I took about 15 minutes for a simple 500.000 row import. Doing that with [local infile](https://dev.mysql.com/doc/refman/8.4/en/load-data.html) reduced the time to under 20 seconds."^^ . + . + . + . + . + . + . + . + "2"^^ . + . + "1"^^ . + . + . + "0"^^ . + "@C3roe so how can i solve? you mean the query to db is wrong?"^^ . + . + . + . + . + "Applying Global Middleware to All Queued Jobs in Laravel 12 (Like withMiddleware for Web)"^^ . + . + . + . + . + "Set [precision](https://www.php.net/manual/en/ini.core.php#ini.precision) and [serialize_precision](https://www.php.net/manual/en/ini.core.php#ini.serialize-precision) to -1 or a large number (more than 20?) to make sure that the value is actually 100.0 and not just displayed as 100.0."^^ . + "What is the PHP equivalent for Node Version Manager"^^ . + . + . + "2"^^ . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + . + "Relevant: https://stackoverflow.com/help/closed-questions, https://stackoverflow.com/help/duplicates, https://stackoverflow.com/help/reopen-questions in case you're not aware of how the closure/duplicate/re-open system works here."^^ . + . + . + "1"^^ . + "O.... so you then can simply check for an odd string length right? Split by 2, if an odd number merge the last two. I've updated my answer."^^ . + "<p>Solved this question by myself. I am using get_post_meta() which automatically unserialize the data and then array_sum() to get the number. Thanks for the answers.</p>\n"^^ . + . + "Post your command time on both systems and compare to what you get on Imagick to see if it is PHP, Imagemagick or Imagick. Note that Imagemagick does not maintain Imagick. If it is Imagick, the consult with the Imagick developers. Post your input image and I will try to compare results from both your versions of Imagemagick if I can install both your versions. Note that Imagemagick 7.0.7.x is ancient and a lot has changed between then and now. PHP 7 is old also."^^ . + . + "<p>Some versions of OpenSSL no longer support RC4 encryption (see for example <a href="https://onecompiler.com/php/439wn6b6p" rel="nofollow noreferrer">here</a>).</p>\n<p>The script can be fixed like this to correctly detect RC4 support:</p>\n<pre><code>if(function_exists('openssl_encrypt') &amp;&amp; in_array('rc4-40', openssl_get_cipher_methods()))\n{\n function RC4($key, $data)\n {\n return openssl_encrypt($data, 'rc4-40', $key, OPENSSL_RAW_DATA);\n }\n}\nelse\n{\n function RC4($key, $data)\n {\n // Fallback implementation\n // ...\n }\n}\n</code></pre>\n"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + "text"^^ . + . + . + "<p>Setting <code>$worker-&gt;count</code> inside the loop won’t create new processes dynamically.</p>\n<p>You need something similar to this.</p>\n<pre><code>$worker = new \\Workerman\\Worker();\n$worker-&gt;count = 10; # Define here\n$array = [...]; # data\n\n$worker-&gt;onWorkerStart = function($worker) use ($array) {\n \n $totalItems = count($array);\n $perWorker = ceil($totalItems / $worker-&gt;count);\n $workerId = $worker-&gt;id; # worker unique id\n $start = $workerId * $perWorker;\n $slice = array_slice($array, $start, $perWorker);\n \n foreach ($slice as $item) {\n # Process each item\n }\n};\n\n\\Workerman\\Worker::runAll();\n</code></pre>\n"^^ . + . + . + "1"^^ . + . + . + . + "And again you forgot to provide the PHP code."^^ . + . + . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + "0"^^ . + "<p>I have a data file from an external source which contains multiple XML snippets (up to 350). Each one starts with a bit of text and then some XML output like this :</p>\n<pre><code>2025-02-21 16:45:55,760 - Transaction RUN04-merchtranid1 - Success: &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;payment_response&gt;\n &lt;transaction_type&gt;sale&lt;/transaction_type&gt;\n &lt;status&gt;approved&lt;/status&gt;\n &lt;recurring_type&gt;initial&lt;/recurring_type&gt;\n &lt;unique_id&gt;ccc01a6fb43b45cf38298fee067d1688&lt;/unique_id&gt;\n &lt;transaction_id&gt;RUN04-merchtranid1&lt;/transaction_id&gt;\n &lt;mode&gt;test&lt;/mode&gt;\n &lt;timestamp&gt;2025-02-21T14:45:55Z&lt;/timestamp&gt;\n &lt;descriptor&gt;UAT Gen Current UK&lt;/descriptor&gt;\n &lt;amount&gt;0&lt;/amount&gt;\n &lt;currency&gt;EUR&lt;/currency&gt;\n &lt;sent_to_acquirer&gt;true&lt;/sent_to_acquirer&gt;\n &lt;scheme_transaction_identifier&gt;485029514074150&lt;/scheme_transaction_identifier&gt;\n&lt;/payment_response&gt;\n\n2025-02-21 16:45:56,704 - Transaction RUN04-merchtranid2 - Success: &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;payment_response&gt;\n &lt;transaction_type&gt;sale&lt;/transaction_type&gt;\n &lt;status&gt;approved&lt;/status&gt;\n &lt;recurring_type&gt;initial&lt;/recurring_type&gt;\n &lt;unique_id&gt;1f293c3166045f645b9ea4aeee755840&lt;/unique_id&gt;\n &lt;transaction_id&gt;RUN04-merchtranid2&lt;/transaction_id&gt;\n &lt;mode&gt;test&lt;/mode&gt;\n &lt;timestamp&gt;2025-02-21T14:45:56Z&lt;/timestamp&gt;\n &lt;descriptor&gt;UAT Gen Current UK&lt;/descriptor&gt;\n &lt;amount&gt;0&lt;/amount&gt;\n &lt;currency&gt;GBP&lt;/currency&gt;\n &lt;sent_to_acquirer&gt;true&lt;/sent_to_acquirer&gt;\n &lt;scheme_transaction_identifier&gt;MDHMKJSTW&lt;/scheme_transaction_identifier&gt;\n &lt;scheme_settlement_date&gt;0129&lt;/scheme_settlement_date&gt;\n&lt;/payment_response&gt;\n</code></pre>\n<p>I need to roll through it with PHP and pick out the &lt;unique_id&gt; and matching &lt;transaction_id&gt; for each transaction. I can do this if it was a properly formatted XML document but this obviously isn't.</p>\n<p>Would really appreciate any ideas ?</p>\n"^^ . + "Yeah correct its a Java package. Using the jar package & executing the command in PHP. For example - `java -jar -Dfile.encoding=utf-8 ../java/tabula-1.0.5-jar-with-dependencies.jar --no-spreadsheet -f TSV -a 120.63,224.98,145.26,384.23 -p 1 "/private/tmp/sample.pdf"`"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + "When I enter platform login -vvv, I see only this:\nDEBUG Determined CA bundle path: C:\\Users\\28E4~1\\AppData\\Local\\Temp/platformsh-cli-8.2.26-4.22.0\\php\\extras\\cacert.pem\nDEBUG Using Docker credential helper for session storage\nDEBUG Loading session\nStarting local web server with command: C:\\Users\\28E4~1\\AppData\\Local\\Temp\\platformsh-cli-8.2.26-4.22.0\\php\\php.exe -dvariables_order=egps -S 127.0.0.1:5000 -t "C:\\Users\\user\\.platformsh/oauth-listener"\n# Running command: start "" "http://127.0.0.1:5000"\n\nI think I should to use another deploying platform. Do you have any ideas?"^^ . + . + . + "also your code is vulnerable to path traversal..."^^ . + . + . + . + "0"^^ . + . + "True statement. I do need the value of $valid, but I could break after that to save time."^^ . + . + . + . + "But did it work?"^^ . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + "Please properly explain, what "not working" actually means. Did you restart the web server after making such changes?"^^ . + . + "0"^^ . + "I recommend you make use of table aliases in your queries, so you wouldn't have to repeatedly concatenate all the table name constants."^^ . + . + "1"^^ . + "-3"^^ . + "0"^^ . + . + "<p>There is no built-in function. You need to create the handler yourself.\nIn any case, you need an extended class - there are no public methods for searching for a router by name.</p>\n<p>There is an example with <strong>routes</strong> in the documentation:\n<a href="https://codeigniter4.github.io/userguide/concepts/services.html#defining-services" rel="nofollow noreferrer">https://codeigniter4.github.io/userguide/concepts/services.html#defining-services</a></p>\n<p>Add new methods to your class and use them anywhere as a <code>service('routes')-&gt;isAllow('homepage')</code>.</p>\n<p>I think there is no answer to the second question. CodeIgniter does not store the names of the group as you have defined it. He combines the options in the process and forgets about it.</p>\n"^^ . + . + "Check this out: https://stackoverflow.com/questions/635937/how-do-i-specify-unique-constraint-for-multiple-columns-in-mysql\n\nin short: prefix key is not allowed on INT fields..."^^ . + . + "-1"^^ . + . + . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + "2"^^ . + "0"^^ . + . + "I used composer and registered my files as:\n\n```\n{\n "autoload": {\n "psr-4": {\n "MyPlugin\\\\": "src/"\n }\n }\n }\n´´´\n \nBut it seems like limesurvey is already doing that for the plugin folder. The config file works like a charm when i remove the namespace. Did you end up getting it working with namespaces for the client? (right now i feel like im pouring energy down a black hole)"^^ . + . + . + "Thanks @RobEyre for that. It's weird because echoing produces "Yes" but var_dump produces NULL."^^ . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + "php-8.2"^^ . + . + "<p>Since you are using http instead of https, make sur to set K_COOKIE_SECURE to false in shared-&gt;config-&gt;tce_config.php file<br />\n<code>define('K_COOKIE_SECURE', true);</code></p>\n"^^ . + . + "0"^^ . + "<p>Potential backward compatibility issues in Joomla 4\n<a href="https://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_4#Plugins_.28Events.29" rel="nofollow noreferrer">https://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_4#Plugins_.28Events.29</a></p>\n<p>im trying to develop a plugin in php Joomla Virtuemart and i m stack how to call/execute it .</p>\n<p>Php 8.2\nJoomla 5.2 / VM 4.4</p>\n<p>I m trying to get virtuemart ids and quantity from the order details page and parse values via link method to another page. I m trying to show the link below items of order and in shipping section</p>\n<p>the following links does not show</p>\n<p>i dont know if i use the correct class and or the event/trigger ?</p>\n<pre><code>&lt;?php\ndefined('_JEXEC') or die('Restricted access');\n\nuse Joomla\\CMS\\Plugin\\CMSPlugin;\nuse Joomla\\CMS\\Factory;\n\nclass plgSystemSomething extends CMSPlugin\n{\n public function plgVmOnShowOrderBackend($virtuemart_order_id, $orderData)\n {\n // URL Order id\n $orderLink = JRoute::_('index.php?option=com_virtuemart&amp;view=orders&amp;task=edit&amp;virtuemart_order_id=' . $virtuemart_order_id, false);\n\n // HTML show the link\n $html = '&lt;div style=&quot;margin-top:15px; padding:10px; border:1px solid #ddd; background:#f9f9f9;&quot;&gt;\n &lt;strong&gt;Here :&lt;/strong&gt; \n &lt;a href=&quot;' . $orderLink . '&quot; target=&quot;_blank&quot;&gt;Links of order #' . $virtuemart_order_id . '&lt;/a&gt;\n &lt;/div&gt;';\n\n return $html;\n }\n}\n\n</code></pre>\n<p>I temporary use this method</p>\n<pre><code> $app = Factory::getApplication();\n\n if ($app-&gt;isClient('administrator') &amp;&amp; \n($app-&gt;input-&gt;get('option') == 'com_virtuemart') &amp;&amp; \n($app-&gt;input-&gt;get('view') == 'orders') &amp;&amp; \n($app-&gt;input-&gt;get('virtuemart_order_id'))) { do }\n</code></pre>\n"^^ . + . + . + . + "I also dont understand the problem. If the updates happen simultaneously, which they shouldnt since its php, dispatch the actual inserts as jobs to make sure they get worked off asynchronously and add the check logic in those jobs?"^^ . + "1"^^ . + . + . + . + "0"^^ . + "1"^^ . + . + "@nico-haase I just tried with static JS and the graph is well displayed on the page load"^^ . + "@Tatachiblob hi! I followed the instructions and was only able to go up until step 4 then I hit a dead end. It seems that the link is no longer available in jellycan. I also did try to download the memcache from https://memcached.org/downloads but I couldn't find any memcache.exe on the last two versions I downloaded."^^ . + . + . + "This can be solved on the calling side, the API side, or both. If empty values are never valid, I would argue it is probably the API's responsibility. Do you have control over that?"^^ . + . + "Superglobals vs $GLOBALS visibility in PHP"^^ . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + "<p>This code was working up until I upgraded to HPOS and its throwing errors now. please see code below, how do I fix this?</p>\n<p>// Add a custom field IMEI Number</p>\n<pre><code>add_action('woocommerce_before_order_itemmeta', 'add_order_item_custom_field', 10, 2);\n\nfunction add_order_item_custom_field($item_id, $item) {\n // Targeting line items type only\n if ($item-&gt;get_type() !== 'line_item') return;\n\n woocommerce_wp_text_input(array(\n 'id' =&gt; 'imei_numberID' . $item_id,\n 'label' =&gt; __('Serial Number', 'cfwc'),\n 'description' =&gt; __('Enter the Serial Number of the Device/s separated by comma for better tracking.', 'ctwc'),\n 'desc_tip' =&gt; true,\n 'class' =&gt; 'woocommerce',\n 'value' =&gt; wc_get_order_item_meta($item_id, '_serial_number'),\n ));\n}\n</code></pre>\n<p>// Save the custom field value</p>\n<pre><code>add_action('save_post', 'save_order_item_custom_field_value', 10000, 2);\n\nfunction save_order_item_custom_field_value($post_id, $post) {\n if ('shop_order' !== $post-&gt;post_type)\n return $post_id;\n\n if (defined('DOING_AUTOSAVE') &amp;&amp; DOING_AUTOSAVE)\n return $post_id;\n\n if (!current_user_can('edit_shop_order', $post_id))\n return $post_id;\n\n $order = wc_get_order($post_id);\n\n // Loop through order items\n foreach ($order-&gt;get_items() as $item_id =&gt; $item) {\n if (isset($_POST['imei_numberID' . $item_id])) {\n $item-&gt;update_meta_data('_serial_number', \n sanitize_text_field($_POST['imei_numberID' . $item_id]));\n $item-&gt;save();\n }\n }\n $order-&gt;save();\n }\n</code></pre>\n"^^ . + . + . + . + "1"^^ . + "<p>First of all, make sure your passwords in the database are actually password hashes and that they were hashed via <a href="https://www.php.net/manual/en/function.password-hash.php" rel="nofollow noreferrer">password_hash</a>. If you did not hash them or did not use this way to hash them, then your password validation is incompatible with the way passwords and password hashes are being stored in your database.</p>\n<p>The documentation warns you that if you use <a href="https://www.php.net/manual/en/password.constants.php#constant.password-bcrypt" rel="nofollow noreferrer">PASSWORD_BCRYPT</a> as the algorithm then your password is truncated to 72 characters before being hashed.</p>\n<p>The first parameter is your password string, the second is the algorithm and the third is the options. These are possible algorithms to choose from</p>\n<blockquote>\n<p>PASSWORD_DEFAULT - Use the bcrypt algorithm (default as of PHP 5.5.0). Note that this constant is designed to change over time as new and stronger algorithms are added to PHP. For that reason, the length of the result from using this identifier can change over time. Therefore, it is recommended to store the result in a database column that can expand beyond 60 characters (255 characters would be a good choice).</p>\n<p>PASSWORD_BCRYPT - Use the CRYPT_BLOWFISH algorithm to create the hash. This will produce a standard crypt() compatible hash using the &quot;$2y$&quot; identifier. The result will always be a 60 character string, or false on failure.</p>\n<p>PASSWORD_ARGON2I - Use the Argon2i hashing algorithm to create the hash. This algorithm is only available if PHP has been compiled with Argon2 support.</p>\n<p>PASSWORD_ARGON2ID - Use the Argon2id hashing algorithm to create the hash. This algorithm is only available if PHP has been compiled with Argon2 support.</p>\n</blockquote>\n<p>and among the options you may have a salt or other specified elements that alter the hash from the unmodified result.</p>\n<p><a href="https://www.php.net/manual/en/function.password-verify.php" rel="nofollow noreferrer">password_verify</a> in its second parameter passes the cost and salt too.</p>\n<p>You can try running</p>\n<pre><code>password_verify($rawPassword, password_hash($rawPassword, $algo, $options))\n</code></pre>\n<p>and it should always be true. So try this with your test-case. If it's not matching, then you found errors in the PHP functions that you call. If they are matching, then you do not properly pass the hash and will need to carefully check what you pass, or the password was simply incorrect.</p>\n"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + "1"^^ . + "1"^^ . + "0"^^ . + "Guys, I added an explanation in the post. There is a misunderstanding between this project (1 pack vs 50 packs) and the projects that use these packs. I hope it is clearer now."^^ . + . + "<p>If you're using Laravel Reverb, please note that if you're using a domain protected by SSL, you may need to implement the broadcasting authentication method yourself. I encountered this issue once. For a live server, you will also need to configure a reverse proxy in Apache or Nginx to get everything running smoothly.</p>\n<p><strong>Frontend <code>env</code> file configuration</strong></p>\n<pre><code>REVERB_SERVER_PORT=8080\nREVERB_PORT=80\n</code></pre>\n<p><strong>Backend <code>env</code> file configuration</strong></p>\n<pre><code>VITE_REVERB_PORT=8080\nVITE_REVERB_SCHEME=http\n</code></pre>\n<p><strong>Laravel echo setup for Javascript</strong></p>\n<pre><code>const echo = new Echo({\n broadcaster: &quot;reverb&quot;,\n key: import.meta.env.VITE_REVERB_APP_KEY,\n wsHost: import.meta.env.VITE_REVERB_HOST,\n wsPort: import.meta.env.VITE_REVERB_PORT ?? 80,\n wssPort: import.meta.env.VITE_REVERB_PORT ?? 443,\n forceTLS: false,\n encrypted: true,\n enabledTransports: [&quot;ws&quot;],\n transport: &quot;ws&quot;,\n \n authEndpoint: import.meta.env.VITE_API_URL + &quot;/broadcasting/auth&quot;,\n \n auth: {\n headers: {\n Authorization: `Bearer ${token}`,\n Accept: &quot;application/json&quot;,\n },\n },\n });\n\n // Use private().listen() if you're using event\n \n echo?.private(`room.${props.room.room_code}`)?.notification((room) =&gt; {\n // Handle notification\n});\n</code></pre>\n"^^ . + . + "phpstorm"^^ . + . + "0"^^ . + . + "2"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + "I've already voted to re-open it, but it needs 3 votes. Be patient"^^ . + . + "1"^^ . + "1"^^ . + "If the _"page that returns with the table data"_ is the _direct_ response to the request that submitted the data, then it should not need sessions or cookies. The data should be available _while_ that page gets created."^^ . + . + . + "1"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + "1"^^ . + "<p>I have a few forms on my website which I need site visitors to submit in sequence.</p>\n<p>'form1' sends the user data to the (php mailto) form mailer.</p>\n<p>The header(location) of the form mailer then directs the site visitor to a page with 'form2'.</p>\n<p>I need a php solution to pre-populate form2 with the previously submitted data from form1.</p>\n<p>I would like a slicker alternative to passing the data through the URL.</p>\n<p>Form 1:</p>\n<pre><code>&lt;form id=&quot;form1&quot; action=&quot;formMailer.php&quot; method=&quot;post&quot;&gt;\n Name:&amp;nbsp;&lt;input type=&quot;text&quot; id=&quot;userName&quot; name=&quot;userName&quot; value=&quot;&quot;&gt;\n Email:&amp;nbsp;&lt;input type=&quot;email&quot; id=&quot;userEmail&quot; name=&quot;userEmail&quot; value=&quot;&quot;&gt;\n&lt;input type=&quot;submit&quot; id=&quot;submitButton&quot; name=&quot;submitButton&quot; value=&quot;Submit&quot;&gt;\n</code></pre>\n<p>PHP Form Mailer:</p>\n<pre><code>&lt;?php \n\n $name = $_POST['userName']; \n $email = $_POST['userEmail']; \n\n $message =\n\n &quot;\\r\\nYour Name: &quot; .$name .\n &quot;\\r\\nYour Email: &quot; .$email;\n\n $subject =&quot;Subject of email&quot;;\n\n $mailto = &quot;recieving@email.com&quot;;\n\n $separator = md5(uniqid(time()));\n\n $eol = &quot;\\r\\n&quot;;\n\n$headers = &quot;From: &quot;.$name.&quot; &lt;&quot;.$email.&quot;&gt;&quot; . $eol;\n$headers .= &quot;MIME-Version: 1.0&quot; . $eol;\n$headers .= &quot;Content-Type: multipart/mixed;&quot;. $eol. &quot; boundary=\\&quot;&quot; . $separator . &quot;\\&quot;&quot; . $eol;\n$headers .= &quot;This is a MIME encoded message.&quot; . $eol . $eol;\n\n$body = &quot;--&quot; . $separator . $eol;\n$body .= &quot;Content-Type: text/plain; charset=\\&quot;iso-8859-1\\&quot;&quot; . $eol;\n$body .= &quot;Content-Transfer-Encoding: 8bit&quot; . $eol . $eol;\n$body .= $message . $eol;\n\n mail($mailto, $subject, $body, $headers);\n\n header('location: /formFolder/form2.php');\n\n?&gt;\n</code></pre>\n<p>Form 2:</p>\n<pre><code>&lt;form id=&quot;form2&quot; action=&quot;nextAction&quot; method=&quot;post&quot;&gt;\n Name:&amp;nbsp;&lt;input type=&quot;text&quot; id=&quot;userName&quot; name=&quot;userName&quot; value=&quot;&quot;&gt;\n Email:&amp;nbsp;&lt;input type=&quot;email&quot; id=&quot;userEmail&quot; name=&quot;userEmail&quot; value=&quot;&quot;&gt;\n Other Data:&amp;nbsp;&lt;input type=&quot;text&quot; id=&quot;other_userData&quot; name=&quot;other_userData&quot; value=&quot;&quot;&gt;\n&lt;input type=&quot;submit&quot; id=&quot;submitButton&quot; name=&quot;submitButton&quot; value=&quot;Submit&quot;&gt;\n</code></pre>\n<p>I tried some php 'get' and 'echo' script, but it seems the data gets lost somewhere between the mailto and the second form.</p>\n"^^ . + . + "<p>Trying to run WordPress in kubernetes cluster - However Faling to launch due to error failed to open stream: No such file or directory.</p>\n<p>I have wordpress pod using volumes for <code>/var/www/html</code></p>\n<p>POD Error logs</p>\n<pre><code>No 'wp-config.php' found in /var/www/html, but 'WORDPRESS_...' variables supplied; copying '/usr/src/wordpress/wp-config-\n[php:error] [pid 56] [client 10.244.2.0:44079] PHP Fatal error: \nUncaught Error: Failed opening required '/var/www/html/wp-load.php' (include_path='.:/usr/local/lib/php') in /var/www/html/wp-blog-header.php:13\\nStack trace:\\n#0 /var/www/html/index.php(17): require()\\n#1 {main}\\n \nthrown in /var/www/html/wp-blog-header.php on line 13, \nreferer: http://localhost:8001/\n</code></pre>\n<p>NFS Directory\n<a href="https://i.sstatic.net/ZIXQ9dmS.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZIXQ9dmS.png" alt="enter image description here" /></a></p>\n<p>Kubernetes yaml files.</p>\n<pre><code>---\n# Wordpress deployment\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: wordpress\nspec:\n replicas: 1\n selector:\n matchLabels:\n app: wordpress-app\n template:\n metadata:\n labels:\n app: wordpress-app\n spec:\n containers:\n - name: wordpress\n image: wordpress:6.2.1-apache\n securityContext:\n capabilities:\n add: [ &quot;SYS_ADMIN&quot; ]\n ports:\n - containerPort: 80\n name: http-port\n volumeMounts:\n - name: wordpress-data\n mountPath: /var/www/html\n envFrom:\n - configMapRef:\n name: wordpress-cm\n volumes:\n - name: wordpress-data\n persistentVolumeClaim:\n claimName: wordpress-pvc\n---\n# Persistent volume - Dynamically provission using nfs server\nkind: PersistentVolumeClaim\napiVersion: v1\nmetadata:\n name: wordpress-pvc\n labels:\n app: wordpress-app\nspec:\n storageClassName: nfs-client\n accessModes:\n - ReadWriteOnce\n resources:\n requests:\n storage: 10Gi\n---\n# ConfigMap\napiVersion: v1\nkind: ConfigMap\nmetadata:\n name: wordpress-cm\n namespace: default\ndata:\n WORDPRESS_DB_NAME: wordpress\n WORDPRESS_DB_USER: root\n WORDPRESS_DB_PASSWORD: 'Password'\n WORDPRESS_DB_HOST: mysql-0.mysql.default.svc.cluster.local\n WORDPRESS_DEBUG: &quot;true&quot;\n---\n# Service\napiVersion: v1\nkind: Service\nmetadata:\n name: wordpress\n namespace: default\nspec:\n type: LoadBalancer\n selector:\n app: wordpress-app\n ports:\n - protocol: TCP\n port: 80\n targetPort: http-port\n\n</code></pre>\n"^^ . + . + . + "query-builder"^^ . + . + "0"^^ . + "OK, so every time you draw a ball from the urn, you remove all the balls that belong to that person and continue the process until the end?"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + "LiveComponent isn't updating the LiveProp value"^^ . + "Unfortunately I do not have any more output than exception and related class mentioned in main post. I made this script to provide upgrade: https://pastebin.com/GQPVk2u2 @nico-haase\n\nDefault php on the server is `PHP 8.4.4 (cli) (built: Feb 15 2025 08:59:03) (NTS)` but in the script I use php7.4 used by PrestaShop I would like to upgrade. :)\n@c3roe"^^ . + . + "3"^^ . + "Prestashop Controllers and Hooks"^^ . + "Issues with Parsing Classic Editor"^^ . + . + . + "Laravel many to many relation between TWO polymorphic types"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "[How to create a minimal, reproduceable example](https://stackoverflow.com/help/minimal-reproducible-example) will help you compose your question in a way that allows us to better help you. Please read it and adjust your post accordingly."^^ . + . + . + "0"^^ . + "<p>The problem was laying somewhere in the FBlog package. I just removed the package altogether for the time being and things are working again. Thank you Tatachiblob for your help</p>\n"^^ . + . + "0"^^ . + . + "0"^^ . + "You really wrote something that's better and more feature-complete, and better tested and more reliable than PHPMailer? I'm sure the world would love to see it, perhaps you should publish it as a package for everyone to benefit from?"^^ . + "0"^^ . + "<p>I think your current logic doesn't track whether the user has already rated. To fix this, use a cookie for guest users and a custom user meta field for logged-in users.</p>\n<p>A solution can be like this:</p>\n<pre><code>// Check user is rated\nfunction user_already_rated() {\n if (is_user_logged_in()) {\n return get_user_meta(get_current_user_id(), 'user_has_rated_' . get_the_ID(), true);\n } else {\n return isset($_COOKIE['rated_post_' . get_the_ID()]);\n }\n}\n\n// Hide rating if user rated\nadd_filter('comment_form_fields', function($fields) {\n if (user_already_rated()) {\n unset($fields['rating']);\n }\n return $fields;\n});\n\n// After submit a rating, set cookie\nadd_action('comment_post', function($comment_id) {\n if (!empty($_POST['rating'])) {\n if (is_user_logged_in()) {\n update_user_meta(get_current_user_id(), 'user_has_rated_' . get_the_ID(), true);\n } else {\n setcookie('rated_post_' . get_the_ID(), 'true', time() + (86400 * 365), COOKIEPATH, COOKIE_DOMAIN);\n }\n }\n});\n</code></pre>\n<p>the above code displays the rating form only once per user (logged-in or guest) and hides it afterward, but allows unlimited comments.</p>\n"^^ . + "<p>when I try to create a symfony project, this is what I get. However, a few days ago, when I did <code>symfony -v</code>, everything was OK.</p>\n<p>this is what I get as an error :</p>\n<p><code>You must enable the openssl extension in your php.ini to load information from https://repo.packagist.org</code></p>\n<p>I've removed the ; in front of <code>extension=php_openssl</code>.</p>\n<p>Do this command (without success) <code>compose config -g -- disable-tls true</code></p>\n<p>this one too: <code>php -i | Select-String “openssl</code></p>\n<p>and the result :</p>\n<p><code>OpenSSL support =&gt; disabled (install ext/openssl)</code></p>\n"^^ . + . + "It depends what the receiving server is expecting. There's no real functional difference whether you put the token in the body or the header, as long as both ends of the process (JS code and server code) are expecting the same approach."^^ . + . + . + "when a class is instantiated (`$p = new Alpha`) therefore the variable `$p`'s **value** is not the instantiated object itself but it is actually the "object identifier", right ?"^^ . + "-1"^^ . + . + "<p><a href="https://i.sstatic.net/oTDsJKOA.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/oTDsJKOA.png" alt="see the highlighted parts" /></a></p>\n<p>Sometimes VSCode goes crazy and converts the tooltip to real characters and the code crashes because it doesn't understand what <code>baseOptions:</code> means.</p>\n<p>I don't want to turn off the tooltip.\nHow can I turn it off so it turns into source code?</p>\n<pre class="lang-php prettyprint-override"><code>public function behaviors() {\n return HandleAuth::behaviors(\n [\n &quot;verbs&quot; =&gt; [\n &quot;class&quot; =&gt; VerbFilter::class\n ]\n ]\n );\n}\n</code></pre>\n"^^ . + . + . + . + . + . + . + "http"^^ . + "1"^^ . + . + "1"^^ . + "Runtime Exception using the Maestroerror\\HeicToJpg library in Codeigniter"^^ . + ""there's an error detected by Cursor IDE" - can you share the error message in text form, along with the code involved?"^^ . + . + . + . + . + "I don't see the point to catch the following line since you already know it exists and it doesn't provide any new information. In my opinion, the line that contains `HP: 0` suffices."^^ . + "2"^^ . + "laravel-7"^^ . + . + "open-telemetry-collector"^^ . + . + . + . + "One step at a time. After that, start with the upload sample for small (<3MB) files as that's pretty short. Make it with with hard-coded values again, in a self-contained script. The think about how you might pass a file name as input to it, and then think about maybe how you could change that to be a file that the user selected. It's a jigsaw puzzle, but if you get each of the pieces working independently, they are much more achievable on their own, and then it's far easier to fit them together - at that point you're only worrying about the joins"^^ . + . + "@Blackhole I was just adding more context :)"^^ . + . + "1"^^ . + . + . + . + "0"^^ . + ""but i don't receive the confirmation e-mail" - just to state what is hopefully obvious, but before sending an email I would make sure the code's logic is working, and you can do that with a simple `die('Role changed');` message. This way you aren't hunting for a bug that turns out to be unrelated to code but instead elsewhere in SMTP, SPF, DKIM, etc."^^ . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + "@Barmar Payload action: add_to_wishlist\nadd_to_wishlist: 13058\ncontext: frontend\nproduct_type: simple\nnonce: 3ccef0e66e but response {"result":false}"^^ . + "0"^^ . + "caching"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + "5"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + "aes"^^ . + "@IMSoP I didn't vote this question, but I've learned that I should only vote how helpful this question is for future users and duplicates aren't very helpful. A vote should have nothing to do with the user, learning things the first time or difficult searches. It should only indicate future users if this question could help them. Duplicates are usually rather not helpful, because they hide good questions and answers."^^ . + . + . + "<p>I am integrating PhonePe's Auto-Debit API (<code>/v3/recurring/debit/init</code>) but keep receiving the following error response:</p>\n<pre><code>{ \n &quot;status&quot;: &quot;error&quot;, \n &quot;message&quot;: &quot;Please check the inputs you have provided. [message = Incorrect Request.]&quot; \n}\n</code></pre>\n<p>Payload Request is:</p>\n<pre><code>{\n &quot;merchantId&quot;: &quot;MID12345&quot;,\n &quot;merchantUserId&quot;: &quot;U123456789&quot;,\n &quot;subscriptionId&quot;: &quot;OMS2006110139450123456789&quot;,\n &quot;transactionId&quot;: &quot;TX1234567890&quot;,\n &quot;autoDebit&quot;: true,\n &quot;amount&quot;: 39900\n}\n</code></pre>\n<p>X-VERIFY, payload format correct or wrong?\nI have followed the <a href="https://developer.phonepe.com/v1/reference/recurring-init" rel="nofollow noreferrer">documentation</a> and ensured the request format is correct, but I still get this error. I need clarification on whether my request payload is missing any required fields or if the <code>X-VERIFY</code> signature is incorrect.</p>\n<p>How should I structure the request properly to avoid this error? Any guidance would be appreciated.</p>\n<ul>\n<li>Ensured transactionId is unique for every request.</li>\n<li>Verified amount is in paisa format (e.g., ₹399.00 = 39900).</li>\n<li>Tested in Postman using hardcoded values.</li>\n<li>Checked subscriptionId format to ensure correctness.</li>\n<li>Generated X-VERIFY hash according to PhonePe’s documentation.</li>\n<li>Logged request payload to confirm correct structure.</li>\n</ul>\n<p>Expected Outcome: I expected a successful API response with transaction details.</p>\n<p>Here is the minimal reproducible example for my issue:</p>\n<pre><code>$apiKey = 'your_salt_key';\n$baseUrl = '``https://mercury-t2.phonepe.com``';\n$subscriptionId = 'SUB123456';\n$transactionId = 'TX' . strtoupper(bin2hex(random_bytes(8))); // Generate unique transaction ID\n$amount = 10000; // Amount in paise (₹100)\n$callurl = &quot;https://yourdomain.com/api/phonepe/callback&quot;\n\n// Request payload\n$authPayload_1 = [\n 'merchantId' =&gt; 'your_merchant_id',\n 'merchantUserId' =&gt; 'your_merchant_id',\n 'subscriptionId' =&gt; $subscriptionId, \n 'transactionId' =&gt; $transactionId,\n 'autoDebit' =&gt; true,\n 'amount' =&gt; $amount,\n];\n$base64Payload = base64_encode(json_encode($authPayload_1));\n$payloadHash_1 = $base64Payload . '/v3/recurring/debit/init' . $apiKey;\n$checksum_a = hash('sha256', $payloadHash_1);\n$xVerifyy = $checksum_a . '###' . 'your_salt_index';\n\n$curl = curl_init();\ncurl_setopt_array($curl, [\n CURLOPT_URL =&gt; $baseUrl . '/v3/recurring/debit/init',\n CURLOPT_RETURNTRANSFER =&gt; true,\n CURLOPT_POST =&gt; true,\n CURLOPT_POSTFIELDS =&gt; json_encode(['request' =&gt; $base64Payload]),\n CURLOPT_HTTPHEADER =&gt; [\n 'Content-Type: application/json',\n 'X-VERIFY: ' . $xVerifyy,\n 'X-CALLBACK-URL: '.$callurl\n\n ],\n]);\n\n$response = curl_exec($curl);\n$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\ncurl_close($curl);\n\n$responseData = json_decode($response, true);\nvar_dump($responseData);```\n \n \n</code></pre>\n"^^ . + . + . + "0"^^ . + . + "<p>simply using <code>header('location: /formFolder/form2.php');</code> loses the data. You need a way to persist the data between requests.</p>\n<p>1. Modify <code>formMailer.php</code> to use sessions</p>\n<pre><code>&lt;?php\nsession_start(); // Start the session\n\n$name = $_POST['userName'];\n$email = $_POST['userEmail'];\n\n// Store data in session variables\n$_SESSION['userName'] = $name;\n$_SESSION['userEmail'] = $email;\n\n$message =\n &quot;\\r\\nYour Name: &quot; . $name .\n &quot;\\r\\nYour Email: &quot; . $email;\n\n$subject = &quot;Subject of email&quot;;\n$mailto = &quot;recieving@email.com&quot;;\n$separator = md5(uniqid(time()));\n$eol = &quot;\\r\\n&quot;;\n\n$headers = &quot;From: &quot; . $name . &quot; &lt;&quot; . $email . &quot;&gt;&quot; . $eol;\n$headers .= &quot;MIME-Version: 1.0&quot; . $eol;\n$headers .= &quot;Content-Type: multipart/mixed;&quot; . $eol . &quot; boundary=\\&quot;&quot; . $separator . &quot;\\&quot;&quot; . $eol;\n$headers .= &quot;This is a MIME encoded message.&quot; . $eol . $eol;\n\n$body = &quot;--&quot; . $separator . $eol;\n$body .= &quot;Content-Type: text/plain; charset=\\&quot;iso-8859-1\\&quot;&quot; . $eol;\n$body .= &quot;Content-Transfer-Encoding: 8bit&quot; . $eol . $eol;\n$body .= $message . $eol;\n\nmail($mailto, $subject, $body, $headers);\n\nheader('location: /formFolder/form2.php');\n?&gt;\n</code></pre>\n<p>2. Modify <code>form2.php</code> to retrieve and populate the form using session data</p>\n<pre><code>&lt;?php\nsession_start(); // Start the session\n\n$userName = isset($_SESSION['userName']) ? $_SESSION['userName'] : '';\n$userEmail = isset($_SESSION['userEmail']) ? $_SESSION['userEmail'] : '';\n\n// Optionally, clear the session data after using it if you don't need it later\n// unset($_SESSION['userName']);\n// unset($_SESSION['userEmail']);\n?&gt;\n\n&lt;form id=&quot;form2&quot; action=&quot;nextAction&quot; method=&quot;post&quot;&gt;\n Name:&amp;nbsp;&lt;input type=&quot;text&quot; id=&quot;userName&quot; name=&quot;userName&quot; value=&quot;&lt;?php echo htmlspecialchars($userName); ?&gt;&quot;&gt;\n Email:&amp;nbsp;&lt;input type=&quot;email&quot; id=&quot;userEmail&quot; name=&quot;userEmail&quot; value=&quot;&lt;?php echo htmlspecialchars($userEmail); ?&gt;&quot;&gt;\n Other Data:&amp;nbsp;&lt;input type=&quot;text&quot; id=&quot;other_userData&quot; name=&quot;other_userData&quot; value=&quot;&quot;&gt;\n &lt;input type=&quot;submit&quot; id=&quot;submitButton&quot; name=&quot;submitButton&quot; value=&quot;Submit&quot;&gt;\n&lt;/form&gt;\n</code></pre>\n<p>Important Considerations:</p>\n<p>Sessions rely on cookies or URL parameters to track users. Ensure your website is configured to handle sessions securely.</p>\n<p>Add more robust error handling to your code, such as checking if $_POST variables are set before accessing them.</p>\n<p>Sessions have a default expiration time. You can configure this in your PHP settings.</p>\n<p>After form2 is submitted, you can unset or destroy the session, so a user cannot reload form2 and see the data.</p>\n"^^ . + . + "PHP Deprecated: Creation of dynamic property WooCommerce\\Square\\Gateway\\Gift_Card::$placeholder_id is deprecated in /home/teconnexpower/public_html/wp-content/plugins/woocommerce-square/includes/Framework/PaymentGateway/Payment_Gateway.php"^^ . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + "@hakre I understand your concern bro. but there is something called blog in www. Do read them sometime, not everything is generated with LLM,\nhttps://www.devgem.io/posts/how-to-use-prefix-with-middleware-in-laravel-11\nhttps://www.slingacademy.com/article/route-prefixing-and-grouping-in-laravel-a-complete-guide/"^^ . + "Here is [my own answer](https://stackoverflow.com/a/79441591/4512005). It works."^^ . + "<p>Without more information, all I can suggest are generalities: <em>factorize baby, factorize</em></p>\n<pre><code>$pattern = '~\n (?=\\D)\n (?:\n \\b (?: xx[gls] | (\\D) \\1+ ) \\b \\K\n |\n (\\D) \\2+\n )\n ~x';\n\n$replacement = '$2';\n</code></pre>\n<ol>\n<li><p>Use the <em>first character discrimination technique</em> -&gt; the goal is to fail quickly on useless positions in the string. That's why I put a lookahead assertion in factor at the start of the pattern. Note that the three branches of your original pattern matches this lookahead. Testing if a basic lookahead at the start fails or not is faster than testing three branches.</p>\n</li>\n<li><p>Same idea for the word-boundary, the two first branches of your original pattern have word boundaries, put them in factor using groups.</p>\n</li>\n<li><p><code>xxg|xxl|xxs</code> =&gt; <code>xx[gls]</code>. One more time, remember that alternations have a cost.</p>\n</li>\n</ol>\n"^^ . + . + "0"^^ . + "try `$groupingline = $linedata->groupBy('id')->map(function ($group) {\n return $group->values();\n})->values();`"^^ . + "0"^^ . + "-1"^^ . + . + . + . + . + . + . + . + "<p>I have a table in PHP, which has rows being generated dynamically.</p>\n<p>Multiple rows in one row.</p>\n<p>This is the structure that is needed and cannot be changed. This is a sample table structure(image attached). Now, I have code written that table in a simmilar structure. But i cannot apply pagination and search functionalities of DATATABLES on this, as there are dynamic rows. What should i do?</p>\n<p>This is the table part and I tried to initialise it using datatable, but datatables failed to paginate or append search to it.:</p>\n<pre><code>&lt;table class=&quot;table table-striped table-hover table-bordered&quot; id=&quot;myTable&quot; style=&quot;margin-bottom: 5rem; width:100%;&quot;&gt;\n &lt;thead&gt;\n &lt;tr&gt;\n &lt;th rowspan=&quot;2&quot; class=&quot;tHeader&quot;&gt;S.No.&lt;/th&gt;\n &lt;th rowspan=&quot;2&quot; class=&quot;tHeader&quot;&gt;Name &amp; Designation&lt;/th&gt;\n &lt;th colspan=&quot;5&quot; class=&quot;tHeader&quot;&gt;Year 2023&lt;/th&gt;\n &lt;th colspan=&quot;5&quot; class=&quot;tHeader&quot;&gt;Year2024&lt;/th&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;th class=&quot;tHeader&quot;&gt;Details of property 2023&lt;/th&gt;\n &lt;th class=&quot;tHeader&quot;&gt;Present Value 2023&lt;/th&gt;\n &lt;th class=&quot;tHeader&quot;&gt;How acquire 2023&lt;/th&gt;\n &lt;th class=&quot;tHeader&quot;&gt;Annual Income 2023&lt;/th&gt;\n &lt;th class=&quot;tHeader&quot;&gt;Remarks 2023&lt;/th&gt;\n &lt;th class=&quot;tHeader&quot;&gt;Details of property 2024&lt;/th&gt;\n &lt;th class=&quot;tHeader&quot;&gt;Present Value 2024&lt;/th&gt;\n &lt;th class=&quot;tHeader&quot;&gt;How acquire 2024&lt;/th&gt;\n &lt;th class=&quot;tHeader&quot;&gt;Annual Income 2024&lt;/th&gt;\n &lt;th class=&quot;tHeader&quot;&gt;Remarks 2024&lt;/th&gt;\n &lt;/tr&gt;\n &lt;/thead&gt;\n &lt;tbody&gt;\n &lt;?php if(!empty($infoData))\n {\n $i = 1;\n foreach($infoData as $row)\n {\n $prev_types = explode(&quot;&lt;br&gt;&quot;, $row['prop_type_prev']);\n $prev_addresses = explode(&quot;&lt;br&gt;&quot;, $row['prev_address']);\n $prev_values = explode(&quot;&lt;br&gt;&quot;, $row['value_prev']);\n $annual_prev = explode(&quot;&lt;br&gt;&quot;, $row['annual_prev']);\n $remarks_prev = explode(&quot;&lt;br&gt;&quot;, $row['remarks_prev']);\n $on_name_prev = explode(&quot;&lt;br&gt;&quot;, $row['on_name_prev']);\n $person_prev = explode(&quot;&lt;br&gt;&quot;, $row['person_prev']);\n $rrt_name_prev = explode(&quot;&lt;br&gt;&quot;, $row['rrt_name_prev']);\n $prop_acq_type_name_prev = explode(&quot;&lt;br&gt;&quot;, $row['prop_acq_type_name_prev']);\n $acq_date_prev = explode(&quot;&lt;br&gt;&quot;, $row['acq_date_prev']);\n $share_prev = explode(&quot;&lt;br&gt;&quot;, $row['share_prev']);\n\n $prop_type_name_curr = explode(&quot;&lt;br&gt;&quot;, $row['prop_type_name_curr']);\n $current_address = explode(&quot;&lt;br&gt;&quot;, $row['current_address']);\n $present_value_curr = explode(&quot;&lt;br&gt;&quot;, $row['present_value_curr']);\n $annual_income_curr = explode(&quot;&lt;br&gt;&quot;, $row['annual_income_curr']);\n $remarks_curr = explode(&quot;&lt;br&gt;&quot;, $row['remarks_curr']);\n $string_agg = explode(&quot;&lt;br&gt;&quot;, $row['string_agg']);\n $person_current = explode(&quot;&lt;br&gt;&quot;, $row['person_current']);\n $rrt_name_curr = explode(&quot;&lt;br&gt;&quot;, $row['rrt_name_curr']);\n $prop_acq_type_name_curr = explode(&quot;&lt;br&gt;&quot;, $row['prop_acq_type_name_curr']);\n $acq_date_curr = explode(&quot;&lt;br&gt;&quot;, $row['acq_date_curr']);\n $share_curr = explode(&quot;&lt;br&gt;&quot;, $row['share_curr']);\n\n\n $rowspan = max(count($prev_types), count($prev_addresses), count($prev_values));\n\n for($j = 0; $j &lt; $rowspan; $j++)\n { ?&gt;\n &lt;tr&gt;\n &lt;?php if($j == 0) { ?&gt;\n &lt;td rowspan=&quot;&lt;?= $rowspan; ?&gt;&quot;&gt;&lt;?= $i++; ?&gt;&lt;/td&gt;\n &lt;td rowspan=&quot;&lt;?= $rowspan; ?&gt;&quot;&gt;&lt;?= $row['emp_code'] . &quot; &quot; . $row['emp_name'] . &quot; &quot; . $row['desig']; ?&gt;&lt;/td&gt;\n &lt;?php } ?&gt;\n\n &lt;td&gt;&lt;?= isset($prev_types[$j]) ? $prev_types[$j] . &quot; &quot; . $prev_addresses[$j] : ''; ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?= isset($prev_values[$j]) ? $prev_values[$j] : ''; ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?php\n if($prop_on_name_prev[$j] == 2)\n {\n echo isset($person_prev[$j]) ? $person_prev[$j] . &quot; &quot; . $rrt_name_prev[$j] . &quot;&lt;br&gt;&quot; : 'null';\n } else if($prop_on_name_prev[$j] == 1)\n {\n echo 'self' . &quot;&lt;br&gt;&quot;;\n } else\n echo &quot; &quot; . &quot;&lt;br&gt;&quot;;\n echo isset($prop_acq_type_name_prev[$j]) ? $prop_acq_type_name_prev[$j] . &quot; &quot; : '';\n if(isset($acq_date_prev[$j]) &amp;&amp; !empty($acq_date_prev[$j]))\n {\n echo date('d-m-Y', strtotime($acq_date_prev[$j])) . &quot; &quot;;\n } else\n {\n echo &quot;&quot;;\n }\n echo isset($share_prev[$j]) ? $share_prev[$j] : '';\n ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?= isset($annual_income_prev[$j]) ? $annual_income_prev[$j] : ''; ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?= isset($remarks_prev[$j]) ? $remarks_prev[$j] : ''; ?&gt;&lt;/td&gt;\n\n\n &lt;td&gt;&lt;?= isset($prop_type_name_curr[$j]) ? $prop_type_name_curr[$j] . &quot; &quot; . $current_address[$j] : ''; ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?= isset($present_value_curr[$j]) ? $present_value_curr[$j] : ''; ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?php\n if(isset($string_agg[$j]) &amp;&amp; $string_agg[$j] == 2)\n {\n echo isset($person_current[$j]) ? $person_current[$j] . &quot; &quot; . $rrt_name_curr[$j] . &quot;&lt;br&gt;&quot; : 'null';\n } else if(isset($string_agg[$j]) &amp;&amp; $string_agg[$j] == 1)\n {\n echo 'self' . &quot;&lt;br&gt;&quot;;\n } else\n echo &quot; &quot; . &quot;&lt;br&gt;&quot;;\n echo isset($prop_acq_type_name_curr[$j]) ? $prop_acq_type_name_curr[$j] . &quot; &quot; : '';\n if(isset($acq_date_curr[$j]) &amp;&amp; !empty($acq_date_curr[$j]))\n {\n echo date('d-m-Y', strtotime($acq_date_curr[$j])) . &quot; &quot;;\n } else\n {\n echo &quot;&quot;;\n }\n echo isset($share_curr[$j]) ? $share_curr[$j] : '';\n ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?= isset($annual_income_curr[$j]) ? $annual_income_curr[$j] : ''; ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?= isset($remarks_curr[$j]) ? $remarks_curr[$j] : ''; ?&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php }\n }\n } ?&gt;\n &lt;/tbody&gt;\n&lt;/table&gt;\n</code></pre>\n<p><a href="https://i.sstatic.net/fzRPMYA6.png" rel="nofollow noreferrer">Expected table structure with this code</a></p>\n"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + "Laravel Session Getting Lost"^^ . + . + . + ""as is" is but a delusion. The other post is 100% correct: it is *your own* code does the conversion which you are to find out and uproot. I smell an infamous test_input function which w3schools spoiled PHP developers with for decades. Or some similar function."^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + "Using a cookie (except in cases of double-send) is a naive solution. Although `samesite=strict` effectively solves the problem, it does not guarantee that the client browser supports the flag."^^ . + . + . + . + . + "Add a specific category in Elementor Category Archive Template page for a Widget"^^ . + . + "0"^^ . + . + . + . + "zend-decorators"^^ . + "An alternate approach is using: https://github.com/aws/aws-sdk-php-symfony"^^ . + "1"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + "class_alias won't work because (as the documentation states) the aliased class is identical to the original. You can't use it to _replace_ one existing class with another existing class. It's more like just creating a second name to use for the original class (which is what an alias is in real life - if I give myself an alias of "Bob", it doesn't mean I myself am replaced with a different person, it just means the me who already exists now has two names)."^^ . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + . + "use access token for life time in xero"^^ . + . + . + . + "<p>I actually managed to make it work with the following command run from the container:</p>\n<p>`$(PHP_RUN) bin/console messenger:consume ui_job import_export_job data_maintenance_job ${O}`</p>\n"^^ . + . + . + . + "rijndael"^^ . + "1"^^ . + . + . + . + . + "3"^^ . + . + . + "Please add that part to the question. If you use a single quote the API key is not inserted. You should be able to see active hooks via `/getWebhookInfo`."^^ . + . + "1"^^ . + . + . + "<p>I am trying to sync car data from an external API into my WordPress site, which uses the Vehica theme. The API fetch is working (verified in debug.log), but the imported data does not appear in the listing on my site.</p>\n<p>Here’s how I fetch and insert the data:</p>\n<ol>\n<li>Fetching API Data : I retrieve the data using wp_remote_post and parse the JSON response.</li>\n<li>Syncing to WordPress : I create or update posts of type vehica_car, setting metadata, taxonomies, and featured images.</li>\n<li>Debugging : I checked debug.log and confirmed that posts are inserted/updated, I added a function to print available post types (get_post_types()), and vehica_car is liste, I called vehica_sync_products() manually in functions.php, but the data still does not appear in the Vehica listings.</li>\n</ol>\n<p>What could be missing that prevents the imported posts from appearing in Vehica’s front-end listing?</p>\n<p>Code Snippet:\nHere’s the core part of my sync function:</p>\n<pre><code> function vehica_sync_products() {\n require_once(ABSPATH . 'wp-admin/includes/media.php');\n require_once(ABSPATH . 'wp-admin/includes/file.php');\n require_once(ABSPATH . 'wp-admin/includes/image.php');\n\n $api_products = vehica_fetch_api_products();\n if (!$api_products) {\n error_log('No data received from API');\n return;\n }\n\n foreach ($api_products as $product) {\n $slug = sanitize_title($product['URL Slug']);\n $existing_post = get_page_by_path($slug, OBJECT, 'vehica_car');\n\n $post_data = [\n 'post_title' =&gt; sanitize_text_field($product['Title']),\n 'post_content' =&gt; wp_kses_post($product['Content'] ?? 'No description available.'),\n 'post_type' =&gt; 'vehica_car',\n 'post_status' =&gt; 'publish',\n 'post_name' =&gt; $slug,\n 'meta_input' =&gt; [\n 'vehica_price' =&gt; floatval($product['Vehica Currency 6656 2384'] ?? 0),\n 'vehica_model' =&gt; sanitize_text_field($product['Model'] ?? ''),\n 'vehica_year' =&gt; intval($product['Tahun'] ?? 2023),\n 'vehica_mileage' =&gt; floatval($product['Jarak Tempuh'] ?? 0),\n 'vehica_fuel_type' =&gt; sanitize_text_field($product['Jenis Bahan Bakar'] ?? ''),\n 'vehica_transmission'=&gt; sanitize_text_field($product['Transmisi'] ?? ''),\n 'vehica_condition' =&gt; sanitize_text_field($product['Kondisi'] ?? ''),\n ]\n ];\n\n if ($existing_post) {\n $post_data['ID'] = $existing_post-&gt;ID;\n $post_id = wp_update_post($post_data, true);\n } else {\n $post_id = wp_insert_post($post_data, true);\n }\n\n if (!is_wp_error($post_id) &amp;&amp; !empty($product['Galeri'])) {\n $gallery = explode(', ', $product['Galeri']);\n if (!empty($gallery[0])) {\n $image_id = media_sideload_image($gallery[0], $post_id, '', 'id');\n if (!is_wp_error($image_id)) {\n set_post_thumbnail($post_id, $image_id);\n }\n }\n }\n }\n}\n\n// Debugging post types\nadd_action('init', function() {\n $post_types = get_post_types();\n error_log(print_r($post_types, true)); \n});\n\n// Running sync manually\nadd_action('init', function() {\n vehica_sync_products();\n});\n</code></pre>\n<p>Additional Context:</p>\n<ul>\n<li>I have enabled debug.log and will provide <a href="https://files.catbox.moe/f9vrci.png" rel="nofollow noreferrer">screenshots</a> of the logs.</li>\n<li>The posts are inserted, and they appear in the WordPress admin panel under &quot;Vehica Cars.&quot;</li>\n<li>However, they do not appear on the front-end listing in Vehica.</li>\n</ul>\n"^^ . + "0"^^ . + . + "1"^^ . + . + "Thank you very much, Im going to test your approach, and then I'll think about your logic + `upsert()`\n\n- best regards"^^ . + "<blockquote>\n<p>Any ideas how I could keep the encryption but verify passwords without decrypting</p>\n</blockquote>\n<p>As far as I understand your situation, this statement contradicts itself. But since the encryption key seems to be static, I would just rehash all passwords:</p>\n<ul>\n<li>Add a new column <code>password_argon</code> (or think of a better name)</li>\n<li>Implement a feature that any time a password is added/changed, a <code>password_hash($password)</code> is also persisted along the encrypted password</li>\n<li>Run a batch script for each record that lacks the <code>password_argon</code> field to store <code>password_hash(mcrypt_decrypt($encryptedPassword))</code></li>\n<li>Once all fields have been populated, switch to verifying passwords using <code>password_verify($input, $passwordArgon)</code></li>\n<li>Drop the encrypted passwords. You’ll have no way of accessing raw passwords any more</li>\n</ul>\n<p>In case I misunderstood and the key is not static, but is derrived from the password itself, you can do a similar rehash process when the user signs in, i.e. when your app handles the raw password in memory anyway. This will improve the situation for active users, but after a period of time you can make the decision to cut off the inactive ones by dropping the encrypted password field. They will have the option to reset their password using a forgot password flow.</p>\n"^^ . + . + "1"^^ . + . + . + . + . + . + "1"^^ . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + "<p>Im looking for some advice around something i'm trying to create for a customer.</p>\n<p><a href="https://pjs-adventures.com/test-checkout/" rel="nofollow noreferrer">https://pjs-adventures.com/test-checkout/</a></p>\n<p>Essentially, they run &quot;events&quot; which are really woocommerce products, I need to attach &quot;attendees&quot; to that Product an pass the ID over from step 1 - 5 so when step 5 comes, the person doing the booking for the adventure, can fill out medical forms for each attendee.</p>\n<p><strong>Step 4 is working great:</strong></p>\n<p><img src="https://i.sstatic.net/oTgqRvNA.png" alt="step 41" /></p>\n<p>Step 5 isn't as I don't think the ID is being passed over from the &quot;event&quot; selector properly, thus it can;t find the attendees but they are there in the post type.</p>\n<p><a href="https://i.sstatic.net/82y23dFT.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/82y23dFT.png" alt="Step 5" /></a></p>\n<p>Here is my complete code:</p>\n<pre><code>&lt;?php\n/**\n * Template Name: Registration Form\n */\n\nget_header();\n\n// Handle attendee form submission\nif ($_SERVER[&quot;REQUEST_METHOD&quot;] == &quot;POST&quot; &amp;&amp; isset($_POST['acf_attendee_submit'])) {\n if (!empty($_POST['attendee_first_name'])) {\n foreach ($_POST['attendee_first_name'] as $index =&gt; $first_name) {\n if (!empty($first_name) &amp;&amp; !empty($_POST['attendee_surname'][$index]) &amp;&amp; !empty($_POST['attendee_email'][$index]) &amp;&amp; !empty($_POST['event_id'])) {\n\n $event_id = intval($_POST['event_id']);\n\n $attendee_data = array(\n 'post_title' =&gt; sanitize_text_field($first_name . ' ' . $_POST['attendee_surname'][$index]),\n 'post_status' =&gt; 'publish',\n 'post_type' =&gt; 'attendees',\n );\n\n // Insert new Attendee post\n $attendee_id = wp_insert_post($attendee_data);\n\n // If attendee post was successfully created, update ACF fields\n if ($attendee_id) {\n update_field('attendee_first_name', sanitize_text_field($first_name), $attendee_id);\n update_field('attendee_surname', sanitize_text_field($_POST['attendee_surname'][$index]), $attendee_id);\n update_field('attendee_email', sanitize_email($_POST['attendee_email'][$index]), $attendee_id);\n update_field('event_id', $event_id, $attendee_id);\n }\n }\n }\n }\n\n \n}\n\n// Ensure session starts\nif (session_status() == PHP_SESSION_NONE) {\n session_start();\n}\n\n// Ensure session array exists\nif (!isset($_SESSION['attendees'])) {\n $_SESSION['attendees'] = [];\n}\n?&gt;\n\n&lt;div class=&quot;container&quot;&gt;\n &lt;h1&gt;Adventure Registration&lt;/h1&gt;\n\n \n\n &lt;!-- Registration Form --&gt;\n &lt;div class=&quot;form-container&quot;&gt;\n &lt;div class=&quot;progress-sidebar&quot;&gt;\n &lt;div class=&quot;step active&quot; data-step=&quot;1&quot;&gt;&lt;i class=&quot;fas fa-user&quot;&gt;&lt;/i&gt; Personal Details &lt;/div&gt;\n &lt;div class=&quot;step&quot; data-step=&quot;2&quot;&gt;&lt;i class=&quot;fas fa-map-marker-alt&quot;&gt;&lt;/i&gt; Address &amp; Contact Details&lt;/div&gt;\n &lt;div class=&quot;step&quot; data-step=&quot;3&quot;&gt;&lt;i class=&quot;fas fa-credit-card&quot;&gt;&lt;/i&gt; Billing Details&lt;/div&gt;\n &lt;div class=&quot;step&quot; data-step=&quot;4&quot;&gt;&lt;i class=&quot;fas fa-users&quot;&gt;&lt;/i&gt; Adventure Attendees&lt;/div&gt;\n &lt;div class=&quot;step&quot; data-step=&quot;5&quot;&gt;&lt;i class=&quot;fas fa-medkit&quot;&gt;&lt;/i&gt; Medical Assessment&lt;/div&gt;\n &lt;div class=&quot;step&quot; data-step=&quot;6&quot;&gt;&lt;i class=&quot;fas fa-file-signature&quot;&gt;&lt;/i&gt; Consent&lt;/div&gt;\n &lt;/div&gt;\n\n &lt;form method=&quot;post&quot; id=&quot;acf-attendee-form&quot;&gt;\n &lt;!-- Step 1: Personal Details --&gt;\n &lt;div class=&quot;form-step active&quot; data-step=&quot;1&quot;&gt;\n &lt;h3&gt;&lt;i class=&quot;fas fa-user&quot;&gt;&lt;/i&gt; Personal Details&lt;/h3&gt;\n\n &lt;!-- Event Selection Warning --&gt;\n &lt;p id=&quot;event-warning&quot; style=&quot;color: red; font-weight: bold;&quot;&gt;\n ⚠️ You must choose an event before proceeding!\n &lt;/p&gt;\n\n &lt;!-- Event Dropdown --&gt;\n &lt;label for=&quot;event-dropdown&quot;&gt;&lt;strong&gt;Select Your Adventure:&lt;/strong&gt;&lt;/label&gt;\n &lt;select id=&quot;event-dropdown&quot; name=&quot;event_id&quot; required&gt;\n &lt;option value=&quot;&quot;&gt;-- Choose an Adventure --&lt;/option&gt;\n &lt;?php\n // Fetch WooCommerce Products (Events)\n $events = get_posts([\n 'post_type' =&gt; 'product',\n 'posts_per_page' =&gt; -1\n ]);\n\n foreach ($events as $event) {\n $event_date = get_post_meta($event-&gt;ID, '_event_date', true);\n $formatted_date = $event_date ? date(&quot;jS F Y&quot;, strtotime($event_date)) : 'Date Not Set';\n echo '&lt;option value=&quot;' . esc_attr($event-&gt;ID) . '&quot; data-name=&quot;' . esc_attr($event-&gt;post_title) . '&quot;&gt;'\n . esc_html($event-&gt;post_title) . ' - (' . $formatted_date . ')&lt;/option&gt;';\n }\n ?&gt;\n &lt;/select&gt;\n\n &lt;!-- Hidden input to store selected event ID --&gt;\n &lt;input type=&quot;hidden&quot; name=&quot;selected_event_id&quot; id=&quot;selected_event_id&quot; value=&quot;&quot;&gt;\n\n &lt;hr&gt;\n\n &lt;!-- Personal Details --&gt;\n &lt;input type=&quot;text&quot; name=&quot;personal_first_name[]&quot; placeholder=&quot;First Name&quot; required&gt;\n &lt;input type=&quot;text&quot; name=&quot;personal_surname[]&quot; placeholder=&quot;Surname&quot; required&gt;\n &lt;input type=&quot;email&quot; name=&quot;personal_email[]&quot; placeholder=&quot;Email&quot; required&gt;\n &lt;input type=&quot;text&quot; name=&quot;personal_dob[]&quot; id=&quot;personal_dob&quot; placeholder=&quot;DD/MM/YYYY&quot; required&gt;\n\n &lt;p id=&quot;dob-warning&quot; style=&quot;color: red; font-size: 14px; display: none;&quot;&gt;⚠️ Please enter a valid date in DD/MM/YYYY format.&lt;/p&gt;\n\n &lt;button type=&quot;button&quot; id=&quot;next-step-btn&quot; class=&quot;next-step&quot; disabled&gt;Next&lt;/button&gt;\n&lt;/div&gt;\n\n&lt;script&gt;\ndocument.addEventListener(&quot;DOMContentLoaded&quot;, function() {\n const eventDropdown = document.getElementById(&quot;event-dropdown&quot;);\n const nextButton = document.getElementById(&quot;next-step-btn&quot;);\n const eventWarning = document.getElementById(&quot;event-warning&quot;);\n const selectedEventId = document.getElementById(&quot;selected_event_id&quot;);\n\n // Load stored event from sessionStorage (if previously selected)\n if (sessionStorage.getItem(&quot;selected_event_id&quot;)) {\n eventDropdown.value = sessionStorage.getItem(&quot;selected_event_id&quot;);\n selectedEventId.value = sessionStorage.getItem(&quot;selected_event_id&quot;);\n eventWarning.style.display = &quot;none&quot;;\n nextButton.disabled = false;\n }\n\n // Store event selection in sessionStorage\n eventDropdown.addEventListener(&quot;change&quot;, function() {\n if (this.value !== &quot;&quot;) {\n nextButton.disabled = false;\n eventWarning.style.display = &quot;none&quot;;\n selectedEventId.value = this.value;\n\n // Store event ID &amp; name in sessionStorage\n const selectedOption = this.options[this.selectedIndex];\n sessionStorage.setItem(&quot;selected_event_id&quot;, this.value);\n sessionStorage.setItem(&quot;selected_event_name&quot;, selectedOption.dataset.name);\n } else {\n nextButton.disabled = true;\n eventWarning.style.display = &quot;block&quot;;\n sessionStorage.removeItem(&quot;selected_event_id&quot;);\n sessionStorage.removeItem(&quot;selected_event_name&quot;);\n }\n });\n\n // Validate DOB format\n const dobInput = document.getElementById(&quot;personal_dob&quot;);\n const dobWarning = document.getElementById(&quot;dob-warning&quot;);\n const datePattern = /^(0[1-9]|[12][0-9]|3[01])\\/(0[1-9]|1[0-2])\\/(19|20)\\d{2}$/;\n\n dobInput.addEventListener(&quot;input&quot;, function() {\n if (!datePattern.test(dobInput.value)) {\n dobWarning.style.display = &quot;block&quot;;\n dobInput.style.border = &quot;2px solid red&quot;;\n } else {\n dobWarning.style.display = &quot;none&quot;;\n dobInput.style.border = &quot;2px solid green&quot;;\n }\n });\n});\n&lt;/script&gt;\n\n &lt;!-- Step 2: Address &amp; Contact --&gt;\n &lt;div class=&quot;form-step&quot; data-step=&quot;2&quot;&gt;\n &lt;h3&gt;&lt;i class=&quot;fas fa-map-marker-alt&quot;&gt;&lt;/i&gt; Address &amp; Contact Details&lt;/h3&gt;\n &lt;input type=&quot;text&quot; name=&quot;attendee_address_line_1&quot; placeholder=&quot;Address Line 1&quot; required&gt;\n &lt;input type=&quot;text&quot; name=&quot;attendee_address_line_2&quot; placeholder=&quot;Address Line 2&quot; required&gt;\n &lt;input type=&quot;text&quot; name=&quot;attendee_city&quot; placeholder=&quot;Town/City&quot; required&gt;\n &lt;input type=&quot;text&quot; name=&quot;attendee_county&quot; placeholder=&quot;County&quot; required&gt;\n &lt;input type=&quot;text&quot; name=&quot;attendee_postcode&quot; placeholder=&quot;Postcode&quot; required&gt;\n &lt;input type=&quot;text&quot; name=&quot;attendee_country&quot; placeholder=&quot;Country&quot; required&gt;\n &lt;button type=&quot;button&quot; class=&quot;prev-step&quot;&gt;Back&lt;/button&gt;\n &lt;button type=&quot;button&quot; class=&quot;next-step&quot;&gt;Next&lt;/button&gt;\n &lt;/div&gt;\n\n &lt;!-- Step 3: Billing --&gt;\n &lt;div class=&quot;form-step&quot; data-step=&quot;3&quot;&gt;\n &lt;h3&gt;&lt;i class=&quot;fas fa-credit-card&quot;&gt;&lt;/i&gt; Billing Details&lt;/h3&gt;\n &lt;input type=&quot;text&quot; name=&quot;billing_name&quot; placeholder=&quot;Billing Name&quot; required&gt;\n &lt;input type=&quot;text&quot; name=&quot;billing_address&quot; placeholder=&quot;Billing Address&quot; required&gt;\n &lt;button type=&quot;button&quot; class=&quot;prev-step&quot;&gt;Back&lt;/button&gt;\n &lt;button type=&quot;button&quot; class=&quot;next-step&quot;&gt;Next&lt;/button&gt;\n &lt;/div&gt;\n\n \n&lt;!-- Step 4: Display Attendees --&gt;\n\n\n\n &lt;div class=&quot;form-step&quot; data-step=&quot;4&quot;&gt;\n &lt;h3&gt;&lt;i class=&quot;fas fa-users&quot;&gt;&lt;/i&gt; Adventure Attendees&lt;/h3&gt;\n\n &lt;?php\n global $product;\n $product_id = isset($product) ? $product-&gt;get_id() : null;\n ?&gt;\n\n &lt;!-- Show Selected WooCommerce Product --&gt;\n &lt;p&gt;&lt;strong&gt;Adding attendees for:&lt;/strong&gt; \n &lt;span id=&quot;selected-product-name&quot; style=&quot;color: #C1272D; font-weight: bold;&quot;&gt;Loading...&lt;/span&gt;\n &lt;/p&gt;\n\n &lt;!-- Add Attendee Form --&gt;\n &lt;input type=&quot;text&quot; id=&quot;attendee_first_name&quot; placeholder=&quot;First Name&quot; required&gt;\n &lt;input type=&quot;text&quot; id=&quot;attendee_surname&quot; placeholder=&quot;Surname&quot; required&gt;\n &lt;input type=&quot;email&quot; id=&quot;attendee_email&quot; placeholder=&quot;Email&quot; required&gt;\n &lt;input type=&quot;text&quot; id=&quot;attendee_dob&quot; placeholder=&quot;Date of Birth (DD/MM/YYYY)&quot; required&gt;\n &lt;button type=&quot;button&quot; id=&quot;add-attendee-btn&quot;&gt;+ Add Attendee&lt;/button&gt;\n\n &lt;!-- Show Attendees Added --&gt;\n &lt;h4&gt;Attendees Added:&lt;/h4&gt;\n &lt;ul id=&quot;attendee-list&quot;&gt;\n &lt;?php\n if (!empty($_SESSION['attendees'])) {\n foreach ($_SESSION['attendees'] as $attendee) {\n echo &quot;&lt;li&gt;{$attendee['firstName']} {$attendee['surname']} ({$attendee['email']})&lt;/li&gt;&quot;;\n }\n } else {\n echo &quot;&lt;li&gt;No attendees added yet.&lt;/li&gt;&quot;;\n }\n ?&gt;\n &lt;/ul&gt;\n\n &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; You &lt;span style=&quot;color: red;&quot;&gt;must submit attendees&lt;/span&gt; before proceeding to medical assessment.&lt;/p&gt;\n\n &lt;button type=&quot;button&quot; id=&quot;submit-attendees-btn&quot;&gt;Submit Attendees&lt;/button&gt;\n &lt;p id=&quot;submission-status&quot;&gt;&lt;/p&gt;\n\n &lt;button type=&quot;button&quot; class=&quot;prev-step&quot;&gt;Back&lt;/button&gt;\n &lt;button type=&quot;button&quot; class=&quot;next-step&quot; id=&quot;next-medical&quot; disabled&gt;Next&lt;/button&gt;\n\n &lt;!-- Hidden input to store the WooCommerce product ID --&gt;\n &lt;input type=&quot;hidden&quot; name=&quot;selected_product_id&quot; id=&quot;selected_product_id&quot; value=&quot;&lt;?php echo esc_attr($product_id); ?&gt;&quot;&gt;\n&lt;/div&gt;\n\n&lt;script&gt;\ndocument.addEventListener(&quot;DOMContentLoaded&quot;, function() {\n const selectedProductName = document.getElementById(&quot;selected-product-name&quot;);\n const selectedProductIdInput = document.getElementById(&quot;selected_product_id&quot;);\n\n // Retrieve the WooCommerce product name and ID from sessionStorage\n const storedProductId = sessionStorage.getItem(&quot;selected_product_id&quot;);\n const storedProductName = sessionStorage.getItem(&quot;selected_product_name&quot;);\n\n if (storedProductId &amp;&amp; storedProductName) {\n selectedProductIdInput.value = storedProductId;\n selectedProductName.innerText = storedProductName; // FIX: Ensure correct name appears\n } else {\n selectedProductName.innerText = &quot;(No event selected)&quot;;\n }\n});\n&lt;/script&gt;\n\n\n&lt;!-- Step 5: Medical Assessment --&gt;\n&lt;div class=&quot;form-step&quot; data-step=&quot;5&quot;&gt;\n &lt;h3&gt;&lt;i class=&quot;fas fa-medkit&quot;&gt;&lt;/i&gt; Medical Assessment&lt;/h3&gt;\n &lt;p&gt;We take your safety on all our adventures very seriously.&lt;/p&gt;\n &lt;p&gt;It is vital all participants fully disclose their medical information prior to departure. This information will remain confidential and is only viewed by PJS Adventures, the PJS Team Leader or Guide, and your expedition medic, if applicable.&lt;/p&gt;\n\n &lt;?php\n global $wpdb;\n\n // Retrieve the event (product) ID from sessionStorage (JS will populate this)\n echo '&lt;script&gt;\n var storedEventId = sessionStorage.getItem(&quot;selected_event_id&quot;);\n document.getElementById(&quot;stored-event-id&quot;).value = storedEventId;\n &lt;/script&gt;';\n\n // Get event ID from form submission or session\n $product_id = isset($_POST['selected_event_id']) ? intval($_POST['selected_event_id']) : 0;\n\n // DEBUG: Show product ID\n echo &quot;&lt;p&gt;&lt;strong&gt;DEBUG: Selected Product (Event) ID:&lt;/strong&gt; &quot; . esc_html($product_id) . &quot;&lt;/p&gt;&quot;;\n\n // Query attendees where event_id (WooCommerce product ID) matches\n $attendees = get_posts([\n 'post_type' =&gt; 'attendees',\n 'post_status' =&gt; 'publish',\n 'numberposts' =&gt; -1,\n 'meta_query' =&gt; [\n [\n 'key' =&gt; 'event_id', // Ensure attendees store product_id under 'event_id'\n 'value' =&gt; (string) $product_id, \n 'compare' =&gt; '='\n ]\n ]\n ]);\n\n // DEBUG: Show fetched attendees\n echo &quot;&lt;p&gt;&lt;strong&gt;DEBUG: Found &quot; . count($attendees) . &quot; attendees.&lt;/strong&gt;&lt;/p&gt;&quot;;\n\n if (!empty($attendees)) {\n echo &quot;&lt;ul&gt;&quot;;\n foreach ($attendees as $attendee) {\n echo &quot;&lt;li&gt;&quot; . esc_html(get_field('attendee_first_name', $attendee-&gt;ID)) . &quot; &quot; . esc_html(get_field('attendee_surname', $attendee-&gt;ID)) . &quot;&lt;/li&gt;&quot;;\n }\n echo &quot;&lt;/ul&gt;&quot;;\n }\n ?&gt;\n\n &lt;!-- Attendee Selection Dropdown --&gt;\n &lt;label for=&quot;attendee-select&quot;&gt;&lt;strong&gt;Select an Attendee:&lt;/strong&gt;&lt;/label&gt;\n &lt;select id=&quot;attendee-select&quot; name=&quot;attendee_id&quot;&gt;\n &lt;option value=&quot;&quot;&gt;-- Choose an Attendee --&lt;/option&gt;\n &lt;?php if (!empty($attendees)): ?&gt;\n &lt;?php foreach ($attendees as $attendee): ?&gt;\n &lt;option value=&quot;&lt;?php echo esc_attr($attendee-&gt;ID); ?&gt;&quot;&gt;\n &lt;?php echo esc_html(get_field('attendee_first_name', $attendee-&gt;ID) . ' ' . get_field('attendee_surname', $attendee-&gt;ID)); ?&gt;\n &lt;/option&gt;\n &lt;?php endforeach; ?&gt;\n &lt;?php else: ?&gt;\n &lt;option value=&quot;&quot;&gt;No attendees found&lt;/option&gt;\n &lt;?php endif; ?&gt;\n &lt;/select&gt;\n&lt;/div&gt;\n\n&lt;!-- Medical Assessment Form (Hidden by Default) --&gt;\n&lt;div id=&quot;medical-form-container&quot; style=&quot;display: none;&quot;&gt;\n &lt;h4&gt;Medical Information for &lt;span id=&quot;selected-attendee-name&quot;&gt;&lt;/span&gt;&lt;/h4&gt;\n \n &lt;textarea name=&quot;medical_conditions&quot; id=&quot;medical_conditions&quot; placeholder=&quot;Enter medical conditions...&quot; required&gt;&lt;/textarea&gt;\n &lt;input type=&quot;text&quot; name=&quot;allergies&quot; id=&quot;allergies&quot; placeholder=&quot;Allergies (if any)&quot;&gt;\n &lt;input type=&quot;text&quot; name=&quot;medications&quot; id=&quot;medications&quot; placeholder=&quot;Medications (if any)&quot;&gt;\n\n &lt;button type=&quot;button&quot; id=&quot;save-medical-info&quot;&gt;Save Medical Info&lt;/button&gt;\n &lt;p id=&quot;save-message&quot; style=&quot;display: none; color: green;&quot;&gt;Medical info saved successfully!&lt;/p&gt;\n&lt;/div&gt;\n\n &lt;!-- Step 6: Consent --&gt;\n &lt;div class=&quot;form-step&quot; data-step=&quot;6&quot;&gt;\n &lt;h3&gt;&lt;i class=&quot;fas fa-file-signature&quot;&gt;&lt;/i&gt; Consent&lt;/h3&gt;\n &lt;button type=&quot;button&quot; class=&quot;prev-step&quot;&gt;Back&lt;/button&gt;\n &lt;button type=&quot;submit&quot; name=&quot;acf_attendee_submit&quot;&gt;Save &amp; Submit&lt;/button&gt;\n &lt;/div&gt;\n &lt;/form&gt;\n &lt;/div&gt;\n\n &lt;script&gt;\ndocument.addEventListener(&quot;DOMContentLoaded&quot;, function () {\n const eventDropdown = document.getElementById(&quot;event-dropdown&quot;);\n\n // Check if there's an event stored in sessionStorage\n if (sessionStorage.getItem(&quot;selectedEvent&quot;)) {\n eventDropdown.value = sessionStorage.getItem(&quot;selectedEvent&quot;);\n }\n\n eventDropdown.addEventListener(&quot;change&quot;, function () {\n sessionStorage.setItem(&quot;selectedEvent&quot;, eventDropdown.value);\n });\n});\n&lt;/script&gt;\n \n \n&lt;/div&gt;\n\n&lt;script&gt;\ndocument.addEventListener(&quot;DOMContentLoaded&quot;, function () {\n const steps = document.querySelectorAll(&quot;.step&quot;);\n const formSteps = document.querySelectorAll(&quot;.form-step&quot;);\n let currentStep = 1;\n\n function showStep(step) {\n formSteps.forEach(el =&gt; el.classList.remove(&quot;active&quot;));\n steps.forEach(el =&gt; el.classList.remove(&quot;active&quot;));\n document.querySelector(`.form-step[data-step=&quot;${step}&quot;]`).classList.add(&quot;active&quot;);\n document.querySelector(`.step[data-step=&quot;${step}&quot;]`).classList.add(&quot;active&quot;);\n }\n\n document.querySelectorAll(&quot;.next-step&quot;).forEach(button =&gt; {\n button.addEventListener(&quot;click&quot;, () =&gt; {\n if (currentStep &lt; formSteps.length) {\n currentStep++;\n showStep(currentStep);\n }\n });\n });\n\n document.querySelectorAll(&quot;.prev-step&quot;).forEach(button =&gt; {\n button.addEventListener(&quot;click&quot;, () =&gt; {\n if (currentStep &gt; 1) {\n currentStep--;\n showStep(currentStep);\n }\n });\n });\n});\n&lt;/script&gt;\n\n\n\n&lt;/script&gt;\n\n&lt;script&gt;\n\ndocument.addEventListener(&quot;DOMContentLoaded&quot;, function () {\n const attendeeSelect = document.getElementById(&quot;attendee-select&quot;);\n const medicalForm = document.getElementById(&quot;medical-form-container&quot;);\n const selectedAttendeeName = document.getElementById(&quot;selected-attendee-name&quot;);\n const saveMedicalInfoBtn = document.getElementById(&quot;save-medical-info&quot;);\n const nextConsentBtn = document.getElementById(&quot;next-consent&quot;);\n const saveMessage = document.getElementById(&quot;save-message&quot;);\n\n // Show Medical Form when Attendee is Selected\n attendeeSelect.addEventListener(&quot;change&quot;, function () {\n if (this.value) {\n selectedAttendeeName.textContent = this.options[this.selectedIndex].text;\n medicalForm.style.display = &quot;block&quot;;\n } else {\n medicalForm.style.display = &quot;none&quot;;\n }\n });\n\n // Save Medical Info\n saveMedicalInfoBtn.addEventListener(&quot;click&quot;, function () {\n const attendeeIndex = attendeeSelect.value;\n const medicalConditions = document.getElementById(&quot;medical_conditions&quot;).value;\n const allergies = document.getElementById(&quot;allergies&quot;).value;\n const medications = document.getElementById(&quot;medications&quot;).value;\n\n if (!attendeeIndex) {\n alert(&quot;Please select an attendee.&quot;);\n return;\n }\n\n fetch(&quot;&lt;?php echo admin_url('admin-ajax.php'); ?&gt;&quot;, {\n method: &quot;POST&quot;,\n headers: { &quot;Content-Type&quot;: &quot;application/x-www-form-urlencoded&quot; },\n body: `action=save_medical_info&amp;attendee_index=${attendeeIndex}&amp;medical_conditions=${medicalConditions}&amp;allergies=${allergies}&amp;medications=${medications}`\n }).then(response =&gt; response.text()).then(data =&gt; {\n if (data.trim() === &quot;success&quot;) {\n saveMessage.style.display = &quot;block&quot;;\n nextConsentBtn.disabled = false;\n setTimeout(() =&gt; {\n saveMessage.style.display = &quot;none&quot;;\n }, 2000);\n } else {\n alert(&quot;Failed to save medical info.&quot;);\n }\n });\n });\n});\n\n&lt;/script&gt;\n\n&lt;script&gt;\n function fetch_attendees_by_event() {\n if (isset($_POST['event_id'])) {\n global $wpdb;\n $event_id = intval($_POST['event_id']);\n\n $attendees = $wpdb-&gt;get_results($wpdb-&gt;prepare(\n &quot;SELECT ID, post_title FROM {$wpdb-&gt;posts} WHERE post_type = 'attendees' AND post_status = 'publish' AND ID IN (\n SELECT post_id FROM {$wpdb-&gt;postmeta} WHERE meta_key = 'event_id' AND meta_value = %d\n )&quot;,\n $event_id\n ));\n\n $attendee_list = [];\n foreach ($attendees as $attendee) {\n $attendee_list[] = [\n 'id' =&gt; $attendee-&gt;ID,\n 'name' =&gt; $attendee-&gt;post_title\n ];\n }\n\n echo json_encode($attendee_list);\n }\n wp_die();\n}\n\nadd_action(&quot;wp_ajax_fetch_attendees_by_event&quot;, &quot;fetch_attendees_by_event&quot;);\nadd_action(&quot;wp_ajax_nopriv_fetch_attendees_by_event&quot;, &quot;fetch_attendees_by_event&quot;);\n&lt;/script&gt;\n&lt;script&gt;\n document.addEventListener(&quot;DOMContentLoaded&quot;, function () {\n // Add Attendee\n document.getElementById(&quot;add-attendee-btn&quot;).addEventListener(&quot;click&quot;, function () {\n const firstName = document.getElementById(&quot;attendee_first_name&quot;).value;\n const surname = document.getElementById(&quot;attendee_surname&quot;).value;\n const email = document.getElementById(&quot;attendee_email&quot;).value;\n const dob = document.getElementById(&quot;attendee_dob&quot;).value;\n\n if (!firstName || !surname || !email || !dob) {\n alert(&quot;Please fill all fields.&quot;);\n return;\n }\n\n fetch(&quot;&lt;?php echo admin_url('admin-ajax.php'); ?&gt;&quot;, {\n method: &quot;POST&quot;,\n headers: { &quot;Content-Type&quot;: &quot;application/x-www-form-urlencoded&quot; },\n body: `action=add_temp_attendee&amp;first_name=${firstName}&amp;surname=${surname}&amp;email=${email}&amp;dob=${dob}`\n }).then(response =&gt; response.text()).then(data =&gt; {\n if (data === &quot;success&quot;) {\n document.getElementById(&quot;attendee-list&quot;).innerHTML += `&lt;li&gt;${firstName} ${surname} (${email})&lt;/li&gt;`;\n document.getElementById(&quot;attendee_first_name&quot;).value = &quot;&quot;;\n document.getElementById(&quot;attendee_surname&quot;).value = &quot;&quot;;\n document.getElementById(&quot;attendee_email&quot;).value = &quot;&quot;;\n document.getElementById(&quot;attendee_dob&quot;).value = &quot;&quot;;\n }\n });\n });\n\n // Submit Attendees\n document.getElementById(&quot;submit-attendees-btn&quot;).addEventListener(&quot;click&quot;, function () {\n fetch(&quot;&lt;?php echo admin_url('admin-ajax.php'); ?&gt;&quot;, {\n method: &quot;POST&quot;,\n headers: { &quot;Content-Type&quot;: &quot;application/x-www-form-urlencoded&quot; },\n body: &quot;action=submit_attendees&quot;\n }).then(response =&gt; response.text()).then(data =&gt; {\n if (data.trim() === &quot;success&quot;) {\n document.getElementById(&quot;submission-status&quot;).innerHTML = &quot;&lt;span style='color: green;'&gt;Attendees submitted successfully!&lt;/span&gt;&quot;;\n document.getElementById(&quot;next-medical&quot;).disabled = false;\n document.getElementById(&quot;attendee-list&quot;).innerHTML = &quot;&lt;li&gt;All attendees submitted.&lt;/li&gt;&quot;;\n } else {\n document.getElementById(&quot;submission-status&quot;).innerHTML = &quot;&lt;span style='color: red;'&gt;No attendees found to submit.&lt;/span&gt;&quot;;\n }\n });\n });\n});\n&lt;/script&gt;\n\n&lt;style&gt;\n.container {\n max-width: 75%;\n margin: 40px auto;\n padding: 30px;\n background: #f9f9f9;\n border-radius: 10px;\n box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);\n}\n\nh1 {\n color: #C1272D;\n text-align: center;\n font-size: 32px;\n font-weight: bold;\n}\n\n.form-container {\n display: flex;\n justify-content: space-between;\n}\n\n.progress-sidebar {\n width: 30%;\n background: #ddd;\n padding: 20px;\n border-radius: 10px;\n}\n\n.step {\n padding: 10px;\n margin-bottom: 10px;\n font-weight: bold;\n display: flex;\n align-items: center;\n cursor: pointer;\n}\n\n.step i {\n margin-right: 8px;\n font-size: 22px;\n}\n\n.step.active {\n background: #C1272D;\n color: white;\n}\n\n.form-step {\n width: 65%;\n display: none;\n}\n\n.form-step.active {\n display: block;\n}\n\nbutton {\n cursor: pointer;\n padding: 10px;\n border-radius: 5px;\n font-size: 16px;\n transition: all 0.3s ease;\n margin-top: 10px;\n}\n\n.next-step {\n background: #007bff;\n color: white;\n}\n\n.prev-step {\n background: #555;\n color: white;\n}\n\n#acf-attendee-form button[type=&quot;submit&quot;] {\n background: #28a745;\n color: white;\n}\n\n.attendees-table {\n width: 100%;\n border-collapse: collapse;\n margin-top: 20px;\n}\n\n.attendees-table th, .attendees-table td {\n border: 1px solid #ddd;\n padding: 10px;\n}\n\n.attendees-table th {\n background: #C1272D;\n color: white;\n text-align: left;\n}\n\n.delete-attendee {\n background: #dc3545;\n color: white;\n padding: 6px 12px;\n border: none;\n cursor: pointer;\n}\n/* Improve Sidebar Layout */\n.progress-sidebar {\n width: 25%;\n background: #ddd;\n padding: 25px;\n border-radius: 10px;\n min-width: 260px;\n}\n\n/* Ensure Step Icons/Text Are Aligned */\n.step {\n padding: 12px 15px;\n display: flex;\n align-items: center;\n gap: 10px;\n white-space: nowrap;\n overflow: hidden;\n}\n\n/* Fix Input Field Widths */\n.form-step input {\n width: calc(100% - 10px);\n padding: 10px;\n margin-bottom: 10px;\n border: 1px solid #ccc;\n border-radius: 5px;\n}\n\n/* Improve Step Navigation Buttons */\n.prev-step, .next-step {\n display: inline-block;\n width: auto;\n min-width: 120px;\n text-align: center;\n font-size: 16px;\n padding: 10px;\n margin: 10px 5px;\n}\n\n/* Fix Table Alignment */\n.attendees-table {\n width: 100%;\n border-collapse: collapse;\n margin-top: 20px;\n table-layout: auto;\n}\n\n/* Center Headers Properly */\nh1, h3 {\n text-align: left;\n padding-left: 15px;\n}\n\n/* Adjust Form Layout to Avoid Overlap */\n.form-container {\n display: flex;\n width: 100%;\n align-items: flex-start;\n gap: 40px;\n}\n\n/* Ensure Form Stays Balanced */\n.form-step {\n width: 70%;\n padding-left: 20px;\n}\n&lt;/style&gt;\n\n&lt;?php get_footer(); ?&gt;\n</code></pre>\n"^^ . + . + "<p>I'd like to do something like this in my Blade pages:</p>\n<pre><code>&lt;div class=&quot;accordion-content&quot;&gt;\n @mdsnippet('snippets/common/some-content-for-multiple-pages.md')\n&lt;/div&gt;\n</code></pre>\n<p>and then _snippets/common/some-content-for-multiple-pages.md contains:</p>\n<pre><code>## here's some content\n</code></pre>\n<p>which Hyde writes out to the output directory as:</p>\n<pre><code>&lt;div class=&quot;accordion-content&quot;&gt;\n &lt;h2&gt;here's some content&lt;/h2&gt;\n&lt;/div&gt;\n</code></pre>\n<p>Is this possible? It looks like we can add Blade in Markdown files:</p>\n<p><a href="https://hydephp.com/docs/1.x/advanced-markdown" rel="nofollow noreferrer">https://hydephp.com/docs/1.x/advanced-markdown</a></p>\n<p>But I'm wanting to do the reverse - Markdown in Blade files.</p>\n"^^ . + . + "plugins"^^ . + "laravel-herd"^^ . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + "1"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + "I've just updated the post with the errors"^^ . + "0"^^ . + "0"^^ . + "3"^^ . + . + "Do not put the files into an array and then try to append that to FormData - append each file to FormData directly. And use `file[]` as the name you append them under - PHP will overwrite external parameters of the same name, unless you use square brackets to make it populate an array instead."^^ . + "Here is the very first value of the array when you print_r Array\n(\n [0] => Array\n (\n [change] => -\n [change_pay] => 2267.79\n [funds_owned] => test\n [gain] => -8558.58\n [change_qty] => 2400.7378\n [change_cost_basis] => 53778.04\n [change_date] => 1742582868\n ) You can see the very first change value is the dash. The change column needs to moved up one while the other values need to remain"^^ . + "<p>If you need to provide several options for incoming or outgoing data, how do you specify `examples'?</p>\n<p>You can manually specify fields and their values, but\nif I have a DTO model, shouldn't I make a call to this model for an example?</p>\n<p>In php, I tried to do it through a call, the <code>example</code> field accepts <code>string, array, int</code> but not the model.</p>\n<p>I also tried using the factory, but you can't call methods in php attributes.</p>\n<p>There is an error</p>\n<pre><code>Compile Error: Constant expression contains invalid operations\n</code></pre>\n<p>The only thing that worked fine was the inheritance of <code>OpenAPI\\Attributes\\Examples</code> and in my class I made calls and it worked</p>\n<p>Example my class (a handwritten example, but like this : ))</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php \n \nnamespace App\\Dto; \n \nuse OpenApi\\Attributes as OA; \nuse OpenApi\\Attributes\\Examples; \nuse Symfony\\Component\\Serializer\\Annotation\\Groups; \n \nclass AggregatedProductDataSelectExample extends Examples \n{ \n public function __construct( \n AggregatedProductDataSelect $model, \n string $example, \n string $summary, \n ) { \n $this-&gt;product = $product; \n $this-&gt;is_forecast = $is_forecast; \n $this-&gt;max_price = $max_price; \n \n parent::__construct( \n example: $example, \n summary: $summary, \n value: $model-&gt;toArray() \n ); \n } \n}\n\n</code></pre>\n<p>Call</p>\n<pre class="lang-php prettyprint-override"><code>responses: [ \n new OA\\Response( \n response: 200, \n description: 'Агрегированные данные по продуктам в периоде', \n content: [ \n new OA\\JsonContent( \n examples: [ \n new AggregatedProductDataSelectExample( \n new AggregatedProductDataSelect( \n is_forecast: true, \n max_price: 1.0, \n product: '1', \n ),\n summary: 'test1',\n example: 'test ...'\n ), \n ], \n properties: [ \n new OA\\Property( \n property: 'result', \n ref: new Model(type: AggregatedProductDataResponse::class, groups: [&quot;default&quot;]) \n ), \n ] \n ), \n ] \n ), \n]\n</code></pre>\n<p>What is the right way to do this?</p>\n"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + "<p>I am building a WordPress website using the Astra theme, and I noticed that meta and link tags in my site's head section contain closing slashes, like this:</p>\n<pre><code>&lt;meta name=&quot;description&quot; content=&quot;Example description&quot; /&gt;\n&lt;link rel=&quot;canonical&quot; href=&quot;https://example.com/&quot; /&gt;\n</code></pre>\n<p>I would like to remove the closing slash so that the tags appear as follows:</p>\n<pre><code>&lt;meta name=&quot;description&quot; content=&quot;Example description&quot;&gt;\n&lt;link rel=&quot;canonical&quot; href=&quot;https://example.com&quot;&gt;\n</code></pre>\n<p>How can I achieve this in WordPress? Is there a filter or function that can modify the output of these tags? Or is there a plugin that allows customization of how meta and link tags are generated?</p>\n<p>Any guidance would be appreciated. Thank you!</p>\n<p>I tried using the following code in functions.php, but I am not entirely satisfied with this solution:</p>\n<pre class="lang-php prettyprint-override"><code>function fix_self_closing_tags($buffer) {\n return str_replace(' /&gt;', '&gt;', $buffer);\n}\nfunction start_buffer() {\n ob_start('fix_self_closing_tags');\n}\nfunction end_buffer() {\n if (ob_get_length()) ob_end_flush();\n}\nadd_action('template_redirect', 'start_buffer');\nadd_action('shutdown', 'end_buffer');\n</code></pre>\n"^^ . + . + . + . + . + "_"I have multiple players in each position in my database so when selecting a player it would need to allow for all players of that position to be an option."_ - but it should probably also make sure, that the same player isn't assigned to multiple positions. Client-side removal / disabling of options via JS might be a good idea; server-side validation as well, depending on how much you can trust the people who will be using this."^^ . + "<p>I am learning php and LAMP servers, i have a very simple LAMP server running on VMWare fusion on my mac from my home, all it does is connect to the db and displays a success msg. I have set up a virtual host and can access it on my local machine and all machines connected to my network.</p>\n<p>Now, i want to try to access this site over the internet from anywhere, i have a domain name with cloudfare and i have added A records to point to the ip of the server( i got this by running <code>ip a</code> when ssh'd into the server on my machine ), however i cannot acces this site, I don't have a ssl on the server yet, i tried using both fixed and flexible ssl on cloudfare but still can't access the site, what am i missing or doing wrong?</p>\n"^^ . + . + . + . + . + . + "0"^^ . + . + . + "You'd have to whitelist it so they can only switch to a specific role/role(s) that you pre-define, rather than letting the user choose any role, or type anything in as free text. Make sure you validate the choice they've made in server-side code, not just in any JavaScript or HTML."^^ . + . + "<p>I'm trying to parse an Html string that may contain any valid html tags. I used this code to parse the string:</p>\n<pre><code>$doc = new DOMDocument();\n$doc-&gt;loadHTML($product['description']); // comes from db\n$els = $doc-&gt;getElementsByTagName('*');\nforeach ($els as $node) {\n o($node-&gt;nodeName.' '.$node-&gt;nodeValue);\n}\n</code></pre>\n<p>This does print my tags but the first two tags are html and body. I want to ignore those. The string from the db does not contain html or body tags. Here's an example:</p>\n<pre><code>&lt;p&gt;This is a paragraph&lt;/p&gt;\n&lt;ol&gt;\n &lt;li&gt;This is a list&lt;/li&gt;\n&lt;/ol&gt;\n</code></pre>\n<p>I was wondering if there's a way to iterate over tags inside the body only. I tried these</p>\n<pre><code>$els = $doc-&gt;getElementsByTagName('body *');\n\n$body = $doc-&gt;getElementsByTagName('body');\n$els = $body-&gt;getElementsByTagName('*');\n</code></pre>\n<p>Both don't work. I have seen others use xpath but that gives me headaches. Can it be done with DomDocument?</p>\n"^^ . + "0"^^ . + . + "@hakre I do not like to rely on artificial intelligence. It can be used to make things easier, but it is bad to rely on it"^^ . + "0"^^ . + . + . + "<p>First, there is no need including the Route files in the <strong>$routeFiles</strong> since the modules are autoloaded and the Routes auto discovered.</p>\n<p>But in each of the custom module config path, I included the Services.php file and in the Routes.php files, I brought back the former routes settings with the appropriate namespace to each of these files</p>\n<p>in BudgetingModule\\Config\\Routes.php file</p>\n<pre><code> namespace BudgetingModule\\Config;\n\n// Create a new instance of our RouteCollection class.\n$routes = Services::routes();\n\n$routes-&gt;setDefaultNamespace('BudgetingModule\\Controllers');\n$routes-&gt;setDefaultController('Index');\n$routes-&gt;setDefaultMethod('index');\n$routes-&gt;setTranslateURIDashes(false);\n$routes-&gt;setAutoRoute(false);\n</code></pre>\n"^^ . + . + . + . + "@AndreasBöttcher, your comment to me was attached to someone else's answer, which is confusing. Regardless, native WordPress pagination is free, but if you are using a custom rewrite and pulling from an external database, that tells me you aren't using native pagination and instead something custom, and that means you can use whatever variables you want. Please post the code you are using to render the paginated links. Also remember to flush the rewrite rules one time if you ever change the contents of `add_rewrite_rule`."^^ . + "<p>I need to select a dropdown value on an application and should be in a position to go back and update it.</p>\n<p>I am using HTML and CSS in front end. and PHP as the backend language.</p>\n<p>I am able to select a dropdown value and submit/update. I am using the code below:</p>\n<pre class="lang-php prettyprint-override"><code>@php\n$followups= \\App\\Models\\Followup::latest()-&gt;get();\n@endphp\n\n&lt;div class=&quot;col-md-4 col-6&quot;&gt;\n &lt;div class=&quot;form-group mb-30&quot;&gt;\n &lt;label class=&quot;input-label mb-2&quot;&gt;{{translate('Followup')}}*&lt;/label&gt;\n &lt;select class=&quot;sselect-identity theme-input-style mb-30&quot; name=&quot;followup&quot;&gt;\n &lt;option value=&quot;&quot;&gt;-- Select an option --&lt;/option&gt;\n @foreach($followups as $followup)\n &lt;option value=&quot;{{$followup-&gt;followup}}&quot;&gt;\n {{$followup-&gt;followup}}\n &lt;/option&gt;\n @endforeach\n &lt;/select&gt;\n &lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n<p>However, when I go back to select a value in a dropdown. It is stuck and unable to select any other value. I am using the code below for a second edit/update of the dropdown:</p>\n<pre class="lang-php prettyprint-override"><code>@php\n$followups= \\App\\Models\\Followup::latest()-&gt;get();\n@endphp\n\n&lt;div class=&quot;col-md-4 col-6&quot;&gt;\n &lt;div class=&quot;form-group mb-30&quot;&gt;\n &lt;label class=&quot;input-label mb-2&quot;&gt;{{translate('Follow up')}}*&lt;/label&gt;\n &lt;select class=&quot;select-identity theme-input-style mb-30&quot; name=&quot;followup&quot; required&gt;\n &lt;option value=&quot;&quot;&gt;{{ translate('Select an Option') }}&lt;/option&gt;\n @foreach ($followups as $followup)\n &lt;option value=&quot;{{ $followup-&gt;followup }}&quot;\n {{ $followup-&gt;followup === $userDeatials-&gt;followup ? 'selected' : '' }}&gt;\n {{ $followup-&gt;followup }}\n &lt;/option&gt;\n @endforeach\n &lt;/select&gt;\n &lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n<p>I have tried using the html code to fetch the values from a database table. The same code is repeated in the update html code. It does recognize what value is selected in the first update. But I am unable to click on the dropdown and select any other value.</p>\n"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + "heic"^^ . + . + . + "0"^^ . + "2"^^ . + . + "1"^^ . + "1"^^ . + "1"^^ . + "1"^^ . + . + "1"^^ . + . + "Is `$product_id == '13874904'` the free or paid product? Your code only checks for 1 product ID."^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + "-1"^^ . + "I think the biggest "gotcha" of the upgrade process was updating the routes from: `Route::get('/', 'Controller@method')` to: `Route::get('/', 'App\\Http\\Controllers\\Controller@method')`"^^ . + . + "or an alternative to my code would be appreciated"^^ . + . + "0"^^ . + . + . + . + . + "<pre><code> &lt;form action=&quot;admin_review.php?opt=newReview&quot; method=&quot;post&quot; &gt;\n &lt;fieldset&gt;\n &lt;legend&gt;Review Type&lt;/legend&gt;\n &lt;div class=&quot;input&quot;&gt;\n &lt;label for=&quot;movie&quot;&gt;Movie Review&lt;/label&gt;\n &lt;input type=&quot;radio&quot; name=&quot;reviewType&quot; id=&quot;movie&quot;&gt;\n &lt;/div&gt;\n &lt;div class=&quot;input&quot;&gt;\n &lt;label for=&quot;television&quot;&gt;Television Review&lt;/label&gt;\n &lt;input type=&quot;radio&quot; name=&quot;reviewType&quot; id=&quot;television&quot;&gt;\n &lt;/div&gt;\n &lt;div class=&quot;input&quot;&gt;\n &lt;label for=&quot;book&quot;&gt;Book Review&lt;/label&gt;\n &lt;input type=&quot;radio&quot; name=&quot;reviewType&quot; id=&quot;book&quot;&gt;\n &lt;/div&gt;\n &lt;div class=&quot;input&quot;&gt;\n &lt;label for=&quot;comic&quot;&gt;Comic Review&lt;/label&gt;\n &lt;input type=&quot;radio&quot; name=&quot;reviewType&quot; id=&quot;comic&quot;&gt;\n &lt;/div&gt;\n &lt;div class=&quot;input&quot;&gt;\n &lt;label for=&quot;game&quot;&gt;Game Review&lt;/label&gt;\n &lt;input type=&quot;radio&quot; name=&quot;reviewType&quot; id=&quot;game&quot;&gt;\n &lt;/div&gt;\n &lt;/fieldset&gt;\n &lt;input type=&quot;submit&quot; value=&quot;New Review Defintion&quot;&gt; \n &lt;/form&gt;\n\n if(isset($_POST['reviewType'])) {\n $value = $_POST['reviewType'];\n die(&quot;&lt;h1&gt;Review Type &quot; . $value . &quot;&lt;/h1&gt;&quot;);\n</code></pre>\n<p><code>$value</code> is set to &quot;on&quot;, not quite sure where this is coming from and why it isn't the selected value of &quot;movie&quot;.</p>\n"^^ . + . + . + . + "0"^^ . + "<p>I figured it out, at least partially. I need to implement</p>\n<pre><code> /**\n * {@inheritdoc}\n */\n public static function mainPropertyName() { return NULL ; }\n</code></pre>\n<p>in the <code>Demo2CType</code> class. Presumably this tells Drupal there are more than one columns in the type.</p>\n<p>And then remove the <code>UniqueField</code> constraint, or the form validation fails with a different error, in the <code>demo2c.module</code> file.</p>\n<pre><code> //-&gt;addConstraint( 'UniqueField' )\n</code></pre>\n"^^ . + . + "1"^^ . + . + "0"^^ . + "https://wordpress.stackexchange.com/a/387860 says that the featured image won't be available in the publish_post hooks, when Gutenberg is used as editor: _"Because Gutenberg uses the REST API, and by the time the publish_post hook is fired (when wp_update_post() is called — see source), the post's featured image and other meta data have not yet been saved/processed."_ It suggests to hook into `wp_after_insert_post` for that."^^ . + "Updated the question with output."^^ . + . + . + . + "mpdf manual integration issue"^^ . + "It's trying to set the value of the id `g-recaptcha-response`, but it can't find an element with the id of `g-recaptcha-response`. Did you add an input with that id (not name) to your form?"^^ . + . + . + . + "<p>I want to pivot two tables using SQL Server and PHP.</p>\n<p>table 1:</p>\n<pre><code>accountname amount dateposted\nab01 100 jan 1, 2022\nab02 100 jan 1, 2022\nab03 100 jan 1, 2023\n</code></pre>\n<p>table 2:</p>\n<pre><code>accountname target\nab01 100 \nab02 100 \nab03 100 \n</code></pre>\n<p>output table or pivot table:</p>\n<pre><code>accountname jan2022 jan2023 total target percentage\nab01 100 100 100 100%\nab02 100 100 100 100% \nab03 100 100 100 100% \n</code></pre>\n<p>This is tried so far:</p>\n<pre><code>$stmt = $database-&gt;prepare(&quot;SELECT DISTINCT FORMAT(tis_posting_date, 'MMM yyyy') AS month_year\n FROM tis_temp_dsr\n WHERE tis_posting_date BETWEEN '2022-11-29' AND '2023-03-29'&quot;);\n $stmt-&gt;execute();\n $columns_result = $stmt-&gt;fetchAll();\n $columns = [];\n foreach ($columns_result as $row) {\n $columns[] = &quot;[&quot; . $row['month_year'] . &quot;]&quot;;\n}\n\n$column_list = implode(&quot;, &quot;, $columns);\n\n\n$start_date = '2024-12-01';\n$end_date = '2025-03-31';\n\n\n$sql_columns = &quot;\n SELECT DISTINCT FORMAT(tis_posting_date, 'MMM yyyy') AS month_year\n FROM tis_temp_dsr\n WHERE tis_posting_date BETWEEN '$start_date' AND '$end_date'\n&quot;;\n\n$columns_result = $database-&gt;query($sql_columns);\n\n$columns = [];\nforeach ($columns_result as $row) {\n $columns[] = &quot;[&quot; . $row['month_year'] . &quot;]&quot;;\n}\n\n$column_list = implode(&quot;, &quot;, $columns);\n\n$sql = &quot;\n SELECT tis_account_name, $column_list\n FROM (\n SELECT \n tis_account_name,\n FORMAT(tis_posting_date, 'MMM yyyy') AS month_year, \n tis_amount_with_vat\n FROM tis_temp_dsr\n WHERE tis_posting_date BETWEEN '$start_date' AND '$end_date'\n ) AS SourceTable\n PIVOT (\n SUM(tis_amount_with_vat)\n FOR month_year IN ($column_list)\n ) AS PivotTable\n&quot;;\n\n$result = $database-&gt;query($sql);\n</code></pre>\n<p>I just comment the Total, because there's an error on it.</p>\n<p>Thanks in advance.</p>\n<p>It worked when using one table, and there's no date range.</p>\n"^^ . + "0"^^ . + "Datatables Server Side Filtering Wrong When Have Space Character"^^ . + "When you see a 500 server error your first action, before posting on [so], is to check the server error log for the actual problem. Only then consider posting on [so] with the error message taken from the server error log."^^ . + "Wouldn't whereDoesntHave OPEN or IN_PROGRESS suffice?"^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "Full PHP scripts interpreted as HTML often give such "illogical" results, because the browser basically thinks everything between `<?php ... ?>` was a tag (or rather processing instruction), and only displays what is outside of those as text content then. But if you directly check the response in the network panel of your browser dev tools, you should quickly see if that appears to be the full script or not."^^ . + "0"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + "wp_kses_allowed_html not triggered on WP frontend"^^ . + "0"^^ . + "2"^^ . + "<p>Your code is not compatible <a href="https://woocommerce.com/document/high-performance-order-storage/" rel="nofollow noreferrer">High-Performance Order Storage (HPOS)</a> and there are multiple mistakes, like:</p>\n<ul>\n<li><code>woocommerce_order_status_changed</code> has already <code>$order</code> available via its 4th argument,</li>\n<li><code>woocommerce_admin_order_totals_after_total</code> has only <code>$order_id</code> as available argument, but not any <code>$order</code> as 2nd argument…</li>\n</ul>\n<p>Try the following instead:</p>\n<pre class="lang-php prettyprint-override"><code>// Calculate and save transaction fee after order is created/paid\nadd_action('woocommerce_order_status_changed', 'add_transaction_fee_to_order_meta', 10, 4 );\nfunction add_transaction_fee_to_order_meta( $order_id, $old_status, $new_status, $order ) {\n $targeted_statuses = array('processing', 'completed');\n\n if ( in_array( $new_status, $targeted_statuses) &amp;&amp; ! $order-&gt;get_meta('_transaction_fee') &amp;&amp; $order-&gt;get_total() &gt; 0 ) {\n $order-&gt;update_meta_data('_transaction_fee', ($order-&gt;get_total() * 0.015) + 0.25 );\n $order-&gt;save();\n }\n}\n\n\n// Display transaction fee in admin order details *after* &quot;Paid&quot; line\nadd_action('woocommerce_admin_order_totals_after_total', 'display_transaction_fee_in_admin_order_details' );\nfunction display_transaction_fee_in_admin_order_details( $order_id ) {\n $order = wc_get_order($order_id);\n $args = array( 'currency' =&gt; $order-&gt;get_currency() );\n\n if ( $transaction_fee = $order-&gt;get_meta('_transaction_fee') ) {\n printf('&lt;tr&gt;\n &lt;td class=&quot;label&quot;&gt;%s&lt;/td&gt;\n &lt;td width=&quot;%s&quot;&gt;&lt;/td&gt;\n &lt;td class=&quot;total&quot;&gt;%s&lt;/td&gt;\n &lt;/tr&gt;', esc_html__('Transaction Fee:'), '1%', wc_price($transaction_fee, $args ) );\n\n printf('&lt;tr&gt;\n &lt;td class=&quot;label&quot;&gt;%s&lt;/td&gt;\n &lt;td width=&quot;%s&quot;&gt;&lt;/td&gt;\n &lt;td class=&quot;total&quot;&gt;%s&lt;/td&gt;\n &lt;/tr&gt;', esc_html__('Total (after fee):'), '1%', wc_price( $order-&gt;get_total() - $transaction_fee, $args ) );\n }\n}\n</code></pre>\n<p>It should better work without errors, and will be compatible with HPOS.</p>\n<p><a href="https://i.sstatic.net/2f2j9hgM.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2f2j9hgM.png" alt="enter image description here" /></a></p>\n<p>You may need to target the concerned payment gateway(s) in your first function, as actually your code is executed on all processing or completed orders, no matter what payment method has been used.</p>\n"^^ . + . + "1"^^ . + "2"^^ . + . + "1"^^ . + "0"^^ . + . + "<p>Actually I was following up with Brad Traversy’s PHP course, where he said make the “public” folder as the document root from Laragon by simply adding /public to the document root folder in the above mentioned file. And he said these changes can be made through opening the apache server from the taskbar. I tried doing editing this file, and made the required changes, I restarted the apache server from Laragon, but still there is Server error. I hope this sums up the question. I just want to change the document root to Workopia/public from Workopia –</p>\n<pre><code>&lt;VirtualHost *:80&gt; \n DocumentRoot &quot;C:/laragon/www/Workopia/public&quot;\n ServerName Workopia.test\n ServerAlias *.Workopia.test\n &lt;Directory &quot;C:/laragon/www/Workopia/public&quot;&gt;\n AllowOverride All\n Require all granted\n &lt;/Directory&gt;\n&lt;/VirtualHost&gt;\n\n# If you want to use SSL, enable it by going to Menu &gt; Apache &gt; SSL &gt; Enabled\n</code></pre>\n"^^ . + . + . + "0"^^ . + . + . + "2"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "<p>I am trying to add svg image or png image on the wordpress it work everywhere except in:</p>\n<ul>\n<li>cart</li>\n<li>checkout</li>\n<li>orders</li>\n<li>email notifications,</li>\n</ul>\n<p>It parse that as escaped HTML code, so the display in cart is:</p>\n<pre><code>1.000,00 &lt;span class=&quot;sar-svg-symbol&quot;&gt;&lt;img src=&quot;http://localhost:8888/SRS/wp-content/uploads/2025/02/sar_svg_symbol.png&quot; alt=&quot;SAR Symbol&quot; style=&quot;display:inline-block; width:20px; height:auto; vertical-align:middle;&quot;&gt;&lt;/span&gt;\n</code></pre>\n<p>This is my code</p>\n<pre class="lang-html prettyprint-override"><code>function sar_svg_force_png_in_cart_and_checkout($price, $cart_item = null, $cart_item_key = null) {\n $png_url = get_option('sar_svg_png_url', '');\n\n if (empty($png_url)) {\n return $price; // Return original price if PNG is missing\n }\n\n // Remove any existing currency symbols (SAR or ر.س) to prevent duplication\n $price = preg_replace('/(\\s?SAR|\\s?ر\\.س|\\s?ريال)/u', '', $price);\n\n // Ensure PNG is not duplicated\n if (strpos($price, 'sar_svg_symbol.png') !== false) {\n return $price;\n }\n\n // Ensure WooCommerce renders the PNG image\n $formatted_price = trim($price) . ' &lt;span class=&quot;sar-svg-symbol&quot;&gt;&lt;img src=&quot;' . esc_url($png_url) . '&quot; alt=&quot;SAR Symbol&quot; style=&quot;display:inline-block; width:20px; height:auto; vertical-align:middle;&quot;&gt;&lt;/span&gt;';\n \n return wp_kses_post($formatted_price);\n}\n\n// ✅ Apply fix to Cart, Checkout, and Order Totals\nadd_filter('woocommerce_cart_item_price', 'sar_svg_force_png_in_cart_and_checkout', PHP_INT_MAX, 3);\nadd_filter('woocommerce_cart_item_subtotal', 'sar_svg_force_png_in_cart_and_checkout', PHP_INT_MAX, 3);\nadd_filter('woocommerce_cart_totals_order_total_html', 'sar_svg_force_png_in_cart_and_checkout', PHP_INT_MAX, 3);\nadd_filter('woocommerce_order_formatted_line_subtotal', 'sar_svg_force_png_in_cart_and_checkout', PHP_INT_MAX, 3);\nadd_filter('woocommerce_email_order_item_subtotal', 'sar_svg_force_png_in_cart_and_checkout', PHP_INT_MAX, 3);\nadd_filter('woocommerce_email_order_total', 'sar_svg_force_png_in_cart_and_checkout', PHP_INT_MAX, 3);\n</code></pre>\n"^^ . + "https://stackoverflow.com/questions/64723305/change-laravel-datatables-time-format has some information on the format that's being passed, and how to change the date format"^^ . + "<p>I'm building an API using Laravel 10 with Sanctum for authentication, and I'm encountering an issue with email verification. After the user clicks the verification link, the email_verified_at field remains null.</p>\n<p>This is my register component</p>\n<pre><code>import React from &quot;react&quot;;\nimport { useNavigate } from &quot;react-router-dom&quot;;\n\nfunction Register() {\n const [name, setName] = React.useState(&quot;&quot;);\n const [email, setEmail] = React.useState(&quot;&quot;);\n const [password, setPassword] = React.useState(&quot;&quot;);\n const navigate = useNavigate();\n\n React.useEffect(() =&gt; {\n if (localStorage.getItem(&quot;token&quot;)) {\n navigate(&quot;/account&quot;);\n window.location.reload();\n }\n }, []);\n\n async function register() {\n const item = { name, email, password };\n\n let result = await fetch(&quot;http://localhost:8000/api/register&quot;, {\n method: &quot;POST&quot;,\n headers: {\n &quot;Content-Type&quot;: &quot;application/json&quot;,\n Accept: &quot;application/json&quot;,\n },\n body: JSON.stringify(item),\n });\n\n const data = await result.json();\n\n if (result.ok) {\n alert(&quot;Please verify your email before logging in.&quot;);\n navigate(&quot;/login&quot;);\n } else {\n alert(data.message || &quot;Error registering.&quot;);\n }\n }\n\n return (\n &lt;div className=&quot;py-16&quot;&gt;\n &lt;div className=&quot;flex items-center flex-col justify-center gap-6&quot;&gt;\n &lt;div className=&quot;flex items-center justify-center&quot;&gt;\n &lt;h1&gt;Register Form&lt;/h1&gt;\n &lt;/div&gt;\n\n &lt;div className=&quot;flex items-center flex-col gap-5 justify-center&quot;&gt;\n &lt;input\n type=&quot;text&quot;\n placeholder=&quot;Name&quot;\n value={name}\n onChange={(e) =&gt; setName(e.target.value)}\n /&gt;\n &lt;input\n type=&quot;email&quot;\n placeholder=&quot;Email&quot;\n value={email}\n onChange={(e) =&gt; setEmail(e.target.value)}\n /&gt;\n &lt;input\n type=&quot;password&quot;\n placeholder=&quot;Password&quot;\n value={password}\n onChange={(e) =&gt; setPassword(e.target.value)}\n /&gt;\n &lt;/div&gt;\n\n &lt;div&gt;\n &lt;button onClick={register} className=&quot;border-2 border-black p-2&quot;&gt;\n Register\n &lt;/button&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n );\n}\n\nexport default Register;\n</code></pre>\n<p>This is my auth controller</p>\n<pre><code>&lt;?php\n\nnamespace App\\Http\\Controllers;\nuse Illuminate\\Validation\\ValidationException; //manually imported\nuse Illuminate\\Support\\Facades\\Hash; //manually imported\nuse Illuminate\\Http\\Request;\nuse App\\Models\\User; //manualy imported\nuse Illuminate\\Auth\\Events\\Verified;\nuse Illuminate\\Foundation\\Auth\\EmailVerificationRequest;\nuse Carbon\\Carbon;\nclass AuthController extends Controller\n{\n //\n\n public function verifyEmail(Request $request, $id, $hash)\n {\n $user = User::find($id);\n\n if (!$user) {\n return response()-&gt;json(['message' =&gt; 'User not found.'], 404);\n }\n\n\n if (!hash_equals(sha1($user-&gt;getEmailForVerification()), $hash)) {\n return response()-&gt;json(['message' =&gt; 'Invalid verification link.'], 400);\n }\n\n\n if ($user-&gt;email_verified_at) {\n return response()-&gt;json(['message' =&gt; 'Email already verified.']);\n }\n\n $user-&gt;email_verified_at = Carbon::now();\n $user-&gt;save();\n\n return response()-&gt;json(['message' =&gt; 'Email verified successfully.']);\n }\n public function resendEmailVerification(Request $request)\n {\n if ($request-&gt;user()-&gt;hasVerifiedEmail()) {\n return response()-&gt;json(['message' =&gt; 'Email already verified.']);\n }\n\n $request-&gt;user()-&gt;sendEmailVerificationNotification();\n\n return response()-&gt;json(['message' =&gt; 'Verification email sent.']);\n }\n\n public function register(Request $request)\n {\n $request-&gt;validate([\n 'name' =&gt; 'required|string|max:255',\n 'email' =&gt; 'required|string|email|unique:users',\n 'password' =&gt; 'required|string|min:6'\n ]);\n\n $user = User::create([\n 'name' =&gt; $request-&gt;name,\n 'email' =&gt; $request-&gt;email,\n 'password' =&gt; Hash::make($request-&gt;password)\n ]);\n\n\n $user-&gt;sendEmailVerificationNotification();\n\n\n\n $token = $user-&gt;createToken('auth_token')-&gt;plainTextToken;\n\n return response()-&gt;json(['token' =&gt; $token, 'user' =&gt; $user], 201);\n }\n\n public function login(Request $request)\n {\n $request-&gt;validate([\n 'email' =&gt; 'required|email',\n 'password' =&gt; 'required'\n ]);\n\n $user = User::where('email', $request-&gt;email)-&gt;first();\n\n if (!$user || !Hash::check($request-&gt;password, $user-&gt;password)) {\n return [&quot;error&quot; =&gt; &quot;Invalid credentials&quot;];\n }\n\n $token = $user-&gt;createToken('auth_token')-&gt;plainTextToken;\n\n return response()-&gt;json(['token' =&gt; $token, 'user' =&gt; $user]);\n }\n\n public function logout(Request $request)\n {\n $request-&gt;user()-&gt;tokens()-&gt;delete();\n\n return response()-&gt;json(['message' =&gt; 'Logged out']);\n }\n\n public function user(Request $request)\n {\n return response()-&gt;json($request-&gt;user());\n }\n\n\n\n}\n</code></pre>\n<p>These are my api routes</p>\n<pre><code>&lt;?php\n\nuse App\\Http\\Controllers\\AuthController;\nuse App\\Http\\Controllers\\DisplayController;\nuse App\\Http\\Controllers\\OrderController;\nuse App\\Http\\Controllers\\StripeController;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Route;\n\n/*\n|--------------------------------------------------------------------------\n| API Routes\n|--------------------------------------------------------------------------\n|\n| Here is where you can register API routes for your application. These\n| routes are loaded by the RouteServiceProvider within a group which\n| is assigned the &quot;api&quot; middleware group. Enjoy building your API!\n|\n*/\n\nRoute::middleware('auth:sanctum')-&gt;get('/user', function (Request $request) {\n return $request-&gt;user();\n});\n\n\nRoute::post(&quot;/login&quot;,[AuthController::class,&quot;login&quot;]);\nRoute::post(&quot;/register&quot;,[AuthController::class,&quot;register&quot;]);\n\nRoute::middleware('auth:sanctum')-&gt;post('/addOrder', [OrderController::class, 'addOrder']);\n\nRoute::middleware('auth:sanctum')-&gt;post('/pay', [StripeController::class, 'pay']);\n\nRoute::middleware('auth:sanctum')-&gt;get('/displayOrders', [DisplayController::class, 'displayOrders']);\n\n\n\nRoute::get('/email/verify/{id}/{hash}', [AuthController::class, 'verifyEmail'])\n -&gt;middleware(['signed']) \n -&gt;name('verification.verify');\n</code></pre>\n<p>And these are my web routes</p>\n<pre><code>&lt;?php\n\nuse Illuminate\\Support\\Facades\\Route;\nuse Illuminate\\Foundation\\Auth\\EmailVerificationRequest;\nuse App\\Http\\Controllers\\AuthController;\n\n/*\n|--------------------------------------------------------------------------\n| Web Routes\n|--------------------------------------------------------------------------\n|\n| Here is where you can register web routes for your application. These\n| routes are loaded by the RouteServiceProvider within a group which\n| contains the &quot;web&quot; middleware group. Now create something great!\n|\n*/\n\nRoute::get('/', function () {\n return view('welcome');\n});\n\n\nRoute::get('/login', function () {\n return redirect('http://localhost:5173/login');\n})-&gt;name('login');\nRoute::get('/email/verify/{id}/{hash}', [AuthController::class, 'verifyEmail'])\n -&gt;middleware(['auth:sanctum', 'signed'])\n -&gt;name('verification.verify');\n</code></pre>\n<p>I already made sure that the user model has the email verification thing enabled. Simply , after I receive the confirmation email on mailtrap and click the button I am getting redirected to the login page and then when checking the data base the &quot;email_verified_at&quot; entry is still empty... pls help</p>\n"^^ . + . + "1"^^ . + "0"^^ . + . + "Which line is 2510 ?"^^ . + "`$items = WC()->cart->get_cart();` gets you _all_ the items that are currently in the cart - `$quantity=$items['quantity'];` therefor doesn't make sense. You need to _find_ the cart item that matches your passed `$product` first, and then access the quantity of that item."^^ . + . + . + . + . + . + . + . + "0"^^ . + . + "-3"^^ . + "0"^^ . + "<p>I am unable to sftp a file to a server using my code. But only under a very specific scenario.</p>\n<p>MyClient can successfully connect to any SFTP Server I try, except MyHost. Every other client I try, can connect to the MyHost. I even used the client PHP Code on a windows machine and it connects successfully.</p>\n<p><strong>MyClient</strong>: PHP 7.4 on Ubuntu 20. (code below).<br />\n<strong>MyHost</strong>: Windows Server 2016 with OpenSSH SFTP.</p>\n<p>Why?</p>\n<p>The log acts as if the password is incorrect. However as the same password is used on other clients successfully I know that is not the case.</p>\n<p>I thought it was strange the auth skips password and goes to keyboard-interactive. However the successful login from an alternate OS client does the same thing, but succeeds with the keyboard-interactive.</p>\n<pre><code>// Create connection string.\n$connection_handle = curl_init($this-&gt;protocol .'://' . $this-&gt;server . ':' . $this-&gt;port . $this-&gt;remote_directory . '/test.txt');\n\n// Create a test file.\n$file_content = 'We the people of the United States of America in order to form a more perfect union:';\n$file_handle = fopen('php://temp', 'r+');\nfwrite($file_handle, $file_content);\nrewind($file_handle);\nif (!$file_handle)\n{\n throw new APIException('Unable to create memory file handle.');\n}\n\n// Set up\ncurl_setopt($connection_handle, CURLOPT_USERPWD, $this-&gt;user_id . ':' . $this-&gt;password);\ncurl_setopt($connection_handle, CURLOPT_UPLOAD, true);\ncurl_setopt($connection_handle, CURLOPT_PROTOCOLS, $this-&gt;protocol == 'sftp' ? CURLPROTO_SFTP : CURLPROTO_FTP);\ncurl_setopt($connection_handle, CURLOPT_INFILE, $file_handle);\ncurl_setopt($connection_handle, CURLOPT_INFILESIZE, strlen($file_content));\ncurl_setopt($connection_handle, CURLOPT_VERBOSE, true);\ncurl_setopt($connection_handle, CURLOPT_CONNECTTIMEOUT, 5);\n\n// Using a self signed cert locally.\ncurl_setopt($connection_handle, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n$response = curl_exec($connection_handle);\n</code></pre>\n<p>MyClient Log:</p>\n<pre><code>* Trying MyHost\n* TCP_NODELAY set\n* Connected to MyHost (MyHost) port 22 (#0)\n* User: wsftptest\n* Authentication using SSH public key file\n* Authentication failure\n* Closing connection 0\n</code></pre>\n<p>MyHost Log:</p>\n<pre><code>debug3: userauth_finish: failure partial=0 next methods=&quot;publickey,password,keyboard-interactive&quot; [preauth]\ndebug1: userauth-request for user MyHostUser service ssh-connection method keyboard-interactive [preauth]\ndebug1: attempt 1 failures 0 [preauth]\ndebug2: input_userauth_request: try method keyboard-interactive [preauth]\ndebug1: keyboard-interactive devs [preauth]\ndebug1: auth2_challenge: user=wsftptest devs= [preauth]\ndebug1: kbdint_alloc: devices '' [preauth]\ndebug2: auth2_challenge_start: devices [preauth]\ndebug3: user_specific_delay: user specific delay 0.000ms [preauth]\ndebug3: ensure_minimum_time_since: elapsed 0.000ms, delaying 5.311ms (requested 5.311ms) [preauth]\ndebug3: userauth_finish: failure partial=0 next methods=&quot;publickey,password,keyboard-interactive&quot; [preauth]\ndebug3: send packet: type 51 [preauth]\ndebug3: receive packet: type 1 [preauth]\nReceived disconnect from MyHost port 38392:11: Bye Bye [preauth]\nDisconnected from authenticating user MyHostUser MyHost port 38392 [preauth]\n</code></pre>\n"^^ . + . + . + . + "@Barmar I've been looking at various ASN.1 publications and even they are not clear on how the content is supposed to be encoded. This question is to the workflow of how the ASN.1 content is required to be encoded.\n\nI already know Information Objects and Identifiers are not supposed to be encoded. I would like some help on this please."^^ . + . + "archive"^^ . + . + "0"^^ . + "0"^^ . + . + "5"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + . + "Exactly what I want to do is Task Scheduling"^^ . + "Actually, `$this->tags()->pluck('id')->toArray()` returns the ids of *all* the tags instead of the ids of the tags *attached to the article only*. So, not working as expected."^^ . + . + "Just use composer to install mPDF, you'll save yourself a lot of headaches."^^ . + . + . + . + "0"^^ . + . + . + "Thanks, That's exactly what I was trying to formulate! I'd tried something with loops but this feels closer to Laravel guidelines :) Thank you good sir!"^^ . + "$username = $row[‘username’]; $_SESSION[‘username’] = $username; Header(“Location: index.php”); Exit(); that is the rest of his coding."^^ . + . + . + . + . + . + . + . + . + . + "phonepe"^^ . + "cassandra"^^ . + . + . + . + "0"^^ . + "readdir"^^ . + . + "1"^^ . + "yes in $url database column it is inserting $dir thanks for any ideas"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "shortcode"^^ . + "How to handle simultaneous AJAX requests which update the same metadata?"^^ . + . + . + . + "Changing internal link color depending on post type"^^ . + . + . + "1"^^ . + . + "1"^^ . + . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "Bill's right - it's unclear why you only parameterised one of the many variables you're inserting into the query. The correct solution is to parameterise _all_ the input variables."^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "emoji"^^ . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + "1"^^ . + "MediaWiki timeout, apparent memory loop"^^ . + "<p>I'm building a <code>PWA</code> in <code>ionic</code> + <code>vuejs</code>. One of the functions is a small community feed through which people can add posts and other can react to it. When they use an emoticon in a reaction, the emoticon is saved in <code>mysql</code> database. So far, so good.</p>\n<p>When I fetch the community feed from the back-end, the emoticons are shows in the <code>json</code> output, see screenshot from the chrome console:</p>\n<p><a href="https://i.sstatic.net/5X2CqUHO.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/5X2CqUHO.png" alt="enter image description here" /></a></p>\n<p>The problem I have is that this doesn't seem to work in a <code>ios</code> safari browser. In <code>ios</code> safari the whole feed stays empty and it seems like this is due to the <code>json</code> object holding these emoticons. When I remove the emoticons and reload the feed. all is good again.</p>\n<p>My back-end is in <code>php</code>and uses a <code>PDO</code> connection. the connection is set with the charset as <code>charset=utf8mb4</code>. Also, the mysql tables have <code>utf8mb4</code> as the charset and even the fields where the emoticons are stored have the <code>utf8mb4</code> charset.</p>\n<p>Any thoughts on this?</p>\n"^^ . + "0"^^ . + . + "1"^^ . + . + . + "-2"^^ . + . + . + . + . + . + "Have you searched "Permission denied" on this site? There're tons of questions about this error."^^ . + . + . + . + . + . + "0"^^ . + . + . + "anonymous-class"^^ . + . + . + "1"^^ . + "<p>I generally put my SPA and API backend on two separate domains (one pointing to a CDN and the other to the actual server) and deal with cookie issues a lot. However, that may not be entirely applicable to your circumstances since it appears you are using a single domain. Anyhow, hope these troubleshooting steps help:</p>\n<p>A lot of the troubleshooting is probably on the frontend in the browser:</p>\n<h5>Did the browser receive the cookie?</h5>\n<p>This is most likely true since the login response was successful. Check the cookie values:</p>\n<pre><code>&quot;domain&quot;: &quot;example.org&quot;,\n&quot;expires&quot;: &quot;2025-03-03T16:06:18.000Z&quot;,\n&quot;httpOnly&quot;: true,\n&quot;path&quot;: &quot;/&quot;,\n&quot;samesite&quot;: &quot;None&quot;,\n&quot;secure&quot;: true,\n&quot;value&quot;: &quot;...&quot;\n</code></pre>\n<p>Is the <code>domain</code> correct? Is the <code>path</code> correct? Are the other values also correct?</p>\n<h5>Did the browser set the cookie?</h5>\n<p>You can check this by looking at the <code>Storage</code> tab in Firefox and Chrome's <code>Application &gt; Storage</code> tab. If not, then the browser decided the cookie was invalid for some reason.</p>\n<h5>Are there CORS errors in the console?</h5>\n<p>This is more relevant to multi-domain set ups.. But if there are any errors, then it should tell you what is wrong with the cookie.</p>\n<p><em>Sometimes</em> there aren't any errors except for a little triangle warning badge next to the cookie in the request/response. You can hover your mouse over it and it'll tell you what is wrong.</p>\n<h5>Did the browser send the cookie back?</h5>\n<p>In the request, did it include the cookie? If not, then the domain/path is probably wrong. Check the values for <code>domain</code> and <code>path</code> again.</p>\n<p>If the browser <em>did</em> send it back to the server, then the issue is likely that Apache isn't sending the cookie back to the Laravel app. At which point I am also at a loss without more information about the set up.</p>\n"^^ . + . + "<p><strong>Summarize:</strong></p>\n<p>I'm using the following code that allow customers know calculation of an extra cost depending on product weight and then add to the cart summary.</p>\n<p><strong>Problem:</strong></p>\n<p>Code rendundant. I think there is a way to obtain the same output with a more clean and organized code.</p>\n<p><strong>Description:</strong>\nThis code add a cost name &quot;Contributo costo pedane&quot; on each unit depending from product weight setted up from woocommerce procuct page.</p>\n<p>For each unit weight add 2,00 Euros</p>\n<pre><code>/*\n *Add cart fees by cart total weight Add_pedane\n */\n\nadd_action( 'woocommerce_cart_calculate_fees', 'a_man_ltd_wc_add_cart_fees' );\nif ( ! function_exists( 'a_man_ltd_wc_add_cart_fees' ) ) {\n function a_man_ltd_wc_add_cart_fees( $cart ) {\n $weight = $cart-&gt;get_cart_contents_weight();\n if ( $weight &lt;= 1 ) {\n $name = 'Contributo costo pedane';\n $amount = 2;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 1 and $weight &lt;=2 ) {\n $name = 'Contributo costo pedane';\n $amount = 4;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 2 and $weight &lt;=3 ) {\n $name = 'Contributo costo pedane';\n $amount = 6;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 3 and $weight &lt;=4 ) {\n $name = 'Contributo costo pedane';\n $amount = 8;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 4 and $weight &lt;=5 ) {\n $name = 'Contributo costo pedane';\n $amount = 10;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 5 and $weight &lt;=6 ) {\n $name = 'Contributo costo pedane';\n $amount = 12;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 6 and $weight &lt;=7 ) {\n $name = 'Contributo costo pedane';\n $amount = 14;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 7 and $weight &lt;=8 ) {\n $name = 'Contributo costo pedane';\n $amount = 16;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 8 and $weight &lt;=9 ) {\n $name = 'Contributo costo pedane';\n $amount = 18;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 9 and $weight &lt;=10 ) {\n $name = 'Contributo costo pedane';\n $amount = 20;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 10 and $weight &lt;=11 ) {\n $name = 'Contributo costo pedane';\n $amount = 22;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 11 and $weight &lt;=12 ) {\n $name = 'Contributo costo pedane';\n $amount = 24;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 12 and $weight &lt;=13 ) {\n $name = 'Contributo costo pedane';\n $amount = 26;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 13 and $weight &lt;=14 ) {\n $name = 'Contributo costo pedane';\n $amount = 28;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 14 and $weight &lt;=15 ) {\n $name = 'Contributo costo pedane';\n $amount = 30;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 15 and $weight &lt;=16 ) {\n $name = 'Contributo costo pedane';\n $amount = 32;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 16 and $weight &lt;=17 ) {\n $name = 'Contributo costo pedane';\n $amount = 34;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 17 and $weight &lt;=18 ) {\n $name = 'Contributo costo pedane';\n $amount = 36;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 18 and $weight &lt;=19 ) {\n $name = 'Contributo costo pedane';\n $amount = 38;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 19 and $weight &lt;=20 ) {\n $name = 'Contributo costo pedane';\n $amount = 40;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 20 and $weight &lt;=21 ) {\n $name = 'Contributo costo pedane';\n $amount = 42;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 21 and $weight &lt;=22 ) {\n $name = 'Contributo costo pedane';\n $amount = 44;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 22 and $weight &lt;=23 ) {\n $name = 'Contributo costo pedane';\n $amount = 46;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 23 and $weight &lt;=24 ) {\n $name = 'Contributo costo pedane';\n $amount = 48;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 24 and $weight &lt;=25 ) {\n $name = 'Contributo costo pedane';\n $amount = 50;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 25 and $weight &lt;=26 ) {\n $name = 'Contributo costo pedane';\n $amount = 52;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 26 and $weight &lt;=27 ) {\n $name = 'Contributo costo pedane';\n $amount = 54;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 27 and $weight &lt;=28 ) {\n $name = 'Contributo costo pedane';\n $amount = 56;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 28 and $weight &lt;=29 ) {\n $name = 'Contributo costo pedane';\n $amount = 58;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 29 and $weight &lt;=30 ) {\n $name = 'Contributo costo pedane';\n $amount = 60;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 30 and $weight &lt;=31 ) {\n $name = 'Contributo costo pedane';\n $amount = 62;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 31 and $weight &lt;=32 ) {\n $name = 'Contributo costo pedane';\n $amount = 64;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n if ( $weight &gt; 32 and $weight &lt;=33 ) {\n $name = 'Contributo costo pedane';\n $amount = 66;\n $taxable = true;\n $tax_class = '';\n $cart-&gt;add_fee( $name, $amount, $taxable, $tax_class );\n }\n }\n}\n</code></pre>\n<p><strong>Limit and expectation:</strong>\nIn this example of coding posted below I have mapped costs for max weight 32-33 units manually but I think it is possible to do something oriented to infinite units with incremental steps of 2 Euros for each unit.</p>\n"^^ . + . + . + "0"^^ . + . + . + . + . + "6"^^ . + "Updated question"^^ . + . + . + . + . + . + "`Of course, I've already tried to edit the code several times`...ok, but you're supposed to show us your attempt. On this site we help people with their code, we don't write it all for them generally - although this one is fairly straightforward because there are worked examples of the exact same thing in multiple places online, including the official documentation - so all you have to do is follow the same pattern. If you get stuck with that, you post your code and show your _specific_ problem...otherwise your question is just generic and hence gets closed as a duplicate of existing solutions"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + "A cookie's uniqueness boils down to the cookie's name, domain and path, and when you use the `Set-Cookie` head you should take this into account. The concept of "pages" or "values" is something that only really exists in your application."^^ . + "0"^^ . + "Okay, that's the blocker for you, I can understand that, but see how much better it helps to describe what you're looking for? You could [edit] that in (in comments it gets lost). You should then also write about your configuration as we can't see it from the code: Phpstan version, Laravel version, Larastan version - just all the necessary details that can influence the behaviour."^^ . + . + "0"^^ . + "block_0 has an innerHTML that contain the subform added by the collectionField\nnew_block_0 is null, maybe because the fetch fail with the 405 Method Not Allowed error"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + . + "this version is actually longer that simple sum and works a little bit slower because of function call and array allocation"^^ . + . + . + "Thank you so much, it works!\nAnd thank you for the provided documentation, I will use it!\n\nCheers."^^ . + . + "<p>I have a webform for my site visitors.</p>\n<p>I need to send the results of the form to the visitors' email address, as well as my own.</p>\n<p>However, I would like my email address to be hidden from the visitor.</p>\n<p>Is there a way to make my email address a 'bcc' in the $mailto script?</p>\n<p>The example below works fine to send the data to both addresses. I just need ex. my_address@email.com to be bcc.</p>\n<pre><code>&lt;?php\n\n$name = $_POST['userName'];\n$email = $_POST['userEmail'];\n$phone = $_POST['userPhone'];\n\n$composition =\n\n&quot;\\r\\nName: &quot; . $name .\n&quot;\\r\\nEmail Address: &quot; . $email .\n&quot;\\r\\nPhone Number: &quot; . $phone ;\n\n$subject = &quot;This is where the subject goes&quot;;\n$fromname = &quot;$name&quot;;\n$fromemail = &quot;$email&quot;;\n$mailto = &quot;visitor_address@email.com,my_address@email.com&quot;;\n\n$separator = md5(uniqid(time()));\n\n$eol = &quot;\\r\\n&quot;;\n\n$headers = &quot;From: &quot;.$fromname.&quot; &lt;&quot;.$fromemail.&quot;&gt;&quot; . $eol;\n$headers .= &quot;MIME-Version: 1.0&quot; . $eol;\n$headers .= &quot;Content-Type: multipart/mixed;&quot;. $eol. &quot; boundary=\\&quot;&quot; . \n$separator . &quot;\\&quot;&quot; . $eol;\n$headers .= &quot;This is a MIME encoded message.&quot; . $eol . $eol;\n$body = &quot;--&quot; . $separator . $eol;\n$body .= &quot;Content-Type: text/plain; charset=\\&quot;iso-8859-1\\&quot;&quot; . $eol;\n$body .= &quot;Content-Transfer-Encoding: 8bit&quot; . $eol . $eol;\n$body .= $composition . $eol;\n\nmail($mailto, $subject, $body, $headers);\n\nheader('location: /folder/page.hmtl');\n\n?&gt;\n</code></pre>\n<p>I tried:</p>\n<pre><code>$mailto = &quot;visitors_address@email.com,?bbc=my_address@email.com&quot;;\n</code></pre>\n<p>And tried:</p>\n<pre><code>$mailto = &quot;visitors_address@email.com?bbc=my_address@email.com&quot;;\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + "@NikPatel: Then this: https://stackoverflow.com/questions/79432624/default-image-for-uploading-a-file?noredirect=1#comment140087545_79432624 and you should perhaps file this as a feature request, because Filament has no fallback pages for individual inputs in their non-selective load state."^^ . + . + . + . + . + . + . + . + "1"^^ . + . + "0"^^ . + . + "when i want to install composer i got this error"^^ . + "0"^^ . + "Phalcon 4.2 to 5.4 Migration – HTML Escaping Issue in Form Labels"^^ . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + "simple , i want to install php gd extension"^^ . + "Would you be able to provide a live [mcve], e.g. using JSFiddle or Plunkr?"^^ . + . + "The Loader class itself doesn't know where its source data comes from; it's injected based on settings. When used as $model, it might load from an XML file (e.g., model.xml) or an SQL database. Similarly, as $target, it could use target.xml or a different database. This flexibility means the source varies by context ($model or $target) and type (XML or SQL). Thus, #[Inject] alone can't handle this dynamic, context-dependent injection. @ChrisHaas"^^ . + "jenssegers-mongodb"^^ . + "<p>I would like to offer 3 products for Subscription and allow the customer to choose one.</p>\n<p>Below is the PHP code to create the checkout session.</p>\n<pre><code>$result = $stripe-&gt;checkout-&gt;sessions-&gt;create([\n 'mode' =&gt; 'subscription',\n 'line_items' =&gt; [\n [\n 'price' =&gt; 'price_ddd',\n 'quantity' =&gt; 1,\n ],\n [\n 'price' =&gt; 'price_eee',\n 'quantity' =&gt; 1,\n ],\n [\n 'price' =&gt; 'price_fff',\n 'quantity' =&gt; 1,\n ], \n ],\n 'customer_email' =&gt; $useremail, \n 'subscription_data' =&gt; ['trial_period_days' =&gt; 14, 'trial_settings' =&gt; ['end_behavior' =&gt; ['missing_payment_method' =&gt; 'cancel']],],\n 'ui_mode' =&gt; 'embedded',\n 'payment_method_collection' =&gt; 'if_required',\n 'return_url' =&gt; site_url(&quot;billing/callback&quot;) . &quot;?session_id={CHECKOUT_SESSION_ID}&quot; \n ]); \n</code></pre>\n<p>The checkout page shows like this:\n<a href="https://i.sstatic.net/CU6AfM1r.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/CU6AfM1r.png" alt="enter image description here" /></a></p>\n<p>I need the customer to choose the product from the 3 products. It doest not offer the option choose. It only shows the 3 products.</p>\n<p>How to allow it to choose the product?</p>\n"^^ . + "3"^^ . + "0"^^ . + . + . + "0"^^ . + "1"^^ . + . + . + . + "It is just another example of catastrophic backtracking and how poorly it is handled by PHP. Note it has nothing to do specifically with `i`, it has to do with the input text, its length and the character arrangement inside the text."^^ . + "namespaces"^^ . + "We have two domains: one for development testing (which is minimally affected) and one for production (which is severely affected). On the development domain, a page takes around 6 seconds to load, whereas on the production domain, it takes 10–15 seconds."^^ . + "0"^^ . + . + . + "Yes the issue was fixed , dir structure was wrong"^^ . + "You claim that the titles are in the second array, but they're in the third one. You didn't count the empty 2nd array (a blank line in the file)."^^ . + "1"^^ . + . + . + . + . + . + "It’s always a good idea to [read the docs](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#godaddy)."^^ . + "0"^^ . + . + . + "@Sam, try and change: `$rate_percentage = floatval( $rate['rate'] );` with: `$rate_percentage = floatval( $rate['rate'] ) / 100;`. By dividing the tax rate by 100, you're effectively transforming the percentage into a usable decimal from e.g. 10% to 0.10. This percentage needs to be converted to decimal. There is explanation in WooCommerce documentation on [How taxes work in WooCommerce](https://woocommerce.com/document/setting-up-taxes-in-woocommerce/how-taxes-work-in-woocommerce/)."^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + "There are so many questions like this here on SO already, with so many answers you could check, have you tried any of those solutions? Random eg: https://stackoverflow.com/questions/43715106/404-not-found-but-route-exist-in-laravel-5-4"^^ . + . + "@Epilol - I've updated my answer with some more information about the undefined variable."^^ . + . + "2"^^ . + . + "<p>php -r &quot;readfile('https://getcomposer.org/installer');&quot;\nPHP Warning: readfile(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:0A000086:SSL routines::certificate verify failed in Command line code on line 1</p>\n<p>Warning: readfile(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:0A000086:SSL routines::certificate verify failed in Command line code on line 1\nPHP Warning: readfile(): Failed to enable crypto in Command line code on line 1</p>\n<p>Warning: readfile(): Failed to enable crypto in Command line code on line 1\nPHP Warning: readfile(<a href="https://getcomposer.org/installer" rel="nofollow noreferrer">https://getcomposer.org/installer</a>): Failed to open stream: operation failed in Command line code on line 1</p>\n<p>Warning: readfile(<a href="https://getcomposer.org/installer" rel="nofollow noreferrer">https://getcomposer.org/installer</a>): Failed to open stream: operation failed in Command line code on line 1</p>\n<p>i have modified php.ini with:\n<code>openssl.cafile=&quot;C:\\xampp\\apache\\bin\\curl-ca-bundle.crt&quot;</code>\n<code>curl.cainfo=&quot;C:\\xampp\\apache\\bin\\curl-ca-bundle.crt&quot;</code></p>\n"^^ . + "I can't reproduce the error."^^ . + "@David - alas it isn't quite doing it. Either JS isn't posting or (as I seem to be learning), I need more JS to get the POSTed value, probably in a JSON format so that PHP can play with it. Or more accurately, JS posts to another PHP page that gives the answer I need and returns it back for JS to display. If I'm understanding correctly. It's a huge misunderstanding on my part of what JS does."^^ . + . + . + . + . + . + "Thanks so much, the only problem is that I have the same result with the order being the same. The dash is at the top like before. I made minor changes to your code and provided more of my original code that I left out so that it wouldn't look so messy. Here is the full code for that section https://3v4l.org/B7RQ7"^^ . + . + . + . + . + ""I'm getting few errors, one related to autoloader. other error indicates platform incompatibility." - You should have shared the error messages, they're telling you what's wrong. In general, you should develop the code locally in the same major+minor version that you'll be using on production."^^ . + . + . + . + "0"^^ . + . + "ok but im passing just a simple integer 1 or 2 or 3 becouse i have 3 columns only to check and in the db there is a table column named "column" for check the column number and the value is an integer 1 or 2 or 3.maybe can be the column name named "column" that make somthing wrong?"^^ . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + . + "2"^^ . + . + "1"^^ . + "0"^^ . + "Should work with a single parameter: `->whereRaw("ST_Contains(ST_GeomFromText(?), location)", [sprintf(\n 'POLYGON((%.12F %.12F, %.12F %.12F, %.12F %.12F, %.12F %.12F, %.12F %.12F))',\n $southWest['lat'], $southWest['lng'],\n $southWest['lat'], $northEast['lng'],\n $northEast['lat'], $northEast['lng'],\n $northEast['lat'], $southWest['lng'],\n $southWest['lat'], $southWest['lng']\n )]\n )`"^^ . + . + . + . + "Thanks for helping! Unfortunately, all ways behaves the same"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + "Thank you. That was very helpful. I was able to figure out which middleware was responsible for this. I also found a bug in my LoginController where I set the ‘guest’ middleware although I shouldn't do it there"^^ . + "If you start with this, I clearly understand that the goal is to have your Laravel app run locally on Windows startup. In light of this, I wrote the answer. The key is to set XAMPP to start automatically, configure XAMPP to start the httpd and MySQL services on startup, and use my answer to modify the `htdocs` folder to point to the Laravel `public` folder: https://stackoverflow.com/a/79511576/15167500"^^ . + . + . + "to remove use detach. Since the answer as been helpful kindly accept it"^^ . + "I think it could be due to a timeout. Have you set all of these?`max_input_time = 6000`, `max_execution_time = 6000`, and `memory_limit = -1` in the `php.ini` file. Also, make sure you have set the `client_max_body_size` in both the `HTTP block` and the `server block` in the `nginx.conf` file."^^ . + . + "<p>I'm trying to create a simple WordPress widget for AI text generation. The widget should allow the user to type a prompt, set a word limit, and click a &quot;Generate Text&quot; button. I want to use the OpenAI API to generate text based on the prompt and word limit. However, I'm facing an issue with how the widget behaves depending on where it's loaded.</p>\n<p><strong>Problem:</strong></p>\n<p>The AI text generation works fine when all the options (form) are loaded on the WordPress front page (working example in CODE-1 below). But I want the widget to only be available in the backend (as part of the widget options).</p>\n<p>So, my goal is to make the AI text generator available only in the backend for editing widgets, and have the API generate text and insert it into the widget's text area. The main issue is that AJAX doesn’t seem to work properly within widget options, and I’m struggling to find a solution.</p>\n<p><strong>What I want to achieve:</strong></p>\n<ul>\n<li>Create a widget in the WordPress backend.</li>\n<li>Use the OpenAI API to generate text based on user input (prompt and\nword limit).</li>\n<li>Insert the generated text into the widget text area.</li>\n</ul>\n<p><strong>Questions:</strong></p>\n<p>How can I make AJAX work properly inside the WordPress widget options in the backend?\nIs there a recommended approach for integrating OpenAI API text generation with a WordPress widget in the backend?\nI’m not sure what else to check or why API requests can't be handled through the backend widget options. I tested AI text generation on a backend page (not widgets), and it works fine there. The issue is only with the widgets, and I can’t figure out why it’s not working. There are no errors in the console, nothing—it just doesn’t work in the widget.</p>\n<p>Any help would be greatly appreciated!</p>\n<p><strong>CODE-1 (works OK if loaded as front-end widget):</strong></p>\n<pre><code>&lt;?php\n/*\nPlugin Name: OpenAI Widget\nDescription: A simple WordPress widget to generate text using OpenAI GPT-3.5 API.\nVersion: 1.0\nAuthor: WP\n*/\n\nclass OpenAI_Widget extends WP_Widget {\n\n public function __construct() {\n parent::__construct(\n 'openai_widget',\n __('OpenAI Text Generator', 'openai_widget_domain'),\n array('description' =&gt; __('Generate text using OpenAI GPT-3.5', 'openai_widget_domain'))\n );\n }\n\n public function widget($args, $instance) {\n echo $args['before_widget'];\n ?&gt;\n &lt;div class=&quot;openai-widget&quot;&gt;\n &lt;label for=&quot;openai_prompt&quot;&gt;Prompt:&lt;/label&gt;\n &lt;textarea id=&quot;openai_prompt&quot; rows=&quot;3&quot;&gt;&lt;/textarea&gt;\n\n &lt;label for=&quot;openai_word_limit&quot;&gt;Word Limit:&lt;/label&gt;\n &lt;input type=&quot;number&quot; id=&quot;openai_word_limit&quot; value=&quot;100&quot; min=&quot;1&quot; max=&quot;500&quot;/&gt;\n\n &lt;button id=&quot;openai_generate&quot;&gt;Generate Text&lt;/button&gt;\n\n &lt;label for=&quot;openai_output&quot;&gt;Output:&lt;/label&gt;\n &lt;textarea id=&quot;openai_output&quot; rows=&quot;5&quot; readonly&gt;&lt;/textarea&gt;\n &lt;/div&gt;\n\n &lt;script&gt;\ndocument.addEventListener(&quot;DOMContentLoaded&quot;, function() {\n document.getElementById(&quot;openai_generate&quot;).addEventListener(&quot;click&quot;, function() {\n let prompt = document.getElementById(&quot;openai_prompt&quot;).value.trim();\n let wordLimit = parseInt(document.getElementById(&quot;openai_word_limit&quot;).value);\n\n if (prompt.length === 0) {\n alert(&quot;Please enter a prompt.&quot;);\n return;\n }\n\n fetch('&lt;?php echo admin_url('admin-ajax.php'); ?&gt;', {\n method: &quot;POST&quot;,\n headers: { &quot;Content-Type&quot;: &quot;application/x-www-form-urlencoded&quot; },\n body: `action=openai_generate_text&amp;prompt=${encodeURIComponent(prompt)}&amp;word_limit=${wordLimit}`\n })\n .then(response =&gt; response.json())\n .then(data =&gt; {\n console.log(data); // Debugging: log the response data\n\n // Check if the response is as expected\n if (data.success) {\n const output = document.getElementById(&quot;openai_output&quot;);\n if (output) {\n output.value = data.data.text || &quot;No text generated.&quot;; // Access text inside `data.data.text`\n } else {\n console.error('Output textarea not found.');\n }\n } else {\n const output = document.getElementById(&quot;openai_output&quot;);\n if (output) {\n output.value = &quot;Error: &quot; + (data.message || &quot;Unknown error&quot;);\n } else {\n console.error('Output textarea not found.');\n }\n }\n })\n .catch(error =&gt; {\n console.error(&quot;Error:&quot;, error);\n const output = document.getElementById(&quot;openai_output&quot;);\n if (output) {\n output.value = &quot;Error: Unable to reach API or process request.&quot;;\n }\n });\n });\n});\n\n\n &lt;/script&gt;\n &lt;?php\n echo $args['after_widget'];\n }\n\n public function form($instance) {\n echo '&lt;p&gt;No settings required.&lt;/p&gt;';\n }\n\n public function update($new_instance, $old_instance) {\n return $new_instance;\n }\n}\n\nfunction register_openai_widget() {\n register_widget('OpenAI_Widget');\n}\nadd_action('widgets_init', 'register_openai_widget');\n\nfunction openai_generate_text() {\n if (!isset($_POST['prompt']) || !isset($_POST['word_limit'])) {\n wp_send_json_error(['message' =&gt; 'Invalid request']);\n }\n\n $api_key = 'MY-API-KEY'; // Replace with your OpenAI API key\n $prompt = sanitize_text_field($_POST['prompt']);\n $word_limit = max(1, min((int) $_POST['word_limit'], 500));\n\n // OpenAI tokens are ~4 per word, but we cap them to 2048 to prevent long responses\n $max_tokens = min($word_limit * 4, 2048);\n\n // Updated API endpoint for GPT-3.5 Turbo\n $response = wp_remote_post('https://api.openai.com/v1/chat/completions', [\n 'headers' =&gt; [\n 'Authorization' =&gt; 'Bearer ' . $api_key,\n 'Content-Type' =&gt; 'application/json',\n ],\n 'body' =&gt; json_encode([\n 'model' =&gt; 'gpt-3.5-turbo',\n 'messages' =&gt; [\n ['role' =&gt; 'system', 'content' =&gt; 'You are a helpful assistant.'],\n ['role' =&gt; 'user', 'content' =&gt; $prompt],\n ],\n 'max_tokens' =&gt; $max_tokens,\n 'temperature' =&gt; 0.7,\n 'top_p' =&gt; 1.0,\n ]),\n ]);\n\n if (is_wp_error($response)) {\n wp_send_json_error(['message' =&gt; 'API request failed: ' . $response-&gt;get_error_message()]);\n }\n\n $body = json_decode(wp_remote_retrieve_body($response), true);\n\n // Debugging: Log the full response body to see the structure of the response\n error_log('OpenAI Response: ' . print_r($body, true));\n\n // Check if the response has the correct structure\n if (isset($body['choices'][0]['message']['content'])) {\n wp_send_json_success(['text' =&gt; trim($body['choices'][0]['message']['content'])]);\n } else {\n wp_send_json_error(['message' =&gt; 'Error from OpenAI: ' . json_encode($body)]);\n }\n}\nadd_action('wp_ajax_openai_generate_text', 'openai_generate_text');\nadd_action('wp_ajax_nopriv_openai_generate_text', 'openai_generate_text');\n?&gt;\n</code></pre>\n<p><strong>CODE-2 (loaded in widgets backend options - not working):</strong></p>\n<pre><code>&lt;?php\n/*\nPlugin Name: OpenAI Widget - backend options\nDescription: A simple WordPress widget to generate text using OpenAI GPT-3.5 API.\nVersion: 1.0\nAuthor: WP\n*/\n\nclass OpenAI_Widget extends WP_Widget {\n\n public function __construct() {\n parent::__construct(\n 'openai_widget',\n __('OpenAI Text Generator', 'openai_widget_domain'),\n array('description' =&gt; __('Generate text using OpenAI GPT-3.5', 'openai_widget_domain'))\n );\n }\n\n public function widget($args, $instance) {\n // On the front-end, just show the widget without any fields or outputs.\n echo $args['before_widget'];\n echo $args['after_widget'];\n }\n\n public function form($instance) {\n // Backend form\n $prompt = !empty($instance['prompt']) ? $instance['prompt'] : '';\n $word_limit = !empty($instance['word_limit']) ? $instance['word_limit'] : 100;\n ?&gt;\n &lt;p&gt;\n &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('prompt'); ?&gt;&quot;&gt;&lt;?php _e('Prompt:'); ?&gt;&lt;/label&gt;\n &lt;textarea class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('prompt'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('prompt'); ?&gt;&quot; rows=&quot;3&quot;&gt;&lt;?php echo esc_attr($prompt); ?&gt;&lt;/textarea&gt;\n &lt;/p&gt;\n &lt;p&gt;\n &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('word_limit'); ?&gt;&quot;&gt;&lt;?php _e('Word Limit:'); ?&gt;&lt;/label&gt;\n &lt;input class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('word_limit'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('word_limit'); ?&gt;&quot; type=&quot;number&quot; value=&quot;&lt;?php echo esc_attr($word_limit); ?&gt;&quot; min=&quot;1&quot; max=&quot;500&quot; /&gt;\n &lt;/p&gt;\n &lt;p&gt;\n &lt;!-- Button in backend --&gt;\n &lt;button class=&quot;widefat&quot; type=&quot;button&quot; id=&quot;generate_openai_backend_text&quot;&gt;Generate Text (Backend Only)&lt;/button&gt;\n &lt;/p&gt;\n &lt;div id=&quot;openai_backend_output_area&quot; style=&quot;display:none;&quot;&gt;\n &lt;h4&gt;Generated Text:&lt;/h4&gt;\n &lt;textarea id=&quot;openai_backend_output&quot; rows=&quot;5&quot; readonly&gt;&lt;/textarea&gt;\n &lt;/div&gt;\n\n &lt;?php\n }\n\n public function update($new_instance, $old_instance) {\n // Save the widget options\n $instance = array();\n $instance['prompt'] = !empty($new_instance['prompt']) ? sanitize_text_field($new_instance['prompt']) : '';\n $instance['word_limit'] = !empty($new_instance['word_limit']) ? intval($new_instance['word_limit']) : 100;\n return $instance;\n }\n}\n\nfunction register_openai_widget() {\n register_widget('OpenAI_Widget');\n}\nadd_action('widgets_init', 'register_openai_widget');\n\n// Handle the AJAX request for text generation\nfunction openai_generate_text() {\n if (!isset($_POST['prompt']) || !isset($_POST['word_limit'])) {\n wp_send_json_error(['message' =&gt; 'Invalid request']);\n }\n\n $api_key = 'MY-API-KEY'; // Replace with your OpenAI API key\n $prompt = sanitize_text_field($_POST['prompt']);\n $word_limit = max(1, min((int) $_POST['word_limit'], 500));\n\n // OpenAI tokens are ~4 per word, but we cap them to 2048 to prevent long responses\n $max_tokens = min($word_limit * 4, 2048);\n\n // Updated API endpoint for GPT-3.5 Turbo\n $response = wp_remote_post('https://api.openai.com/v1/chat/completions', [\n 'headers' =&gt; [\n 'Authorization' =&gt; 'Bearer ' . $api_key,\n 'Content-Type' =&gt; 'application/json',\n ],\n 'body' =&gt; json_encode([\n 'model' =&gt; 'gpt-3.5-turbo',\n 'messages' =&gt; [\n ['role' =&gt; 'system', 'content' =&gt; 'You are a helpful assistant.'],\n ['role' =&gt; 'user', 'content' =&gt; $prompt],\n ],\n 'max_tokens' =&gt; $max_tokens,\n 'temperature' =&gt; 0.7,\n 'top_p' =&gt; 1.0,\n ]),\n ]);\n\n if (is_wp_error($response)) {\n wp_send_json_error(['message' =&gt; 'API request failed: ' . $response-&gt;get_error_message()]);\n }\n\n $body = json_decode(wp_remote_retrieve_body($response), true);\n\n // Check if the response has the correct structure\n if (isset($body['choices'][0]['message']['content'])) {\n wp_send_json_success(['text' =&gt; trim($body['choices'][0]['message']['content'])]);\n } else {\n wp_send_json_error(['message' =&gt; 'Error from OpenAI: ' . json_encode($body)]);\n }\n}\nadd_action('wp_ajax_openai_generate_text', 'openai_generate_text');\nadd_action('wp_ajax_nopriv_openai_generate_text', 'openai_generate_text');\n?&gt;\n</code></pre>\n\n"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + "1"^^ . + "0"^^ . + . + "@YourCommonSense in OP question variables already declared, they should be array, but they were variables, so having variables already - it is faster to just sum neither make array from them and then sum, that's the point, plus just code's length is shorter for variables, it is also just fact"^^ . + "0"^^ . + . + "0"^^ . + . + . + "2"^^ . + "0"^^ . + . + "[PDFtk](https://www.pdflabs.com/tools/pdftk-server/) is able to merge (concatenate) PDFs."^^ . + "0"^^ . + "0"^^ . + "Yes, you should definitely decide how you would like to post the content, and I guess that would depend on the context. If the data is entered into a form either `application/x-www-form-urlencoded` or `multipart/form-data` are the most obvious. In other cases it could be `application/json`. But in general the context does not exclude one or the other."^^ . + . + . + . + "0"^^ . + "can you please explain how to use sql injection when the multiple rows are not from one table but more than one tables in the GUI ?"^^ . + "SPA with laravel"^^ . + . + . + . + . + "3"^^ . + "amazon-textract"^^ . + . + "Thank you. I launched the 2 commands but the result is the same version 8.4.1"^^ . + . + "Only add the fields to the array when they aren't empty. That requires creating the array first, adding the fields as necessary, and *then* json_encode'ing it"^^ . + . + . + "0"^^ . + "<p>I'm using a $product-&gt;get_available_variations() loop to display an image gallery of variations on the product page:</p>\n<pre><code>$variations = $product-&gt;get_available_variations();\nforeach ( $variations as $variation ) { ?&gt;\n &lt;li&gt;\n &lt;img... /&gt;\n &lt;/li&gt;\n&lt;?php } ?&gt;\n</code></pre>\n<p>I've set up the attribute to use 'Name' for the default sort order in the Attributes settings.</p>\n<p>It looks like the variations in the dropdown field observe this sort order (no matter what order I drag/drop the variations in the admin). But the $product-&gt;get_available_variations() loop seems to ignore this sort order and use the order of the variations in the admin.</p>\n<p>Is there a way I can ensure the above loop ALSO observes the same order as the dropdown?</p>\n"^^ . + "1"^^ . + "<p>I have a php project reading data from .xlsx files that uses the no-longer-supported box/spout library. In order for it to work with the latest PHP version, I had to modify the box/spout code to add a bunch of #[\\ReturnTypeWillChange] Attributes to suppress a bunch of deprecation warnings .</p>\n<p>It seems like it would be better to use the current, supported library of OpenSpout instead, but I can't get it installed. Box/Spout I could install just by copying the files into my project and then requiring the Autoloader.php file in files where I used the library. Openspout no longer has this autoloader file and the documentation only talks about installing using Composer. Is there any way to install it like I did Box/Spout? I have to go through a lot of bureaucracy if I have to use composer.</p>\n"^^ . + . + . + . + "@Rag If you understand the context/topic of this question, then you are probably a good candidate to curate the question title into something less vague. Please try to edit the question title into something that is narrowly indicative of the asked question. Vague titles are not good for the researcher experience."^^ . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + "php files are downloading instead of running on my browser"^^ . + "@Gordon Yes, I know all of this, so I managed to build everything. I built all the details of registering the site's keys and registering the keys of each user from scratch and it works great. Only the sending step with these keys still works for me only with Minishlink\\WebPush."^^ . + . + . + . + . + "An interesting question, but did you [do any research](https://stackoverflow.com/help/how-to-ask)? In other words: What's stopping you from doing this yourself. Trouble [reading the manual](https://www.php.net/manual/en/book.zip.php)?"^^ . + "laravel-backpack"^^ . + "vite"^^ . + . + . + . + . + . + "0"^^ . + . + . + "<p>What I am trying to do is show a breakdown of the Woocommerce transaction fee being applied after the order total:</p>\n<p>It would something like this:</p>\n<ul>\n<li>Items Subtotal: £375.00</li>\n<li>Shipping: £0.00</li>\n<li>VAT: £75.00</li>\n<li>Order Total: £450.00</li>\n<li>Paid: £450.00</li>\n<li>Transaction Fee: £7.00</li>\n<li>Total (after fee): £443.00</li>\n</ul>\n<p>A visual of where it should go, I have highlighted it and as you see it's just an error at the moment:</p>\n<p><a href="https://i.sstatic.net/MBXUFdHp.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MBXUFdHp.png" alt="enter image description here" /></a></p>\n<p>The code in my functions .php</p>\n<pre><code> // Calculate and save transaction fee after order is created/paid\nadd_action('woocommerce_order_status_changed', 'add_transaction_fee_to_order_meta', 10, 3);\nfunction add_transaction_fee_to_order_meta($order_id, $old_status, $new_status) {\n if ($new_status == 'processing' || $new_status == 'completed') {\n $order = wc_get_order($order_id);\n\n if (get_post_meta($order_id, '_transaction_fee', true) == '') {\n $order_total = $order-&gt;get_total();\n $transaction_fee = ($order_total * 0.015) + 0.25;\n\n update_post_meta($order_id, '_transaction_fee', $transaction_fee);\n\n }\n }\n}\n\n\n// Display transaction fee in admin order details *after* &quot;Paid&quot; line\nadd_action('woocommerce_admin_order_totals_after_total', 'display_transaction_fee_in_admin_order_details', 10, 2);\nfunction display_transaction_fee_in_admin_order_details($order_id, $order) {\n $transaction_fee = get_post_meta($order_id, '_transaction_fee', true);\n\n if ($transaction_fee) {\n if (is_object($order) &amp;&amp; is_a($order, 'WC_Order')) {\n ?&gt; &lt;tr&gt;\n &lt;td class=&quot;label&quot;&gt;Transaction Fee:&lt;/td&gt;\n &lt;td width=&quot;1%&quot;&gt;&lt;/td&gt;\n &lt;td class=&quot;total&quot;&gt;\n &lt;?php echo wc_price($transaction_fee); ?&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td class=&quot;label&quot;&gt;Total (after fee):&lt;/td&gt;\n &lt;td width=&quot;1%&quot;&gt;&lt;/td&gt;\n &lt;td class=&quot;total&quot;&gt;\n &lt;?php echo wc_price($order-&gt;get_total() - $transaction_fee); ?&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php\n } else {\n error_log(&quot;WC_Order object not available in display_transaction_fee_in_admin_order_details for order ID: &quot; . $order_id);\n }\n }\n}\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + "2"^^ . + . + "themes"^^ . + . + . + . + "0"^^ . + . + "2"^^ . + "Failed to open stream: Permission denied Error using Laravel & Docker"^^ . + . + "0"^^ . + . + "You mention "changing the print link code from plain URL to a JavaScript produced one" but you haven't included either a plain url or an example of a javascript produced one, which I'm not even quite sure what you mean by that. Is a JS-produced link added after the page has loaded?"^^ . + . + "regex"^^ . + . + . + "`I'm questioning if it is going all the way through the file when it could stop when the ID is found`...well yes the original code will go through the whole file. You can easily debug/test and prove that's the case though, if you're not sure from just reading the code. And the second example will stop the loop when it finds that `$valid` is true (although as above, using `break;` would have the same basic effect). Again, you can easily debug/test to prove that's what it's doing, if you're unsure. Have you tested that? Is the code not doing what you expected it to, in some way?"^^ . + . + "0"^^ . + "Barmar and Mike, the examples in my question are just that – examples. I find natural language examples more easily comprehensible than strings of abstract gibberish."^^ . + "Yes. Absolutely. Thank you, @bobble bubble! So much better. Updated regex pattern: ```^([a-zA-Z ]+(?:\\b\\.[a-zA-Z ]*)*)$```. Replaced ```(?<=[a-zA-Z])``` with a ```\\b``` Regex demo link: https://regex101.com/r/Cha5FW/7 . < : )"^^ . + "0"^^ . + . + . + . + "Sorry but I', not using components / class, I'm using the Functional version."^^ . + . + . + "Did you mean to use `fetchFromString` as seen in the [example here](https://github.com/slimphp/Twig-View)?"^^ . + "1"^^ . + "No, you need to check the 6 digit prefixes first, because checking 4 digit prefix first could result in a false match."^^ . + . + "<p>There isn't any other function that will return a float. However, <code>diffInWeekendDays</code> is an option. Take your current number of days, and subtract the result of that function.</p>\n<pre><code>$weekend_days = $startDate-&gt;copy()-&gt;diffInWeekendDays($endDate);\n$dayCount -= $weekend_days;\n</code></pre>\n"^^ . + . + . + . + "1"^^ . + "Make sure the paths are right. It always helps me tremendously to have [display_errors turned on in php.ini](https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display)"^^ . + "4"^^ . + . + . + "1"^^ . + "Calling a non-static method using keyword static in PHP"^^ . + . + "windows-server-2016"^^ . + . + . + . + . + . + . + . + . + "But, to reiterate, splitting **every single class** into a separate package would be ridiculous, and nobody is suggesting that. If you have hundreds of classes (which you surely will by the time you get to megabytes of code), then you could split them into, say, 10 packages of 10-100 classes each. The overhead is 10 `composer.json` files, whose info will be copied (once each) into the `composer.lock` of the application; and a few extra lines in Composer's generated autoloader. The rest will be exactly the same PHP files arranged in a slightly different directory structure."^^ . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + "I see you have changed your edit, but this time you are looping through `$area_codes`, which is precisely what the OP wanted to avoid."^^ . + "<p>Not finding a solution, I approached it differently. I created a new endpoint, /mon-compte/vouchers/download. I pass the current language in the arguments of the download button on my /en/mon-compte/voucher page. I handle the click with JS, then send it to the new download endpoint, which is managed in store default language. I retrieve the language passed in the arguments, and this way, I return the corresponding PDF without worrying about the translation plugin</p>\n"^^ . + . + . + . + . + . + . + . + "<p>I'm getting the following when accessing pages in certain namespaces in a previously working site:</p>\n<pre><code>Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes) in /usr/local/var/www/mediawiki-1.43.0/includes/libs/rdbms/database/DatabaseMySQL.php on line 670\n</code></pre>\n<h2>Background</h2>\n<p>I loaded a bunch of info into MediaWiki 1.43.0 (latest as of today) in late Februray, and have not touched it since February 28, when I gave a demo in which all features were working.</p>\n<p>Things I've done prior to then included setting up numerous namespaces and categories. They all worked as of February 28.</p>\n<p>Now, when I try to access certain namespaces (Template, Category, Minutes, Policy, Request, Agreement), it hangs up as noted above.</p>\n<p>It was originally failing with a different message, a 30-second timeout. After searching for a solution, it was suggested that putting the following at the top of php.ini would help:</p>\n<pre><code>$cfg['ExecTimeLimit'] = 0;\n</code></pre>\n<p>I did that and re-started httpd. Then the timeout notice went away, replaced by the DatabaseMySQL.php error noted above.</p>\n<p>Nothing shows up in the httpd <code>error_log</code>. I know I have the right one, because it noted the re-start after changing php.ini.</p>\n<p>Nothing interesting shows up in the httpd <code>access_log</code>:</p>\n<pre><code>----------------\n127.0.0.1 - - [13/Mar/2025:10:49:31 -0700] &quot;GET /wiki/index.php/Special:RecentChanges HTTP/1.1&quot; 200 227\n</code></pre>\n<p>(I put the row of dashes in the log to mark what is new.)</p>\n<p>The MariaDB log shows a timeout, but I can access all the MediaWiki tables using a different interface (Sequel Pro, Querius, and the mysql CLI) instantaneously.</p>\n<pre><code>----------------\n2025-03-13 10:58:49 131 [Warning] Aborted connection 131 to db: 'Hearthstone' user: 'root' host: 'localhost' (Got an error reading communication packets)\n</code></pre>\n<p>So it seems clear it is an apache/php/mediawiki problem, not a database one. It seems likely that something is causing a recursive memory-eating loop, causing the database connection to timeout.</p>\n<h2>So, what changed since February 28?</h2>\n<p>Well, I updated from MacOS 13.7.3 to 13.7.4, which was just a maintenance update. That seems like an unlikely cause, as MariaDB and apache seem to be otherwise working fine.</p>\n<p>I had changed from a DHCP-assigned address to &quot;DHCP with Manual Address&quot; with the fixed address 192.168.10.254, because local users had trouble with the previous dynamic address. I also changed this back to a DHCP-assigned address (it gave me the old .106 address that I had before), and still had the problem.</p>\n<p>I wanted the wiki to be in local time, instead of UTC. I un-commented this line in php.ini and re-started apache. I did not save any wiki pages while in this state, and have since changed it back to commented out, and re-started apache.</p>\n<pre><code>;date.timezone = 'America/Vancouver'\n</code></pre>\n<p>I have been experimenting with extensions, but I have commented out <strong>all</strong> the <code>wfLoadExtension('…');</code> lines in LocalSettings.php — even ones that had been working fine on February 28th.</p>\n<p>I also commented out <strong>all</strong> the namespaces I added, even though they had not changed since February 28th. That did not change the behaviour, so I un-commented it.</p>\n<pre><code>$wgExtraNamespaces =\n array( 3000 =&gt; 'Test',\n 3001 =&gt; 'Test_talk',\n 3002 =&gt; 'Minutes',\n 3003 =&gt; 'Minutes_talk',\n 3004 =&gt; 'Policy',\n 3005 =&gt; 'Policy_talk',\n 3006 =&gt; 'Proposal',\n 3007 =&gt; 'Proposal_talk',\n 3006 =&gt; 'Request',\n 3007 =&gt; 'Request_talk',\n 3008 =&gt; 'Agreement',\n 3009 =&gt; 'Agreement_talk',\n 3010 =&gt; 'Project',\n 3011 =&gt; 'Project_talk'\n );\n$wgContentNamespaces = array(3002, 3004, 3006, 3008, 3010);\n</code></pre>\n<p>Finally, I went into the MediaWiki <code>maintenance</code> directory, and read at least the first page of each file there. I didn't see anything that seemed like it would address my issue.</p>\n<p>I've been hacking MediaWiki since 1.12, but I'm at a bit of a loss here.</p>\n<p>Often, in the course of providing a good description like this one, I figure out what's wrong. But not this time!</p>\n<p>Any ideas on how to troubleshoot this?</p>\n<p>Thanks!</p>\n"^^ . + . + . + . + "0"^^ . + . + "How can I extend an existing Botble enum to add a new constant without modifying the core class?"^^ . + . + . + "1"^^ . + . + . + "0"^^ . + "WooCommerce additional registration field validation being ignored?"^^ . + "There are lots of possible complications with this. Easy to solve ones: What if class B is used somewhere? But also more difficult to solve ones: What if class B overwrites a method of class C? You will either loose access to the method in B or C. There are probably many more problems like this."^^ . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + "-1"^^ . + . + "0"^^ . + "-1"^^ . + . + "1"^^ . + . + "variables"^^ . + . + . + "0"^^ . + . + . + . + . + "_"It doesn't display on 'lesson' pages"_ - so are you getting any of the error texts you `return` in multiple places shown on those pages then? Or just "nothing"? If the latter, what happens when you make your shortcode function just return a static text right at the start, `return "Am I actually working?";` or something like that - do you get _that_ shown on your "lesson" page then?"^^ . + "0"^^ . + . + . + . + "@ADyson - Those are the samples I was looking at, yes. They are far too complex for my simple brain; they give fragmented examples of how to do various things, but not a simple example of how to put it all together. Lots of technical jargon where new terms are introduced or redefined without explanation. Just too much information. Yes, the v2 of the SDK for PHP."^^ . + . + . + . + . + "0"^^ . + . + . + "Your answer is wrong, as you are getting the checkout field default value from the checkout page that has not been saved into the customer order."^^ . + . + "did you clear the cache before zipping?"^^ . + . + "@PatrickJanser as you wrote, it sounds as best idea to use cookie in Javascript. But I will be very grateful for any advice. Only soulution I have found till now, is make on input onchange open php file which will keep data in Session and than go back to the first page. I am sure this is not the best solution."^^ . + . + . + . + . + . + "-1"^^ . + . + . + "2"^^ . + "0"^^ . + "Advice: Use `pg_query_params` and a proper UPDATE statement."^^ . + "1"^^ . + "http-headers"^^ . + . + . + . + "<p>The code appears to hardcode many things, and that may or may not be the issue.</p>\n<p>First I see this:</p>\n<pre><code>CURLOPT_URL =&gt; ' https://demo.docusign.net/restapi/v2.1/accounts/123456789/envelopes',\n</code></pre>\n<p>The 123456789 is, I assume, your accountID, is this a GUID? or a short numeric value? are you sure you have the right accountID in there?</p>\n<p>Then I see this:</p>\n<pre><code> CURLOPT_HTTPHEADER =&gt; array ('Authorization: Bearer eyJ0****'),\n</code></pre>\n<p>First, do you hardcode a token? that won't work, tokens expire after 8 hours. If you don't do that, how do you obtain it using JWT? do you have a consistent code that does this every time you need one? I would suggest trying to use the PHP SDK that does this for you. You can find this code in <a href="https://github.com/docusign/code-examples-php/blob/master/JWTConsoleApp/JWTConsoleApp.php" rel="nofollow noreferrer">https://github.com/docusign/code-examples-php/blob/master/JWTConsoleApp/JWTConsoleApp.php</a></p>\n<p>Third, I suggest you have code like this:</p>\n<pre><code>curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Authorization': 'someAuthorization',\n 'x-api-key': 'somekey',\n 'Content-Type': 'application/x-www-form-urlencoded'\n));\n</code></pre>\n<p>You need to set multiple headers, not just one</p>\n<p>These headers are also needed:</p>\n<pre><code>'--header' &quot;Accept: application/json&quot; \\\n'--header' &quot;Content-Type: application/json&quot;)\n</code></pre>\n"^^ . + "0"^^ . + . + . + "If it's an image you're sending, you might want to optimize it and perhaps even resize it first. The team at Spatie.be has a nice free [library](https://github.com/spatie/image) for that."^^ . + "The reason this works is that the internal name of the "anonymous" class is generated by the compiler, and different every time (there's an incrementing number on the end to avoid collisions). If OpCache is not enabled, then every time you require/include a file, it is compiled again, so a new class name is generated."^^ . + . + "Hey, sorry, there are no errors in the logs, and if I do for example:\n\n```$room = \\App\\Models\\Gameroom::find(2)\nbroadcast(new \\App\\Events\\NewPlayerJoined($room))```\n\nThen i get back ```Illuminate\\Broadcasting\\PendingBroadcast {#5325}``` in tinker"^^ . + . + "@GordonDavisson: I disagree to the disagree. Important parts are missing, one for the script of which shellcheck would highlight, and as well the invocation while being asked about. That's outright sloppy not only for the bash tag."^^ . + . + "0"^^ . + . + . + . + . + "<p>I believe simplesamlphp is meant for native php, and there's no direct documentation for laravel integration.\nWhat you can do is to find laravel compatible saml authentication library.</p>\n<p>I think you can use this library if you want your laravel app to act as the IDP.</p>\n<p><a href="https://github.com/codegreencreative/laravel-samlidp" rel="nofollow noreferrer">https://github.com/codegreencreative/laravel-samlidp</a></p>\n<p>If you want your laravel app to act as the SP, then this library should work.</p>\n<p><a href="https://github.com/24Slides/laravel-saml2" rel="nofollow noreferrer">https://github.com/24Slides/laravel-saml2</a></p>\n<p>I personally have used laravel-saml2 for microsoft Azure AD integration, and it works well, but I haven't tried the laravel-samlidp yet.</p>\n<p>Regards,</p>\n"^^ . + . + "1"^^ . + . + . + . + . + . + "2"^^ . + . + . + "0"^^ . + "3"^^ . + . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + "2"^^ . + . + . + . + . + . + . + "I downloaded jpegsrc.v9f.tar.gz from https://www.ijg.org/files and I get libjpeg.pc after running ./configure"^^ . + "XAMPP can only use port 80. You can change it to 8000, but then it will only be able to use port 8000: [How to change XAMPP apache server port?](https://stackoverflow.com/a/21914920/15167500). I think... I haven't used XAMPP in years. As I mentioned, you can easily start the PHP server from CMD either with the native PHP command `php -S $host:$port -t public/` or the built-in Laravel Artisan `php artisan serve` from project-root. You can schedule CMD to run on startup, and when the system starts, CMD will launch and start the server; for this don't need XAMPP, btw needed for MySQL."^^ . + . + . + . + . + "0"^^ . + . + . + . + "<p>I am creating an editable row in HTML, PHP and JavaScript.</p>\n<p>This is the html and php element in <code>index.php</code> :</p>\n<pre><code>&lt;tbody id=&quot;inforTypeTable&quot;&gt;\n &lt;?php foreach ($inforTypes as $room) : ?&gt;\n &lt;tr data-id=&quot;&lt;?= $room['id'] ?&gt;&quot;&gt;\n &lt;td&gt;&lt;?= $room['id'] ?&gt;&lt;/td&gt;\n &lt;td contenteditable=&quot;true&quot; class=&quot;room-type&quot;&gt;&lt;?= htmlspecialchars($room['room_type']) ?&gt;&lt;/td&gt;\n &lt;td contenteditable=&quot;true&quot; class=&quot;room-desc&quot;&gt;&lt;?= htmlspecialchars($room['room_desc']) ?&gt;&lt;/td&gt;\n &lt;td&gt;\n &lt;i class=&quot;bi bi-floppy2-fill save-btn&quot; title=&quot;Save&quot; style=&quot;cursor:pointer; opacity:0.5;&quot;&gt;&lt;/i&gt;\n &lt;i class=&quot;bi bi-trash3-fill delete-btn&quot; title=&quot;Delete&quot; style=&quot;cursor:pointer;&quot;&gt;&lt;/i&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php endforeach; ?&gt;\n &lt;/tbody&gt;\n</code></pre>\n<p>and the following is the script to handle the save-btn (I included the update and delete too):</p>\n<pre><code>$(document).ready(function() {\n $('[data-bs-toggle=&quot;tooltip&quot;]').tooltip();\n\n $('td[contenteditable=&quot;true&quot;]').on('input', function() {\n $(this).closest('tr').find('.save-btn').css('opacity', '1').css('cursor', 'pointer');\n });\n\n // Save changes\n $(document).on(&quot;click&quot;, &quot;.save-btn&quot;, function() {\n let row = $(this).closest(&quot;tr&quot;);\n let id = row.data(&quot;id&quot;);\n let roomType = row.find(&quot;.room-type&quot;).text().trim();\n let roomDesc = row.find(&quot;.room-desc&quot;).text().trim();\n\n console.log(&quot;Saving:&quot;, roomType, roomDesc);\n\n $.post(&quot;rooms.functions.php&quot;, {\n action: id ? &quot;update&quot; : &quot;add&quot;,\n id,\n roomType,\n roomDesc\n }, function(response) {\n console.log(&quot;Raw Response:&quot;, response); // Log the raw response\n\n // Only parse the response if it's valid JSON\n try {\n let res = JSON.parse(response);\n alert(res.message);\n if (res.status === &quot;success&quot; &amp;&amp; !id) {\n row.attr(&quot;data-id&quot;, res.id);\n row.find(&quot;td:first&quot;).text(res.id);\n }\n } catch (e) {\n console.error(&quot;JSON Parse Error---&gt; &quot;, e);\n alert(&quot;Error processing request. Please check the console for details.&quot;);\n }\n });\n });\n\n\n // Delete room type\n $(document).on(&quot;click&quot;, &quot;.delete-btn&quot;, function() {\n let row = $(this).closest(&quot;tr&quot;);\n let id = row.data(&quot;id&quot;);\n\n if (confirm(&quot;Are you sure you want to delete this room type?&quot;)) {\n $.post(&quot;rooms.functions.php&quot;, {\n action: &quot;delete&quot;,\n id\n }, function(response) {\n console.log(&quot;Raw Response (Delete):&quot;, response);\n try {\n let res = JSON.parse(response);\n alert(res.message);\n if (res.status === &quot;success&quot;) {\n row.remove();\n }\n } catch (e) {\n console.error(&quot;JSON Parse Error:&quot;, e);\n alert(&quot;Error processing request. Check console for details.&quot;);\n }\n });\n }\n });\n\n // Add new row\n $(&quot;#addNew&quot;).click(function() {\n let newRow = $(`\n &lt;tr&gt;\n &lt;td&gt;New&lt;/td&gt;\n &lt;td contenteditable=&quot;true&quot; class=&quot;room-type&quot;&gt;&lt;/td&gt;\n &lt;td contenteditable=&quot;true&quot; class=&quot;room-desc&quot;&gt;&lt;/td&gt;\n &lt;td&gt;\n &lt;i class=&quot;bi bi-floppy2-fill save-btn&quot; title=&quot;Save&quot; style=&quot;cursor:pointer; opacity:0.5;&quot;&gt;&lt;/i&gt;\n &lt;i class=&quot;bi bi-trash3-fill delete-btn&quot; title=&quot;Delete&quot; style=&quot;cursor:pointer;&quot;&gt;&lt;/i&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n `);\n $(&quot;#roomTypeTable&quot;).append(newRow);\n });\n });\n</code></pre>\n<p>The following is the php which manages the crud:</p>\n<pre><code>&lt;?php\nrequire '../config.php'; // Database connection\n\nheader('Content-Type: application/json'); // Force JSON response\nob_clean(); // Remove any unwanted whitespace or characters before output\nob_start(); // Start output buffering\n\nif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n $action = $_POST['action'] ?? '';\n\n if ($action === 'update') {\n $id = $_POST['id'] ?? null;\n $roomType = trim($_POST['roomType'] ?? '');\n $roomDesc = trim($_POST['roomDesc'] ?? '');\n\n if (!empty($id) &amp;&amp; !empty($roomType) &amp;&amp; !empty($roomDesc)) {\n $stmt = $pdo-&gt;prepare(&quot;UPDATE room_type SET room_type = ?, room_desc = ?, created_date = NOW(), created_by = 'WIAL' WHERE id = ?&quot;);\n $stmt-&gt;execute([$roomType, $roomDesc, $id]);\n echo json_encode([&quot;status&quot; =&gt; &quot;success&quot;, &quot;message&quot; =&gt; &quot;Room type updated successfully!&quot;]);\n } else {\n echo json_encode([&quot;status&quot; =&gt; &quot;error&quot;, &quot;message&quot; =&gt; &quot;Invalid data for update.&quot;]);\n }\n } elseif ($action === 'delete') {\n $id = $_POST['id'] ?? null;\n\n if (!empty($id)) {\n $stmt = $pdo-&gt;prepare(&quot;DELETE FROM room_type WHERE id = ?&quot;);\n $stmt-&gt;execute([$id]);\n echo json_encode([&quot;status&quot; =&gt; &quot;success&quot;, &quot;message&quot; =&gt; &quot;Room type deleted successfully!&quot;]);\n } else {\n echo json_encode([&quot;status&quot; =&gt; &quot;error&quot;, &quot;message&quot; =&gt; &quot;Invalid ID for delete.&quot;]);\n }\n } elseif ($action === 'add') {\n $roomType = trim($_POST['roomType'] ?? '');\n $roomDesc = trim($_POST['roomDesc'] ?? '');\n\n if (!empty($roomType) &amp;&amp; !empty($roomDesc)) {\n $stmt = $pdo-&gt;prepare(&quot;INSERT INTO room_type (room_type, room_desc, created_date, created_by) VALUES (?, ?, NOW(), 'WIAL')&quot;);\n $stmt-&gt;execute([$roomType, $roomDesc]);\n $lastId = $pdo-&gt;lastInsertId(); // Get last inserted ID\n echo json_encode([&quot;status&quot; =&gt; &quot;success&quot;, &quot;message&quot; =&gt; &quot;Room type added successfully!&quot;, &quot;id&quot; =&gt; $lastId]);\n } else {\n echo json_encode([&quot;status&quot; =&gt; &quot;error&quot;, &quot;message&quot; =&gt; &quot;Invalid data for add.&quot;]);\n }\n } else {\n echo json_encode([&quot;status&quot; =&gt; &quot;error&quot;, &quot;message&quot; =&gt; &quot;Invalid action.&quot;]);\n }\n ob_end_flush(); // Send output buffer\n exit; // Ensure PHP stops execution after sending JSON\n}\n</code></pre>\n<p>Add, update and delete is managed successfully, means the table in database is updated.\n<strong>however the page is not updated/refreshed</strong>. and there is error</p>\n<pre><code>Raw Response (Delete): \nObject { status: &quot;success&quot;, message: &quot;Room type deleted successfully!&quot; }\nrooms.php:322:33\nJSON Parse Error: SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data\n &lt;anonymous&gt; https://localhost/dev/index.php:324\n jQuery 7\n &lt;anonymous&gt; https://localhost/dev/index.php:318\n jQuery 8\n &lt;anonymous&gt; https://localhost/dev/index.php:280\n jQuery 13\nindex.php:330:37\n &lt;anonymous&gt; https://localhost/dev/index.php:330\n jQuery 7\n &lt;anonymous&gt; https://localhost/dev/index.php:318\n jQuery 8\n &lt;anonymous&gt; https://localhost/dev/index.php:280\n jQuery 13\n</code></pre>\n<p>Can you advise how to have the table in index.php refreshed once the operation is successfully executed?</p>\n"^^ . + "0"^^ . + "twitter-api-v2"^^ . + "Thanks, I will add branch reset group in footnotes of my answer ."^^ . + . + . + . + "Without checking your code, I can say that the most common reason for this to occur is that the storage space in the database is too short for the hash of the password. As [they say in the manual](https://www.php.net/manual/en/function.password-hash.php): 255 characters would be a good choice. What did you use?"^^ . + "pointers"^^ . + . + "@WiktorStribiżew That's a reason to close as a _duplicate_, but not to down vote as a "low quality question", or close as "needs debugging details". [Everyone has to learn things for the first time sometime](https://xkcd.com/1053/), and there's no obvious way for someone to look at this code and know to search for that or [other possible duplicates](https://stackoverflow.com/q/12841970/157957)."^^ . + "@ADyson If you're looking to argue with me about this, feel free to come to my privates anyway and chat. I have no interest in digging into all the people trying to solve my question."^^ . + . + "The job list is not displaying properly"^^ . + . + "0"^^ . + . + . + . + . + "2"^^ . + . + "Could it be that the other email addresses are valid as well?"^^ . + . + . + "<p>I ran into a client that is running on PHP 5.6, and it looks like it was made back, right when encryption was starting to be a thing but supported decryption for passwords. Now, they do NOT need decrypting the password, it just has a script that decrypts the hashes in the DB using <code>mcrypt_get_iv</code> to verify it is correct.</p>\n<p>They are using something similar to</p>\n<pre><code>mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $encryptkey, $password, MCRYPT_MODE_ECB, $iv);\n</code></pre>\n<p>to encrypt their passwords.</p>\n<p>Any ideas how I could keep the encryption but verify passwords without decrypting? They have thousands of users over 20 years. The only option I could think of was to make a new <code>pw_hash</code> field and use their current decryptor and run through a new system and remove this old stuff.</p>\n<p>I was able to upgrade their PHP to 7.1. but after that <em>mcrypt</em> is removed.</p>\n<p>EDIT</p>\n<p>I feel like I asked what I wanted, but will try to clarify. I want to use something other than mcrypt due to it being deprecated, but not lose thousands of users passwords. Currently they are stored and verified using a decrypt and encrypt function that is reliant on mcrypt/mcrypt_get_iv.</p>\n<p>Once I upgrade to &gt; 7.1 their login and registration process will break.</p>\n"^^ . + . + . + . + . + . + "Related: https://stackoverflow.com/q/42411383/457268"^^ . + "@Olivier I assumed the probabilities for each person and each position clearly followed mathematically from the rules I had set out and only gave an example for the probabilities of the first position. There should have been an "etc." at the end of that. But I'll edit the question to make this more clear. It's take me a few minutes."^^ . + . + "2"^^ . + . + "0"^^ . + . + "Not sure what a "time-based survey is". If it's not an exam, what difference does how long the user takes to complete it make to the results? Before we get into solutions, I just wondered what the point of it was."^^ . + "<p>Thanks to everyone that helped guide me through this especially @ADyson. Using their link I was able to get the following code to transfer my PNG file properly:</p>\n<pre><code>#Initiate cURL object\n$ch = curl_init();\n#Set your URL\ncurl_setopt($ch, CURLOPT_URL, 'https://storage101.dfw1.clouddrive.com/v1/MossoCloudFS_..../myContainer/myFile.png');\n#Indicate, that you plan to upload a file\ncurl_setopt($ch, CURLOPT_UPLOAD, true);\n#Indicate your protocol\ncurl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);\n#Set flags for transfer\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);\n\n$headers = array();\n$headers[] = 'Content-Type: image/png';\n$headers[] = 'X-Auth-Token: '.$myID;\ncurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n#Set HTTP method to PUT\ncurl_setopt($ch, CURLOPT_PUT, 1);\n#Indicate the file you want to upload\ncurl_setopt($ch, CURLOPT_INFILE, fopen('myFolder/myFile.png', 'rb'));\n#Indicate the size of the file (it does not look like this is mandatory, though)\ncurl_setopt($ch, CURLOPT_INFILESIZE, filesize('myFolder/myFile.png'));\n#Execute\ncurl_exec($ch);\ncurl_close($ch);\n</code></pre>\n"^^ . + . + "0"^^ . + . + . + . + "Is there a problem with the code you posted? What problem? What error message/unexpected behavior are you getting?"^^ . + "Please [edit] your question to include a [mre] so that readers can run your code to answer your question."^^ . + "2"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + . + "<p>We have been using FPDF on our AWS EC2 instances for many years and for some of the documents, we use the SetProtection script to encrypt them, allowing only &quot;print&quot; as the possible option.</p>\n<p>We are in the process of migrating our systems from Amazon Linux 2 to Amazon Linux 2023 and have discovered that SetProtection behaves differently on this system. Instead of allowing the document to be opened normally, it now demands a password, despite none being set.</p>\n<p>I've tracked it done to a function called <code>RC4</code> that uses <code>openssl_encrypt</code> for some purpose (which is installed and used elsewhere fine). That code (documented at <a href="http://www.fpdf.org/en/script/script37.php" rel="nofollow noreferrer">http://www.fpdf.org/en/script/script37.php</a>) offers a php-only fallback for when openssl_encrypt is not available, which works a treat, when used instead. This is what leads me to believe that there is something in the OpenSSL piece that is being odd. Equally, it could be the later version of PHP that has changed the behaviour.</p>\n<p>There are no errors in the log at the time the PDF is being created.</p>\n<p>The PHP version of the one that works, is 8.0.30. The PHP version of the one that doesn't, is 8.3.10. The version of OpenSSL that works is OpenSSL/1.0.2k-fips and the version of OpenSSL that doesn't is OpenSSL/3.0.8.</p>\n<p><strong>Update</strong></p>\n<p>Not sure if this information will be helpful, however I have discovered that the code <code>return openssl_encrypt($data, 'RC4-40', $key, OPENSSL_RAW_DATA);</code>, which is in the SetProtection script, returns <em>nothing at all</em> on the new system and &quot;stuff&quot; on the old. I have fiddled about with different cipher methods to no avail (which is not surprising, given that I really don't have a clue ...)</p>\n"^^ . + "Unable to get data by sending html request"^^ . + . + . + . + . + . + . + . + . + "ACF function [`the_field()`](https://www.advancedcustomfields.com/resources/the_field/) does echo itself the value, so remove `echo`… Now in your `IF` statement, you need to replace the function `the_field()` with [`get_field()`](https://www.advancedcustomfields.com/resources/get_field/)..."^^ . + . + . + . + . + . + . + . + "Is there a more efficient way to extract links from an array of strings?"^^ . + "0"^^ . + . + "I don't think you need a controller for that. However, I don't have clear what you did. Did you created a module and put inside `hookDisplayAdminProductsMainStepLeftColumnMiddle()` method?"^^ . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + "Error en la solicitud Matrix: cURL error 60: SSL certificate problem: unable to get local issuer certificate"^^ . + . + "2"^^ . + "<p>You need to use WooCommerce <code>WC_Data</code> methods on the <code>WC_Product</code> object instead of WP postmeta functions.\nSo try to replace:</p>\n<pre class="lang-php prettyprint-override"><code>update_post_meta($product_id, '_custom_date', $yesterday );\n</code></pre>\n<p>with:</p>\n<pre class="lang-php prettyprint-override"><code>$product-&gt;update_meta_data('_custom_date', $yesterday);\n$product-&gt;save();\n</code></pre>\n<p>Using the <code>save()</code> method, refresh the product cache (and should also trigger at least one the hooks you mentioned).</p>\n<p>In the future, always try to use WooCommerce methods instead of WordPress functions.</p>\n"^^ . + "0"^^ . + . + . + . + . + . + . + "multibyte-functions"^^ . + "0"^^ . + "0"^^ . + . + . + . + "@Ammar The question is lacking a lot of details. And anyway, googling for "_how to transfer JavaScript data to PHP_" gives quite a lot of results. Stackoverflow already has [answers to this question](https://stackoverflow.com/questions/1917576/how-do-i-pass-javascript-variables-to-php)."^^ . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + "1"^^ . + . + "1"^^ . + . + . + . + . + "Ok, fair enough. However much you want to avoid JS here, I think it's unrealistic. PHP can't tell what happens on the browser side, it can only respond when a HTTP request is sent to it. If it was me, I'd design this as a single page, with JS to hide/show each question, and use AJAX to regularly send the latest data to the server in the background. And you can have a single timer over the whole thing. (The server-side might stil want to record the start and end times of the survey for that sessions so it can validate that the user didn't mess with the client-side timer and submit too late)"^^ . + . + "http-redirect"^^ . + "0"^^ . + "@yivi The dozen of services live in a folder whose content I can change easily. The `ExternalDepency` is loaded from a external path. I need the functionality of `ExternalDepency`, I need to change one sepcific behavior of it though."^^ . + "<p>It's possible to get the direct children of the folder with the <code>https://www.googleapis.com/drive/v3/files</code> endpoint.\nExample:</p>\n<pre><code>https://www.googleapis.com/drive/v3/files?q='folderId' in parents\n</code></pre>\n<p>You wont be able, however, to get the whole tree from this, you would need to query the contents of the subfolders on demand.</p>\n<p>Source: <a href="https://developers.google.com/drive/api/guides/search-files" rel="nofollow noreferrer">https://developers.google.com/drive/api/guides/search-files</a></p>\n<p>Source: <a href="https://developers.google.com/drive/api/guides/ref-search-terms#file-properties" rel="nofollow noreferrer">https://developers.google.com/drive/api/guides/ref-search-terms#file-properties</a></p>\n"^^ . + "fastroute"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + "try to debug your code. what I could find is maybe `$role_check = array('pro')` should be `$role_check = 'pro'`"^^ . + "<p>The <code>Queue</code> facade has a <code>createPayloadUsing</code> method which allows you to register a callback that is executed when the job payload is created. You should be able to use this to inject middleware into your jobs.</p>\n<p>The code below injects a middleware (<code>ConfigureJobTenantMiddleware</code>) into the job and makes sure it runs <strong>before</strong> the middleware defined by the job itself.</p>\n<pre class="lang-php prettyprint-override"><code>use Illuminate\\Support\\Facades\\Queue;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\n\nQueue::createPayloadUsing(function ($connection, $queue, $payload) {\n if (isset($payload['data']['command'])) {\n $job = unserialize($payload['data']['command']);\n\n if ($job instanceof ShouldQueue) {\n $middleware = [new ConfigureJobTenantMiddleware()];\n\n if (method_exists($job, 'middleware')) {\n $middleware = array_merge($middleware, $job-&gt;middleware());\n }\n\n $job-&gt;middleware = $middleware;\n\n $payload['data']['command'] = serialize($job);\n }\n }\n\n return $payload;\n});\n</code></pre>\n"^^ . + . + "1"^^ . + "valet"^^ . + . + . + "Fastest way to randomly shuffle an array based on probabilities in PHP?"^^ . + . + "I was planning on adding a honeypot for additional security, however many of the current spam registrations are coming in without filling any of the custom fields, so I can't imagine they would fill the honeypot. Which is why I am looking for a way to identify and stop those registrations that are missing required fields."^^ . + "0"^^ . + "Can you address what this has to do with the API? Is the problem with the API pulling this content, or is the problem with the content being entered into WordPress."^^ . + "omg, i'm tryed many combinations of nullable initialization, but i'm not try set null in props.... just simple mistake *facepalm*"^^ . + "1"^^ . + "According to the documentation the `X-CALLBACK-URL` header is mandatory but you haven't included it in your code."^^ . + . + . + "<p>I'm confused about the concept of variable in PHP.\nAs far as I know, a variable in PHP has a name (<code>$p</code>) and a value (<code>'Carlo'</code>).</p>\n<p><code>$p</code> has an associated entry in symbol table, such an entry actually points to the memory area where the variable's value is stored (i.e. the string <code>'Carlo'</code>).</p>\n<p>Consider the following:</p>\n<pre><code>$n =&amp; $p\n</code></pre>\n<p><code>$n</code> basically is an alias of <code>$p</code> therefore it points to the memory area where <code>$p</code> points to.</p>\n<p>From an &quot;under the hood&quot; viewpoint, does the PHP interpreter create a new entry in symbol table for <code>$n</code>or since it is an alias doesn't have its own symbol table's entry ?</p>\n<p>Btw, suppose to define <code>class Alpha</code> with its properties and methods. Then does <code>$c = new Alpha</code> actually return a &quot;reference&quot; into the <code>$c</code> variable, in other words is <code>$c</code>'s value a reference in memory to an instance of <code>class Alpha</code> ?</p>\n"^^ . + . + . + "2"^^ . + . + . + . + "@KeyboardCorporation KlantInzien is a component within that blade file (beheer.klanten.zien): `<livewire:klant-inzien />`"^^ . + . + "Location/Installation of PHPMailer"^^ . + . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + "It would also make sense you describe your learning/the solving, just code most often is not entirely helpful in itself because it's also with the problems we have to find yet. Just FYI."^^ . + . + . + "0"^^ . + . + "Why does simplexml_load_string fail on complex (but valid) SOAP XML?"^^ . + "1"^^ . + "I posted a screenshot and the output I expect. I hope this clarifies it. As you see it is s:25:"array_index"..."^^ . + . + . + "What about `',`? [See here](https://regex101.com/r/P8dTJn/1): `(?i)[a-z](?:[a-z '.,-]*)`; these are also valid names: "Jill M. K. Roe-O'Conner, III"; if you don't want those, try `(?i)^[a-z](?:[a-z .]*)$` [See here](https://regex101.com/r/Mz2UrO/1)."^^ . + "installation"^^ . + . + . + . + "1"^^ . + "0"^^ . + "currency"^^ . + . + "0"^^ . + . + "1"^^ . + "1"^^ . + . + "@hakre That question is about Android, while this one is using PHP. While the basic approach of providing your own full path (rather than Firebase generating its own key) is the same across platforms, it's never gonna be an exact duplicate based on that."^^ . + . + . + "0"^^ . + "@MarkusZeller I registered the webhook by using this url https://api.telegram.org/bot$telegramBotToken/setWebhook?url=$webhookUrl"^^ . + . + . + . + "i added that it does not work\nalthough clearing the channels.php seems to fix it but i need the channels.php because i have private channels"^^ . + . + . + . + . + "<p>The PHP manual states:</p>\n<blockquote>\n<p>As of 8.0.0, the GD extension uses objects instead of resources, and objects cannot be explicitly closed.</p>\n</blockquote>\n<p>This is useful, but also can be a little disingenuous - implying that image resources / objects can not be destroyed.</p>\n<p>As mentioned on <a href="https://stackoverflow.com/questions/3822188/php-image-save-resize-show-practices">other questions</a> there are some replacement methods that can be used for images. However, specifically looking at objects we can view <a href="https://stackoverflow.com/questions/8798443/how-to-destroy-an-object">this Q&amp;A</a>.</p>\n<p>There are two useful methods to &quot;clear&quot; this memory footprint of the GD image object.</p>\n<h2>1.</h2>\n<p>Clear memory immediately. Use <code>= null</code>. Slight CPU load but suitable for loops dealing with significant numbers of images:</p>\n<pre><code>foreach($imageArray as $imageRow){\n $image = imagecreatefrompng($imageRow);\n\n // Do some stuff with $image\n\n}\n// Previously\n// imagedestroy($image); \n// Now: \n$image = null;\n</code></pre>\n<h2>2.</h2>\n<p>Clear memory efficiently. Use <code>unset()</code>. Suitable for effective cleaning large image resources in low number of images:</p>\n<pre><code>foreach($imageArray as $imageRow){\n $image = imagecreatefrompng($imageRow);\n\n // Do some stuff with $image\n\n}\n// Previously\n// imagedestroy($image); \n// Now: \nunset($image);\n</code></pre>\n<p>Remember all image resources and objects are cleaned anyway automatically at the end of the script so if you're dealing with non-massive images or very small numbers of images there's little benefit to explicitly clearing the GD object before the natural end of the script.</p>\n"^^ . + . + "0"^^ . + . + "openssl, gpg or whatever - either way, using PHP will add more complexity. "How to use php to encrypt large files" appears to be an "XY problem". What is your goal? To encrypt a large file? Well then, look for the solution for this exact problem."^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "Connecting Laravel to SQL Server certificate problem"^^ . + "<p>You are checking with the status code. While that is generally correct w/ HTTP, mind that you request a PHP script.</p>\n<p>That PHP script <em>does</em> exist, regardless of the query parameters.</p>\n<p>Can't imagine you tried 15 <em>different</em> answers on site, but for the code example:</p>\n<ol>\n<li>Check for 200 status code on the expected line</li>\n<li>Check for Content-Length</li>\n</ol>\n<pre class="lang-php prettyprint-override"><code> ...\n\n $headers = get_headers($url, true);\n stream_context_set_default($previous);\n\n [$status] = sscanf($headers[0] ?? '', 'HTTP/1.1 %d OK');\n\n return $status === 200 &amp;&amp; isset($headers['Content-Length']);\n}\n</code></pre>\n<p>As you also have found out that the criteria/meaning can greatly differ across sites, I'd suggest you give it a callback function where you can adopt:</p>\n<pre class="lang-php prettyprint-override"><code>\nfunction FileExists($url, ?closure $filter): bool\n{\n $previous = stream_context_get_options(stream_context_get_default());\n stream_context_set_default(['http' =&gt; ['method' =&gt; 'HEAD', 'follow_location' =&gt; 0]]);\n $headers = get_headers($url, true);\n stream_context_set_default($previous);\n\n [$status] = sscanf($headers[0] ?? '', 'HTTP/1.1 %d OK');\n\n return $status === 200 &amp;&amp; $filter ? $filter($headers) : true;\n}\n\n$url1 = &quot;https://example.net/path/to/script.php?option=a&quot;;\n$url2 = &quot;https://example.net/path/to/script.php?option=b&quot;;\n\nvar_dump(\n FileExists($url1, fn (array $headers): bool =&gt; isset($headers['Content-Length'])),\n FileExists($url2, fn (array $headers): bool =&gt; isset($headers['Content-Length'])),\n); // bool(false), bool(true)\n</code></pre>\n<p>Work with the parts you stumble upon and make them inject able (= flexible).</p>\n"^^ . + . + . + "0"^^ . + "3"^^ . + . + . + "I have to write a test case bro , I wana implement it using dusk"^^ . + "tabulapdf appears to be a Java app, right? I can't find a PHP specific version of it, just a wrapper around the Java version. If I'm wrong, please provide a link. If this is the Java version, PHP is just passing arguments to the jar, but you'd need to determine what those outside of PHP first."^^ . + . + . + "0"^^ . + . + "Can you recheck the setup guide [here](https://github.com/lexik/LexikJWTAuthenticationBundle/blob/3.x/Resources/doc/index.rst#getting-started)? Seems to me you might be missing a few steps. The error on step 6 is likely that the process can't find the openssl binary. If you just installed openssl, rebooting might fix the problem (because the PATH var might not be updated in that context)."^^ . + . + "3"^^ . + . + . + . + "0"^^ . + "sabredav"^^ . + . + . + "<p>I want to create a web application with a feature to take pictures from the front camera with html tag such as</p>\n<ul>\n<li>html</li>\n</ul>\n<pre><code>&lt;form id=&quot;data&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;\n&lt;input type=&quot;file&quot; capture=&quot;camera&quot; accept=&quot;image/*&quot; class=&quot;btn btn-primary&quot; \n id=&quot;takePhoto&quot; name=&quot;takePhoto&quot; /&gt;\n&lt;input type=&quot;submit&quot; id=&quot;submit&quot; name=&quot;submit&quot; class=&quot;btn btn-primary&quot; value=&quot;Upload!&quot; /&gt;\n&lt;/form&gt;\n\n</code></pre>\n<ul>\n<li>Javascript</li>\n</ul>\n<pre><code> &lt;script&gt;\n \n $(document).ready(function(){\n $(&quot;form#data&quot;).submit(function(e) {\n e.preventDefault(); \n var formData = new FormData(this);\n\n $.ajax({\n url:'https://example.com/proccess.php',\n crossDomain: true,\n type: 'POST',\n data: formData,\n success: function (data) {\n alert(data)\n },\n cache: false,\n contentType: false,\n processData: false\n });\n });\n });\n &lt;/script&gt;\n\n</code></pre>\n<ul>\n<li>php</li>\n</ul>\n<p>....</p>\n<pre><code> header(&quot;Access-Control-Allow-Origin: *&quot;);\n header('Access-Control-Allow-Methods: GET, POST, REQUEST');\n \n $folderPath = &quot;uploads/&quot;;\n $tdate = date('d_m_Y_h_i_s'); \n $allowed_ext = array('doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf', 'rar', 'zip', 'jpg', 'jpeg', 'png');\n $file_name = $_FILES[&quot;takePhoto&quot;][&quot;name&quot;];\n $file_temp = $_FILES[&quot;takePhoto&quot;][&quot;tmp_name&quot;];\n $sourceProperties = getimagesize($file_temp);\n \n $fileNewName = $tdate;\n $ext = pathinfo($_FILES[&quot;takePhoto&quot;][&quot;name&quot;], PATHINFO_EXTENSION);\n $getname = explode(&quot;.&quot;, $file_name);\n \n $ori_file = substr(str_replace(str_split('\\\\/:*#?&quot;&lt;&gt;|&amp;+-;.()'), '_', $getname[0]),0);\n $ori_file = str_replace(&quot; &quot;,&quot;_&quot;,$ori_file);\n \n $file_name_exp = explode(&quot;.&quot;, $file_name);\n $file_ext = strtolower(array_pop($file_name_exp));\n = strtolower(end(explode('.', $file_name)));\n $file_size = $_FILES[&quot;takePhoto&quot;]['size'];\n \n $file_name_up = $ori_file.'_'.$tdate.'.'.$file_ext;\n \n if(in_array($file_ext, $allowed_ext) === true){\n \n $local = 'uploads/'.$file_name_up;\n \n if (move_uploaded_file($file_tmp,$local)) {\n echo &quot;The file &quot;. basename( $file_name_up) . &quot; has been uploaded.&lt;br&gt;&quot;;\n \n \n if(rename($local, &quot;/mnt/drive/server/uploads/&quot;.basename( $file_name_up))) {\n echo &quot;File moving operation success&lt;br/&gt;&quot;; \n }\n \n } else {\n echo &quot;&quot;;\n }\n \n }else{\n echo '&lt;div class=&quot;error&quot;&gt;ERROR: Extentions not available!&lt;/div&gt;';\n } \n</code></pre>\n<p>...</p>\n<p>If using the smartphone's rear camera, the image can be saved, but if using the front camera, the image cannot be saved perfectly, whether because of the resolution or other things.</p>\n"^^ . + . + "@kamilio3214 yeah you don't need to do any of that, that's old hat. Mysqli has always been able to throw exceptions when problems occur, but in recent php versions that's enabled by default. So you just let php handle any problems the same way you would for any other php error."^^ . + . + "0"^^ . + "Have you tried SSHing to an example machine and running the BASH script directly there? = No \n\n # Get PHP version dynamically\n PHP_VERSION=$(php -r 'echo PHP_VERSION;')\n\n # Print PHP version to check if it's set correctly\n echo "PHP Version: \\${PHP_VERSION}"\n\n\nthis part is not working."^^ . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + "<p>In laravel 12, to redirect users if authenticated. Check the <a href="https://laravel.com/docs/11.x/middleware#middleware-aliases" rel="nofollow noreferrer">document</a>.</p>\n<p>From laravel 11, you can use <code>redirectUsersTo</code> to check user is authenticated in <code>bootstrap/app.php</code>.</p>\n<p><code>bootstrap/app.php</code></p>\n<pre><code>use Illuminate\\Foundation\\Application;\nuse Illuminate\\Foundation\\Configuration\\Middleware;\nuse Illuminate\\Http\\Request;\n\nreturn Application::configure(basePath: dirname(__DIR__))\n ...\n -&gt;withMiddleware(function (Middleware $middleware) {\n ...\n $middleware-&gt;redirectUsersTo(function (Request $request): string {\n if (auth()-&gt;guard('admin_users')-&gt;check()) {\n return 'dashboard';\n }\n\n return '/';\n });\n ...\n })\n ...\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + "0"^^ . + "charts"^^ . + "0"^^ . + . + . + "1"^^ . + . + . + "How to generate Nested JSON using PDO"^^ . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + "`$woocommerce->cart` appears to be null at this point, so try `WC()->cart` instead."^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "`$showConfirmationModal` is not a variable. It's a property of class `Component`."^^ . + . + "<p>The most reliable way to dynamically translate navigation menu items is to use the <code>wp_nav_menu_items</code> filter.</p>\n<pre><code>function translate_nav_menu_items($items, $args) {\n foreach ($items as &amp;$item) {\n if ($item-&gt;title == 'Home') { // Match the original title\n $item-&gt;title = pll__('Home'); // Translate the title\n }\n //Add more translation logic for other menu items here.\n }\n return $items;\n}\nadd_filter('wp_nav_menu_items', 'translate_nav_menu_items', 10, 2);\n</code></pre>\n"^^ . + . + "1"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + "<p>I have created a table that a user can use to input multiple files (photos from a phone).\nI generate the table rows using Javascript and x(below) starts at 1 and increments from there. This is the line that generates the javascript</p>\n<p><code>&lt;th class=&quot;col-xs-1&quot;&gt; &lt;input class=&quot;form-control&quot; type=&quot;file&quot; id=&quot;myFileInput'+ x + '&quot; accept=&quot;image/*;capture=camera&quot;&gt;&lt;/th&gt;'</code></p>\n<p>When I submit these files for upload I send them via AJAX to a php file. This is what I use to create an array of files to send as POST parameters:</p>\n<pre class="lang-none prettyprint-override"><code> for (var r = 1, n = table.rows.length; r &lt; n; r++) {\n var myInput = document.getElementById(&quot;myFileInput&quot; + r);\n fileArray.push(myInput.files[0]);\n }\n</code></pre>\n<p>I send the files array like this:</p>\n<p><code> form.append('file', fileArray);</code></p>\n<p>The problem is that the files array is POST'ed to the PHP file in the $_POST parameters and not the $_FILES array and I don't know how to handle that.</p>\n<p>Here is a minimum reproduceable example - User interface file (html)</p>\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;title&gt;LIST of files to php&lt;/title&gt;\n&lt;meta charset=&quot;utf-8&quot;&gt;\n&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;\n&lt;link href=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;&gt;\n&lt;script src=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js&quot;&gt;&lt;/script&gt;\n\n\n&lt;/head&gt;\n&lt;body&gt;\n\n &lt;!-- Container for padding https://www.w3schools.com/bootstrap5/bootstrap_containers.php --&gt;\n&lt;div class=&quot;container p-5 my-5 border&quot;&gt;\n\n &lt;!-- Table of files --&gt;\n\n &lt;div class=&quot;container my-5&quot;&gt;\n &lt;table id=&quot;FileTable&quot; class=&quot;table table-bordered table-striped table-hover&quot;&gt;\n &lt;thead&gt;\n &lt;tr&gt;\n &lt;/tr&gt;\n &lt;/thead&gt;\n &lt;/table&gt;\n &lt;button onclick=&quot;addRow()&quot; type=&quot;button&quot; class=&quot;btn btn-primary&quot;&gt;Add Another Photo Or File&lt;/button&gt; \n &lt;/div&gt;\n\n &lt;!-- Submit request --&gt;\n &lt;div class=&quot;container my-5&quot;&gt;\n &lt;button onclick=&quot;submitFiles()&quot; type=&quot;button&quot; class=&quot;btn btn-primary&quot;&gt;Submit&lt;/button&gt; \n &lt;/div&gt;\n\n&lt;/div&gt;\n\n&lt;script&gt;\n const queryString = window.location.search;\n const urlParams = new URLSearchParams(queryString);\n\n function submitFiles() {\n\n //File(s)\n var table = document.getElementById('FileTable');\n\n var fileArray = [];\n for (var r = 1, n = table.rows.length; r &lt; n; r++) {\n var myInput = document.getElementById(&quot;myFileInput&quot; + r);\n fileArray.push(myInput.files[0]);\n }\n\n var form = new FormData(),\n xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState == XMLHttpRequest.DONE) {\n alert('Submited');\n }\n } \n\n form.append('file', fileArray);\n xhr.open('post', 'uploadMinReproduceable.php', true);\n xhr.send(form);\n\n}\n\n function deleteRow(id)\n {\n document.getElementById(id).remove()\n }\n\n function addRow() {\n\n var table = document.getElementById(&quot;FileTable&quot;);\n // GET TOTAL NUMBER OF ROWS \n var x =table.rows.length;\n var id = &quot;row&quot;+x;\n var row = table.insertRow(x);\n row.id=id;\n var cell1 = row.insertCell(0);\n var cell2 = row.insertCell(1);\n\n var cell1Inner = ' &lt;th class=&quot;col-xs-1&quot;&gt; &lt;input class=&quot;form-control&quot; type=&quot;file&quot; id=&quot;myFileInput'+ x + '&quot; accept=&quot;image/*;capture=camera&quot;&gt;&lt;/th&gt;';\n cell1.innerHTML = cell1Inner;\n\n cell2.classList.add(&quot;text-center&quot;);\n cell2.classList.add(&quot;py-1&quot;);\n cell2.innerHTML = '&lt;button class=&quot;btn btn-outline-primary btn-xs&quot; onclick=&quot;deleteRow(\\'' + id + '\\')&quot; &gt;Delete&lt;/button&gt;';\n }\n\n //Initialise the table with a row\n addRow(); \n\n&lt;/script&gt;\n\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<p>The PHP file:</p>\n<pre><code>&lt;?php\n \nheader('Content-Type: application/json; charset=utf-8');\n\nerror_log('post params for upload file ' . $_SERVER['SCRIPT_NAME']);\nforeach ($_POST as $key =&gt; $value) {\n error_log(' key: '. $key .' value: '. $value);\n}\n\nerror_log('files params for upload file ' . $_SERVER['SCRIPT_NAME']);\nforeach ($_FILES as $key =&gt; $value) {\n error_log(' Files key: '. $key .' Files value: '. $value);\n}\n\n$dsID = !empty($_POST['id_Job'])?$_POST['id_Job']:'0';\n$locationvalue = '';\nif (isset($_POST['Location']) &amp;&amp; $_POST['Location'] !== '') {\n $locationvalue = $_POST['Location'] ;\n}\n\n?&gt;\n</code></pre>\n<p>The result in the error log (note that the $_FILES array is empty):</p>\n<pre><code>[26-Feb-2025 17:33:14 Australia/Sydney] post params for upload file /uploadMinReproduceable.php\n[26-Feb-2025 17:33:14 Australia/Sydney] key: file value: [object File]\n[26-Feb-2025 17:33:14 Australia/Sydney] files params for upload file /uploadMinReproduceable.php\n</code></pre>\n<p>The expected result in the error log for the $_FILES array:</p>\n<pre><code>[26-Feb-2025 16:16:14 Australia/Adelaide] files params for upload file /FileTest/uploadFile.php\n[26-Feb-2025 16:16:14 Australia/Adelaide] Files key: file Files value: Array\n</code></pre>\n<p>Note: This isn't the same as <a href="https://stackoverflow.com/questions/65571991/sending-multiple-files-as-part-of-xmlhttprequest-and-formdata">Sending Multiple Files As Part of XMLHttpRequest and FormData</a> because that is using an input of type <code>multiple=&quot;multiple&quot;</code> which constructs it's own files array. In this case I am creating my own files array and that is not being passed through in the correct format to PHP</p>\n"^^ . + . + "0"^^ . + "Firstname Not Displaying on Homepage After Signup"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + "<blockquote>\n<p>but <code>localhost/mydomain.com/</code> simply says 'localhost redirected you too many times'. How do I get the redirect to work fine both on a live server and localhost?</p>\n</blockquote>\n<p>This is not the &quot;root directory&quot; as you've stated in the question title; it's a subdirectory and that's the problem...</p>\n<blockquote>\n<pre><code>RewriteCond %{REQUEST_URI} /(.*)/$\nRewriteRule ^ /%1 [R=301,L]\n</code></pre>\n</blockquote>\n<p>The rule already <em>excludes</em> the root directory - as it should. (This is achieved because the regex <code>/(.*)/$</code> would fail to match the root).</p>\n<p>The problem with this rule is you are trying to remove the trailing slash from every other URL, including <em>subdirectories</em> (as in physical filesystem directories). You can't do this - directories need the trailing slash<sup><b>*1</b></sup>. You would have the same problem on the live server if you requested a subdirectory. (I assume you do have subdirectories for assets, images, etc.?)</p>\n<p>If you remove the trailing slash then mod_dir will (by default) append the slash again with a 301 redirect - resulting in an endless redirect loop.</p>\n<p>(<sup><b>*1</b></sup> You can suppress the trailing slash on directories, in terms of the URL you see - but the trailing slash still needs to be present in order to serve directory index documents from those directories. In order to achieve this you can internally rewrite the request to append the trailing slash - but this is messy - particularly when resolving canonicalization issues - and probably not necessary in your situation anyway.)</p>\n<p>It's a simple fix... you basically need to check that the request does not map to a directory before removing the trailing slash.</p>\n\n<p>Try the following instead:</p>\n<pre><code># Removing trailing slashes from non-directory URLs\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteCond ${REQUEST_URI} ^/(.+)/$\nRewriteRule ./$ https://example.net/%1 [R=301,L]\n</code></pre>\n\n<p>Note that I've also included the scheme+hostname in the <em>substitution</em> string (as you have in the other canonical redirects) in order to minimise the number of redirects when also requesting HTTP and/or www (although these should be edge cases anyway).</p>\n<p>You will need to clear your browser (and possibly other intermediary) caches before testing and test first with a 302 (temporary) redirect to avoid potential caching issues. 301 (permanent) redirects (including <em>errors</em>) are cached persistently by the browser.</p>\n<hr />\n<blockquote>\n<p>when someone types <code>d/file/</code> or <code>d/file</code> in the url bar, it loads the same content (duplicate content)</p>\n</blockquote>\n<p>However, that is something you should really be controlling in your PHP router. Your PHP code must be resolving both requests into one for both URLs to return the same response - perhaps you should not be doing that. Then one or other URL (eg. the one <em>with</em> the trailing slash) will naturally result in a 404 (assuming that's what your router does). Or redirect one to the other in your PHP router/script - by doing this in PHP you can selectively redirect only the URLs that need redirecting and not URLs that would otherwise result in a 404 anyway.</p>\n<p>This also avoids the need to explicitly check for physical directories, since requests for physical directories are not hitting your router.</p>\n<hr />\n<p><em>Aside:</em></p>\n<blockquote>\n<p>On localhost, localhost/mydomain.com/folder/file/ redirects fine,</p>\n</blockquote>\n<p>Instead of simply using a subdirectory off the localhost, why don't you define the <code>&lt;VirtualHost&gt;</code> <code>ServerName</code> and <code>DocumentRoot</code> properly for <code>mydomain.com</code> - or perhaps use a subdomain like <code>local.mydomain.com</code> if you need to keep <code>mydomain.com</code> (the live site) accessible? Then you have the same directory structure on both local and live sites.</p>\n<p>(It could still be stored as a subdirectory off the localhost's document root if you wish, but the files could literally be stored anywhere.)</p>\n"^^ . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + "1"^^ . + "<p>I have some SOAP XML that is being sent to me and I'm trying to parse it with this function I wrote:</p>\n<pre><code>function soapXmlToJson($soapXml) { \n libxml_use_internal_errors(true);\n \n // Load XML with namespace awareness\n $xml = simplexml_load_string($soapXml, &quot;SimpleXMLElement&quot;, LIBXML_NOCDATA);\n \n if($xml === false) {\n $errors = libxml_get_errors();\n libxml_clear_errors();\n echo(&quot;XML Parsing Error: &quot; . print_r($errors, true));\n return ['json' =&gt; null, 'array' =&gt; null];\n }\n \n // Convert XML to an array while stripping namespaces\n $array = json_decode(json_encode($xml), true);\n \n // Convert to JSON\n $json = json_encode($array);\n \n echo(&quot;soapXml=$soapXml&quot;);\n echo(&quot;json=$json&quot;);\n echo(&quot;array=&quot;.print_r($array, true));\n \n return ['json' =&gt; $json, 'array' =&gt; $array];\n}\n</code></pre>\n<p>This function works fine for Simple XML, like this:</p>\n<p><code>&lt;note&gt;&lt;to&gt;Tove&lt;/to&gt;&lt;from&gt;Jani&lt;/from&gt;&lt;heading&gt;Reminder&lt;/heading&gt;&lt;body&gt;Do not forget me this weekend!&lt;/body&gt;&lt;/note&gt;</code></p>\n<p>But when I feed it this large XML it's not working. The $xml variable from simplexml_load_string always returns &quot;&quot; (a blank string). Here is the large XML payload that's failing:</p>\n<pre><code>&lt;s:Envelope xmlns:s=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;\n &lt;s:Body&gt;\n &lt;Book xmlns=&quot;http://groundxchange.com/GXCore/v1/&quot;&gt;\n &lt;input xmlns:a=&quot;http://groundxchange.com/GXCore/v1/GXObjects&quot;\n xmlns:i=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;\n &lt;a:Credentials&gt;\n &lt;a:AuthId&gt;preprod-la-dev1&lt;/a:AuthId&gt;\n &lt;a:AuthPassword&gt;xogfeb-xiqpi1-janNyg&lt;/a:AuthPassword&gt;\n &lt;/a:Credentials&gt;\n &lt;a:Header&gt;\n &lt;a:ChannelType&gt;AffiliateToAffiliate&lt;/a:ChannelType&gt;\n &lt;a:ExternalNetworkId i:nil=&quot;true&quot;/&gt;\n &lt;a:ExternalNetworkResNumber i:nil=&quot;true&quot;/&gt;\n &lt;a:GXReservationMsgGroupId&gt;UD976156228&lt;/a:GXReservationMsgGroupId&gt;\n &lt;a:GXTransactionId&gt;185432&lt;/a:GXTransactionId&gt;\n &lt;a:ReceiverPartcipantCode&gt;US.AL.LA.DEV1&lt;/a:ReceiverPartcipantCode&gt;\n &lt;a:ReceiverResNumber/&gt;\n &lt;a:SenderParticipantCode&gt;PREPROD-SC-1&lt;/a:SenderParticipantCode&gt;\n &lt;a:SenderResNumber&gt;77166*2&lt;/a:SenderResNumber&gt;\n &lt;/a:Header&gt;\n &lt;a:Message&gt;\n &lt;a:AdditionalData&gt;\n &lt;a:NameValuePair&gt;\n &lt;a:FieldName&gt;VIPCODE&lt;/a:FieldName&gt;\n &lt;a:Value&gt;VIP_2&lt;/a:Value&gt;\n &lt;/a:NameValuePair&gt;\n &lt;/a:AdditionalData&gt;\n &lt;a:AllowedBookingUpdateActionTypes xmlns:b=&quot;http://schemas.microsoft.com/2003/10/Serialization/Arrays&quot;&gt;\n &lt;b:string&gt;DelayedConfirmation&lt;/b:string&gt;\n &lt;b:string&gt;FinalCloseoutCharges&lt;/b:string&gt;\n &lt;b:string&gt;ServiceProviderCancel&lt;/b:string&gt;\n &lt;b:string&gt;ServicingVehicleGPSTracking&lt;/b:string&gt;\n &lt;b:string&gt;StatusUpdate&lt;/b:string&gt;\n &lt;/a:AllowedBookingUpdateActionTypes&gt;\n &lt;a:BookerIATA i:nil=&quot;true&quot;/&gt;\n &lt;a:CCBillingZipCode i:nil=&quot;true&quot;/&gt;\n &lt;a:CCCVVNo&gt;0&lt;/a:CCCVVNo&gt;\n &lt;a:CCExpiryMonth&gt;0&lt;/a:CCExpiryMonth&gt;\n &lt;a:CCExpiryYear&gt;0&lt;/a:CCExpiryYear&gt;\n &lt;a:CCHolderName i:nil=&quot;true&quot;/&gt;\n &lt;a:CCNumber i:nil=&quot;true&quot;/&gt;\n &lt;a:CCType&gt;Unknown&lt;/a:CCType&gt;\n &lt;a:ContactEmail&gt;ankit.patel@groundwidgets.com&lt;/a:ContactEmail&gt;\n &lt;a:ContactName&gt;Res Dispatch&lt;/a:ContactName&gt;\n &lt;a:ContactPhone&gt;+1 2122132132&lt;/a:ContactPhone&gt;\n &lt;a:CreditCard3DSecureData/&gt;\n &lt;a:CustomFields/&gt;\n &lt;a:CustomerCode&gt;SarjuTest&lt;/a:CustomerCode&gt;\n &lt;a:DepartmentCode/&gt;\n &lt;a:DropffDateTime i:nil=&quot;true&quot;/&gt;\n &lt;a:EmployeeCode/&gt;\n &lt;a:ExtraPassengers/&gt;\n &lt;a:ExtraServices xmlns:b=&quot;http://schemas.microsoft.com/2003/10/Serialization/Arrays&quot;&gt;\n &lt;b:string&gt;Child Seat&lt;/b:string&gt;\n &lt;b:string&gt;Wheelchair&lt;/b:string&gt;\n &lt;b:string&gt;123&lt;/b:string&gt;\n &lt;/a:ExtraServices&gt;\n &lt;a:IsMailOrTelephoneOrder i:nil=&quot;true&quot;/&gt;\n &lt;a:Locations&gt;\n &lt;a:LocationDetail&gt;\n &lt;a:AddressLine1&gt;109 East 42nd Street&lt;/a:AddressLine1&gt;\n &lt;a:AddressLine2/&gt;\n &lt;a:AddressLine3/&gt;\n &lt;a:AddressType&gt;Pickup&lt;/a:AddressType&gt;\n &lt;a:AirlineCode i:nil=&quot;true&quot;/&gt;\n &lt;a:AirportCity i:nil=&quot;true&quot;/&gt;\n &lt;a:AirportCode i:nil=&quot;true&quot;/&gt;\n &lt;a:AirportICAOCode i:nil=&quot;true&quot;/&gt;\n &lt;a:AirportName i:nil=&quot;true&quot;/&gt;\n &lt;a:City&gt;New York&lt;/a:City&gt;\n &lt;a:CountryCode&gt;US&lt;/a:CountryCode&gt;\n &lt;a:DestinationAirport i:nil=&quot;true&quot;/&gt;\n &lt;a:DispatchCrossStreet/&gt;\n &lt;a:DispatchDirection/&gt;\n &lt;a:DispatchPickupPoint i:nil=&quot;true&quot;/&gt;\n &lt;a:FixedBaseOperatorInfo i:nil=&quot;true&quot;/&gt;\n &lt;a:FlightNumber i:nil=&quot;true&quot;/&gt;\n &lt;a:FlightScheduleDateTime i:nil=&quot;true&quot;/&gt;\n &lt;a:FlightType i:nil=&quot;true&quot;/&gt;\n &lt;a:Latitude&gt;40.752062&lt;/a:Latitude&gt;\n &lt;a:LocationType&gt;Address&lt;/a:LocationType&gt;\n &lt;a:Longitude&gt;-73.976300&lt;/a:Longitude&gt;\n &lt;a:Notes/&gt;\n &lt;a:OriginAirport i:nil=&quot;true&quot;/&gt;\n &lt;a:PickupDropoffPoint/&gt;\n &lt;a:PlaceName&gt;Hyatt Grand Central New York&lt;/a:PlaceName&gt;\n &lt;a:PostalCode&gt;10017&lt;/a:PostalCode&gt;\n &lt;a:ScheduledArrivalDateTime i:nil=&quot;true&quot;/&gt;\n &lt;a:ScheduledDepartureDateTime i:nil=&quot;true&quot;/&gt;\n &lt;a:ShipCarrier i:nil=&quot;true&quot;/&gt;\n &lt;a:ShipName i:nil=&quot;true&quot;/&gt;\n &lt;a:ShipScheduledDateTime i:nil=&quot;true&quot;/&gt;\n &lt;a:ShipScheduledPier i:nil=&quot;true&quot;/&gt;\n &lt;a:ShipTerminal i:nil=&quot;true&quot;/&gt;\n &lt;a:State&gt;NY&lt;/a:State&gt;\n &lt;a:TrainCarrierCode i:nil=&quot;true&quot;/&gt;\n &lt;a:TrainDestinationStation i:nil=&quot;true&quot;/&gt;\n &lt;a:TrainNumber i:nil=&quot;true&quot;/&gt;\n &lt;a:TrainOriginStation i:nil=&quot;true&quot;/&gt;\n &lt;a:TrainScheduledDateTime i:nil=&quot;true&quot;/&gt;\n &lt;a:TrainScheduledPlatformTrack i:nil=&quot;true&quot;/&gt;\n &lt;a:TrainStation i:nil=&quot;true&quot;/&gt;\n &lt;/a:LocationDetail&gt;\n &lt;a:LocationDetail&gt;\n &lt;a:AddressLine1&gt;20 West 34th Street&lt;/a:AddressLine1&gt;\n &lt;a:AddressLine2/&gt;\n &lt;a:AddressLine3/&gt;\n &lt;a:AddressType&gt;Dropoff&lt;/a:AddressType&gt;\n &lt;a:AirlineCode i:nil=&quot;true&quot;/&gt;\n &lt;a:AirportCity i:nil=&quot;true&quot;/&gt;\n &lt;a:AirportCode i:nil=&quot;true&quot;/&gt;\n &lt;a:AirportICAOCode i:nil=&quot;true&quot;/&gt;\n &lt;a:AirportName i:nil=&quot;true&quot;/&gt;\n &lt;a:City&gt;New York&lt;/a:City&gt;\n &lt;a:CountryCode&gt;US&lt;/a:CountryCode&gt;\n &lt;a:DestinationAirport i:nil=&quot;true&quot;/&gt;\n &lt;a:DispatchCrossStreet/&gt;\n &lt;a:DispatchDirection/&gt;\n &lt;a:DispatchPickupPoint i:nil=&quot;true&quot;/&gt;\n &lt;a:FixedBaseOperatorInfo i:nil=&quot;true&quot;/&gt;\n &lt;a:FlightNumber i:nil=&quot;true&quot;/&gt;\n &lt;a:FlightScheduleDateTime i:nil=&quot;true&quot;/&gt;\n &lt;a:FlightType i:nil=&quot;true&quot;/&gt;\n &lt;a:Latitude&gt;40.748440&lt;/a:Latitude&gt;\n &lt;a:LocationType&gt;Address&lt;/a:LocationType&gt;\n &lt;a:Longitude&gt;-73.985664&lt;/a:Longitude&gt;\n &lt;a:Notes/&gt;\n &lt;a:OriginAirport i:nil=&quot;true&quot;/&gt;\n &lt;a:PickupDropoffPoint/&gt;\n &lt;a:PlaceName&gt;Empire State Building&lt;/a:PlaceName&gt;\n &lt;a:PostalCode&gt;10001&lt;/a:PostalCode&gt;\n &lt;a:ScheduledArrivalDateTime i:nil=&quot;true&quot;/&gt;\n &lt;a:ScheduledDepartureDateTime i:nil=&quot;true&quot;/&gt;\n &lt;a:ShipCarrier i:nil=&quot;true&quot;/&gt;\n &lt;a:ShipName i:nil=&quot;true&quot;/&gt;\n &lt;a:ShipScheduledDateTime i:nil=&quot;true&quot;/&gt;\n &lt;a:ShipScheduledPier i:nil=&quot;true&quot;/&gt;\n &lt;a:ShipTerminal i:nil=&quot;true&quot;/&gt;\n &lt;a:State&gt;NY&lt;/a:State&gt;\n &lt;a:TrainCarrierCode i:nil=&quot;true&quot;/&gt;\n &lt;a:TrainDestinationStation i:nil=&quot;true&quot;/&gt;\n &lt;a:TrainNumber i:nil=&quot;true&quot;/&gt;\n &lt;a:TrainOriginStation i:nil=&quot;true&quot;/&gt;\n &lt;a:TrainScheduledDateTime i:nil=&quot;true&quot;/&gt;\n &lt;a:TrainScheduledPlatformTrack i:nil=&quot;true&quot;/&gt;\n &lt;a:TrainStation i:nil=&quot;true&quot;/&gt;\n &lt;/a:LocationDetail&gt;\n &lt;/a:Locations&gt;\n &lt;a:ModifyNote i:nil=&quot;true&quot;/&gt;\n &lt;a:NumberOfBags i:nil=&quot;true&quot;/&gt;\n &lt;a:NumberOfChildren i:nil=&quot;true&quot;/&gt;\n &lt;a:NumberOfInfants i:nil=&quot;true&quot;/&gt;\n &lt;a:NumberOfPassengers&gt;1&lt;/a:NumberOfPassengers&gt;\n &lt;a:NumberOfWheelchairs i:nil=&quot;true&quot;/&gt;\n &lt;a:PNRLocator i:nil=&quot;true&quot;/&gt;\n &lt;a:PassengerBillingAddressLine1 i:nil=&quot;true&quot;/&gt;\n &lt;a:PassengerBillingAddressLine2 i:nil=&quot;true&quot;/&gt;\n &lt;a:PassengerBillingCity i:nil=&quot;true&quot;/&gt;\n &lt;a:PassengerBillingCountryCode i:nil=&quot;true&quot;/&gt;\n &lt;a:PassengerBillingPostalCode i:nil=&quot;true&quot;/&gt;\n &lt;a:PassengerBillingState i:nil=&quot;true&quot;/&gt;\n &lt;a:PassengerCellPhone&gt;+1 2122132132&lt;/a:PassengerCellPhone&gt;\n &lt;a:PassengerEmail&gt;ankit.patel@groundwidgets.com&lt;/a:PassengerEmail&gt;\n &lt;a:PassengerFirstName&gt;Sarju&lt;/a:PassengerFirstName&gt;\n &lt;a:PassengerLastName&gt;Patel&lt;/a:PassengerLastName&gt;\n &lt;a:PassengerNameSignInfo i:nil=&quot;true&quot;/&gt;\n &lt;a:PaymentOption&gt;IN&lt;/a:PaymentOption&gt;\n &lt;a:PickupDateTime&gt;2025-03-07T06:00:00&lt;/a:PickupDateTime&gt;\n &lt;a:PickupDateTimeUTC&gt;2025-03-07T11:00:00&lt;/a:PickupDateTimeUTC&gt;\n &lt;a:PurchaseOrderNumber&gt;77166*2&lt;/a:PurchaseOrderNumber&gt;\n &lt;a:RequestType&gt;New&lt;/a:RequestType&gt;\n &lt;a:RequestedNumberOfMin&gt;0&lt;/a:RequestedNumberOfMin&gt;\n &lt;a:SegmentTypeCode&gt;Transfer&lt;/a:SegmentTypeCode&gt;\n &lt;a:SpecialInstruction&gt;àThis is test transaction&lt;/a:SpecialInstruction&gt;\n &lt;a:TotalDrivingDistance&gt;1.79&lt;/a:TotalDrivingDistance&gt;\n &lt;a:TotalDrivingTime&gt;9&lt;/a:TotalDrivingTime&gt;\n &lt;a:VehicleTypeCode&gt;Sedan&lt;/a:VehicleTypeCode&gt;\n &lt;/a:Message&gt;\n &lt;/input&gt;\n &lt;/Book&gt;\n &lt;/s:Body&gt;\n&lt;/s:Envelope&gt;\n</code></pre>\n<p>Why is it that the simple XML works fine here, but <code>simplexml_load_string</code> is failing with this more complex XML? I have already confirmed it is valid XML, properly encoded, etc. I tried stripping namespaces, etc. (but obviously shouldn't have to).</p>\n"^^ . + "<p>At my company, we're migrating Phalcon from version 4.2 to 5.4 while using PHP 7.4. We're facing an issue with form initialization, specifically with the HTML inside labels being escaped.</p>\n<p>We define our forms using Phalcon's form component like this:</p>\n<pre class="lang-php prettyprint-override"><code>class CustomForm extends FormBase\n{\n // ...\n $customfield = new Numeric('customfield');\n $customfield-&gt;setLabel(ucwords($translations['keyi18n']) . ' &lt;span title=&quot;Lorem&quot; class=&quot;gv-tip&quot;&gt;&amp;nbsp;&lt;i class=&quot;fas fa-info-circle&quot;&gt;&lt;/i&gt;&lt;/span&gt;');\n $this-&gt;add($customfield);\n // ...\n}\n</code></pre>\n<p>In our Volt template, we display the form as follows:</p>\n<pre class="lang-none prettyprint-override"><code>{{ form.label('customfield', ['class':'customclass']) }}\n{{ form.render('customfield', ['class':'customclass']) }}\n</code></pre>\n<p>However, the label is rendered with escaped HTML, meaning the <code>&lt;span&gt;</code> and <code>&lt;i&gt;</code> tags appear as plain text :</p>\n<pre class="lang-html prettyprint-override"><code>&lt;label for=&quot;customfield&quot; class=&quot;customclass&quot;&gt;keyi18n &amp;lt;span title=&quot;Lorem&quot; class=&quot;gv-tip&quot;&amp;gt;&amp;amp;nbsp;&amp;lt;i class=&quot; fas fa-info-circle&quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/span&amp;gt;&lt;/label&gt;\n</code></pre>\n<p>Things We've Tried:</p>\n<ul>\n<li>Enabling/disabling Volt’s autoescape mode</li>\n<li>Using Tag::setAutoescape(false); in the Volt view</li>\n</ul>\n<p>How to properly display the label with unescaped HTML?</p>\n"^^ . + . + . + . + . + "As to why the query works - it's a fake query made up by Laravel. Not the actual query sent to database."^^ . + "If the same error you refered to is about not registered, it is just a warning. The key is, can yum find those missing packages?"^^ . + "@admcfajn yeah i tried adding the operator, same issues unfortunately. However i may take you up on the upgrade directions as i think the previous dev left it too long then was worried about breaking the whole system."^^ . + . + . + . + . + . + . + . + . + "database-migration"^^ . + "Should edit your question with new information."^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + "SQL Unknown column error with first() and findAll()"^^ . + . + "3"^^ . + "0"^^ . + . + . + . + . + . + "How did you register the webhook?"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + "<p>My company is moving all our data to Microsoft Fabrics, which is great, however we have some PHP app who needs to access those datas.</p>\n<p>All those apps are using Doctrine DBAL, and we can't find how to get the connection.</p>\n<p>PHP 8.3.16\nDoctrine DBAL : 4.2.2\nODBC DRIVER : 18\nsqlsrv et pdo_sqlsrv drivers : 5.12</p>\n<p>I'm using the following code to get the connection :</p>\n<pre><code> $connectionParams = [\n 'dbname' =&gt; 'My_DB_Name',\n 'user' =&gt; 'xxxxx@xxxxxx.com',\n 'password' =&gt; 'MyPassword',\n 'host' =&gt; 'xxxxxxxxxxxxxx.datawarehouse.fabric.microsoft.com',\n 'driver' =&gt; 'pdo_sqlsrv', //doesn't work with sqlsrv either\n 'port' =&gt; 1433,\n 'driverOptions' =&gt; [ // tried few additional parameters, but are not accepeted or working\n //'Authentification' =&gt; 'ActiveDirectoryPassword',\n //&quot;Trustedconnection&quot;=&gt;&quot;true&quot;\n //'TrustServerCertificate' =&gt; true\n ]\n ];\n $this-&gt;conn = \\Doctrine\\DBAL\\DriverManager::getConnection($connectionParams);\n</code></pre>\n<p>And this code to test</p>\n<pre><code> try{\n $a = self::instance()-&gt;fetchAssociative('SELECT * FROM Production_Data');\n echo('OK&lt;br&gt;');\n Toolbox::var_dump($a,false,0);\n }catch(\\Throwable $e){\n echo($e-&gt;getMessage());\n }\n</code></pre>\n<p>As a results, I have a blank page. No results at all, not even an error.... and 'OK<br>' doesn't show up....\nWe also tried a classic PDO connection, but doesn't work either.\nWe an reach and query the warehouse correctly using SQL Server Management studio though.</p>\n<p>Thank you for your help !</p>\n"^^ . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + "ebay-api"^^ . + "1"^^ . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + "<p>I noticed that anonymous classes created using the same method are the same classes.</p>\n<pre><code>function test($test) {\n return new class($test) {\n public function __construct(public $test) {}\n };\n}\nfunction test2($test) {\n return new class($test) {\n public function __construct(public $test) {}\n };\n}\n\nfunction compare($a, $b) {\n var_dump([\n $a == $b,\n $a === $b,\n get_class($a) == get_class($b),\n ]);\n}\n\n\ncompare(test(1), test(1)); // true, false, true,\ncompare(test(['abc']), test(1)); // false, false, true,\ncompare(test(1), test2('xx')); // false, false, false\ncompare(test('xx'), test2('xx')); // false, false, false\n</code></pre>\n<p>I explain it to myself in such a way that PHP simply substitutes a random name there. So in reality there is simply a class with some name, and running the same function multiple times does not change the name, so the class is the same.</p>\n<p>However, I wonder how to generate a class using one code, which have the same syntax but are different classes. Because now I cannot imagine copying this and creating <code>test3()</code>, <code>test4()</code>, <code>test5()</code>, <code>...</code>, <code>test50()</code>, and so on, depending on how many different classes I would need.</p>\n<h3>More context</h3>\n<p>I was creating test for a certain method.</p>\n<p>To call the method, a class implementing some interface was needed.</p>\n<p>I decided that I would not test existing classes, but would create an anonymous class in which I would implement that interface.</p>\n<p>The interface contains only 1 method that must return a string.</p>\n<p>So I generate random string before creating the class object, then set a field through the constructor, and the method would return the value of this field.</p>\n<p>But I decided that one test was not enough.</p>\n<p>So I wanted to create more such cases and ran 50x method.</p>\n<p>Unfortunately, inside this mechanism, a check is performed based on the <code>::class</code>. So having 50 different objects that returned different values ​​from the method doesnt matter, as long as they were the same classes, and from the point of view of this mechanism it was important (I will not go into details why, because it took some time), hence my question.</p>\n"^^ . + . + . + "<p>I'm using the <strong>JWT Authentication for WP-API</strong> plugin (version 1.3.6) to authenticate requests to my WordPress REST API. However, when making requests, instead of getting a JSON response, I receive the full HTML of the website (including the login page).</p>\n<h3>What I tried:</h3>\n<ul>\n<li><p>Checked responses in Postman and the browser—same issue.</p>\n</li>\n<li><p>Verified <code>.htaccess</code> and <code>wp-config.php</code> settings match a working setup.</p>\n</li>\n<li><p>Ensured that the JWT token is correctly included in the request headers.</p>\n</li>\n</ul>\n<h3>Expected Behavior:</h3>\n<p>I expect a valid JSON response from the API, not an HTML page.</p>\n<h3>Steps to Reproduce:</h3>\n<h4>1️⃣ <strong>.htaccess Configuration</strong></h4>\n<pre><code># BEGIN WordPress\nRewriteEngine On\nRewriteCond %{REQUEST_URI} ^/wp-json/jwt-auth/v1/token [OR]\nRewriteCond %{HTTP:Authorization} ^(.*)\nRewriteRule .* - [E=HTTP_AUTHORIZATION:%1]\n# END WordPress\n</code></pre>\n<h4>2️⃣ <strong>wp-config.php Changes</strong></h4>\n<pre><code>define('JWT_AUTH_SECRET_KEY', 'your_secret_key_here');\ndefine('JWT_AUTH_CORS_ENABLE', true);\n</code></pre>\n<h4>3️⃣ <strong>Example API Request (Using cURL)</strong></h4>\n<pre><code>curl -X POST &quot;https://example.com/wp-json/wp/v2/posts&quot; \\\n -H &quot;Authorization: Bearer YOUR_JWT_TOKEN&quot;\n</code></pre>\n<h4>4️⃣ <strong>Response I Get (Incorrect)</strong></h4>\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;...&lt;/head&gt;\n&lt;body&gt;\n &lt;form method=&quot;post&quot; action=&quot;https://example.com/wp-login.php&quot;&gt;...&lt;/form&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<p>Instead of a JSON response, I receive the <strong>WordPress login page</strong> in HTML.</p>\n<h3>Questions:</h3>\n<ol>\n<li><p>Why is my API redirecting to the login page instead of returning JSON?</p>\n</li>\n<li><p>Could there be a missing configuration causing WordPress to handle the request as a normal page load?</p>\n</li>\n</ol>\n<p>Would appreciate any insights!</p>\n<hr />\n"^^ . + . + . + . + . + "0"^^ . + . + . + "When using `Probability` larger than 3, one could define a function to calculate `P` in stead of the `CASE WHEN....END` thing."^^ . + "-1"^^ . + . + . + "<p>You need to ensure that the autoloader knows where to look based on the class name.</p>\n<p>a simple autoloader:</p>\n<pre><code>spl_autoload_register(function ($class_name) {\n \n $base_dir = plugin_dir_path(__FILE__) . 'inc/classes/';\n\n $class_name = str_replace('\\\\', '/', $class_name); //in case of using namespaces\n $file = $base_dir . $class_name . '.php';\n\n if (file_exists($file)) {\n include $file;\n } else {\n error_log(&quot;Unable to load class $class_name&quot;);\n }\n});\n</code></pre>\n<p>now the autoloader will look for class files like <code>my-plugin/inc/classes/post-types/ClassName.php</code> or <code>my-plugin/inc/classes/taxonomies/ClassName.php</code> depending on where the class located</p>\n"^^ . + . + "`I thought I had supplied code that demonstrated the issue`...unfortunately not. Look at the demo you provided: https://phpize.online/sql/mysql80/48403b312e413068b7b758f2ed20acfc/php/php84/06a9e44c30a03b750b746884a42da68c/ . The PHP side is incomplete, doesn't run the queries you're talking about, and actually just crashes. The SQL side of it updates the database correctly though."^^ . + . + . + . + . + . + . + "1"^^ . + . + . + "load_plugin_textdomain Generates Notice in WordPress Multisite Only"^^ . + . + . + . + . + "0"^^ . + "There is more active fork https://github.com/he4rt/scylladb-php-driver (have not try it myself)"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + "<p>An approach is similar to the one mentioned upon this <a href="https://stackoverflow.com/a/35656904/4706711">answer</a>. Resulting this command:</p>\n<pre class="lang-php prettyprint-override"><code>namespace App\\Command;\n\nuse App\\Entity\\Business;\nuse App\\Entity\\User;\nuse Doctrine\\DBAL\\Connection;\nuse Doctrine\\ORM\\EntityManagerInterface;\nuse Doctrine\\ORM\\Query\\Expr\\Join;\nuse Symfony\\Component\\Console\\Attribute\\AsCommand;\nuse Symfony\\Component\\Console\\Command\\Command;\nuse Symfony\\Component\\Console\\Input\\InputArgument;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\nuse Symfony\\Component\\Console\\Input\\InputOption;\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\nuse Symfony\\Component\\Console\\Style\\SymfonyStyle;\n\n#[AsCommand(\n name: 'test:query',\n description: 'Add a short description for your command',\n)]\nclass TestQueryCommand extends Command\n{\n\n private Connection $connection;\n\n public function __construct(private readonly EntityManagerInterface $em)\n {\n parent::__construct();\n\n $this-&gt;connection = $this-&gt;em-&gt;getConnection();\n }\n\n protected function execute(InputInterface $input, OutputInterface $output): int\n {\n $businessCountQuery = $this-&gt;connection-&gt;createQueryBuilder()\n -&gt;select('count(id) as count,user_id')\n -&gt;from('business')\n -&gt;groupBy('user_id')\n -&gt;getSQL();\n\n $qbU = $this-&gt;connection-&gt;createQueryBuilder()\n -&gt;from('user', 'u')\n -&gt;select('u.*',&quot;bc.count&quot;)\n -&gt;join('u','('.$businessCountQuery.')','bc','u.id = bc.user_id')\n -&gt;setMaxResults(5);\n\n\n $sql = $qbU-&gt;getSQL();\n\n $output-&gt;writeln($sql);\n\n $results = $this-&gt;connection-&gt;fetchAllAssociative($sql);\n foreach ($results as $result) {\n $output-&gt;writeln(&quot;User ID: &quot; . $result['id']); // Assuming 'u' is the User entity\n $output-&gt;writeln(&quot;Business Count: &quot; . $result['email']);\n $output-&gt;writeln(&quot;Business Count: &quot; . $result['count']);\n $output-&gt;writeln(&quot;----------------------------&quot;);\n }\n\n\n return Command::SUCCESS;\n }\n}\n\n</code></pre>\n<p>As you can see, first and foremost I need to get the connection from the entity manager:</p>\n<pre><code> $this-&gt;connection = $this-&gt;em-&gt;getConnection();\n</code></pre>\n<p>The Doctrine has 2 &quot;levels&quot; The DBAL that manages the Database connection and the queries on it and the ORM that is a Result mapping ontop of DBAL.</p>\n<p>Therefore, there are 2 query builders as well:</p>\n<ol>\n<li>One for DBAL</li>\n<li>One for ORM</li>\n</ol>\n<p>ORM uses it own SQL language named DQL. DQL does <strong>NOT</strong> subqueries, same this applied to the ORM query builder. In order to achieve this we need to <strong>bypass</strong> the ORM and interface with db using the <strong>DBAL</strong>.</p>\n<p>So at <code>execute</code> method we are using the query builder provided from <strong>DBAL</strong> and generate the <strong>SQL</strong> query instead of DQL.</p>\n<p>Using a seperate query builder in order to create the subquery first:</p>\n<pre><code>$businessCountQuery = $this-&gt;connection-&gt;createQueryBuilder()\n -&gt;select('count(id) as count,user_id')\n -&gt;from('business')\n -&gt;groupBy('user_id')\n -&gt;getSQL();\n</code></pre>\n<p>And we retrieve the generated SQL. At DBAL you cannot provide a subquery as is. Then upon the main query we provide the generated SQL:</p>\n<pre><code> $qbU = $this-&gt;connection-&gt;createQueryBuilder()\n -&gt;from('user', 'u')\n -&gt;select('u.*',&quot;bc.count&quot;)\n -&gt;join('u','('.$businessCountQuery.')','bc','u.id = bc.user_id')\n -&gt;setMaxResults(5);\n</code></pre>\n<p>Then we can execute it via:</p>\n<pre><code> $results = $this-&gt;connection-&gt;fetchAllAssociative($sql);\n</code></pre>\n<p>If we want, we can hydrate to an Entity (in order words, create an Entity object and populate the query result to it) as explained in this <a href="https://stackoverflow.com/a/56684721/4706711">answer</a>.</p>\n<hr />\n<h1>Bonus</h1>\n<p>In my entities I use a constant named <code>TABLE</code> so I can reference the table that entity creates:</p>\n<pre><code>&lt;?php\n\ndeclare(strict_types=1);\n\nnamespace App\\Entity;\n\nuse Doctrine\\ORM\\Mapping as ORM;\nuse App\\Entity\\Business;\n\n#[ORM\\Entity()]\n#[ORM\\Table(name: User::TABLE)]\nclass User\n{\n const TABLE = 'user';\n\n // Rest of code goes here.\n}\n\n</code></pre>\n<pre><code>&lt;?php\n\ndeclare(strict_types=1);\n\nnamespace App\\Entity;\n\nuse Doctrine\\ORM\\Mapping as ORM;\n\n#[ORM\\Entity]\n#[ORM\\Table(name: Business::TABLE)]\nclass Business\n{\n const TABLE='business';\n}\n\n</code></pre>\n<p>Therefore, I have a quick reference of the table that entity is <strong>without</strong> need to make an Entity instance for just the table.</p>\n<p>Therefore, I can use entity classes upon the <em>DBAL</em> Queries in order to reference the table using a static reference:</p>\n<pre><code>\nuse App\\Entity\\Business;\nuse App\\Entity\\User;\n\n// Rest of code goes here ommitted for simplicity\n\nclass TestQueryCommand extends Command\n{\n \n // Rest of code goes here ommitted for simplicity\n protected function execute(InputInterface $input, OutputInterface $output): int\n {\n\n $businessCountQuery = $this-&gt;connection-&gt;createQueryBuilder()\n -&gt;select('count(id) as count,user_id')\n -&gt;from(Business::TABLE )\n -&gt;groupBy('user_id')\n -&gt;getSQL();\n\n $qbU = $this-&gt;connection-&gt;createQueryBuilder()\n -&gt;from(User::TABLE, 'u')\n -&gt;select('u.*',&quot;bc.count&quot;)\n -&gt;join('u','('.$businessCountQuery.')','bc','u.id = bc.user_id')\n -&gt;setMaxResults(5);\n\n // rest of code goes here ommitted for readability\n }\n\n}\n</code></pre>\n<p>Though it is optional, it offers a reference between entity and table.</p>\n"^^ . + "php-8.4"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + . + "Why Laravel Sanctum still uses CSRF token for SPA auth?"^^ . + . + . + "2"^^ . + "Ah yes! HAHAHAHA, what a coincidence. Me and Troy are trying to actually setup a docker too but we are trying redis for that one. We haven't tried memcached there yet. We were actually talking about you yesterday. Anyway, thought of saying hi first. I'll check out the link, thank you!"^^ . + . + "[This article has some interesting information around this](https://www.alibabacloud.com/help/en/redis/support/what-do-i-do-if-the-cannot-assign-requested-address-error-is-returned-when-i-access-apsaradb-for-redis-over-short-lived-connections). "Applications that experience this error mostly use php-fpm and phpredis. In this architecture, when a large number of concurrent requests are being processed, TCP connections in the TIME-WAIT state increase and the client cannot allocate new ports. In this case, the `Cannot assign requested address` error is returned." Try using `pconnect` instead."^^ . + . + "2"^^ . + . + . + "How to use AJAX in a widget only on the admin backend?"^^ . + . + . + . + "1"^^ . + "1"^^ . + "Why are you setting the `additionalinfo` to be a random `string`? The only valid value listed in the API docs is `timeintransit`. Can you try by either removing `additionalinfo` or setting it to `timeintransit`?"^^ . + "This may still fail. It's saying it can't find `user on null`, which means `$image` is null. There should be another outer check that says `if($image)`. The controller code is just conjecture, since we're not sure how the OP is getting `$image`"^^ . + . + "twig"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + "UPS Rate API missing or invalid field"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + "1"^^ . + "Any error messages in the console? What does the response look like when you inspect it in the network panel?"^^ . + . + . + . + . + "<p>hello everyone I have Laravel Framework 10.48.28\nand mongodb 1.45.3</p>\n<p>I have two collections\n<code>permissions</code> &amp; <code>permission_curds</code></p>\n<pre><code>&lt;?php\nnamespace App\\Models;\n\nuse MongoDB\\Laravel\\Eloquent\\Model;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse MongoDB\\BSON\\ObjectId;\nclass Permission extends Model\n{\n protected $fillable = ['name'];\n public function permission_curds()\n {\n return $this-&gt;hasMany(Permission_curd::class, 'permission_id', '_id');\n }\n}\n</code></pre>\n<p>and this is my Permissino_curd model</p>\n<pre><code>&lt;?php\nnamespace App\\Models;\nuse MongoDB\\Laravel\\Eloquent\\Model;\nclass Permission_curd extends Model\n{\n protected $fillable =\n [\n 'permission_id', 'read', 'update', 'create', 'delete', 'restore', 'force_delete', 'model_id'\n ];\n}\n</code></pre>\n<p>Now I did this in my controller.</p>\n<pre><code>$permission = Permission::with('permission_curds')-&gt;first();\ndd($permission-&gt;permission_curds);\n</code></pre>\n<p>I get this result</p>\n<p><a href="https://i.sstatic.net/kao7WLb8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/kao7WLb8.png" alt="enter image description here" /></a></p>\n<p>empty array</p>\n<p>This is my permission collection.\n<a href="https://i.sstatic.net/eLXQQ4vI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/eLXQQ4vI.png" alt="enter image description here" /></a></p>\n<p>and this is my permission_curds collection\n<a href="https://i.sstatic.net/pBFYz6hf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pBFYz6hf.png" alt="enter image description here" /></a></p>\n<p>As you can see the _id is object to have relation\nive tried this</p>\n<pre><code>$permission_curds = Permission_curd::where('permission_id',Helper::object_id('67a71938dd8a9219ab0d632b'))-&gt;get();\ndd($permission_curds);\n</code></pre>\n<p>i get result\n<a href="https://i.sstatic.net/KntbAU3G.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/KntbAU3G.png" alt="enter image description here" /></a>\nnot empty array\nif i store the permission_id as normal string\nit works find but chatgpt told me do not store the foreign key as normal text store it as objectId\nthis is my Helper::object_id() function code</p>\n<pre><code>use MongoDB\\BSON\\ObjectId;\npublic static function object_id($id)\n{\n if ($id === null || $id instanceof ObjectId) {\n return $id;\n }\n return new ObjectId($id);\n}\n</code></pre>\n<p>Can anyone please help me\nthanks</p>\n"^^ . + . + "<p>You can set your Products IDs in an array and use PHP conditional function <code>in_array()</code> like:</p>\n<pre class="lang-php prettyprint-override"><code>add_filter( 'woocommerce_coupon_is_valid_for_product', 'quadlayers_exclude_product_from_product_promotions', 9999, 4 );\nfunction quadlayers_exclude_product_from_product_promotions( $valid, $product, $coupon, $values ) {\n $targeted_ids = array(49134, 49137, 29873, 43181, 49317, 114863, 117949, 120076, 122660, 129323);\n \n if ( in_array($product-&gt;get_id(), $targeted_ids) ) {\n $valid = false;\n }\n return $valid;\n}\n</code></pre>\n<p>It should work.</p>\n"^^ . + . + . + . + . + "1"^^ . + . + . + "1"^^ . + . + "0"^^ . + "<p>i have solve the problem thanks for every one helped me</p>\n<ul>\n<li><p>the problem was on the '.htaccess' file</p>\n</li>\n<li><p>i was't adding the size appropriately which is</p>\n</li>\n</ul>\n<pre><code>&lt;IfModule mod_php.c&gt;\n php_value upload_max_filesize 100M\n php_value post_max_size 100M\n&lt;/IfModule&gt;\n</code></pre>\n<ul>\n<li>the old form that didnt work with me</li>\n</ul>\n<pre><code>php_value upload_max_filesize 100M\nphp_value post_max_size 120M\n</code></pre>\n<p>*this one was proposed by Chat gpt</p>\n"^^ . + . + . + . + . + . + . + "3"^^ . + . + . + . + . + . + "0"^^ . + "-1"^^ . + . + "0"^^ . + . + "<p><strong>Environment</strong></p>\n<ul>\n<li>Frontend: React Application hosted on CloudFront</li>\n<li>Blog: WordPress hosted on Lightsail</li>\n<li>Domain: Using a single domain (xyz.com) without subdomains</li>\n<li>CDN: AWS CloudFront</li>\n</ul>\n<p><strong>Current Setup</strong></p>\n<ul>\n<li>Main domain (xyz.com) -&gt; React App</li>\n<li>Blog path (xyz.com/blog) -&gt; WordPress installation</li>\n<li>Using CloudFront behaviors to route <code>/blog/*</code> requests to WordPress origin</li>\n</ul>\n<p><strong>Desired Outcome</strong></p>\n<ul>\n<li>Serve React app from the main domain (xyz.com)</li>\n<li>Serve WordPress blog from xyz.com/blog</li>\n<li>Hide the actual WordPress installation URL</li>\n<li>Maintain full WordPress functionality including the admin panel</li>\n</ul>\n<p><strong>Issue</strong>\nWhen setting up CloudFront behavior for <code>/blog/*</code> to route to WordPress origin, the WordPress admin panel functionality breaks. Specifically:</p>\n<ul>\n<li>Some internal WordPress API calls are being incorrectly routed to xyz.com instead of the WordPress installation</li>\n<li>The admin panel becomes partially non-functional</li>\n<li>Regular blog viewing works fine, but administrative functions fail</li>\n</ul>\n<p><strong>What I've Tried</strong></p>\n<ol>\n<li>Added CloudFront origin pointing to WordPress installation</li>\n<li>Created behavior pattern for <code>/blog/*</code> to route to WordPress origin</li>\n<li>WordPress installation is functioning correctly when accessed directly</li>\n</ol>\n<p><strong>Questions</strong></p>\n<ol>\n<li>How can I properly configure CloudFront to handle both React app and WordPress admin functionality?</li>\n<li>What's the correct way to handle WordPress internal API calls in this setup?</li>\n<li>Are there specific WordPress settings or configurations needed for this setup?</li>\n</ol>\n<p><strong>Additional Context</strong></p>\n<ul>\n<li>Need to maintain a single domain for SEO purposes</li>\n<li>Want to avoid exposing actual WordPress installation URL</li>\n<li>Full admin functionality is crucial for content management</li>\n</ul>\n"^^ . + . + . + . + "0"^^ . + "1"^^ . + "visual-studio-code"^^ . + "0"^^ . + "It seems that during my installation and reading online topics, i used option 2 to Copy project's public folder to htdocs.\n\nIn the context of the above, i searched for the index.php which i found under D:\\xampp\\htdocs\\App\\public but didnt understand what should be done much.\n\nbelow is a copy of the index"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + "0"^^ . + "0"^^ . + . + . + "<p><strong>Issue: Error Creating UUID for ETX Receipt</strong></p>\n<p>Problem Statement:Despite following all the instructions provided by the source for generating a UUID for an ETX receipt, errors persist during the process.</p>\n<p>Source Instructions Followed:<a href="https://sdk.invoicing.eta.gov.eg/receiptissuancefaq/#how-to-generate-receipt-uuid" rel="nofollow noreferrer">The UUID generation steps were taken from the official guidelines available at:ETA Receipt Issuance FAQ - UUID Generation</a></p>\n<p>Steps Taken:</p>\n<p>Implemented the UUID generation logic as per the provided documentation.</p>\n<p>Ensured all required parameters were correctly formatted and included.</p>\n<p>Verified system date, time, and unique transaction identifiers.</p>\n<p>Checked for any potential conflicts or duplicate values.</p>\n<p>Attempted multiple runs with different test cases.</p>\n<p><strong>Encountered Errors:</strong></p>\n<p>Error messages related to UUID creation.</p>\n<p><strong>Request for Assistance:Seeking guidance on:</strong></p>\n<p>Debugging methods for UUID generation errors.</p>\n<p>Confirming the correct implementation of the required format.</p>\n<p>Understanding any additional requirements not explicitly mentioned in the documentation.</p>\n<p>Any insights or solutions from those who have successfully generated UUIDs for ETX receipts would be greatly appreciated.</p>\n<pre><code> /////// receiptData\n \n \n $date_now = gmdate(&quot;Y-m-d\\TH:i:s\\Z&quot;);\n \n \n $receiptData = [\n &quot;header&quot; =&gt; [\n &quot;dateTimeIssued&quot; =&gt; $date_now,\n &quot;receiptNumber&quot; =&gt; &quot;11111&quot;,\n &quot;uuid&quot; =&gt; &quot;&quot;,\n &quot;previousUUID&quot; =&gt; &quot;&quot;,\n &quot;referenceOldUUID&quot; =&gt; &quot;&quot;,\n &quot;currency&quot; =&gt; &quot;EGP&quot;,\n &quot;exchangeRate&quot; =&gt; 0,\n &quot;sOrderNameCode&quot; =&gt; &quot;sOrderNameCode&quot;,\n &quot;orderdeliveryMode&quot; =&gt; &quot;&quot;,\n &quot;grossWeight&quot; =&gt; 6.58,\n &quot;netWeight&quot; =&gt; 6.89\n ],\n &quot;documentType&quot; =&gt; [\n &quot;receiptType&quot; =&gt; &quot;S&quot;,\n &quot;typeVersion&quot; =&gt; &quot;1.2&quot;\n ],\n &quot;seller&quot; =&gt; [\n &quot;rin&quot; =&gt; &quot;249628635&quot;,\n &quot;companyTradeName&quot; =&gt; &quot;Mahmoud Mahros&quot;,\n &quot;branchCode&quot; =&gt; &quot;0&quot;,\n &quot;branchAddress&quot; =&gt; [\n &quot;country&quot; =&gt; &quot;EG&quot;,\n &quot;governate&quot; =&gt; &quot;cairo&quot;,\n &quot;regionCity&quot; =&gt; &quot;city center&quot;,\n &quot;street&quot; =&gt; &quot;16 street&quot;,\n &quot;buildingNumber&quot; =&gt; &quot;14BN&quot;,\n &quot;postalCode&quot; =&gt; &quot;74235&quot;,\n &quot;floor&quot; =&gt; &quot;1F&quot;,\n &quot;room&quot; =&gt; &quot;3R&quot;,\n &quot;landmark&quot; =&gt; &quot;tahrir square&quot;,\n &quot;additionalInformation&quot; =&gt; &quot;talaat harb street&quot;\n ],\n &quot;deviceSerialNumber&quot; =&gt; &quot;100010001010&quot;,\n &quot;syndicateLicenseNumber&quot; =&gt; &quot;100010001010&quot;,\n &quot;activityCode&quot; =&gt; &quot;4922&quot;\n ],\n &quot;buyer&quot; =&gt; [\n &quot;type&quot; =&gt; &quot;P&quot;,\n &quot;id&quot; =&gt; &quot;29308263200032&quot;,\n &quot;name&quot; =&gt; &quot;mahmoud mahros&quot;,\n &quot;mobileNumber&quot; =&gt; &quot;+201020567462&quot;,\n &quot;paymentNumber&quot; =&gt; &quot;987654&quot;\n ],\n &quot;itemData&quot; =&gt; [\n [\n &quot;internalCode&quot; =&gt; &quot;880609&quot;,\n &quot;description&quot; =&gt; &quot;Samsung A02 32GB_LTE_BLACK_DS_SM-A022FZKDMEB_A022 _ A022_SM-A022FZKDMEB&quot;,\n &quot;itemType&quot; =&gt; &quot;EGS&quot;,\n &quot;itemCode&quot; =&gt; &quot;EG-249628635-1&quot;,\n &quot;unitType&quot; =&gt; &quot;EA&quot;,\n &quot;quantity&quot; =&gt; 35,\n &quot;unitPrice&quot; =&gt; 247.96000,\n &quot;netSale&quot; =&gt; 7810.74000,\n &quot;totalSale&quot; =&gt; 8678.60000,\n &quot;total&quot; =&gt; 8887.04360,\n &quot;commercialDiscountData&quot; =&gt; [\n [\n &quot;amount&quot; =&gt; 867.86000,\n &quot;description&quot; =&gt; &quot;XYZ&quot;,\n &quot;rate&quot; =&gt; 2.3\n ]\n ],\n &quot;itemDiscountData&quot; =&gt; [\n [\n &quot;amount&quot; =&gt; 10,\n &quot;description&quot; =&gt; &quot;ABC&quot;,\n &quot;rate&quot; =&gt; 2.3\n ],\n [\n &quot;amount&quot; =&gt; 10,\n &quot;description&quot; =&gt; &quot;XYZ&quot;,\n &quot;rate&quot; =&gt; 4.0\n ],\n [\n &quot;amount&quot; =&gt; 11,\n &quot;description&quot; =&gt; &quot;SSS&quot;,\n &quot;rate&quot; =&gt; 4.0\n ]\n ],\n &quot;valueDifference&quot; =&gt; 20,\n &quot;taxableItems&quot; =&gt; [\n [\n &quot;taxType&quot; =&gt; &quot;T1&quot;,\n &quot;amount&quot; =&gt; 1096.30360,\n &quot;subType&quot; =&gt; &quot;V009&quot;,\n &quot;rate&quot; =&gt; 14\n ]\n ]\n ]\n ],\n &quot;totalSales&quot; =&gt; 8678.60000,\n &quot;totalCommercialDiscount&quot; =&gt; 867.86000,\n &quot;totalItemsDiscount&quot; =&gt; 20,\n &quot;extraReceiptDiscountData&quot; =&gt; [\n [\n &quot;amount&quot; =&gt; 0,\n &quot;description&quot; =&gt; &quot;ABC&quot;,\n &quot;rate&quot; =&gt; 10\n ]\n ],\n &quot;netAmount&quot; =&gt; 7810.74000,\n &quot;feesAmount&quot; =&gt; 0,\n &quot;totalAmount&quot; =&gt; 8887.04360,\n &quot;taxTotals&quot; =&gt; [\n [\n &quot;taxType&quot; =&gt; &quot;T1&quot;,\n &quot;amount&quot; =&gt; 1096.30360\n ]\n ],\n &quot;paymentMethod&quot; =&gt; &quot;C&quot;,\n &quot;adjustment&quot; =&gt; 0,\n &quot;contractor&quot; =&gt; [\n &quot;name&quot; =&gt; &quot;contractor1&quot;,\n &quot;amount&quot; =&gt; 2.563,\n &quot;rate&quot; =&gt; 2.3\n ],\n &quot;beneficiary&quot; =&gt; [\n &quot;amount&quot; =&gt; 20.569,\n &quot;rate&quot; =&gt; 2.147\n ]\n ];\n \n \n function generateReceiptUUID(array $receipt): string {\n // Ensure UUID is empty before generation\n $receipt['header']['uuid'] = &quot;&quot;;\n \n // Normalize the receipt object by serializing and flattening\n $normalizedString = normalizeReceipt($receipt);\n \n // Create SHA-256 hash\n $hash = hash('sha256', $normalizedString);\n \n return strtoupper($hash); // Convert to uppercase (if required)\n }\n \n function normalizeReceipt(array $receipt): string {\n // Sort keys to maintain consistency\n ksort($receipt);\n \n $normalizedString = &quot;&quot;;\n foreach ($receipt as $key =&gt; $value) {\n if (is_array($value)) {\n // Recursive call for nested arrays\n $normalizedString .= strtoupper($key) . normalizeReceipt($value);\n } else {\n // Append key and value in normalized format\n $normalizedString .= strtoupper($key) . '&quot;' . $value . '&quot;';\n }\n }\n \n return $normalizedString;\n }\n \n $uuid = generateReceiptUUID($receiptData);\n \n $receiptData[&quot;header&quot;][&quot;uuid&quot;] = $uuid;\n \n $formattedData = [\n &quot;receipts&quot; =&gt; [$receiptData] // تغليف البيانات داخل مصفوفة\n ];\n \n echo $formattedData;\n \n</code></pre>\n<hr />\n<p>The error</p>\n<pre><code>{\n &quot;rejectedDocuments&quot;: [\n {\n &quot;receiptNumber&quot;: &quot;11111&quot;,\n &quot;uuid&quot;: &quot;12EA4F6A2399445077232FD50FD2E605949D29E30DE02AF5F5EC7A6BF613678C&quot;,\n &quot;error&quot;: {\n &quot;message&quot;: &quot;Validation Error&quot;,\n &quot;target&quot;: &quot;12EA4F6A2399445077232FD50FD2E605949D29E30DE02AF5F5EC7A6BF613678C&quot;,\n &quot;details&quot;: [\n {\n &quot;code&quot;: &quot;CF440&quot;,\n &quot;message&quot;: &quot;Valid UUID is required&quot;,\n &quot;target&quot;: &quot;uuid&quot;,\n &quot;propertyPath&quot;: &quot;header.uuid&quot;\n }\n ]\n }\n }\n ],\n &quot;header&quot;: {\n &quot;statusCode&quot;: &quot;Success&quot;,\n &quot;code&quot;: &quot;Success&quot;,\n &quot;details&quot;: [],\n &quot;correlationId&quot;: &quot;0HNAR040EIOSG:00000002&quot;,\n &quot;requestTime&quot;: &quot;2025-03-22T09:26:50.9192819Z&quot;,\n &quot;responseProcessingTimeInTicks&quot;: 392660\n }\n}\n</code></pre>\n"^^ . + "Just to reiterate what was mentioned in the first comment - you can commit dependencies, eg your whole `vendor/` dir, so you don't need to run composer on the target machine. I'm not really sure why it is regarded as bad practice - requiring `composer install` during deploy seems like needlessly adding an extra step, risk, and potential point of failure at a point you really don't want trouble."^^ . + "1"^^ . + . + . + "The same goes for `Country`."^^ . + "The data that is being fetched from the API endpoint is not under my control, so we can't remove iframe tag from there . We have to remove it after fetching the data from there. That's why I am using in-built function from wordpress but they are not working as expected"^^ . + . + "0"^^ . + "0"^^ . + "2"^^ . + "<p>Getting the following error. Fatal error: Uncaught TypeError: Cannot access offset of type string on string in C:\\xampp\\htdocs\\pauline project1\\getEmployee.php:50 Stack trace: #0 {main} thrown in C:\\xampp\\htdocs\\pauline project1\\getEmployee.php on line 50</p>\n<pre><code>&lt;?php\nrequire_once(&quot;database.php&quot;);\n$sql=&quot;SELECT * FROM employee_details&quot;;\n\n$result = $conn-&gt;query($sql);\nif($result-&gt;num_rows&gt;0){\n $data = $result-&gt;fetch_assoc();\n}else{\necho&quot;0 results&quot;;\n}\nmysqli_close($conn);\n?&gt;\n\n&lt;!DOCTYPE html&gt;\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n &lt;meta charset=&quot;utf-8&quot;&gt;\n &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;\n &lt;title&gt;Employee&lt;/title&gt;\n &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;styled.css&quot;&gt;\n&lt;/head&gt;\n&lt;body&gt;\n &lt;div class=&quot;container&quot;&gt;\n &lt;nav&gt;\n &lt;div&gt;\n &lt;ul&gt;\n &lt;li&gt;\n &lt;a href=&quot;home.php&quot;&gt;Home&lt;/a&gt;\n &lt;/li&gt;\n &lt;li&gt;\n &lt;a href=&quot;getEmployee.php&quot;&gt;Employees&lt;/a&gt;\n &lt;/li&gt;\n &lt;li&gt;\n &lt;a href=&quot;newEmployee.php&quot;&gt;New Employees&lt;/a&gt;\n &lt;/li&gt;\n &lt;/ul&gt;\n &lt;/div&gt;\n &lt;/nav&gt;\n &lt;div class=&quot;body-home&quot;&gt;\n &lt;table border=&quot;1&quot;&gt;\n &lt;tr&gt;\n &lt;th&gt;Employee name&lt;/th&gt;\n &lt;th&gt;Employee position&lt;/th&gt;\n &lt;th&gt;Employee hours worked&lt;/th&gt;\n &lt;th&gt;Employee hourly rate&lt;/th&gt;\n &lt;/tr&gt;\n &lt;?php foreach($data as $row): ?&gt;\n &lt;tr&gt;\n &lt;td&gt;&lt;?= htmlspecialchars($row['empName']) ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?= htmlspecialchars($row['empositon']) ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?= htmlspecialchars($row['emphoursworked']) ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?= htmlspecialchars($row['emphourlyrate']) ?&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php endforeach ?&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n"^^ . + "No success in my attempts to place that annotation so far. Also this might be related insofar as PHPStan assumes a type upfront and then doesn't accept potential other value types later. https://github.com/phpstan/phpstan/issues/9181"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + "0"^^ . + "Unable to install gd extension on redhat 9 php remi php8.2"^^ . + . + . + . + . + "I checked the database, it has the Andr\\xc3\\xa9"^^ . + . + . + . + "3"^^ . + . + . + . + . + . + . + . + "browser"^^ . + . + . + . + . + . + . + . + . + . + "what shell is this, show output of `echo $SHELL`"^^ . + . + . + . + "@StellanCoder they didn't use any external tool, they just set `CURLOPT_VERBOSE=>1` to make cURL print details about the request it is making, to the console."^^ . + "2"^^ . + "0"^^ . + . + "@hakre I edited the question to include the line from the PHP script that calls the bash script. The rest of the bash script is fairly well runnable, provided one takes the time to set up their own server to pull their own repo, and sets up all the local folders, and makes sure git and nvm are up to date. You and I both know no one is doing that. I didn't see the note about shellcheck, but I agree with Gordon Davisson - whatever it would find wouldn't be terribly useful considering that *the script runs successfully every time, even when run by PHP*. The problem is the waiting."^^ . + "@KIKO Software. The reason why I use JSON_UNESCAPED_UNICODE is that I need to deal with Chinese Character. Anyway, I have tried your suggestion and it works smoothly. Thx very much."^^ . + "<p>I have a site which has private access. Access is permitted when the user is validated using authentication code in the PHP pages they are accessing. This all works fine and dandy.</p>\n<p>However, the pages link to resources (images, videos, etc) for which there is no authentication. Thus, theoretically, those resources could be accessed from an unauthorized user. I could simply use mod_auth_basic or similar on the directory containing the resources, but this would require users to log in twice - once for the pages and once for the resources.</p>\n<p>Is there a way I can have apache only serve the files if the request comes only from certain resource?</p>\n<p>Or are there any other suggestions to accomplish what I want?</p>\n"^^ . + . + . + . + . + "I'm suggesting seeing if you can run the binary directly from the command line (presuming you have command line access to your web server). I put the full path to the binary for clarity and to emulate what the PHP code is doing (see https://github.com/MaestroError/php-heic-to-jpg/blob/cebe7319dcecbcb8bb03102151a82c9e235080e4/src/HeicToJpg.php#L159)"^^ . + "0"^^ . + "<p>You are right. Please report this bug on PHPStan’s GitHub.</p>\n"^^ . + . + "0"^^ . + . + . + "Xero API PKCE giving Invalid_client error"^^ . + "0"^^ . + . + "Let's clarify some things here. What are you after here? There are many questions you should be asking like: why are you using twemproxy? Why are you using Redis? Are you aware of what has been going on with Redis the company? Are you aware of what has been going on with forks/alternatives to Redis? Are you aware that Redis has scaling solutions built for it (Redis Cluster)? Why are you load testing from Kubernetes using k6, some docker containers you are spinning up (for development) with a docker compose? With that said @maiorano84's post seems valuable.... more in next comment."^^ . + . + "0"^^ . + . + . + "When a file is not found, anything below the error is a no show, how can I fix this?"^^ . + "2"^^ . + "crash"^^ . + . + . + "I corrected the DBFIDDLE, there was one line commented, but that should not be done.... "^^ . + . + "<p>Using <code>curl -I -L https://www.casamarx.com.br</code> shows the redirect is done by WP to the non-www variant. Then your nginx config redirects back to the www-variant.</p>\n<p>Either change nginx to redirect to non-www, or set <code>WP_HOME</code> and <code>WP_SITEURL</code> to your site with www, e.g. using <code>wp-config.php</code>:</p>\n<pre class="lang-none prettyprint-override"><code>define('WP_HOME', 'https://www.casamarx.com.br');\ndefine('WP_SITEURL', 'https://www.casamarx.com.br');\n</code></pre>\n<p>When this works, you can change the URLs accordingly in WP General Settings and remove the 2 definitions from <code>wp-config</code>.</p>\n<p>See: <a href="https://www.wpbeginner.com/wp-tutorials/how-to-change-your-wordpress-site-urls-step-by-step/" rel="nofollow noreferrer">https://www.wpbeginner.com/wp-tutorials/how-to-change-your-wordpress-site-urls-step-by-step/</a></p>\n"^^ . + "@krisgjika i have the problem the form show ok and insert data to db. and all work fine. But when i implement a button to reset the table and start from zero the number sequence i get an error becouse the db is empty and the blade template get an empty variable. so i get a laravel error and the page not show"^^ . + . + "php-carbon"^^ . + . + . + "apache"^^ . + . + "0"^^ . + "0"^^ . + "My program was not converting the code. But the quick html form I built to test things out had no <meta charset="utf-8"> statement. This was causing the & #128512;. When I added that statement to the form and submitted, the emoji was submitted as 240, 159, 152, 128. So I don't have to worry about converting after all. So your posts assisted me in figuring out what I need to do. Thank you. I feel bad that things got unpleasant in these posts. I was doing my best all along to treat your posts seriously and respond accordingly. Clearly you are very knowledgeable in these areas."^^ . + . + "0"^^ . + . + "WooCommerce tables used for HPOS are different than legacy WordPress ones: With HPOS, the billing and shipping address data is located in `wp_wc_order_addresses` DB table and meta data is located in `wp_wc_orders_meta` DB table... You can always save the desired data (shipping first and last name) as custom order **meta data** (and for previous existing orders you can execute a custom SQL query to save the desired data (shipping first and last name) as custom order meta data, in a unique SQL query). This way, you will be able to use your current code successfully."^^ . + "PHP Workerman. Multiple processes in foreach loop"^^ . + . + "What do you mean?\nI asking about migration with money datatype in Laravel for SQL Server."^^ . + . + . + . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + "1"^^ . + . + "gpio"^^ . + . + . + . + . + "Please do [edit] your question with updates and info like this, rather than burying it (unformatted) in the comments. Then your post is coherent."^^ . + . + "0"^^ . + . + . + "Using different samesite cookie value in different pages"^^ . + "1"^^ . + "If class B is used somewhere, I'd want to refactor it to use class C. B shouldn't overwrite a method of C (since C is the child to B)."^^ . + "0"^^ . + "How to switch to php8.3 on Fedora 41?"^^ . + "laravel-sanctum"^^ . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + . + "<p>I'm creating the budget app using mvc pattern. On the balance sheet display page I have a drop-down menu from which the user can select the time period for which the balance sheet is to be displayed (it is in the form of tables for income and expenses). After the user selects an option, it immediately jumps to the default &quot;Wybierz okres czasu&quot;, and the one selected by the user should be preserved. In addition, after selecting, for example, &quot;bieżący miesiąc&quot;, only records for the current month should appear in the tables, and nothing changes and all of them are still displayed. Additionally, when I go to the page number from the navigation, e.g. 2, and select an option from the menu there, it immediately jumps to the first page. I've checked that the form doesn't send any values ​​from the form at all. It returns an empty array. Please help me figure out why this is happening.\nThis is a form for selecting a time period:</p>\n<pre><code>&lt;section&gt;\n &lt;?php\n $selected_period = $oldFormData['time-slot'] ?? '';\n $start_day = $oldFormData['startDay'] ?? '';\n $end_day = $oldFormData['endDay'] ?? '';\n ?&gt;\n\n &lt;form id=&quot;form_balance&quot; method=&quot;post&quot; action=&quot;?p=&lt;?= $_GET['p'] ?? '' ?&gt;&quot;&gt;\n\n &lt;?php include $this-&gt;resolve('partials/_csrf.php') ?&gt;\n &lt;div class=&quot;check-period&quot;&gt;\n &lt;div&gt;\n &lt;label for=&quot;time-slot&quot;&gt;\n &lt;select id=&quot;time-slot&quot; name=&quot;time-slot&quot; onchange=&quot;this.form.submit()&quot;&gt;\n &lt;option selected disabled&gt;Wybierz okres czasu&lt;/option&gt;\n &lt;option value=&quot; bieżący_miesiąc&quot; &lt;?php echo $selected_period === 'bieżący_miesiąc' ? 'selected' : ''; ?&gt;&gt;\n bieżący miesiąc&lt;/option&gt;\n &lt;option value=&quot;poprzedni_miesiąc&quot; &lt;?php echo $selected_period === 'poprzedni_miesiąc' ? 'selected' : ''; ?&gt;&gt;\n poprzedni miesiąc&lt;/option&gt;\n &lt;option value=&quot;bieżący_rok&quot; &lt;?php echo $selected_period === 'bieżący_rok' ? 'selected' : ''; ?&gt;&gt;\n bieżący rok&lt;/option&gt;\n &lt;option value=&quot;niestandardowy&quot; &lt;?php echo $selected_period === 'niestandardowy' ? 'selected' : ''; ?&gt;&gt;\n niestandardowy&lt;/option&gt;\n &lt;/select&gt;\n &lt;/label&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/form&gt;\n &lt;/section&gt;\n</code></pre>\n<p>This is the createViewShowBalance() function from TransactionController.php file that supports form:</p>\n<pre><code>$page = $_POST['p'] ?? $_GET['p'] ?? 1;\n$page = max(1, (int) $page);\n$length = 3;\n$offset = ($page - 1) * $length;\n$searchTerm = $_GET['s'] ?? null;\n\n$userId = $_SESSION['user'];\n$oldFormData = $_POST ?? [];\n\n$selected_period = $oldFormData['time-slot'] ?? null;\n$startDay = $endDay = null;\n\nif ($selected_period) {\n switch ($selected_period) {\n case 'bieżący_miesiąc':\n $startDay = date('Y-m-01');\n $endDay = date('Y-m-d');\n break;\n case 'poprzedni_miesiąc':\n $startDay = date('Y-m-01', strtotime('-1 month'));\n $endDay = date('Y-m-t', strtotime('-1 month'));\n break;\n case 'bieżący_rok':\n $startDay = date('Y-01-01');\n $endDay = date('Y-m-d');\n break;\n case 'niestandardowy':\n if (!empty($oldFormData['startDay']) &amp;&amp; !empty($oldFormData['endDay'])) {\n $startDay = $oldFormData['startDay'];\n $endDay = $oldFormData['endDay'];\n } else {\n echo &quot;Nie wybrano poprawnych dat dla niestandardowego okresu.&quot;;\n }\n break;\n default:\n echo &quot;Nieprawidłowy wybór okresu.&quot;;\n break;\n }\n}\n\n\nif (!empty($startDay) &amp;&amp; !empty($endDay)) {\n $sumIncomes = $this-&gt;transactionsService-&gt;sumIncomesByPeriod($startDay, $endDay, $userId);\n $sumExpenses = $this-&gt;transactionsService-&gt;sumExpensesByPeriod($startDay, $endDay, $userId);\n\n [$incomes, $incomesCount] = $this-&gt;transactionsService-&gt;getUserIncomesByPeriod(\n $startDay,\n $endDay,\n $userId,\n $length,\n $offset\n );\n [$expenses, $expensesCount] = $this-&gt;transactionsService-&gt;getUserExpensesByPeriod(\n $startDay,\n $endDay,\n $userId,\n $length,\n $offset\n );\n} else {\n $sumIncomes = $this-&gt;transactionsService-&gt;sumIncomes($userId);\n $sumExpenses = $this-&gt;transactionsService-&gt;sumExpenses($userId);\n\n [$incomes, $incomesCount] = $this-&gt;transactionsService-&gt;getUserIncomes(\n $length,\n $offset\n );\n [$expenses, $expensesCount] = $this-&gt;transactionsService-&gt;getUserExpenses(\n $length,\n $offset\n );\n}\n\n$totalCount = max($incomesCount, $expensesCount);\n\n$lastPage = (int) max(1, ceil($totalCount / $length));\n$page = min($page, $lastPage);\n$pages = $lastPage ? range(1, $lastPage) : [];\n\n$pageLinks = array_map(\n fn($pageNum) =&gt; http_build_query([\n 'p' =&gt; $pageNum,\n 's' =&gt; $searchTerm\n ]),\n $pages\n);\n\necho $this-&gt;view-&gt;render(\n &quot;transactions/show_balance.php&quot;,\n [\n 'incomes' =&gt; $incomes,\n 'expenses' =&gt; $expenses,\n 'currentPage' =&gt; $page,\n 'previousPageQuery' =&gt; http_build_query([\n 'p' =&gt; max(1, $page - 1),\n 's' =&gt; $searchTerm\n ]),\n 'lastPage' =&gt; $lastPage,\n 'nextPageQuery' =&gt; http_build_query([\n 'p' =&gt; min($lastPage, $page + 1),\n 's' =&gt; $searchTerm\n ]),\n 'pageLinks' =&gt; $pageLinks,\n 'searchTerm' =&gt; $searchTerm,\n 'sumIncomes' =&gt; $sumIncomes,\n 'sumExpenses' =&gt; $sumExpenses,\n 'expensesCount' =&gt; $expensesCount,\n 'incomesCount' =&gt; $incomesCount,\n 'oldFormData' =&gt; $oldFormData,\n 'selected_period' =&gt; $selected_period,\n 'startDay' =&gt; $startDay,\n 'endDay' =&gt; $endDay\n ]\n);\n</code></pre>\n"^^ . + . + . + "0"^^ . + "<p>Scrolling down event the server side is sent data with page by page, received successfully and the data item is also combined by the previous page and next page data item, but Twitter typehead only renders first page data item, <strong>but it does not update the suggestion item list by the next page's data item when scrolling down</strong>.</p>\n"^^ . + . + . + "2"^^ . + "0"^^ . + "1"^^ . + "1"^^ . + "3"^^ . + "curl"^^ . + . + . + . + "@Sierra Walker If possible, share your GitHub repo?"^^ . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + ""I was wondering if something else is available which can be married to the timer" - yes, using Javascript, you can achieve this"^^ . + . + . + . + . + "@KeyboardCorporation it seems i've resolved it... really weird"^^ . + "<p>With WordPress, I'm using Advanced Custom Fields with a repeater field <a href="https://www.advancedcustomfields.com/resources/repeater/" rel="nofollow noreferrer">https://www.advancedcustomfields.com/resources/repeater/</a> and I'm trying to work out how to add some conditions to the repeater loop to conditionally display some repeater rows.</p>\n<p>Right now, this works and displays all repeater fields:</p>\n<pre><code>if (have_rows('repeater')): \n\n echo '&lt;div class=&quot;container-fluid&quot;&gt;&lt;div class=&quot;row&quot;&gt;';\n\n while( have_rows('repeater') ): the_row();\n\n echo '&lt;div class=&quot;col&quot;&gt;';\n echo '&lt;div class=&quot;title&quot;&gt;';\n the_sub_field('title');\n echo '&lt;/div&gt;&lt;/div&gt;';\n \n endwhile;\n\n echo '&lt;/div&gt;&lt;/div&gt;';\n\n endif;\n</code></pre>\n<p>And that outputs:</p>\n<pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;container-fluid&quot;&gt;\n &lt;div class=&quot;row&quot;&gt;\n\n &lt;div class=&quot;col&quot;&gt;\n &lt;div class=&quot;title&quot;&gt;\n The title\n &lt;/div&gt;\n &lt;/div&gt;\n\n &lt;div class=&quot;col&quot;&gt;\n &lt;div class=&quot;title&quot;&gt;\n Another title\n &lt;/div&gt;\n &lt;/div&gt;\n\n &lt;/div&gt;\n&lt;/div&gt;\n\n// and on and on\n</code></pre>\n<p>But what I need to do is display some repeater rows, depending on two conditions: if the user is logged in, and if the repeater subfield show_only_to_logged_in_admins has the value of 1. After any/all of those conditional rows are displayed, I need to <em>continue the repeater loop</em> and display the rest of the repeater rows.</p>\n<p>What I have right now, the code below, displays only the rows with the subfield show_only_to_logged_in_admins at the value of 1 to users who are logged-in administrators, and it displays no rwos to non-logged users and when show_only_to_logged_in_admins field value is 0.</p>\n<pre><code>if (have_rows('repeater')): \n\n echo '&lt;div class=&quot;container-fluid&quot;&gt;&lt;div class=&quot;row&quot;&gt;';\n\n while( have_rows('repeater') ): the_row();\n\n $show_only = get_sub_field('show_only_to_logged_in_admins');\n $current_user = wp_get_current_user();\n\n if ((user_can( $current_user, 'administrator' )) &amp; ($show_only == 1)) {\n\n echo '&lt;div class=&quot;col&quot;&gt;';\n echo '&lt;div class=&quot;title&quot;&gt;';\n the_sub_field('title');\n echo '&lt;/div&gt;&lt;/div&gt;';\n\n }\n\n endwhile;\n\n echo '&lt;/div&gt;&lt;/div&gt;';\n\nendif;\n</code></pre>\n<p>But what I need is this:</p>\n<pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;container-fluid&quot;&gt;\n &lt;div class=&quot;row&quot;&gt;\n\n// the rows that are shown to logged users and when\n// the repeater subfield show_only_to_logged_in_admins\n// has the value of 1\n\n &lt;div class=&quot;col&quot;&gt;\n &lt;div class=&quot;title&quot;&gt;\n The title\n &lt;/div&gt;\n &lt;/div&gt;\n\n// and on and on\n\n// and then the rest of the repeater rows\n\n &lt;div class=&quot;col&quot;&gt;\n &lt;div class=&quot;title&quot;&gt;\n Another title\n &lt;/div&gt;\n &lt;/div&gt;\n\n &lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n<p>How can I display the conditional rows, and then continue the loop for all the rest of the rows?</p>\n<p>Would I use a nested while or do-while loop for the conditionals? Nested inside the main repeater loop <code>while( have_rows('repeater') ): the_row();</code> ?</p>\n"^^ . + "Or you could use only SQL part, using https://sqlize.online/, that would demonstrate an SQL query either "doesn't update" a different value or returns 0 affected rows after an actual update. But either way it must be a *working code that recreates the problem you are observing*."^^ . + . + . + "I had $product go through a filter, and couldn't access data properly, so I couldn't get the booking ID. Ended up accessing the "booking" array on $product_data:\n $booking_data_store = $product_data['booking'];\n $start_date = $booking_data_store['_start_date'];\n $end_date = $booking_data_store['_end_date'];\n\nThanks for the help though :)"^^ . + . + "1"^^ . + "<pre><code>\n\nfunction intToRomanianOrReverse($value, bool $array = true) {\n static $nfh = new \\NumberFormatter('@numbers=roman', \\NumberFormatter::DECIMAL);\n\n return $nfh-&gt;{$array ? 'format' : 'parse'}($value);\n}\n\nfunction intToRomanNumeral(int $value): ?string {\n return intToRomanianOrReverse($value, true);\n}\n\nfunction romanNumeralToInt(string $roman): ?int {\n return intToRomanianOrReverse($value, false);\n}\n</code></pre>\n"^^ . + . + . + . + . + . + "WAMPServer, much like XAMPP but you can configure each Virtual Host to use a different version of PHP using PHP as FCGI"^^ . + "Nope, not a brace -- you have an unclosed double quote earlier in the file. Use an editor/IDE with syntax highlighting and this sort of issue becomes rather trivial to spot. And/or `git log` to see what the last change was, because you're using source control, right?"^^ . + "probability"^^ . + "What do you mean "it didn't work"? you get an error or something? I'm using it in code working right here."^^ . + . + . + . + "0"^^ . + . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + "unix"^^ . + . + . + . + "@LoicTheAztec I apologize for the inaccuracies in my question. I am referring to products on sale."^^ . + . + "1"^^ . + . + "Are string-backed enums useful as string constant dumps in PHP?"^^ . + "Please add all clarification **to your question** by editing it. Also, can you check which of these calls take so much time?"^^ . + . + . + "Do you have a question for us? Is the code not working for you? Do you get an error message? I do notice that you don't handle any errors that might occur during execution, is that intentional?"^^ . + "Why jQuery, instead of Vanilla JavaScript?"^^ . + "<p>I’m building a social media network the person i’m learning step by step on is doing it without a username just a email &amp; password to sign in. Within that i’m now on the Handling Login errors &amp; since mines is username &amp; not email it’s hard to figure out what to type this is his coding.</p>\n<pre><code>&lt;?php\nIf(isset($_Post[‘log_button’])){\n\n$email = filter_var($_POST[‘log_email’]), FILTER_SANITIZE_EMAIL); //sanitize email\n\n$_SESSION[‘log_email’] = $email; //Store email into session variable\n$password = md5($_POST[‘log_password’]); //Get password\n\n$check_database_query = mysqli_query($con, “SELECT * FROM users WHERE email=‘$email’ AND password=‘$password’”);\n\nIf($check_login_query ==1) {\n$row = mysqli_fetch_array($check_database_query);\n</code></pre>\n<p>$username = $row[‘username’];</p>\n<pre><code>$_SESSION[‘username’] = $username\n</code></pre>\n<p>header(“Location: index.php”);\nexit();</p>\n<pre><code>}\n}\n\n?&gt;\n</code></pre>\n<p>The first line with the sanitize i’m not sure what code to use to sanitize a username when I looked it up sanitizeUser was a coding but it doesn’t allow that. It says Fatal error: Uncaught error: Undefined constant “sanitizeUsername”. I changed it to just\n$username = filter_var($_POST[‘log_username’]);\nEverything that said email I replaced with username so my code looks like this</p>\n<pre><code>&lt;?php\n</code></pre>\n<p>If(isset($_Post[‘login_button])) {</p>\n<pre><code>$username = filter_var($_POST[‘log_username’]);\n\n$_SESSION[‘log_username’] = $username; //Store username into session variable\n$password = md5($_POST[‘log_password’]); //Get password\n\n$check_database_query = mysqli_query($con, “SELECT * FROM users WHERE username=‘$username’ AND password=‘$password’”);\n\nIf($check_login_query ==1) {\n$row = mysqli_fetch_array($check_database_query);\n</code></pre>\n<p>$username = $row[‘username’];</p>\n<pre><code>$_SESSION[‘username’] = $username\n</code></pre>\n<p>header(“Location: index.php”);\nexit();</p>\n<pre><code>}\n}\n?&gt;\n</code></pre>\n<p>I can’t log in no more! Need help!!</p>\n"^^ . + . + . + "Please add all clarification to your question by editing it. Also, share how this problem is related to [tag:project] or [tag:organization], or remove these tags if they are irrelevant"^^ . + "Does the [information here](https://stackoverflow.com/a/34883260/7644018) help? Also check the comments too. Also [see other answers](https://stackoverflow.com/search?tab=relevance&q=curl%2060%20error&searchOn=3) about the same error, in case something else might be helpful."^^ . + "Please add all clarification (including all kinds of code!) to your question by editing it. Also, if the tag Laravel 6 was only added by accident, what about that version information in the text? The most recent version of the v6.18 branch was published in Oct 2020...."^^ . + . + . + "templates"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + "1"^^ . + . + "1"^^ . + . + . + . + "laravel-filament"^^ . + . + "I Thought so, thanks"^^ . + "0"^^ . + . + . + . + . + . + "Thank you, Loic. This is a good workaround. This will buy us time as we go through and manually place the variations in the alpha order. If I'm interpreting this correctly -- it's sorting by the variation slug. Correct?\n\nQuestion: Is there a way I could run a one-time script or plugin that would place all the variations in alpha order across the site?"^^ . + "1"^^ . + "0"^^ . + "0"^^ . + "Is it related to Doctrine and how Doctrine creates queries through Query builder"^^ . + "<p>I'm encountering the following error when attempting to upload an image in my Laravel project:</p>\n<blockquote>\n<p>Error: Illuminate\\Http\\Exceptions\\PostTooLargeException</p>\n</blockquote>\n<p>I understand that this issue is related to file size limitations. Based on my research, I modified the following settings in my php.ini file:</p>\n<pre><code>post_max_size=1g\nupload_max_filesize=1g\nmax_execution_time=3000\nmax_input_time=3000\n</code></pre>\n<p>After making these changes, I restarted Apache, but the error persists.</p>\n<h4>What I Have Tried</h4>\n<ul>\n<li>Updated <code>php.ini</code> settings (as shown above)</li>\n<li>Restarted Apache and MySQL to apply changes</li>\n<li>Checked Laravel configuration to ensure proper file storage settings</li>\n<li>Verified that the correct <code>php.ini</code> file is being modified using</li>\n</ul>\n"^^ . + . + . + . + . + . + "symbolic-math"^^ . + "<p>A simple, single-page, demo that should show how you can accomplish the goal of uploading multiple files and process them easily in PHP using the <code>$_FILES</code> array</p>\n<p>If you modify your approach you can simplify the code as shown below - use <code>Fetch</code> rather than <code>XMLHttpRequest</code>, supply a <code>form</code> to the <code>FormData</code> constructor - these in turn allow you easier processing in PHP. The delegated event handler groups the <code>click</code> functionality into one place rather than multiple inline handlers.</p>\n<p>The comments in the code expand a little on this</p>\n<pre><code>&lt;?php\n\n if( $_SERVER['REQUEST_METHOD']=='POST' &amp;&amp; !empty( $_FILES ) ){\n \n $files=(object)$_FILES[ 'files' ];\n \n foreach( $files-&gt;name as $i =&gt; $void ){\n $name = $files-&gt;name[$i];\n $size = $files-&gt;size[$i];\n $type = $files-&gt;type[$i];\n $tmp = $files-&gt;tmp_name[$i];\n $error= $files-&gt;error[$i];\n \n if( $error==UPLOAD_ERR_OK ){\n echo $name, $type, $size, '&lt;br /&gt;';\n # do interesting things with the files...\n }\n }\n \n exit();\n }\n \n?&gt;\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n &lt;head&gt;\n &lt;title&gt;LIST of files to php&lt;/title&gt;\n &lt;meta charset='utf-8'&gt;\n &lt;meta name='viewport' content='width=device-width, initial-scale=1'&gt;\n &lt;style&gt;\n table{\n border:1px solid grey;\n font-family:monospace;\n width:600px;\n }\n td,th{\n padding:0.25rem;\n margin:0.1rem;\n border:1px solid grey;\n }\n input,button{\n padding:0.5rem;\n margin:0.25rem;\n }\n \n td:nth-of-type(2){\n text-align:center\n }\n &lt;/style&gt;\n &lt;/head&gt;\n &lt;body&gt;\n\n &lt;div data-id='container' class='container p-5 my-5 border'&gt;\n &lt;div class='container my-5'&gt;\n &lt;!-- \n simplify using the FormData Object by using a FORM\n The FORM can be supplied to FormData as a parameter\n which in turn collates all the file inputs for you.\n \n Note the use of [] in the file input name, viz: files[]\n this ensures the files are sent in an array that can be \n processed by PHP.\n \n --&gt;\n &lt;form name='uploads'&gt;\n &lt;table class='table table-bordered table-striped table-hover'&gt;\n &lt;colgroup&gt;\n &lt;col width='65%' /&gt;\n &lt;col width='35%' /&gt;\n &lt;/colgroup&gt;\n &lt;thead&gt;\n &lt;tr&gt;\n &lt;th&gt;File&lt;/th&gt;\n &lt;th&gt;Actions&lt;/th&gt;\n &lt;/tr&gt;\n &lt;/thead&gt;\n &lt;tbody&gt;\n &lt;tr&gt;\n &lt;td&gt;&lt;input type='file' class='form-control' name='files[]' accept='image/*;capture=camera' /&gt;&lt;/td&gt;\n &lt;td&gt;&lt;button data-action='delete-row' class='btn btn-outline-primary btn-xs'&gt;Delete&lt;/button&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;/tbody&gt;\n &lt;/table&gt;\n &lt;/form&gt;\n &lt;button data-action='add-row' type='button' class='btn btn-primary'&gt;Add Another Photo Or File&lt;/button&gt; \n &lt;/div&gt;\n \n \n \n &lt;div class='container my-5'&gt;\n &lt;button data-action='submit-files' type='button' class='btn btn-primary'&gt;Submit&lt;/button&gt; \n &lt;/div&gt;\n &lt;/div&gt;\n \n \n &lt;!-- just to render results --&gt;\n &lt;output&gt;&lt;/output&gt;\n \n \n &lt;!--\n A template can be used to provision any HTML content you\n want to use later so that it might easily and repeatably\n be added to the DOM. As a template it's content are not\n visible so will not affect layout.\n --&gt;\n &lt;template&gt;\n &lt;tr&gt;\n &lt;td&gt;&lt;input type='file' class='form-control' name='files[]' accept='image/*;capture=camera' /&gt;&lt;/td&gt;\n &lt;td&gt;&lt;button data-action='delete-row' class='btn btn-outline-primary btn-xs'&gt;Delete&lt;/button&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;/template&gt;\n\n\n &lt;script&gt;\n /*\n Rather than multiple inline event handlers, some \n using numerically indexed IDs ( never really a great \n approach ) use a single &quot;delegated event listener&quot;\n and inspect the &quot;event&quot; to deduce if the target\n / source was a button. If it was, inspect it's data-action\n attribute (or whatever) and run the appropriate function.\n \n Using Fetch to send the request rather than `XMLHttpRequest`\n you will find it easier as the files will be correctly available\n within the `$_FILES` array in PHP.\n */\n document.querySelector('.container').addEventListener('click',e=&gt;{\n const form=document.forms.uploads;\n const output=document.querySelector('output');\n const tbody=form.querySelector('table tbody');\n const oTmpl=document.querySelector('template').content.cloneNode(true);\n \n const callback=(r)=&gt;{\n console.log(r)\n output.innerHTML=r\n };\n const addrowhandler=(e)=&gt;{\n tbody.appendChild( oTmpl );\n };\n const deleterowhandler=(e)=&gt;{\n tbody.removeChild( e.target.closest('tr') )\n };\n const submitfileshandler=(e)=&gt;{\n let fd=new FormData( form );\n \n fetch( location.href,{ method:'post',body:fd })\n .then(r=&gt;r.text())\n .then(callback)\n .catch(alert)\n };\n \n \n \n if( e.target instanceof HTMLButtonElement ){\n switch( e.target.dataset.action ){\n case 'add-row':addrowhandler(e);break;\n case 'submit-files':submitfileshandler(e);break;\n case 'delete-row':deleterowhandler(e);break;\n }\n }\n })\n &lt;/script&gt;\n &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n"^^ . + "0"^^ . + . + . + . + "<p>You are displaying the value inside the loop before updating $prev_row. you should:</p>\n<ol>\n<li><p>Store the results in an array first.</p>\n</li>\n<li><p>Loop through the array to display them properly.</p>\n</li>\n</ol>\n<p>Hope it will work. I have pasted your updated code snippet below</p>\n<pre><code>$rows = []; // Store rows before displaying\n$prev_row = null;\n\nwhile ($change_row = mysql_fetch_array($result)) {\n $change = '-'; // Default for the first row\n\n if ($prev_row !== null) {\n if ($prev_row &gt; $change_row['change_pay']) {\n $change_diff = (($prev_row - $change_row['change_pay']) / $prev_row) * 100;\n $change = '&lt;font color=&quot;red&quot;&gt;' . number_format($change_diff, 2) . '% decrease&lt;/font&gt;';\n } else {\n $change_diff = (($change_row['change_pay'] - $prev_row) / $prev_row) * 100;\n $change = '&lt;font color=&quot;green&quot;&gt;' . number_format($change_diff, 2) . '% increase&lt;/font&gt;';\n }\n }\n\n // Store data in array instead of printing immediately\n $rows[] = [\n 'pay' =&gt; $change_row['change_pay'],\n 'change' =&gt; $change\n ];\n\n $prev_row = $change_row['change_pay'];\n}\n\n// Now loop through the stored data to display it correctly\nforeach ($rows as $row) {\n echo '&lt;tr&gt;\n &lt;td class=&quot;bigtext&quot;&gt;&lt;b&gt;' . $row['pay'] . '&lt;/b&gt;&lt;/td&gt;\n &lt;td class=&quot;bigtext&quot;&gt;&lt;b&gt;' . $row['change'] . '&lt;/b&gt;&lt;/td&gt;\n &lt;/tr&gt;';\n}\n</code></pre>\n"^^ . + "vapid"^^ . + . + . + . + "If it is not required to be up and running all the time, you can also use services like NGROK or Expose to share your XAMPP website."^^ . + . + "The [documentation](https://www.php.net/manual/en/function.session-regenerate-id.php) has a warning about potential lost session data (and examples you might be interested in)."^^ . + . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + "You could set url search params for the link on PageB: `<a href="/pageC?from=pageB">` and shows the orange picture if the `from=pageB` is present in the url on PageC."^^ . + . + . + "0"^^ . + "arrays"^^ . + . + "Quite open for advice on those or a pointer to an article."^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + "2"^^ . + . + "telephone validation opencart"^^ . + "I TRIED the solutions for that question. I even linked to it in the first line. The solution there is to downgrade PHPUnit. I DID that as well. So yes, you could say it's a duplicate. But that doesn't help me."^^ . + "APIPlatform v2.7/3.0 - Custom Patch action - Wrong iri"^^ . + "0"^^ . + . + . + "<p>If data is intended to be an array , you need to update your validation rules to reflect that. For example:</p>\n<pre><code>public function rules(): array\n{\n return [\n 'data' =&gt; 'required' ];\n}\n\npublic function messages(): array\n{\n return [\n 'data.required' =&gt; 'error.action.required.data',\n ];\n}\n</code></pre>\n"^^ . + "What did you try so far?"^^ . + "<p>You just need to define the absolute path where you want to move the file :</p>\n<pre><code>&lt;?php\nif ($request-&gt;hasFile('front_picture_path')) {\n $imageName = time() . '_front.' . $request-&gt;file('front_picture_path')-&gt;getClientOriginalExtension();\n\n // Get the base path\n $basePath = base_path();\n\n // Adjust the path to point to the correct subdomain (web21 instead of web19)\n $destinationPath = str_replace('/19/web/', '/21/web/', $basePath) . '/public/uploads_ext/uploads';\n\n // Move the uploaded file\n $request-&gt;file('front_picture_path')-&gt;move($destinationPath, $imageName);\n\n // Store the new file path\n $imgdata['right_picture_path'] = $destinationPath . '/' . $imageName;\n}\n</code></pre>\n"^^ . + "0"^^ . + . + . + . + "<p>I want to know how to populate a div's content differently, based on which page a visitor came from?</p>\n<p>For example:</p>\n<p>If a site visitor enters the direct URL mywebsite.com/pageC into their browser, the 'default' content loaded into a particular div [id=fruitBasket] is a photo of an apple.</p>\n<p>And, If the visitor arrives at pageC from a link on pageA (or any other page except pageB), the same 'default' content [a photo of an apple] is loaded into the same div.</p>\n<p>However... If the visitor arrives at PageC from a link on PageB, the same div is loaded with a photo of an orange instead.</p>\n"^^ . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "<p>I'm having some trouble with PhpStorm intellisense when working with several classes. This is the structure I'm dealing with:</p>\n<pre class="lang-php prettyprint-override"><code>trait ContextTrait\n{\n public Subscriptions $subscription;\n \n public function setSubscription(Subscriptions $value): self \n {\n $this-&gt;subscription = $value;\n \n return $this;\n }\n}\n\nabstract class Transaction\n{\n use ContextTrait;\n \n protected ?int $paymentMethodId = null;\n \n public function setPaymentMethodId(?int $value): self \n {\n $this-&gt;paymentMethodId = $value;\n\n return $this;\n }\n}\n\nclass Invoice extends Transaction\n{\n protected ?string $dueDate = null;\n \n public function setDueDate(?string $value): self\n {\n $this-&gt;dueDate = $value;\n \n return $this;\n }\n}\n</code></pre>\n<p>When initializing the class like this:</p>\n<pre class="lang-php prettyprint-override"><code>$invoice = (new Invoice)\n -&gt;setSubscription(...)\n -&gt;setPaymentMethodId(...)\n -&gt;setDueDate(...);\n</code></pre>\n<p>I'm having the following issues:</p>\n<ol>\n<li>The intellisense (while typing) only works for the functions <code>-&gt;setSubscription</code> and <code>-&gt;setPaymentMethodId</code>, it doesn't work for <code>-&gt;setDueDate</code>.</li>\n<li>Pressing <kbd>F12</kbd> on <code>-&gt;setDueDate</code> doesn't work, it returns the error &quot;Cannot find declaration to go to&quot;.</li>\n<li>The function <code>setDueDate</code> is grayed out in the class, stating that the function is never used anywhere.</li>\n</ol>\n<p>If I use a different instantiation approach (without chaining):</p>\n<pre class="lang-php prettyprint-override"><code>$invoice = new Invoice;\n$invoice-&gt;setSubscription(...);\n$invoice-&gt;setPaymentMethodId(...);\n$invoice-&gt;setDueDate(...);\n</code></pre>\n<p>Everything works perfectly. Is there any way to fix this?</p>\n<hr />\n<p><strong>Edit</strong>:</p>\n<p>An example of what is shows to me in PhpStorm:</p>\n<ol>\n<li><strong>Using chaining method</strong>: It does not show the <code>-&gt;setDueDate</code> function.</li>\n</ol>\n<p><a href="https://i.sstatic.net/yru7WlD0.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/yru7WlD0.png" alt="enter image description here" /></a></p>\n<ol start="2">\n<li><strong>Not using chaining method</strong>: It shows the <code>-&gt;setDueDate</code> function.</li>\n</ol>\n<p><a href="https://i.sstatic.net/QSqIcqjn.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/QSqIcqjn.png" alt="enter image description here" /></a></p>\n"^^ . + "0"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + . + "Override NGINX client_max_body_size only for specific path/URL?"^^ . + "@Luuk 3 / (3 + 2 + 1). This is a simple urn model. John has 3 balls, Peter 2, and Paul 1. The probability of each ball is 1 / sum(balls), so the probability for John is 3 * 1 / sum(balls). Or did I make a mistake in my calculations?"^^ . + "0"^^ . + . + . + . + . + . + . + . + "0"^^ . + "You have a filter and a function, and the former invokes the latter, so to debug this you need to see if the filter is being called. Erase the contents of the function (leaving the function itself) and replace with just `die('here');`. Test whatever you are doing. If you see the `die`, the filter is firing and reaching your function, so that means the function's logic is not correct. If you aren't seeing the `die`, it is possible it is being invoked in a different way, but more likely the hook isn't firing. Until you know that the hook is firing, don't bother with the contents of the function."^^ . + "0"^^ . + . + "I don't know if DEVSENSE is open source, but maybe you could at least try to report it to them. As you have found out yourself this class is not deprecated so they are giving you wrong information."^^ . + "2"^^ . + . + . + . + . + . + . + . + "I am using mb_strpos() and mb_substr() to cut down a larger text and divide the words into an array... I had difficulties at first until I started using the mb functions... so I thought mb_split() might help but it doesn't... just stuck at the moment on why I can't get the split to work correctly...."^^ . + . + "1"^^ . + "Your question is not very clear. For example, what is *"the player"* that you are creating? Try to better explain the context with details and try to provide some debugging details."^^ . + "Thanks for adding an edit. The idea of [mcve] is to provide *just* enough information, but *enough* information for us to reproduce your issue. It also allows you to identify exactly where the issue is during that process. By narrowing down exactly where the issue is, you can (for example) rule out the php. The code in your original (before edit) question just needed some HTML and *context* - ie some data for the messageRow/message parameters. The console.log output shows that `message.message_id` is not what *you're* expecting - so start by debugging where that value comes from."^^ . + "2"^^ . + . + . + "As above - split the file first, get the chunks of xml, then process each one as normal"^^ . + "@C3roe i use live server i tried to use Apache its work...tnx"^^ . + . + . + . + . + . + "<p>To ensure your function runs for free orders, use the <code>woocommerce_order_status_completed</code> hook, as free orders are most likely set to completed. Also, it is a good idea to check if the order is paid or not, and if not, run the role change.</p>\n<pre><code>function change_role_on_purchase( $order_id ) {\n\n $order = wc_get_order( $order_id ); // Use wc_get_order for better compatibility\n if (!$order) return; // If order is not valid, exit the function.\n\n $items = $order-&gt;get_items();\n\n foreach ( $items as $item ) {\n $product_id = $item-&gt;get_product_id();\n\n if ( $order-&gt;get_user_id() &gt; 0 &amp;&amp; $product_id == '13874904' ) {\n $user_id = $order-&gt;get_user_id();\n update_user_meta( $user_id, 'special_subscriber_product_purchased', 1 ); //Use a more descriptive meta key.\n $user = new WP_User( $user_id );\n // Remove role\n $user-&gt;remove_role( 'subscriber' );\n // Add role\n $user-&gt;add_role( 'special_subscriber' );\n break; // No need to continue looping if the specific product is found.\n }\n }\n}\nadd_action( 'woocommerce_order_status_completed', 'change_role_on_purchase' );\n\nfunction change_role_on_purchase_pending( $order_id ) {\n\n $order = wc_get_order( $order_id ); // Use wc_get_order for better compatibility\n if (!$order) return; // If order is not valid, exit the function.\n\n if ($order-&gt;get_total() &gt; 0) return; // If order is paid, exit.\n\n $items = $order-&gt;get_items();\n\n foreach ( $items as $item ) {\n $product_id = $item-&gt;get_product_id();\n\n if ( $order-&gt;get_user_id() &gt; 0 &amp;&amp; $product_id == '13874904' ) {\n $user_id = $order-&gt;get_user_id();\n update_user_meta( $user_id, 'special_subscriber_product_purchased', 1 ); //Use a more descriptive meta key.\n $user = new WP_User( $user_id );\n // Remove role\n $user-&gt;remove_role( 'subscriber' );\n // Add role\n $user-&gt;add_role( 'special_subscriber' );\n break; // No need to continue looping if the specific product is found.\n }\n }\n}\nadd_action( 'woocommerce_order_status_pending', 'change_role_on_purchase_pending' );\n</code></pre>\n"^^ . + . + "2"^^ . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + "<p>On Prestashop, I have a production and staging server. I want to activate debug mode on staging environment.</p>\n<p>I can use <code>$_SERVER['SERVER_NAME']</code> to identify my environment, so I can define my constant like this :</p>\n<pre class="lang-php prettyprint-override"><code>if (! defined('_PS_MODE_DEV_')) {\n define('_PS_MODE_DEV_', $_SERVER['SERVER_NAME'] === 'staging.domain.name');\n}\n</code></pre>\n<p>But it's not working, the debug mode is not enabled.</p>\n<p>When I'm testing my values :</p>\n<pre class="lang-php prettyprint-override"><code>var_dump(! defined('_PS_MODE_DEV_')); // true\nif (! defined('_PS_MODE_DEV_')) {\n var_dump($_SERVER['SERVER_NAME'] === 'staging.domain.name'); // true\n define('_PS_MODE_DEV_', $_SERVER['SERVER_NAME'] === 'staging.domain.name');\n}\nvar_dump(_PS_MODE_DEV_); // true\n</code></pre>\n<p>Everything looks good, I don't understand why the debug mode stills disabled.</p>\n<p>I thought it was a problem with the mode itself, but if I set like this :</p>\n<pre class="lang-php prettyprint-override"><code>if (! defined('_PS_MODE_DEV_')) {\n define('_PS_MODE_DEV_', true);\n}\n</code></pre>\n<p>It works, the debug mode is enabled...</p>\n<p>Maybe there is some limitation with <code>define()</code> ? (I cannot find an example using an expression).</p>\n<p>So, I tried like this :</p>\n<pre class="lang-php prettyprint-override"><code>if (! defined('_PS_MODE_DEV_')) {\n if ($_SERVER['SERVER_NAME'] === 'staging.domain.name') {\n define('_PS_MODE_DEV_', true);\n }\n else {\n define('_PS_MODE_DEV_', false);\n }\n}\n</code></pre>\n<p>That works too, the debug mode is enabled on staging. HOWEVER, the debug mode is enabled on production too !</p>\n<p>I am completely lost, because if I set even like this :</p>\n<pre class="lang-php prettyprint-override"><code>if (! defined('_PS_MODE_DEV_')) {\n if (false) {\n define('_PS_MODE_DEV_', true);\n }\n else {\n define('_PS_MODE_DEV_', false);\n }\n}\n</code></pre>\n<p>The debug mode stills enabled... I have no idea what is going on here. For me, it looks like PHP ignores my condition, and takes always the first define().</p>\n<p>Could someone give me some ideas to understand what happens here ?</p>\n"^^ . + . + "1"^^ . + . + . + . + . + "<p>I have a method createSession() that calls session_regenerate_id(true); to prevent session fixation:</p>\n<pre><code>class Session {\n public string $id;\n public string $username;\n public string $role;\n\n public function __construct(){\n session_start();\n $this-&gt;id = $_SESSION['id'] ?? 0;\n $this-&gt;role = $_SESSION['role'] ?? 'guest';\n $this-&gt;username = $_SESSION['username'] ?? 'Guest User';\n }\n\n public function updateSession(array $user){\n $this-&gt;createSession($user);\n }\n\n public function createSession(array $user){\n session_regenerate_id(true);\n $_SESSION['id'] = $user['id'];\n $_SESSION['username'] = strstr($user['email'], '@', true);\n $_SESSION['expire'] = time() + 30 * 60;\n $_SESSION['role'] = $user['role'];\n }\n\n public function destroySession(){\n $_SESSION = [];\n $cookie_data = session_get_cookie_params();\n setCookie(session_name(), '', time() - 42000, $cookie_data['path'], $cookie_data['domain'], $cookie_data['httponly']);\n session_destroy();\n }\n}\n</code></pre>\n<p>After calling this function, all previous session data seems to be lost.</p>\n<p>Is this behavior normal?\nHow can I securely regenerate the session without losing existing data?</p>\n<p>Do I need to manually copy session values before regenerating?</p>\n<p>I’m using PHP 8.2 and storing sessions in the default file-based handler. Could the session storage settings affect this ?</p>\n"^^ . + . + . + "0"^^ . + . + "Maybe you can set the allowtags in the yaml file of the rte preset? Sounds a bit as ic the config isn't getting activated. Not too easy to trace, could you debug the parsefunc's contens in the Viewhelper?"^^ . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + "Eloquent query returning null when using a variable"^^ . + . + "0"^^ . + "1"^^ . + "0"^^ . + "@DaveSpencer An alternative is the [mcrypt](https://pecl.php.net/package/mcrypt) extension, but it's now unmaintained."^^ . + . + "localhost"^^ . + "eclipse"^^ . + . + . + . + . + "Last but not least: You're really doing too much here. If it had worked within two minnutes, that could have been OK even for your use-case, however as has been earlier mentioned: Imagick is a PHP extension. If your PHP version is missing it, install the extension for your PHP version. Then you don't need to learn system administration of all Apache HTTP and PHP integration with it first because you took the first switch to flip for the difference you're looking for."^^ . + "2"^^ . + "For the reason Nico Haase specified, I don't have a Laravel 5 app available to test this, but in Laravel 10 and 11 running the query `$uuid = '...'`, then `Model::where('uuid', $uuid)->first()` and `Model::where('uuid', '...')->first()` both return the same single result (I don't have a `code` column, but same idea)... I can't recreate this, and I have no idea why this would be an error in your code; that's the syntax I've been using for over a decade How are you outputting this? `dd(LiveProducts::where(...)->first())`? Or some other method like the query logger? Did you try `->toSql()`?"^^ . + "0"^^ . + . + . + "<p>I have a server ruled by Plesk running on Apache 2.4.41 and Nginx used in proxy mode.\nI also have ModSecurity enabled with Comodo rules (free). I use PHP 7.4.3 (FPM served by Apache) for back-end scripts with output buffering in my &quot;php.ini&quot; file set as follows <code>output_buffering = 8192</code>.<br><br></p>\n<p>I'm trying to flush data as soon as they're &quot;echo&quot;ed but everything I tried failed so long.<br><br></p>\n<p>I have already <a href="https://stackoverflow.com/questions/33628918/disabling-output-buffer-with-apache-and-php-fpm-via-mod-proxy">checked this topic</a> and it didn't help.</p>\n<p>I've created the following script for testing purpose:</p>\n<pre><code>ob_start();\n\n$respond = function() {\n while(ob_get_level()) ob_end_flush();flush();\n};\n\necho &quot;1\\n&quot;;\n$respond();sleep(2);\n\necho &quot;2\\n&quot;;\n$respond();sleep(2);\n\necho &quot;3\\n&quot;;\n$respond();sleep(2);\n</code></pre>\n<p>When I run the above script, it waits for the script to complete before outputting the result.<br><br></p>\n<p>I have tried to set specific directives for Nginx related to my script as follows</p>\n<pre><code>location = /path/to/my/script.php {\n proxy_buffering off;\n proxy_request_buffering off;\n chunked_transfer_encoding on;\n fastcgi_request_buffering off;\n fastcgi_buffering off;\n tcp_nodelay on;\n}\n</code></pre>\n<p>I have also added special directives for Apache like so</p>\n<pre><code>&lt;Location /path/to/my/script.php&gt;\n SetEnv no-gzip 1\n SetEnv dontlog 1\n SetEnv proxy-nokeepalive 1\n&lt;/Location&gt;\n</code></pre>\n<p>I tried with PHP the following:</p>\n<pre><code>ini_set('output_buffering', '0');\nini_set('zlib.output_compression', '0');\nob_implicit_flush(true);\n</code></pre>\n<p>I've checked using a terminal to execute a similar script with PHP-Cli and it was being displayed every time it was &quot;echo&quot;ed so the problem is not at PHP level.</p>\n<p><strong>How to disable buffering in this case to allow data streaming?</strong></p>\n<p>One additional note, I don't want to disable buffering for my whole server but only for a specif script. The script is not accessible via a URL but used internally by the application. By the way, I don't mind if buffering is disabled for the URL using that script if no other solution exists.</p>\n"^^ . + "If you're using this to build a HTML `mailto` hyperlink, then no. If you're using PHP to send an email directly to a mailserver in the backend then absolutely yes, you can set the bcc field when you send the email. You haven't provided a [mre] of the issue showing all the relevant code, so we can't see what mail tool you're using or how you build the email, so we can't tell you exacty what code to write. But those are your options. You need to [edit] your question."^^ . + "1"^^ . + "Failure to update article tags in Laravel 8 blog application?"^^ . + "0"^^ . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + "Hey hows it going i see there are no debug statements , may you start with that i personally use pure php so i would use `var_dump()` for example , the equivalent in laravel for logging documentation is at https://laravel.com/docs/11.x/logging and also check the requests are fired automatically or do you need to fire that request maybe using `php artisan tinker` ? hope this helps"^^ . + . + . + "0"^^ . + "Is `php` in the default `$PATH`? If not, it might not be found when the script runs, so you get no output in the PHP_VERSION variable. Use `type php` to get the path, and use that in the script."^^ . + . + "0"^^ . + "It feels like you don't want a regex at all, but a proper string tokenizer/parser that knows what "verbs" and "fruit" are."^^ . + "charset"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + "There is confusing documentation out there for this extension unfortunately. Per [this](https://www.php.net/manual/en/install.windows.recommended.php), as of PHP 8.0.0 WinCache is no longer supported, however per [this](https://github.com/php/pecl-caching-wincache/commit/0f7d36567723a8b768f6629fd27b021e0fd96847) someone tried making it compile in PHP 8.1 and later. Also, per [this](https://www.php.net/manual/en/intro.wincache.php) as of version 2.0.0 opcache was removed from the extension since it is bundled, so you might want to re-evaluate if you actually need this."^^ . + . + "This question is similar to: [How to pass parameters to a Script tag?](https://stackoverflow.com/questions/5292372/how-to-pass-parameters-to-a-script-tag). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem."^^ . + "2"^^ . + "1"^^ . + "soap"^^ . + "0"^^ . + "Remove the `-d` from the url, that's a curl option."^^ . + . + . + . + . + "laravel-spark"^^ . + . + . + . + "-1"^^ . + . + "0"^^ . + "How can glob output be used to cd into directories with spaces?"^^ . + "0"^^ . + . + "@aynber is right, but it has to be replacing `:attribute' with `data` which somehow is an array instead of a string, therefore I think `data` might be a reserved keyword, somehow resolving some other data instead of just the input name.."^^ . + . + . + "0"^^ . + "1"^^ . + . + . + . + "Custom Authenticator - Assigning a User (and taking away) Roles"^^ . + . + "check the middlewares that are applied to your specific route, and post them in your question, example `php artisan route:list --path=customer`"^^ . + . + . + . + . + . + "@sln `echo var_export($data, true);` is simply `var_export($data);`. Like `echo sprintf()` is simply `printf()`."^^ . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + "Thank you for messaging. In corephp ffmpeg code is executed and video file is created. Laravel Controller code, created a filelist.txt with the image location and duration ("file 'C:/xampp/htdocs/project/public/storage/videomakingimages/1742807226_ho8JbzKwcS.jpg' duration 3.0"). However, the ffmpeg command could not take the file from this path. So it cannot make the video file."^^ . + . + "Adding an image blog to the file form element"^^ . + . + ""Enough" for what? To confirm that `$_GET['fruit']` is either `Orange` or `Banana` here? Sure, that's fine. Now, where else are you going to use this value and what for and what other steps are you hoping to skip there instead?"^^ . + "I don't have any idea yet. What I've found so far is that I always just search the string with another string. But not with the number of characters. So I don't have any idea yet."^^ . + "Get the sales count of a WooCommerce product for a period of time"^^ . + "1"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + . + . + "Yes, you are right. Actually, $request->user()->avatar returns me the path to a temporary file. I achieved this through debugging"^^ . + "1"^^ . + "1"^^ . + "1"^^ . + . + "windows-authentication"^^ . + . + "0"^^ . + "@droopsnoot You're probably talking about client to server e-mail. Server to server e-mail communication normally starts in plain text over port 25, unless that port is blocked, then a higher port number is attempted. See: https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol"^^ . + . + . + "slack"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + "<p>I think casting your ID's will work.</p>\n<pre><code># in Permission Model\nprotected $casts = [\n '_id' =&gt; 'objectid',\n];\n\n# in Permission_curd Model\nprotected $casts = [\n 'permission_id' =&gt; 'objectid',\n];\n</code></pre>\n<hr />\n<p>In Controller</p>\n<pre><code>public function index()\n{\n $permissions = Permission::with('permission_curds')-&gt;get();\n\n // if first permission with relations:\n // $permission = Permission::with('permission_curds')-&gt;first();\n\n return response()-&gt;json($permissions);\n}\n</code></pre>\n"^^ . + . + . + . + "0"^^ . + "<p>I somehow managed resolve this now.</p>\n<p>In my strace logs I noticed an error indicating the system was looking for the file dblgen17.res in the folder <code>/opt/sqlanywhere17/lib64</code>. This file did not exist in this folder, instead it was located in the folder: <code>/opt/sqlanywhere17/res/</code></p>\n<p>I copied the filed over to /lib64.\nGot another error:</p>\n<pre><code>[08001][unixODBC][SAP][ODBC Driver][SQL Anywhere]Encryption error: Missing or invalid encryption DLL &quot;libdbrsa17_r.so&quot;\n</code></pre>\n<p>Did a <code>sudo chmod 644 /opt/sqlanywhere17/lib64/libdbrsa17_r.so</code> and voila.\n<a href="https://i.sstatic.net/7oGzs0he.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7oGzs0he.png" alt="Success" /></a></p>\n<p>My wild guess is that apache somehow need those files to connect, while local users on the server does not.</p>\n<p>It might not be the correct way of resolving the issue, but atleast apache can now function with ODBC as intended.</p>\n"^^ . + . + "0"^^ . + . + . + . + "As suggested, I have version 9.6.22 of PHPUnit installed, so that's not it. The only answer I saw that "solved" this was by chaning to PHPStorm"^^ . + "2"^^ . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + "1"^^ . + . + "Can not extract JSON values from JSON string using PHP"^^ . + . + . + . + "0"^^ . + . + "sum"^^ . + . + "I pity. Well, just use html_entity_decode() then, as shown in the answer to the duplicate question. That would be double job, but it won't take much understanding"^^ . + "0"^^ . + "<p>I'm working on a login page and the <code>password_verify()</code> always returns <code>false</code> when getting the hash from the DB but prints true when using static values\nHere's my code :</p>\n<pre><code>&lt;?php\nrequire_once &quot;ID.php&quot;;\n\n$message = &quot;&quot;;\n\nif ($_SERVER[&quot;REQUEST_METHOD&quot;] === &quot;POST&quot;) {\n // Connect to the database\n $conn = new mysqli($DB_SERVER, $DB_USER, $DB_PASSWORD, $DB_NAME);\n if ($conn-&gt;connect_error) {\n die(&quot;Connection failed: &quot; . $conn-&gt;connect_error);\n }\n\n $pseudo = $_POST['pseudo'];\n $passwordInput = trim($_POST['password']);\n\n // Fetch the stored password hash\n $stmt = $conn-&gt;prepare(&quot;SELECT password FROM users WHERE Pseudo = ?&quot;);\n $stmt-&gt;bind_param(&quot;s&quot;, $pseudo);\n $stmt-&gt;execute();\n $stmt-&gt;bind_result($storedHash);\n $stmt-&gt;fetch();\n\n // Debugging: Output the fetched stored hash and length\n echo &quot;Stored Hash: $storedHash&lt;br&gt;&quot;;\n echo &quot;Stored Hash Length: &quot; . strlen($storedHash) . &quot;&lt;br&gt;&quot;;\n\n // Check if we found the user\n if ($storedHash) {\n // Debugging: Check if password verification passes\n $verifyResult = password_verify($passwordInput, $storedHash) ? &quot;true&quot; : &quot;false&quot;;\n echo &quot;Password verify result: $verifyResult&lt;br&gt;&quot;;\n\n if (password_verify($passwordInput, $storedHash)) {\n $message = &quot;Login successful!&quot;;\n } else {\n $message = &quot;Invalid username or password.&quot;;\n }\n } else {\n $message = &quot;User not found.&quot;;\n }\n\n $stmt-&gt;close();\n $conn-&gt;close();\n}\n?&gt;\n\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n &lt;title&gt;Login&lt;/title&gt;\n&lt;/head&gt;\n&lt;body&gt;\n &lt;h2&gt;Login&lt;/h2&gt;\n &lt;?php if ($message) echo &quot;&lt;p&gt;$message&lt;/p&gt;&quot;; ?&gt;\n &lt;form method=&quot;POST&quot; action=&quot;&quot;&gt;\n &lt;input type=&quot;text&quot; name=&quot;pseudo&quot; placeholder=&quot;Username&quot; required&gt;&lt;br&gt;\n &lt;input type=&quot;password&quot; name=&quot;password&quot; placeholder=&quot;Password&quot; required&gt;&lt;br&gt;\n &lt;button type=&quot;submit&quot;&gt;Login&lt;/button&gt;\n &lt;/form&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n\n</code></pre>\n<p>I tried using static values and it worked but the second its not static it doesn't work anymore</p>\n"^^ . + . + "1"^^ . + "2"^^ . + "authentication"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + "laravel-livewire"^^ . + "Apache2.4 not loading the PHP module (%1 is not a valid Win32 application)"^^ . + . + . + . + "I had the same issue where the car names appeared in the REST API (wp/v2/vehica_car), but the metadata was missing."^^ . + . + "This answer gave me an entirely different perspective I never thought about. The router class. Handles the 'serving 1 url version' perfectly and gives me more control. Thanks a lot for this answer. Thanks for the effort you put into the details."^^ . + "2"^^ . + "@MagnieMozios it change something my last limit was 2m but now it 8m i think after remove the `ValidatePostSize` the size change from 2m to 8m but i made it more than that inside the php.ini what else could do"^^ . + "<p>You need to make the field nullable in the entity file, then update de database, then try again</p>\n"^^ . + "<p>I try to resize images with CI4 image service class. The original image is with good quality but resized images (which are smaller by dimensions) are with poor quality, even though i don't set any parameter to decrease images quality.</p>\n<p>Here is the code i use:</p>\n<pre><code>$resize_for_width = (isset($slide_settings['IMAGE_WIDTH_LARGE']) &amp;&amp; $slide_settings['IMAGE_WIDTH_LARGE'] &gt; 900 ? $slide_settings['IMAGE_WIDTH_LARGE'] : 900);\n $resize_for_height = (isset($slide_settings['IMAGE_HEIGHT_LARGE']) &amp;&amp; $slide_settings['IMAGE_HEIGHT_LARGE'] &gt; 900 ? $slide_settings['IMAGE_HEIGHT_LARGE'] : 900);\n \n \n if($upload_image_width &gt;= $resize_for_width &amp;&amp; $upload_image_height &gt;= $resize_for_height) {\n \n /** for large image **/\n service('image')\n -&gt;withFile($upload_folder . $filename)\n -&gt;resize($resize_for_width, $resize_for_height, true, 'width')\n -&gt;save($slide_variation_large, 100);\n \n if($slide_type-&gt;resize_type == 'resize_and_crop') {\n \n service('image')\n -&gt;withFile($slide_variation_large)\n -&gt;fit($resize_for_width, $resize_for_height, 'center')\n -&gt;save($slide_variation_large, 100);\n }\n \n } else {\n \n $session-&gt;setFlashdata('warning', lang('Slides.large_image_not_created'));\n }\n</code></pre>\n<p>And here are the original picture:\n<a href="https://i.sstatic.net/515lPymH.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/515lPymH.jpg" alt="enter image description here" /></a></p>\n<p>And resized picture is here:\n<a href="https://i.sstatic.net/Y7A7uAx7.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Y7A7uAx7.jpg" alt="enter image description here" /></a></p>\n<p>I don't have any idea what i should do differently. Any ideas or solutions to that?</p>\n<p>Thank you in advance!</p>\n"^^ . + "What does the `wp_ajax_loadmore_reviews` look like? It would help if we could see the JSON being returned by the AJAX call. Also, are there any other plugins in use? Have you replicated this bug with only the relevant customizations and no other plugins installed?"^^ . + . + . + "4"^^ . + . + . + . + . + . + "Those values are in PHP `serialize()` format. There's no easy way to process them directly in SQL, you'll need to extract them from the DB and use `unserialize()` to parse them."^^ . + . + "0"^^ . + . + . + "eloquent"^^ . + . + . + "2"^^ . + . + "@IMSoP Updated my question with the information."^^ . + . + "I'll do fine, but where should I insert this parent block?)"^^ . + "0"^^ . + . + "how do i solve a shopware6 error variable order is not found"^^ . + . + . + . + "0"^^ . + . + . + . + "<p>I'm new to Laravel but I'm trying to query locations based on bounding box of google map. When I run the page I get the following error:</p>\n<pre><code>&quot;SQLSTATE[HY093]: Invalid parameter number (SQL: select `id`, `name`, `description`, ST_X(location) as latitude, ST_Y(location) as longitude, `event_date` from `events` where ST_Contains(\n ST_GeomFromText('POLYGON((21.02649135043 178.4956953125, 21.02649135043 -15.6546953125, 54.612431928268 -15.6546953125, 54.612431928268 178.4956953125, 21.02649135043 178.4956953125))'),\n location))&quot;\n</code></pre>\n<p>but If I copy the sql from the error message and run it, it produces the results with no error?</p>\n<p>select <code>id</code>, <code>name</code>, <code>description</code>, ST_X(location) as latitude, ST_Y(location) as longitude, <code>event_date</code> from <code>events</code> where ST_Contains(\nST_GeomFromText('POLYGON((21.02649135043 178.4956953125, 21.02649135043 -15.6546953125, 54.612431928268 -15.6546953125, 54.612431928268 178.4956953125, 21.02649135043 178.4956953125))'),\nlocation)</p>\n<p>Here is where I'm building the query.</p>\n<pre class="lang-php prettyprint-override"><code>$events = Event::select(\n 'id',\n 'name',\n 'description',\n DB::raw('ST_X(location) as latitude'),\n DB::raw('ST_Y(location) as longitude'),\n 'event_date'\n)\n -&gt;whereRaw(\n &quot;ST_Contains(\n ST_GeomFromText('POLYGON((? ?, ? ?, ? ?, ? ?, ? ?))'),\n location\n )&quot;,\n [\n $southWest['lat'],\n $southWest['lng'],\n $southWest['lat'],\n $northEast['lng'],\n $northEast['lat'],\n $northEast['lng'],\n $northEast['lat'],\n $southWest['lng'],\n $southWest['lat'],\n $southWest['lng']\n ]\n )\n -&gt;get();\n</code></pre>\n"^^ . + . + "where did you try to log? bc in your controller for example is likely too late"^^ . + "on the endpoint `wp/v2/vehica_car`, you see the car names but not the metadata, it's that ?"^^ . + . + "You may need to downgrade again, or carry out some fixes, [see here](https://www.google.com/search?q=phpmyadmin+support+php+8.4)"^^ . + . + . + "3"^^ . + . + . + "0"^^ . + . + . + . + . + "4"^^ . + . + "0"^^ . + ""doesn't work" is not a problem description. It means nothing to us. Something is happening unless you haven't actually run the code and expect spontaneous execution."^^ . + "0"^^ . + . + . + "1"^^ . + "2"^^ . + . + . + "-4"^^ . + . + "0"^^ . + "`I thought respose would send the code to ddms`...huh? `$.ajax({\n url: 'DDM2.php'` is what _sends_ data to the DDMS2 script. `response` is what comes _back_ from the DDMS2 script. It comes back as a javascript variable called `response`, as you can see. What happens to it after that is up to you. It cannot automatically update your page for you - it doesn't know what you want to do with that data, where you want it to go into the page, or whether it's even usable HTML data (often, such a response might contain JSON data, for example, which you'd want to process)."^^ . + "1"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + "composer-php"^^ . + "1"^^ . + . + "<p>I am trying to upgrade some older code that uses Docusign's username/password method of authentication for their Rest API to the newer OAuth version.\nWe're using this for an automated service so JWT makes sense. Our existing code uses a prebuilt template in the Docusign account and populates it and sends it to the recipient. I have created a JWT Bearer Token and tried implementing it using cURL but I just get the response &quot;false&quot;. I am at a loss here. Docusign hasn't been much help so far, their documentation is overwhelming. This runs in a Wordpress functions.php file, it should be simple. i worked for years the old way.</p>\n<pre><code> $fields = [];\n $initials = [];\n $checkboxes = [];\n $recipients = ['test@test.com'];\n $templateID = &quot;2ce6c87b-****&quot;;\n $accountId = '0cec5847-****';\n $integratorKey = &quot;d2c3fbe6-****&quot;;\n\n $data = array(\n 'accountId' =&gt; $accountID,\n 'templateId' =&gt; $templateID,\n 'templateRoles' =&gt; $recipients,\n 'emailSubject' =&gt; 'Important Forms',\n 'status' =&gt; 'sent',\n );\n\n $data_string = json_encode($data);\n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL =&gt; ' https://demo.docusign.net/restapi/v2.1/accounts/123456789/envelopes',\n CURLOPT_RETURNTRANSFER =&gt; true,\n CURLOPT_POST =&gt; true,\n CURLOPT_POSTFIELDS =&gt; $data_string,\n CURLOPT_HTTPHEADER =&gt; array ('Authorization: Bearer eyJ0****'),\n ));\n\n $response = curl_exec($curl);\n $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n\n echo json_encode($response);\n\n curl_close($curl);\n</code></pre>\n<p>I am expecting some response from the cUrl call, even a 404. I literally get &quot;false&quot;.</p>\n"^^ . + . + "ok. do you have any command to check epel check"^^ . + . + . + . + . + . + "An alternative solution might be to [set localstorage (SO)](https://stackoverflow.com/questions/37052087/how-do-i-update-localstorage-items) - on each of your pages store "page" then on the next page read "page" as the previous page (before setting it to the current page)."^^ . + . + . + . + "cryptography"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + "Looks like execute permission is needed, according to https://github.com/MaestroError/php-heic-to-jpg/commit/095898c4dca1a21da96929a0fb98c79f0dbbcddd"^^ . + "0"^^ . + . + . + . + "2"^^ . + "0"^^ . + "755 doesn't work either"^^ . + . + "Yes, the phpX.Y-dev packages are for PHP module development (e.g. compilation)."^^ . + . + . + . + "2"^^ . + . + "Laravel responds with a 404 not found where there is a route for it"^^ . + . + . + . + . + . + . + . + . + . + . + . + "False. Will add to OP"^^ . + "recaptcha"^^ . + . + "0"^^ . + "Code charge studio 5.1 converting project from 4.3 ver gives converter script error - wrong number of arguments or property assignment"^^ . + "1"^^ . + . + "Is this a problem with jQuery sending the request, or with PHP handling it?"^^ . + "openssl"^^ . + . + . + . + . + . + . + . + "The principles are clearly explained in many places, including here: https://www.greatfrontend.com/questions/quiz/explain-event-delegation . Attach the event handlers to an element which is a parent of where you want to add the modals into, and then check the actual target in the event handler to determine if it was specifically a modal that was clicked. Give it a try, if you get stuck, [edit] the question with your attempt and explain what you've observed while testing your code."^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + "shipping-method"^^ . + "<p>Instead of storing the postcode in a session variable, you should first force guest users WC session initialization with the following:</p>\n<pre class="lang-php prettyprint-override"><code>add_action( 'woocommerce_init', 'force_non_logged_user_wc_session' );\nfunction force_non_logged_user_wc_session(){ \n if( is_user_logged_in() || is_admin() ) {\n return;\n }\n\n if ( isset(WC()-&gt;session) &amp;&amp; ! WC()-&gt;session-&gt;has_session() ) {\n WC()-&gt;session-&gt;set_customer_session_cookie( true ); \n }\n}\n</code></pre>\n<p>Code goes in functions.php file of your child theme or in a plugin.</p>\n<p>Now you can set the postcode directly in your <strong>Step 1</strong> from your defined <code>$postcode</code> variable using the following:</p>\n<pre class="lang-php prettyprint-override"><code>WC()-&gt;customer-&gt;set_shipping_postcode( $postcode );\n</code></pre>\n<p>And you don't need a <strong>step 2</strong>.</p>\n"^^ . + ".htaccess in server/public should not interfere with cookies, but ensure it is not overriding any headers related to cookies"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + "2"^^ . + . + "Updated the answer. :)"^^ . + . + . + "2"^^ . + . + "Please never `die()` and print raw query errors. Please never `trim()` passwords. Why do you call `password_verify()` twice when once is enough? What are the column details. This question Needs Debugging Details."^^ . + "0"^^ . + "<p>In my Symfony project I have these Doctrine models:</p>\n<p>One for my User</p>\n<pre><code>declare(strict_types=1);\n\nnamespace App\\Entity;\n\nuse Doctrine\\ORM\\Mapping as ORM;\nuse App\\Entity\\Business;\n\n#[ORM\\Entity()]\nclass User\n{\n #[ORM\\Id]\n #[ORM\\GeneratedValue]\n #[ORM\\Column(type: 'integer')]\n private $id;\n\n #[ORM\\OneToMany(targetEntity: Business::class, mappedBy:&quot;user&quot;)]\n private Business $business;\n #[ORM\\Column(type: 'string', length: 180, unique: true)]\n private $email;\n\n public function getId(): ?int\n {\n return $this-&gt;id;\n }\n\n public function getEmail(): ?string\n {\n return $this-&gt;email;\n }\n\n public function setEmail(string $email): self\n {\n $this-&gt;email = $email;\n return $this;\n }\n\n public function getBusiness(): ?Business\n {\n return $this-&gt;business;\n }\n\n public function setBusiness(?Business $business): self\n {\n $this-&gt;business = $business;\n return $this;\n }\n}\n\n</code></pre>\n<p>And I one for Business:</p>\n<pre><code>declare(strict_types=1);\n\nnamespace App\\Entity;\n\nuse Doctrine\\ORM\\Mapping as ORM;\n\n#[ORM\\Entity]\nclass Business\n{\n #[ORM\\Id]\n #[ORM\\Column(type: 'integer')]\n #[ORM\\GeneratedValue(strategy: 'AUTO')]\n private $id;\n\n #[ORM\\ManyToOne(targetEntity: User::class, inversedBy: 'business')]\n #[ORM\\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]\n private User $user;\n\n #[ORM\\Column(type: 'string')]\n private string $name = &quot;&quot;;\n\n public function getId(): int\n {\n return $this-&gt;id;\n }\n\n public function getName(): string\n {\n return $this-&gt;name;\n }\n\n public function setName(string $name):void\n {\n $this-&gt;name = trim($name);\n }\n\n public function getUser(): User\n {\n return $this-&gt;user;\n }\n\n public function setUser(User $user):void\n {\n $this-&gt;user = $user;\n }\n\n}\n\n</code></pre>\n<p>Now I try to use doctrine and its query builder in order to run the equivalent of this sql query:</p>\n<pre><code>select\n user.*,\n business_count.count\nfrom\n user\njoin (\n select\n count(*) as count,\n user_id\n from\n business\n group by\n user_id) as business_count on business_count.user_id = user.id;\n</code></pre>\n<p>In order to do this I made this console command:</p>\n<pre><code>&lt;?php\n\nnamespace App\\Command;\n\nuse App\\Entity\\Business;\nuse App\\Entity\\User;\nuse Doctrine\\ORM\\EntityManagerInterface;\nuse Doctrine\\ORM\\Query\\Expr\\Join;\nuse Symfony\\Component\\Console\\Attribute\\AsCommand;\nuse Symfony\\Component\\Console\\Command\\Command;\nuse Symfony\\Component\\Console\\Input\\InputArgument;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\nuse Symfony\\Component\\Console\\Input\\InputOption;\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\nuse Symfony\\Component\\Console\\Style\\SymfonyStyle;\n\n#[AsCommand(\n name: 'test:query',\n description: 'Add a short description for your command',\n)]\nclass TestQueryCommand extends Command\n{\n public function __construct(private readonly EntityManagerInterface $em)\n {\n parent::__construct();\n }\n\n protected function execute(InputInterface $input, OutputInterface $output): int\n {\n $businessCountQuery = $this-&gt;em-&gt;createQueryBuilder()\n -&gt;select('count(b.id) as count,user_id')\n -&gt;from(Business::class ,'b')\n -&gt;groupBy('b.user_id')\n -&gt;getDql();\n\n $qbU = $this-&gt;em-&gt;createQueryBuilder();\n $qU=$qbU-&gt;from(User::class, 'u')\n -&gt;select('u',&quot;bc.count&quot;)\n -&gt;join('('.$businessCountQuery.')','bc',Join::ON,'u.id = bc.user_id')\n -&gt;setMaxResults(5)\n -&gt;getQuery();\n\n $output-&gt;writeln($qU-&gt;getSql());\n\n $results = $qU-&gt;getResult();\n foreach ($results as $result) {\n $output-&gt;writeln(&quot;User ID: &quot; . $result['u']-&gt;getId()); // Assuming 'u' is the User entity\n $output-&gt;writeln(&quot;Business Count: &quot; . $result['bc.count']);\n $output-&gt;writeln(&quot;----------------------------&quot;);\n }\n\n\n return Command::SUCCESS;\n }\n}\n\n</code></pre>\n<p>But once I run this command:</p>\n<pre><code>php bin/console test:query\n</code></pre>\n<p>I get the following error:</p>\n<pre><code> [Semantical Error] line 0, col 48 near 'JOIN (SELECT': Error: Subquery is not supported here \n\n</code></pre>\n<p>So how I can use subqueries in doctrine in order to get counts?</p>\n"^^ . + . + "google-cloud-vertex-ai"^^ . + . + . + "obfuscation"^^ . + . + "image"^^ . + . + "0"^^ . + . + "php-curl"^^ . + . + . + "0"^^ . + "TailwindCSS PostCSS Build Error: Cannot read properties of undefined (reading 'blocklist')"^^ . + "<p>I'm working on a Symfony 7 project with EasyAdmin, and I'm trying to allow users to build article pages with different types of content, such as text blocks, image blocks, blocks with links, etc. To achieve this, I want to dynamically modify the form using the Symfony documentation on dynamic form modification: Symfony Documentation.</p>\n<p>Here's what I've done so far:</p>\n<p>In my ArticleCrudController, I'm using a CollectionField to handle adding and removing blocks:</p>\n<pre><code>CollectionField::new('blocks', 'Blocs')\n -&gt;renderExpanded(true)\n -&gt;setEntryIsComplex()\n -&gt;setEntryType(BlockType::class),\n</code></pre>\n<p>In the BlockType.php file, I add EventListeners to adjust the fields based on the selected type (text, link, etc.):</p>\n<pre><code>$builder\n -&gt;add('type', ChoiceType::class, [\n 'choices' =&gt; [\n 'Text' =&gt; 'text',\n 'Link' =&gt; 'link',\n ],\n ]);\n\n$formModifier = function (FormInterface $form, $data = null) {\n if (is_array($data) &amp;&amp; $data['type'] === 'text') {\n $form-&gt;add('text', TextareaType::class);\n } elseif (is_array($data) &amp;&amp; $data['type'] === 'link') {\n $form-&gt;add('url', UrlType::class);\n }\n};\n\n$builder-&gt;addEventListener(\n FormEvents::PRE_SET_DATA,\n function (FormEvent $event) use ($formModifier) {\n $data = $event-&gt;getData();\n $formModifier($event-&gt;getForm(), $data);\n }\n);\n\n$builder-&gt;get('type')-&gt;addEventListener(\n FormEvents::POST_SUBMIT,\n function (FormEvent $event) use ($formModifier) {\n $type = $event-&gt;getForm()-&gt;getData();\n $formModifier($event-&gt;getForm()-&gt;getParent(), $type);\n }\n);\n\n$builder-&gt;setAction($options['action']);\n\n</code></pre>\n<p>I’m also adding some JavaScript inspired by the documentation to handle the form modification on the client side. Here’s the JS code I’m using to listen for changes and update the form:</p>\n<pre><code>document.addEventListener('DOMContentLoaded', function() {\n document.querySelector('.btn.btn-link.field-collection-add-button').addEventListener('click', function() {\n setTimeout(() =&gt; {\n const form_select_type = document.getElementById('Article_blocks_0_type');\n if (form_select_type) {\n const form = document.getElementById('new-Article-form');\n const block_0 = document.getElementById('Article_blocks_0');\n\n const updateForm = async (data, url, method) =&gt; {\n const req = await fetch(url, {\n method: method,\n body: data,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'charset': 'utf-8'\n }\n });\n\n const text = await req.text();\n return text;\n };\n\n const parseTextToHtml = (text) =&gt; {\n const parser = new DOMParser();\n const html = parser.parseFromString(text, 'text/html');\n return html;\n };\n\n const changeOptions = async (e) =&gt; {\n const requestBody = e.target.getAttribute('name') + '=' + e.target.value;\n const updateFormResponse = await updateForm(requestBody, form.getAttribute('action'), form.getAttribute('method'));\n const html = parseTextToHtml(updateFormResponse);\n\n const new_block_0 = html.getElementById('Article_blocks_0');\n block_0.innerHTML = new_block_0.innerHTML;\n };\n\n form_select_type.addEventListener('change', (e) =&gt; changeOptions(e));\n }\n }, 500);\n });\n});\n</code></pre>\n<p>The problem I'm facing is that, currently, when I change the value of the select dropdown, the new fields don't appear as expected. This is due to the errors that show up in the console. Specifically,\n<code>the 405 Method Not Allowed error </code>\nand the\n<code>TypeError: Cannot read properties of null (reading 'innerHTML').</code></p>\n<p>I tried to manually force the choice of the method, but it didn’t work.</p>\n<p>I also tried to follow the JavaScript example from this post: (<a href="https://stackoverflow.com/questions/71052408/dynamic-form-modification-for-collectionfield-in-easyadmin">Dynamic form modification for CollectionField in EasyAdmin</a>) since the author was trying to do the same thing as me, but I don’t fully understand the code and it didn’t work either.</p>\n<p>As a workaround, I’ve displayed all possible fields for the block (such as text, link, etc.) without worrying about the selected type, and made every fields not required. Then, I hide the fields that don’t match the selected type. While this approach works initially, it’s not an ideal solution, and it leads to issues with maintainability and performance. I really want to find a proper solution where only the relevant field for the selected block type is shown, making the form more optimized and dynamic.</p>\n<p>Has anyone encountered a similar issue or implemented a dynamic form modification like this before? If anyone has any suggestions or can help me resolve the errors , I’d greatly appreciate it!</p>\n"^^ . + "python-requests"^^ . + . + . + . + "And the presence of `object` in the function signature - i.e. `displayST(object $pdo` should have already given you the hint that an object is required for that parameter. It's unclear why you attempted to just provide a piece of text, or how you thought the function would then be able to make use of that to query the database (it uses `$pdo->prepare` later on, as you hopefully noticed)?? Do you understand the difference between the various data types in PHP (objects, strings, numbers, arrays etc)?"^^ . + . + . + . + . + . + . + . + . + . + "1"^^ . + "you can construct a shortcode and execute it with "do_shortcode", look here : https://stackoverflow.com/questions/79387479/wordpress-nested-shortcodes-fix-required/79387484#79387484"^^ . + . + . + . + . + "0"^^ . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + "grafana"^^ . + . + . + . + "1"^^ . + "2"^^ . + "2"^^ . + . + . + "0"^^ . + . + . + "In this case, it downloads wp-login.php file, instead of running it."^^ . + . + . + . + "0"^^ . + "This question is similar to: [How can I install extension php\\_fileinfo in my php.ini in Windows 10](https://stackoverflow.com/questions/69906186/how-can-i-install-extension-php-fileinfo-in-my-php-ini-in-windows-10). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem."^^ . + . + "0"^^ . + . + "imagemagick"^^ . + . + . + . + . + . + . + . + . + "ok but if i comment that view and dd($count); nothing happend. and i don't understand why"^^ . + "0"^^ . + "iis-7.5"^^ . + . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + "i would like to share with you that wincache is not supported by PHP on version 8.x. if you are still trying with other suggestion and would like to know the reason you can go to php folder and run the command php -m that will give you more detail why the extension is not getting loaded"^^ . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "How to retain the selected dates in datepicker after submit in PHP"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + "`My contact_api.php is in: intello_web > includes > api > contact_api.php`...well then you simply didn't traverse up enough levels. `__DIR__ . '/../vendor/autoload.php'` will resolve to `/includes/vendor/...` etc - exactly as the information in the error message shows you. You just need to go up two levels, e.g. `__DIR__ . '/../../vendor/autoload.php'` by the looks of it"^^ . + . + . + "0"^^ . + . + . + . + . + "1"^^ . + . + "1"^^ . + . + "PHP extensions are not being installed correctly while using Docker"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + "@MikeKinghan It's not me that's wanting to do that, it's the makefile generated by the PHP configure."^^ . + "Have you checked what you get on the receiving end? 422 just means "unprocessable entity". Could be for something unrelated. I have this exact code working here, no changes. I get the file ok (with the random filename https://cln.sh/kBdgGyM77MPwPhq4WPyZ). And the controller couldn't be more vanilla https://cln.sh/nFs2shwM3x0Fw0qRR50x"^^ . + . + . + "Did you try to use [`pg_query()` or `pg_query_params()`](https://www.php.net/manual/en/function.pg-query-params.php) to send a [`SET search_path='your_schema';`](https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH) or [`SELECT set_config('search_path','your_schema',false);`](https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADMIN-SET-TABLE) before running your `pg_update()` with just the table name, omitting the schema?"^^ . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + "@MarkusZeller Yeah, I know. But the syntax for using `static` to call a non-static method isn't clearly explained anywhere in the documentation. I've updated the original post to make that point clearer."^^ . + . + . + . + . + "1"^^ . + . + "2"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + "2"^^ . + . + . + "also you can check if its pending if the queue worker is pending using `php artisan queue:work\n` https://laravel.com/docs/12.x/queues"^^ . + . + . + . + . + . + . + "Session conflicts when multiple fat-free-framework based apps are running on the same browser"^^ . + . + . + "@hakre have tried different ways to access FIREBASE_CREDENTIALS, including using withServiceAccount(env('FIREBASE_CREDENTIALS')). I also tried setting the full absolute path in the .env file, but it didn’t work either. I verified that Laravel can read the file using the /check-firebase-key route, and it prints the contents correctly."^^ . + . + "0"^^ . + . + . + . + "@Crunchip happy to help!"^^ . + . + "0"^^ . + . + "Please refer to https://www.php.net/manual/en/features.file-upload.php"^^ . + . + . + "0"^^ . + "1"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + "facebook"^^ . + "<p>After doing a manual installation of PHPMailer, I can't get it to run, although everything seems to be right.</p>\n<p>In my efforts to debug it, my impression is that it's failing on the 'require'. The path is correct with 'resources' being a directory at the root level of the site.</p>\n<p>Is there a problem in nesting PHPMailer like this? I've tried moving it to the root level and still get no result.</p>\n<pre><code>use PHPMailer\\PHPMailer\\PHPMailer;\nuse PHPMailer\\PHPMailer\\SMTP;\nuse PHPMailer\\PHPMailer\\Exception;\n\nrequire 'resources/includes/PHPMailer/src/Exception.php';\nrequire 'resources/includes/PHPMailer/src/PHPMailer.php';\nrequire 'resources/includes/PHPMailer/src/SMTP.php';\n</code></pre>\n<p>FWIW, my debugging has been to insert an echo then terminate the script. It responds before the 'require' but not after.</p>\n"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + "Shopware 6.6.10 fetch cart items from storefront via API"^^ . + "<p>I found a workable approach using traits. While I have to add the <code>use MyFix</code> line to a dozen of services, the fix itself is at least stored in one place in the codebase.</p>\n<p>I still prefer to completely replace the class, yet this works good enough.</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\ninterface Contract\n{\n public static function getFoo(): string;\n}\n\nclass ExternalDependency implements Contract\n{\n\n public static function getFoo(): string\n {\n return 'gnarf!';\n }\n}\n\ntrait MyFix\n{\n public static function getFoo(): string\n {\n return 'Foo';\n }\n}\n\n\nclass Service extends ExternalDependency\n{\n use MyFix;\n}\n\nvar_dump(Service::getFoo());\nvar_dump(Service::getFoo() === 'Foo');\n</code></pre>\n"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + "Unexpected Redirect to /home in Laravel Multi-Guard Auth - Route Not Working (302)"^^ . + . + "1"^^ . + . + . + . + . + . + . + "fgetcsv"^^ . + . + "0"^^ . + . + "hello I was able to get that resolved and i've updated my question. thank you. @hakre"^^ . + . + "1"^^ . + . + . + . + "Azure Web App 502 error - cannot find source & no log errors"^^ . + . + "1"^^ . + . + . + "0"^^ . + . + . + "1"^^ . + . + . + "That means nothing without seeing the script that processes the request. Is `admin-ajax.php` a script of your own or something that comes from WooCommerce?"^^ . + "0"^^ . + "1"^^ . + "It's ok the use the BR for this, but the BR is more valuable with 3 or more terms, or 2 terms with unique constants. \nPython example https://online-python.com/gcQIfUAHP3, Php example https://onlinephp.io/c/c978a"^^ . + . + "0"^^ . + . + . + "Thank you very much ;) muchas gacias :) It was compressed before"^^ . + . + . + . + . + . + . + . + . + . + . + "<p>If you are trying to accomplish this with SPA, <a href="https://laravel.com/docs/12.x/sanctum#spa-authentication" rel="nofollow noreferrer">Laravel sanctum</a> will do the trick.</p>\n<p>Before calling the <code>/register</code> endpoint, you should call the <code>/sanctum/csrf-cookie</code> and point so that your request will automatically have the necessary cookies.</p>\n<p>Make sure that you also have your backend properly configured to make it <a href="https://laravel.com/docs/12.x/sanctum#spa-configuration" rel="nofollow noreferrer">SPA enabled</a>.</p>\n<p>So your axios call might look like this.</p>\n<pre><code>axios.get('/sanctum/csrf-cookie').then(response =&gt; {\n axios.post('/api/register', {\n email: email,\n password: password\n }).then(response =&gt; {\n console.log(response)\n })\n})\n</code></pre>\n<p>Hope this helps.</p>\n"^^ . + "symfony-forms"^^ . + "0"^^ . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + . + "1"^^ . + "PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>woocommerce</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later."^^ . + . + . + . + . + "See https://stackoverflow.com/a/32172422/476 for how to convert the escape-sequence strings into actual strings. That basically gives you the same as your `$iso_string_from_raw`. If outputting that results in mojibake, that's because your output is expected to be Latin1, not UTF-8. For that, decide whether you want to output UTF-8 or Latin1, and convert/adjust accordingly; see https://stackoverflow.com/q/279170/476."^^ . + "<p>I am building a management system to handle composer updates on a group of websites.</p>\n<p>The issue I am encountering is authenticating with a private repository.</p>\n<p>There is an <code>auth.json</code> file, and running composer in the shell works with the private repo.</p>\n<p>When running the script it returns a fatal error:</p>\n<blockquote>\n<p>Host key verification failed.</p>\n</blockquote>\n<p>The following executes with public repos, but fails with the private repos included in the composer.json file.</p>\n<p>Here is the script:</p>\n<pre><code>use Composer\\Console\\Application;\nuse Symfony\\Component\\Console\\Input\\ArrayInput;\n$composerHome = Files::websiteRootDirectory();\nputenv(&quot;COMPOSER_HOME='$composerHome/'&quot;)\n$input = new ArrayInput(array('command' =&gt; 'update'));\n$application = new Application();\n$application-&gt;setCatchExceptions(false);\n$application-&gt;setAutoExit(false);\n$application-&gt;run($input);\n</code></pre>\n<p>I suspect it has to do with an environment setting, but I can't find out what that setting is - I know where the <code>auth.json</code> file is, but if that is what is wrong or how to set it in the script, I don't know.</p>\n<p><em>Edit:</em> I figured out a bit more - composer is looking for the path to the <code>COMPOSER_CAFILE</code>. I do have a certificate registered with git, so I set the path to the directory, then the private key file, then the public key file and all I get is</p>\n<blockquote>\n<p>A valid CA certificate file is required for SSL/TLS</p>\n</blockquote>\n"^^ . + . + . + "That's it, @phihag! I had a feeling it's about the namespace and I even tried to add things like `html:div`. Do you know if tags can be somehow prefixed if we don't register the namespace manually?"^^ . + "logging"^^ . + . + "<p>I am trying to learn how to make a login/register page on html, and I need to have a database to store the account details. I already have MySQL Workbench installed and used it for different projects.</p>\n<p>I tried installing XAMPP, but it had a conflict with the MySQL Workbench, how do I connect PHP without XAMPP? I already uninstalled XXAMP, because I got frustrated last night from the errors.</p>\n"^^ . + . + "Why not **map all uploads** to a **common location**? This way: **Files won’t be duplicated** across different locations. and They will be **accessible to all servers**, ensuring consistency and reducing storage overhead. Ex: `/data/upload`"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + "Unless your file includes a BOM, Notepad++ can only _guess_ a matching encoding. What does the content look like, when you explicitly set it to interpret the loaded file _in_ UTF-16LE encoding?"^^ . + . + . + "1"^^ . + . + . + . + . + "1"^^ . + . + "And as ADyson mentioned in the comments, you can use the `mobiledetectlib` to detect for mobile, as it coves almost all the cases."^^ . + . + "2"^^ . + . + . + "1"^^ . + . + . + . + . + "0"^^ . + "<p>If we look at the calendar, we can see that December 30 and 31, 2024, technically belong to the first week of 2025. However, if you divide the dates by year and week, you will get the wrong result because the last week of 2024 is 01. If I display this in the <code>W Y</code> format, it will show <code>01 2024</code>, but it should have been <code>01 2025</code> in the <code>W o</code> format.</p>\n<ul>\n<li><a href="https://www.php.net/manual/en/datetime.format.php" rel="nofollow noreferrer"><code>date_format</code></a> - PHP Manual</li>\n</ul>\n<blockquote>\n<p><code>Y</code>: A full numeric representation of a year, at least 4 digits, with - for years BCE.</p>\n<p><code>o</code>: ISO 8601 week-numbering year. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</p>\n</blockquote>\n<pre class="lang-php prettyprint-override"><code>$date-&gt;format('W o');\n</code></pre>\n<ul>\n<li><a href="https://onlinephp.io/c/0d4dbb" rel="nofollow noreferrer">PHP Playground</a></li>\n<li><a href="https://laravelplayground.com/#/snippets/3c293d3c-28a9-4686-8aa1-fc943018f3c8" rel="nofollow noreferrer">Laravel Playground</a></li>\n</ul>\n<p>There is a calculation format where the first and last weeks of the year are combined. The WY format does exactly this, adding the December 30 and 31 dates to the first week of the current year (since only two days are missing from that week). In some cases, this is a favorable result, while in others, it is not.</p>\n"^^ . + . + . + . + "environment-variables"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + "pcre"^^ . + . + . + . + . + "2"^^ . + . + . + "<p>If you don' t like any of the built-in commands for this, you can easily set up a custom keybinding with an extension, <a href="https://marketplace.visualstudio.com/items?itemName=ArturoDent.jump-and-select" rel="nofollow noreferrer">Jump and Select</a>, that I wrote. A keybinding like:</p>\n<pre><code>\n{\n &quot;key&quot;: &quot;ctrl+a&quot;, // whatever you want here\n &quot;command&quot;: &quot;jump-and-select.jumpForwardSelect&quot;,\n &quot;args&quot;: {\n &quot;text&quot;: &quot;;&quot;\n }\n}\n</code></pre>\n<p>will select from the cursor to the next <code>:</code> character. Alternatively, you can omit the <code>args</code> and when you trigger that keybinding it will select to the next character you type (or &lt;kbd&gt;Escape&lt;/kbd&gt; to resume normal input. Actually, if all you want to do is the second thing, you don't need a keybinding at all, as there is a built-in keybinding of Shift-Alt+F which does the same thing.</p>\n"^^ . + . + . + "I was able to trim leading and trailing spaces using this function...\n\nfunction mb_trim($str) {\n return preg_replace("/^\\s+|\\s+$/u", "", $str); \n}\n\nstill... the split does not work... so I do not thinking the spaces are affecting it... meaning... the regular expression is either wrong for my use case or there is something else happening."^^ . + . + . + . + "<p><strong>You can use the render_block filter to detect your block variation</strong></p>\n<pre><code>function enqueue_hs_query_script_if_variation_present($block_content, $block) {\n // Check if the block is a 'core/query' block and has your specific class name\n if ($block['blockName'] === 'core/query' &amp;&amp; isset($block['attrs']['className']) &amp;&amp; strpos($block['attrs']['className'], 'hs-query-loop') !== false) {\n // Enqueue your script\n wp_enqueue_script(\n 'hs-query', \n get_template_directory_uri() . '/assets/js/scrolling-query-loop.js',\n array('jquery'),\n wp_get_theme()-&gt;get('Version'),\n true\n );\n }\n return $block_content;\n}\nadd_filter('render_block', 'enqueue_hs_query_script_if_variation_present', 10, 2);\n</code></pre>\n<p><strong>Also make sure your block variation has a unique class name</strong></p>\n<p>In your block-variations.js, you’ve already added a class name (hs-query-loop) to your block variation. This class name is used to identify the block variation in the render_block filter.</p>\n<pre><code>wp.blocks.registerBlockVariation(&quot;core/query&quot;, {\n name: &quot;horizontal-query&quot;,\n title: &quot;Scrolling Query Loop&quot;,\n description: &quot;Displays the Query Loop with horizontal scrolling and navigation buttons.&quot;,\n isActive: [&quot;namespace&quot;],\n attributes: {\n namespace: &quot;hs_query_loop&quot;,\n className: &quot;hs-query-loop&quot;,\n },\n scope: [&quot;inserter&quot;, &quot;transform&quot;],\n});\n</code></pre>\n"^^ . + "0"^^ . + . + . + . + . + "I *did* describe what I was looking for: a way to remedy the error in the code structure provided. Versions added."^^ . + . + "1"^^ . + "What result does the mentioned command produce instead of the expected result?"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + "header"^^ . + "why post to a file within your application?"^^ . + "<p>In PHP 7.1, trailing commas in array definitions are allowed when the array isn't being passed directly to a function. However, when arrays are passed as function arguments, trailing commas cause a syntax error in versions prior to PHP 7.3.</p>\n<pre><code>$methods_dom[] = preg_replace(\n [\n '/International/',\n // ...\n '/Non-Soft Pack Tier 1/', // &lt;-- Trailing comma here\n ],\n [\n 'Intl',\n // ...\n '', // &lt;-- Trailing comma here\n ],\n $methods\n);\n</code></pre>\n<p>For future issues, as best practice, enable full error reporting during development to catch issues early:</p>\n<pre><code>error_reporting(E_ALL);\nini_set('display_errors', 1);\n</code></pre>\n"^^ . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + "0"^^ . + "0"^^ . + "You probably should [edit] your question and add of what nature your changes of the path modification for Mpdf were, as it might be related to the missing interface."^^ . + "1"^^ . + "5"^^ . + . + "<p>As of right now this code works some what, but I need some help to fix the issue with it. I insured this php code into middle of my webpage, see example below:</p>\n<p>Page title here<br>\nNar bar here<br>\nSome more text here...</p>\n<pre><code>&lt;?php\n$file = fopen($_GET[&quot;potus&quot;] . &quot;.txt&quot;, &quot;r&quot;) or exit(&quot;Oh No. The info has not been found. Please try again.&quot;);\n//output a line of the file until the end is reached\nwhile(!feof($file))\n{\n//will return each line with a break\necho fgets($file). '&lt;br /&gt;';\n}\n\n?&gt;\n</code></pre>\n<p>Footer<br>\nSupport links i.e. home, about, search, etc</p>\n<p>I hope I can explain this well. Lets say I have a text file called &quot;abc.txt&quot;, &quot;cbs.txt&quot;, &quot;nbc.txt, and so on uploaded to my server that contains some information about a network like ABC, when someone enters example.com/usr?potus=abc, the site shows the tile, nav bar, some text, the contents of the text file, the footer and supporting links. No issues here anything works fine.</p>\n<p>Now here is where the issue happens if someone just enters example.com/usr or example.com/usr?potus=mouse, only the tap part of the site show, the tile, nav bar, some text, the error &quot;&quot;<em>Oh No. The info has not been found. Please try again.</em>&quot; shows, but anything below the error does not show witch is the footer and supporting links. I have looked at a lot of resources I have tried different type of codes and they all yield to the same results. If the text file is not found, anything below the error message &quot;Oh No. The info has... ...try again.&quot; like the footer and supporting links do not show.</p>\n<p>I am not sure how to fix this and this script that I have now, I have made other sites as well so they all have the same issue just never found a solution.</p>\n"^^ . + . + . + . + "Does the stack trace not extend to inside that function? That line in itself doesn't involve fwrite (as is easy to see) but presumably something within that function does. fwrite is ultimately a system call so it's unlikely the PHP version would affect its internal operations."^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "@Ben using htmlspecialchars before embedding it in a webpage is _output_ santisation, not input santisation, which is what you asked about. You only sanitise the data in context, when you know what environment it's going into and therefore what threats might exist. At the moment of input, you don't know that. What you're doing in your code above is really _validation_, not sanitisation."^^ . + . + . + . + "0"^^ . + "1"^^ . + "Anyone has hints about what's the problem here? - Laravel eager loading"^^ . + "0"^^ . + "1"^^ . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + "A DAL written to use either the Java or Node.js driver should be fine."^^ . + . + . + . + . + . + "0"^^ . + . + . + "@LoicTheAztec You totally right! I was testing while logged-in... I edited the answer, thanks !"^^ . + "Problem with Opennssl extension for create symfony project"^^ . + . + "<p>Apart from removing the extra div and using the article tag as intended, here is something much DRYer that is easier to read AND debug.</p>\n<pre class="lang-html prettyprint-override"><code>if (mysqli_num_rows($result) &gt; 0) { ?&gt;\n&lt;div class='job-container'&gt;\n &lt;ul class='job-list'&gt;\n &lt;?php while ($row = mysqli_fetch_assoc($result)) { \n $data = array_map('htmlspecialchars', $row);\n $company_logo = $data['company_logo'] ?? '';\n extract([\n 'job_name' =&gt; $data['job_name'] ?? '',\n 'company_name' =&gt; $data['company_name'] ?? '',\n 'logo_src' =&gt; $company_logo ? &quot;../../Employer/User/logos/$company_logo&quot; : '../assets/img/default-logo.png',\n 'logo_alt' =&gt; $company_logo ? &quot;$data[company_name] Logo&quot; : 'Default Logo',\n 'job_location' =&gt; $data['job_location'] ?? '',\n 'min_salary' =&gt; $data['min_salary'] ?? '',\n 'max_salary' =&gt; $data['max_salary'] ?? '',\n 'job_type' =&gt; $data['job_type'] ?? ''\n ]);\n ?&gt;\n &lt;li class='job-box'&gt;\n &lt;article class='job-card'&gt;\n &lt;div class='job-items'&gt;\n &lt;div class='company-logo'&gt;\n &lt;img src=&quot;&lt;?= $logo_src ?&gt;&quot; alt=&quot;&lt;?= $logo_alt ?&gt;&quot;&gt;\n &lt;/div&gt;\n &lt;div class='job-details'&gt;\n &lt;h4 class='job-title'&gt;\n &lt;a href='#?vacancyID=&lt;?= $job_name ?&gt;'&gt;&lt;?= $job_name ?&gt;&lt;/a&gt;\n &lt;/h4&gt;\n &lt;ul class='job-info'&gt;\n &lt;li class='company-name'&gt;&lt;?= $company_name ?&gt;&lt;/li&gt;\n &lt;li class='location'&gt;&lt;i class='fas fa-map-marker-alt'&gt;&lt;/i&gt; &lt;?= $job_location ?&gt;&lt;/li&gt;\n &lt;li class='salary'&gt;₱&lt;?= $min_salary ?&gt; - ₱&lt;?= $max_salary ?&gt;&lt;/li&gt;\n &lt;/ul&gt;\n &lt;/div&gt;\n &lt;div class='items-link items-link2 f-right'&gt;\n &lt;a href='job_details.html' class='job-type'&gt;&lt;?= $job_type ?&gt;&lt;/a&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/article&gt;\n &lt;/li&gt;\n &lt;?php } ?&gt;\n &lt;/ul&gt;\n&lt;/div&gt;\n&lt;?php } else { ?&gt;\n&lt;p&gt;No job listings found matching your criteria.&lt;/p&gt;\n&lt;?php }\nmysqli_stmt_close($stmt);\n</code></pre>\n\n"^^ . + "0"^^ . + . + "A GET request isn't supposed to have a body. While you can technically send one with it, some web servers will probably not allow it/didn't think to include that as a valid use case."^^ . + . + . + . + "env PKG_CONFIG_PATH=/usr/local/lib/pkgconfig pkg-config --modversion libjpeg\n9.6.0"^^ . + . + . + . + "<p>I'm having trouble getting my favicon to appear in Google search results. It works fine in browser tabs, but in Google search, it shows the default globe icon instead of my custom favicon.</p>\n<p>Hosting Provider: Netcup\nFile Structure:\nindex.php (root)\nfavicon.ico (root) (192px X 192px)\nIn my head tag, I have</p>\n<pre><code>&lt;link rel=&quot;icon&quot; href=&quot;/favicon.ico&quot; type=&quot;image/x-icon&quot;&gt;\n</code></pre>\n<p>I also tried a favicon.png (192x192 and 512x512)</p>\n<pre><code>&lt;link rel=&quot;icon&quot; href=&quot;/favicon.png&quot; type=&quot;image/png&quot;&gt;\n</code></pre>\n<p>The favicon is accessible via <a href="https://example.org/favicon.ico" rel="nofollow noreferrer">https://example.org/favicon.ico</a>, and I added:</p>\n<pre><code>Allow: /favicon.ico\nAllow: /favicon.png\n</code></pre>\n<p>in the Robots.txt</p>\n<p>Favicon is visible when I open it in the browser.\nUsed URL Inspection Tool to request reindexing for favicon.ico.\nCleared Cache → Waited for Google to update (several days), but still no favicon in search results.\nTried placement → Made sure the tag is in the section.</p>\n<p>Thanks for your help!</p>\n"^^ . + "<p><strong>Here's my code, I'm creating a job-matching type of program and I'm trying to split the condition whether I'm gonna login as a user or an employer. The issue is, basically whenever i click the log in button on my HTML page, it doesn't redirect me to the home-page but it just reloads into the login page. I'd like to know the problem with my code, and how can I fix these issues so the next time I run into them later, I know what to do.</strong></p>\n<pre><code>&lt;?php\n session_start();\n require_once &quot;db-config.php&quot;;\n include(&quot;functions/applicant-login-check.php&quot;);\n include(&quot;functions/company-login-check.php&quot;);\n include(&quot;functions/password-hash.php&quot;);\n\n $email = $_POST[&quot;email&quot;];\n $password = $_POST['password'];\n $verifyPasswordHash = encryption($password);\n $verifyEmailHash = encryption($email);\n\n $user_data = isset($_SESSION['ApplicantID']) ? check_login($link) : null;\n $user_data = isset($_SESSION['CompanyID']) ? check_login_company($link) : null;\n\n if (isset($_POST['login-as'])) {\n $login_as = $_POST['login-as'];\n } else {\n $login_as = null;\n }\n\n if (isset($_SESSION['ApplicantID'])) {\n header(&quot;Location: home-page.php&quot;);\n exit;\n }\n\n if (isset($_SESSION['CompanyID'])) {\n header(&quot;Location: employer-dashboard-page.php&quot;);\n exit;\n }\n\n if ($_SERVER['REQUEST_METHOD'] == &quot;POST&quot;) {\n if (!empty($email) &amp;&amp; !empty($password)) {\n if ($login_as == 'applicant') {\n verify_if_applicant_exists();\n } elseif ($login_as == 'employer') {\n verify_if_company_exists();\n } else {\n echo &quot;Please select a role&quot;;\n }\n }\n }\n\n\n function verify_if_applicant_password_matches() {\n global $verifyPasswordHash, $user_data;\n if ($user_data['ApplicantPass'] === $verifyPasswordHash) {\n $_SESSION['ApplicantID'] = $user_data['ApplicantID'];\n $_SESSION['ApplicantFName'] = $user_data['ApplicantFName'];\n $_SESSION['ApplicantLName'] = $user_data['ApplicantLName'];\n header(&quot;Location: home-page.php&quot;);\n exit;\n }\n }\n\n function verify_if_company_password_matches() {\n global $verifyPasswordHash, $user_data;\n if ($user_data['CompanyPass'] === $verifyPasswordHash) {\n $_SESSION['CompanyID'] = $user_data['CompanyID'];\n $_SESSION['CompanyName'] = $user_data['CompanyName'];\n header(&quot;Location: employer-dashboard-page.php&quot;);\n exit;\n }\n }\n \n function verify_if_company_exists() {\n global $link, $verifyEmailHash, $user_data;\n $sql_query = &quot;SELECT * FROM company WHERE CompanyEmail = '$verifyEmailHash'&quot;;\n $result = mysqli_query($link, $sql_query);\n if ($result &amp;&amp; mysqli_num_rows($result) &gt; 0) {\n $user_data = mysqli_fetch_assoc($result);\n verify_if_company_password_matches();\n }\n }\n\n function verify_if_applicant_exists() {\n global $link, $verifyEmailHash, $user_data;\n $sql_query = &quot;SELECT * FROM applicants WHERE ApplicantEmail = '$verifyEmailHash'&quot;;\n $result = mysqli_query($link, $sql_query);\n if ($result &amp;&amp; mysqli_num_rows($result) &gt; 0) {\n $user_data = mysqli_fetch_assoc($result);\n verify_if_applicant_password_matches();\n }\n }\n?&gt;\n</code></pre>\n<p>Here's the code of the separated functions on where the $_SESSION[''] came from.</p>\n<p><strong>Functions</strong></p>\n<pre><code>&lt;?php\n $host = &quot;localhost&quot;;\n $user= &quot;root&quot;;\n $password= &quot;&quot;;\n $db = &quot;test_jobmatcher&quot;;\n\n $link = mysqli_connect($host, $user, $password, $db);\n\n if ($link === false) {\n die(&quot;ERROR: Could not connect. &quot; . mysqli_connect_error());\n }\n?&gt;\n</code></pre>\n<pre><code>&lt;?php\n include(&quot;db-config.php&quot;);\n\n function check_login($link) {\n if (isset($_SESSION['ApplicantID'])) {\n $id = $_SESSION['ApplicantID'];\n $sql = &quot;SELECT * FROM applicants WHERE ApplicantID = '$id'&quot;;\n $result = mysqli_query($link, $sql);\n\n if (mysqli_num_rows($result) &gt; 0) {\n $user_data = mysqli_fetch_assoc($result);\n if (isset($user_data['ApplicantFName'])) {\n $user_data['ApplicantFName'] = decryption($user_data['ApplicantFName']);\n }\n \n return $user_data;\n }\n else {\n return false;\n }\n }\n header(&quot;Location: login.php&quot;);\n die;\n }\n?&gt;\n</code></pre>\n<pre><code>&lt;?php\n include(&quot;db-config.php&quot;);\n\n function check_login_company($link) {\n if (isset($_SESSION['CompanyID'])) {\n $id = $_SESSION['CompanyID'];\n $sql = &quot;SELECT * FROM company WHERE CompanyID = '$id'&quot;;\n $result = mysqli_query($link, $sql);\n\n if (mysqli_num_rows($result) &gt; 0) {\n $user_data = mysqli_fetch_assoc($result);\n if (isset($user_data['CompanyName'])) {\n $user_data['CompanyName'] = decryption($user_data['CompanyName']);\n }\n \n return $user_data;\n }\n else {\n return false;\n }\n }\n header(&quot;Location: login.php&quot;);\n die;\n }\n?&gt;\n</code></pre>\n<p><strong>HTML Code:</strong></p>\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n&lt;head&gt;\n &lt;meta charset=&quot;UTF-8&quot;&gt;\n &lt;meta name=&quot;viewport&quot; content=&quot;width= , initial-scale=1.0&quot;&gt;\n &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot;&gt;\n &lt;title&gt;Document&lt;/title&gt;\n &lt;script src=&quot;javascript/page-scripts.js&quot;&gt;&lt;/script&gt;\n&lt;/head&gt;\n&lt;body&gt;\n &lt;script src=&quot;javascript/page-scripts.js&quot;&gt;&lt;/script&gt;\n &lt;div class=&quot;container&quot;&gt;\n &lt;form action=&quot;login.php&quot; method=&quot;post&quot;&gt;\n &lt;div class=&quot;login-container&quot;&gt;\n &lt;h1&gt;LOG IN&lt;/h1&gt;\n &lt;div class=&quot;credentials&quot;&gt;\n &lt;div class=&quot;login-selection&quot;&gt;\n &lt;label for=&quot;login-as&quot;&gt;LOG IN AS:&lt;/label&gt;\n &lt;select name=&quot;login-as&quot; id=&quot;login-as&quot; required&gt;\n &lt;option value=&quot;&quot; disabled selected&gt;Select Role&lt;/option&gt;\n &lt;option name = &quot;applicant&quot; value=&quot;applicant&quot;&gt;Applicant&lt;/option&gt;\n &lt;option name = &quot;employer&quot; value=&quot;employer&quot;&gt;Employer&lt;/option&gt;\n &lt;/select&gt;\n &lt;/div&gt;\n &lt;div class=&quot;email-container&quot;&gt;\n &lt;img id=&quot;email-icon&quot; src=&quot;assets/images/profile.png&quot;&gt; \n &lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email-input&quot; class=&quot;form-control&quot; placeholder=&quot;Email&quot;&gt;\n &lt;/div&gt;\n &lt;div class=&quot;password-container&quot;&gt;\n &lt;img id=&quot;password-icon&quot; src=&quot;assets/images/padlock.png&quot;&gt;\n &lt;input type=&quot;password&quot; name=&quot;password&quot; id=&quot;password-input&quot; class=&quot;form-control&quot; placeholder=&quot;Password&quot;&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;div class=&quot;login-actions&quot;&gt;\n &lt;div class=&quot;password-forgot&quot;&gt;\n &lt;a href=&quot;#&quot;&gt;Forgot Password?&lt;/a&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;div class=&quot;login-button&quot;&gt;\n &lt;button type=&quot;submit&quot; name=&quot;login-button&quot; class=&quot;btn-login&quot;&gt;Log In&lt;/button&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/form&gt;\n &lt;/div&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + . + "0"^^ . + "2"^^ . + . + . + . + . + "c"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + "2"^^ . + . + . + . + . + "2"^^ . + "0"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + "<p>I'm trying to use Polymorphic Relationships from this docs <a href="https://laravel.com/docs/12.x/eloquent-relationships#polymorphic-relationships" rel="nofollow noreferrer">https://laravel.com/docs/12.x/eloquent-relationships#polymorphic-relationships</a></p>\n<p>I have model Balance</p>\n<pre class="lang-php prettyprint-override"><code>class Balance\n{\n public $subject;\n public $subject_id;\n \n public function subjectable(): MorphTo\n {\n return $this-&gt;morphTo(__FUNCTION__, 'subject', 'subject_id');\n }\n\n}\n</code></pre>\n<p>Also I have simple mapping in AppServiceProvider</p>\n<pre class="lang-php prettyprint-override"><code> Relation::morphMap([\n 'shop' =&gt; 'App\\Models\\Shop',\n 'merchant' =&gt; 'App\\Models\\Merchant',\n ]);\n</code></pre>\n<p>So if the field <code>subject</code> contains 'shop' or 'merchant' - it works perfect.</p>\n<p>But database is external resource, it's not strict like the code, and there might be some strings, that is not in my models and my app structure. <strong>And I can't control database and change it.</strong></p>\n<p>If <code>subject</code> contains string 'abc' , I'm getting an error: Class &quot;abc&quot; not found.</p>\n<p>So it's impossible to use <code>-&gt;morphTo()</code> in this case.</p>\n<p>Is there a way to limit some &quot;allowed list&quot; of subjects (types), and return <code>null</code> or empty collection, if this <code>subject</code> not in my list?</p>\n<p><strong>UPD:</strong>\nI can't make check <code>$this-&gt;subject</code> inside relation function, because it's null.</p>\n<pre class="lang-php prettyprint-override"><code> public function subjectable() {\n var_dump($this-&gt;subject);\n if (in_array($this-&gt;subject, ['shop', 'merchant'])) {\n return $this-&gt;morphTo(__FUNCTION__, 'subject', 'subject_id');\n }\n return null;\n }\n</code></pre>\n<p>I'm trying:</p>\n<pre class="lang-php prettyprint-override"><code>$result = $query-&gt;with(['subjectable'])-&gt;get(); // $this-&gt;subject is null\n// or\n$result = $query-&gt;get(); \n$result-&gt;load(['subjectable']); // $this-&gt;subject is null\n</code></pre>\n"^^ . + "1"^^ . + "@KJ Yes, I agree, why work with an external API like this? You can test them for free, but after that they cost 39 US$ per month for their lowest tier. For that you can call the API a 1000 times per month, or roughly 1.5 times per hour. Hardly a rate anybody will expect. Prices only spiral after that and I'm sure at the end of the month all unused calls will expire. They do offer a lot of operations, but the costs can quickly explode. This is the same objection I have against most cloud services. It's flexible, great, but can cost a bomb."^^ . + "0"^^ . + "Thanks, will add a code instead of email ID and use post instead of GET."^^ . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "twilio browser hold, add, merge calls"^^ . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + . + "Anyway if `$msg` contains your textarea data, all you have to write is `$msg .= "\\n";` to add the newline (after the initial `$msg = ... ` line, obviously). Or if you need it _before_ the content, so it puts a newline at the end of some _earlier_ content in the file which this is appended to, then `$msg = "\\n".$msg;`. Do whichever works best for you. Again...if you knew you needed a newline character (as you said originally in your question), what exactly prevented you from simply adding that to the string already? Did you not know you could add things to a variable in PHP?"^^ . + . + . + "database-connectivity"^^ . + . + . + . + . + "1"^^ . + . + "<p>I'm new to Stack Overflow, and I'm trying to learn how to properly phrase my questions and comments. Recently, I replied to a question asking for clarification because the author had done something very similar to what I wanted to achieve. However, my comment was deleted after receiving several downvotes.</p>\n<p>Here’s what I wrote:</p>\n<blockquote>\n<p>I'm trying to do something very similar to what you did, but being a\nbeginner, I'm having a lot of difficulty getting my form to work. I've\ntried following several tutorials, but none are as close to what I\nwant to do as what you have achieved. Could you please detail a little\nmore how you managed to set this up? Especially on the JS part which\nis the one I have the most trouble with. Thank you very much for any\nhelp you could give me.</p>\n</blockquote>\n<p>I don’t understand why this comment was poorly received. I’d like to know:</p>\n<p>Why is this type of comment considered inappropriate on Stack Overflow?</p>\n<p>How can I ask a question or request clarification without risking deletion?</p>\n<p>If you're going to downvote this question, please explain me why </p>\n<p>Thanks for your advice! </p>\n"^^ . + "Is there any way to add link in order details page at shipment section?"^^ . + "0"^^ . + . + . + "2"^^ . + "How can I submit a form without breaking dynamic content in PHP with JavaScript?"^^ . + . + "2"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + "organization"^^ . + "1"^^ . + . + . + "package"^^ . + . + "0"^^ . + "1"^^ . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + "Thank you all! I first try to use the old init.php, but too match changes in file names etc.. Then I try as @ADyson suggested: in local environment install php and composer and install ilovepdf-php library (with all related packages dependencies). Then copy created vendor dir to server and use that and ilovepdf now work perfectly! Hurra!"^^ . + . + . + . + . + "Live Server is not Apache. You need to actually use Apache to serve the website"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + "<p>I am moving a project from Symfony 4 to Symfony 6, this means php7 to php8 as well. There was an okta/okta-sdk-php for php7, but there's nothing like that for php8.</p>\n<p>There are many OIDC packages out there, which ones are people using for php8 OKTA authentication?</p>\n"^^ . + . + "1"^^ . + . + . + . + . + . + "1"^^ . + . + . + "-2"^^ . + "simply add `chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache` and let me know if it works or not"^^ . + . + . + . + "<p>I use the fgetcsv() function to break a .CSV file into an array so I can insert the values into a database.</p>\n<p>The problem is that sometimes the corporation that I download these files from change columns around which changes their array number. Here is an example of a print_r of the CSV file:</p>\n<pre><code>Array ( [0] =&gt; Symbol [1] =&gt; Description [2] =&gt; Qty (Quantity) [3] =&gt; Price [4] =&gt; Price Chng % (Price Change %) [5] =&gt; Price Chng (Price Change ) [6] =&gt; Day Chng % (Day Change %) [7] =&gt; Day Chng (Day Change ) [8] =&gt; Cost Basis [9] =&gt; Gain % (Gain/Loss %) [10] =&gt; Gain (Gain/Loss ) [11] =&gt; Reinvest? [12] =&gt; Reinvest Capital Gains? [13] =&gt; Last Div (Last Dividend) [14] =&gt; Volume [15] =&gt; Security Type ) \nArray ( [0] =&gt; Test1 [1] =&gt; test desc [2] =&gt; 820 [3] =&gt; 19.505 [4] =&gt; -1.84% [5] =&gt; -0.365 [6] =&gt; -1.84% [7] =&gt; -300.37 [8] =&gt; 601.73 [9] =&gt; -18.4% [10] =&gt; -607.63 [11] =&gt; No [13] =&gt; 0.72025 [14] =&gt; 7041528 [15] =&gt; ETFs &amp; Closed End Funds ) \nArray ( [0] =&gt; Test2 [1] =&gt; test desc again [2] =&gt; 110 [3] =&gt; 49.715 [4] =&gt; -1.83% [5] =&gt; -0.925 [6] =&gt; -1.76% [7] =&gt; -98.00 [8] =&gt; 95.2 [9] =&gt; -8.78% [10] =&gt; -526.55 [11] =&gt; Yes [14] =&gt; 28668328 [15] =&gt; ETFs &amp; Closed End Funds ) \nArray ( [0] =&gt; Test3 [1] =&gt; test desc example [2] =&gt; 740 [3] =&gt; 21.71 [4] =&gt; -3.98% [5] =&gt; -0.9 [6] =&gt; -3.93% [7] =&gt; -657.59 [8] =&gt; 242.13 [9] =&gt; -20.63% [10] =&gt; -4176.73 [11] =&gt; No [13] =&gt; 2.0216 [14] =&gt; 2759846 [15] =&gt; ETFs &amp; Closed End Funds ) \n</code></pre>\n<p>You can see in the second array it has titles such as $column[0] is Symbol and $column[3] is Price.</p>\n<pre><code>[0] =&gt; Symbol [1] =&gt; Description [2] =&gt; Qty (Quantity) [3] =&gt; Price\n</code></pre>\n<p>Can I add code so that $column[0] for example will always display the symbol name? If the corporation decides to add a column or rearrange stuff, then it will change the Price column into another one like moving it from $column[3] to $column[5]. I am guessing there is a way I can have it search for whichever key that matches a column like Volume for example, then whatever key that is it could make sure all of the keys in every array for Volume will match that key number.</p>\n<p>I was manually just changing the array numbers when they did this, but they change it a lot so I am wondering if I can add some code to where the Symbol column would always be 0 and Price would always be in column 3 and the same applies to all of the column names. If they get rearranged they still have the same number as before?</p>\n<p>A small example of the CSV file:</p>\n<pre><code>&quot;Symbol&quot;,&quot;Description&quot;,&quot;Qty (Quantity)&quot;,&quot;Price&quot;,&quot;Price Chng % (Price Change %)&quot;,&quot;Price Chng $ (Price Change $)&quot;,&quot;Day Chng % (Day Change %)&quot;,&quot;Day Chng $ (Day Change $)&quot;,&quot;Cost Basis&quot;,&quot;Gain % (Gain/Loss %)&quot;,&quot;Gain $ (Gain/Loss $)&quot;,&quot;Reinvest?&quot;,&quot;Reinvest Capital Gains?&quot;,&quot;Last Div (Last Dividend)&quot;,&quot;Volume&quot;,&quot;Security Type&quot;\n&quot;Test1&quot;,&quot;ETF&quot;,&quot;820&quot;,&quot;$19.39&quot;,&quot;-2.42%&quot;,&quot;-$0.48&quot;,&quot;-2.42%&quot;,&quot;-$393.6&quot;,&quot;$601.73&quot;,&quot;-18.89%&quot;,&quot;-$3701.93&quot;,&quot;No&quot;,&quot;--&quot;,&quot;$0.72025&quot;,&quot;14,626,464&quot;,&quot;ETFs &amp; Closed End Funds&quot;\n&quot;Test2&quot;,&quot; ETF&quot;,&quot;110&quot;,&quot;$49.43&quot;,&quot;-2.39%&quot;,&quot;-$1.21&quot;,&quot;-2.39%&quot;,&quot;-$133.1&quot;,&quot;$995.2&quot;,&quot;-9.31%&quot;,&quot;-$557.9&quot;,&quot;Yes&quot;,&quot;--&quot;,&quot;N/A&quot;,&quot;59,351,095&quot;,&quot;ETFs &amp; Closed End Funds&quot;\n&quot;Test3&quot;,&quot; ETF&quot;,&quot;760&quot;,&quot;$21.77&quot;,&quot;-3.72%&quot;,&quot;-$0.84&quot;,&quot;-3.72%&quot;,&quot;-$638.4&quot;,&quot;$687.73&quot;,&quot;-20.02%&quot;,&quot;-$142.53&quot;,&quot;No&quot;,&quot;--&quot;,&quot;$2.0216&quot;,&quot;6,402,084&quot;,&quot;ETFs &amp; Closed End Funds&quot;\n</code></pre>\n"^^ . + . + . + . + "PHP variable as reference"^^ . + . + . + "1"^^ . + "What are you talking about this is my code!"^^ . + "1"^^ . + "0"^^ . + . + "are you sure your error is not from the unique validation? I think you mean to use "distinct" rule"^^ . + . + . + . + . + . + . + . + "So is `$mailTemplate->getContentHtml()` what actually renders the mail template? In that case, you'd have to somehow pass the values to that one then, I suppose?"^^ . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "@ChrisHaas That is what I also thought, so I added the **json decoder** with associative to true as a second argument to tranform the object in an associative array, and then I make a condition to make sure that it does have the format `$decoded_data = ["data" => [...]]`. but maybe i'm overlooking something? [3v4l.org/IbOX2](https://3v4l.org/IbOX2)"^^ . + . + . + . + . + . + . + . + . + "3"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + "1"^^ . + . + . + "1"^^ . + . + "0"^^ . + . + "Authenticating with OAuth 2.0 Application-Only error when curl/php posting"^^ . + . + . + . + "0"^^ . + "`i’m not sure what code to use to sanitize a username`...it's unclear why you think username would need "sanitising"? What are you expecting to be wrong with it? [filter_sanitize_email](https://www.php.net/manual/en/filter.constants.php#constant.filter-sanitize-email) removes characters that can't be in a valid email address. What do you think would be the equivalent for a username?? Is there some specific restriction you want to apply? Unlike emails there is no accepted common standard you can use, it's up to what you want in your own app. I personally see no reason to make restrictions on it"^^ . + . + . + "twitter"^^ . + "2"^^ . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + "2"^^ . + . + "0"^^ . + . + . + . + "Regarding those `b` prefixes: They are very old [Hungarian notation](https://datatables.net/blog/2014/datatables-1.10-beta#camelCase-notation) option names. Many (not all?) of them are still valid (mostly backwards compatible), but were replaced by more modern camel case option names. It is best to use the [modern names](https://datatables.net/upgrade/1.10-convert) (even though many older examples and tutorials use the old names, for obvious reasons). @C3roe"^^ . + "vite-reactjs"^^ . + . + "0"^^ . + "<p><strong>Here is the pattern that you are looking for:</strong></p>\n<p><code>[:LetterSpace:]*((LOOKBEHIND=[:Letter:])[:Dot:][:Letter|Space:]*)*</code></p>\n<p><strong>Regex Pattern (with 1 capturing group for full match):</strong></p>\n<pre><code>^([a-zA-Z ]+(?:(?&lt;=[a-zA-Z])\\.[a-zA-Z ]*)*)$\n</code></pre>\n<p><em>Regex Demo:</em> <a href="https://regex101.com/r/Cha5FW/5" rel="nofollow noreferrer">https://regex101.com/r/Cha5FW/5</a></p>\n<p><strong>Regex Patter for Match-Only:</strong></p>\n<pre><code>^[a-zA-Z ]+((?&lt;=[a-zA-Z])\\.[a-zA-Z ]*)*$\n</code></pre>\n<p><em>Regex Demo:</em> <a href="https://regex101.com/r/Cha5FW/6" rel="nofollow noreferrer">https://regex101.com/r/Cha5FW/6</a></p>\n<hr />\n<p><em>Edit: Added a lookbehind, <code>(?&lt;=[a-zA-Z])</code> before the literal dot, <code>\\</code>, to make sure that the literal dot is always immediately after a letter.</em></p>\n<hr />\n<p><em>Last Edit: Or we could simply do:</em></p>\n<pre><code>^([a-zA-Z ]+(?:\\b\\.[a-zA-Z ]*)*)$\n</code></pre>\n<p>Replaced <code>(?&lt;=[a-zA-Z])</code> with a <code>\\b</code>.<br />\nRegex demo link: <a href="https://regex101.com/r/Cha5FW/7" rel="nofollow noreferrer">https://regex101.com/r/Cha5FW/7</a> .</p>\n"^^ . + . + . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + "youtube"^^ . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + "<p>Sounds like a perfect job for the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/referrer" rel="nofollow noreferrer"><code>Document.referrer</code> property</a>:</p>\n<pre class="lang-js prettyprint-override"><code>if (document.referrer == '') {\n // direct URL entered\n} else if (document.referrer == 'mywebsite.com/pageA') {\n // arrived from /pageA\n}\n</code></pre>\n"^^ . + . + "0"^^ . + "<p>I am working on a WordPress FSE theme, and I'm using block variations.</p>\n<p>I have a query block variation to create a slider of posts, and everything is working. But the slider requires extra javascript that I enqueue using functions.php, however the script was loading on every page. Now I manage to load it only when the query block is present.</p>\n<p>It is close enough but I'd like the script to load only when the block variation is present.</p>\n<p>block-variations.js</p>\n<pre><code>wp.blocks.registerBlockVariation(&quot;core/query&quot;, {\n name: &quot;horizontal-query&quot;,\n title: &quot;Scrolling Query Loop&quot;,\n description: &quot;Displays the Query Loop with horizontal scrolling and navigation buttons.&quot;,\n isActive: [&quot;namespace&quot;],\n attributes: {\n namespace: &quot;hs_query_loop&quot;,\n className: &quot;hs-query-loop&quot;,\n },\n scope: [&quot;inserter&quot;, &quot;transform&quot;],\n });\n</code></pre>\n<p>and my functions.php</p>\n<pre><code>$id = get_the_ID();\nif (has_block('core/query', $id))\n{\n wp_enqueue_script(\n 'hs-query', \n get_template_directory_uri() . '/assets/js/scrolling-query-loop.js',\n array('jquery'),\n wp_get_theme()-&gt;get( 'Version' ),\n true,\n );\n}\n</code></pre>\n<p>I am not sure if I am using the best approach, since I have block-variations.js and my script on different files, both are included using the enqueue function. This is the best I have achieved so far.</p>\n"^^ . + . + . + . + . + . + . + . + "<p>I am trying to add a html form to my website that allows for users to select an option from data in my database multiple times, save it as a variable then display the options selected onto the screen.</p>\n<p>In my case I am aiming to have the user select 11 players from my database where the position = ST through to where position = GK. And once selected, the form being submitted and then the selected players displayed onto the screen in the same position. I currently have a grid layout setup for the positioning of the player selection and display after. I have multiple players in each position in my database so when selecting a player it would need to allow for all players of that position to be an option. Im sure this is pretty basic but i am new to php and am unsure what the best way to do this would be and could do with some help</p>\n<p>I have attempted to do this but recieved errors my code is as follows:</p>\n<pre><code>&lt;?php\n\nrequire_once(&quot;../loginPage/includes/db.inc.php&quot;);\n\nfunction displayST(object $pdo, $lastname, $firstname)\n{\n $query = &quot;SELECT lastname, firstname FROM icons WHERE position = 'ST';&quot;;\n $stmt = $pdo-&gt;prepare($query);\n $stmt-&gt;bindParam(':lastname', $lastname);\n $stmt-&gt;bindParam(':firstname', $firstname);\n $stmt-&gt;execute();\n\n while ($row = $stmt-&gt;fetch(PDO::FETCH_ASSOC)) { ?&gt;\n &lt;html&gt;\n\n &lt;form action=&quot;playerView.inc.php&quot;&gt;\n &lt;select name=&quot;ST&quot;&gt;\n &lt;option value=&quot;&lt;?php echo $row['firstname'] . $row['lastname'];?&gt;&quot;&gt;&lt;?php echo $row['firstname'] . $row['lastname'];?&gt;&lt;/option&gt;\n &lt;/select&gt;\n &lt;/form&gt;\n\n &lt;/html&gt;\n&lt;?php }\n\n}\n</code></pre>\n<p>On the main page:</p>\n<pre><code> &lt;?php\n displayST();\n ?&gt;\n</code></pre>\n<p>The error was:</p>\n<pre class="lang-none prettyprint-override"><code>Fatal error\n: Uncaught ArgumentCountError: Too few arguments to function displayST(), 0 passed in /Applications/MAMP/htdocs/assignment/mainPages/dreamTeam.php on line 97 and at least 1 expected in /Applications/MAMP/htdocs/assignment/mainPages/phpFunctions.inc.php:5 \nStack trace:\n #0 /Applications/MAMP/htdocs/assignment/mainPages/dreamTeam.php(97): displayST()\n #1 {main} thrown in\n</code></pre>\n<p>I have attached mock wireframes to explain better what i am trying to achieve, any guidance is appreciated</p>\n<p><img src="https://i.sstatic.net/AJBQrKU8.png" alt="Before Submitting form (select players)" /></p>\n<p><img src="https://i.sstatic.net/rUd9uAVk.png" alt="Upon submitting form (players displayed to screen)" /></p>\n"^^ . + . + "0"^^ . + "0"^^ . + . + . + "jetbrains-ide"^^ . + . + . + . + . + . + . + . + . + "Can you check if `bootstrap/cache/config.php` exists? Usually, the `php artisan optimize:clear` command should delete the cached configs, but since you mention `env()` is not working, the cache might still exists."^^ . + . + "-2"^^ . + "Have a look at this (see example after "Edit after OP update"): https://wordpress.stackexchange.com/questions/1/how-do-i-turn-off-self-closing-tags-for-markup-in-wordpress-for-html5-or-html4/116#116 - it's very similar to your attempt, only it also takes into account ajax queries and the backend (both bypassed)."^^ . + "`curl_exec()` failed, so you should call [`curl_error()`](https://www.php.net/manual/en/function.curl-error.php) to get the error message."^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "It would be better if you just explained the actual problem you were trying to solve here."^^ . + "0"^^ . + "1"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + "<p>Please image below. The sender is the same subject is the same email address of the sender is the same but they always go into separate email and not in one email thread as it should.</p>\n<p>Below is my PHP mailer script.</p>\n<pre><code>use PHPMailer\\PHPMailer\\PHPMailer;\nuse PHPMailer\\PHPMailer\\SMTP;\nuse PHPMailer\\PHPMailer\\Exception;\n\n//Load Composer's autoloader\nrequire 'vendor/autoload.php';\n\n\nfunction send_mail($to,$subject,$body,$from = '', $host = &quot;support@sensored.com&quot;){\n //Create an instance; passing `true` enables exceptions\n $mail = new PHPMailer(true);\n\n try {\n //Server settings\n// $mail-&gt;SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output\n $mail-&gt;isSMTP(); //Send using SMTP\n $mail-&gt;Host = 'mail.privateemail.com'; //Set the SMTP server to send through\n $mail-&gt;SMTPAuth = true; //Enable SMTP authentication\n $mail-&gt;Username = 'support@sensored.com'; //SMTP username\n $mail-&gt;Password = 'xxxxx'; //SMTP password\n $mail-&gt;SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption\n $mail-&gt;Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`\n\n //Recipients\n $mail-&gt;setFrom($host, $from);\n // $mail-&gt;addAddress($to, 'Subscriber'); //Add a recipient\n $mail-&gt;addAddress($to); //Name is optional\n // $mail-&gt;addReplyTo('support@sensored.com', 'Sensored Support');\n //$mail-&gt;addCC('cc@example.com');\n $mail-&gt;addBCC('sensored@gmail.com');\n\n //Attachments\n // $mail-&gt;addAttachment('/var/tmp/file.tar.gz'); //Add attachments\n // $mail-&gt;addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name\n\n //Content\n $mail-&gt;isHTML(true); //Set email format to HTML\n $mail-&gt;Subject = $subject;\n $mail-&gt;Body = $body;\n //$mail-&gt;AltBody = ' ';\n\n $mail-&gt;send();\n echo 'Message has been sent';\n } catch (Exception $e) {\n echo &quot;Message could not be sent. Mailer Error: {$mail-&gt;ErrorInfo}&quot;;\n }\n}\n</code></pre>\n<p><a href="https://i.sstatic.net/TRwBwnJj.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TRwBwnJj.png" alt="enter image description here" /></a></p>\n"^^ . + "<p>My suggestion is not to create a problem you don't have - this sounds like <em>premature optimisation</em>, and you're imagining extreme scenarios rather than realistic ones.</p>\n<p>As I pointed out in the comments, unused code won't have any <em>run-time</em> impact, because autoloading will ensure that only used classes are actually loaded into memory. So what we're talking about here is <em>download</em> size.</p>\n<p>The numbers you are suggesting are 50 to 100 classes, and it sounds like these will be relatively simple - maybe a few hundred lines of code each. Yet in comments you mention a concern that it could reach 10MB - at 50 bytes per line, and 200 lines per file, that's <em>one thousand</em> classes.</p>\n<p>Having 1000 packages (or config items of any sort) would create far more effort than it would save, but at the point where you have 1000 classes, I suspect you will be able to identify categories - maybe some are physical measurements (length, area, etc), some are financial, some digital (bytes, etc), some to do with time, etc. Creating a package for <em>each of those categories</em> would then make sense.</p>\n<p>As <a href="https://stackoverflow.com/a/79444038/157957">Raghavendra N's answer</a> points out, you can then have a &quot;parent&quot; package which has no code, but depends on all the categories, as a short-hand for loading all of them. Since this can silently replace the existing &quot;monolithic&quot; package, you can cross the bridge when you come to it - if and when the package <em>actually</em> gets too large, create the sub-packages, and go back through your apps using those to save space.</p>\n"^^ . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + "I don't deal with Moodle a lot, so I'm just shooting in the dark a bit. You are sending an object with a single key called `data`. Have you tried wrapping that in one additional array: https://3v4l.org/mOk52"^^ . + "POST data is not logged by default in any platform, for a number of reasons: it can contain confidential data, it can be huge and flood logs/ fill up disc space..."^^ . + . + . + "Oh wait. I got it. If I try running it locally with wampserver, it doesn't work, but when I put the file online, it does, so I'm getting somewhere. Thank you."^^ . + . + "0"^^ . + . + "posix"^^ . + "1"^^ . + . + "Uncaught Error: Call to undefined function create_function() $this->$base = create_function"^^ . + . + "<p>I freshly install <strong>Laravel 12 livewire starter kit</strong>. installation completed without any issue. When submit the user details in register page I found that the page is not correctly submitting the form .URL is appended with query strings instead of submitting. when I check the console it show errors. I can see the same issue in login page also.</p>\n<pre><code>GET http://localhost/flux/flux.js?id=e42ce913 net::ERR_ABORTED 404 (Not Found)\nGET http://localhost/livewire/livewire.js?id=65f3e655 net::ERR_ABORTED 404 (Not Found)\n</code></pre>\n<p>How can I fix this issue?</p>\n"^^ . + "<p>EDITED\nSo i bought this Laundry POS Application from codeanyon and want to run it on stand alone computer ( not server) or hosting online\n<a href="https://codecanyon.net/item/laundry-box-pos-and-order-management-system/36501827?s_rank=1" rel="nofollow noreferrer">This is the app purchased</a>.</p>\n<p>Also this is their documenation which seems to be obselete and old <a href="https://xfortechpvtltd.gitbook.io/laundry-box" rel="nofollow noreferrer">Here</a>.</p>\n<p>while discussing with them, they said i can use XAMPP, however with all the support shared by stackoverflow fellow professionals, it was adviced not to. thus ill do as adviced after having help to deploy.</p>\n<p>As i understood, the app uses artisan to install requiremnts.\ni have done that with no sucess.</p>\n<p>** Can anyone help me properly run the application as when i reach php artisan serve and open <a href="http://127.0.0.1:8000/install" rel="nofollow noreferrer">http://127.0.0.1:8000/install</a> and provide the required settings and click next, nothing happens although in backgroup i see db create in myphp</p>\n"^^ . + "<p>I'm attempting to use the dompdf library to transform html into a pdf format. I was successful in doing so on one machine, however, when I pulled all the code from the branch I was working on from another machine, all the files from dompdf/dompdf are missing. I don't understand why the src files from dompdf/dompdf wouldn't have been included when I pulled. The only difference in these machines is composer isn't installed on the one that's missing the files.</p>\n<p>I need this software to be portable, but does this mean every machine that runs this code must have Composer installed to run things like autoloader.php? I am still a very junior developer.</p>\n<p>The errors when I run the code are:</p>\n<blockquote>\n<p>Fatal error: Uncaught Error: Class &quot;Dompdf\\Options&quot; not found in C:xampp\\htdocs\\UMW-SERVE-2025\\generate_pdf.php:14<br />\nStack trace: #0 (main) thrown in C:\\xampp\\htdocs\\UMW-SERVE-2025\\generate_pdf.php</p>\n</blockquote>\n<p>Here is the fairly straightforward implementation that uses the Dompdf library:</p>\n<pre><code>&lt;?php \n\n\nrequire __DIR__ . &quot;/vendor/autoload.php&quot;;\n\nuse Dompdf\\Dompdf;\nuse Dompdf\\Options;\n\n\n$options = new Options;\n$options-&gt;setChroot(__DIR__); \n\n$dompdf = new Dompdf($options);\n\n$dompdf-&gt;loadHtmlFile(&quot;pdf_template.html&quot;);\n\n\n$dompdf-&gt;render();\n\n$dompdf-&gt;addInfo(&quot;Title&quot;, &quot;SERVE Volunteer Sign-up&quot;);\n\n$dompdf-&gt;stream(&quot;Community_Service_Letter.pdf&quot;, [&quot;Attachment&quot; =&gt; 0]); \n\n\n?&gt; \n</code></pre>\n<p>I've tried messing with the require statement in generate_pdf.php but once I saw the dompdf directory was empty I knew it's simple missing the source code from dompdf. I researched why the autoloader might not be working on the other machine but didn't find anything of interest there. I tried pulling again to the machine hoping somehow the src files would magically appear in the correct directory.</p>\n"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + "Composer has trouble-shooting guidelines on their homepage, I'd suggest you do the _general_ first five always first: https://getcomposer.org/doc/articles/troubleshooting.md#general . Additionally please [edit] your question and put in the command and it's output verbatim: `composer diagnose`."^^ . + "0"^^ . + . + "0"^^ . + "Did you try to replace `woocommerce_after_shop_loop_item_title` hook with `woocommerce_shop_loop_item_title` and a hook priority of 20?"^^ . + . + "Then if we duplicate the PHP code, and run it to set the same password twice in succession, you see that the second run has affected rows as 0 - again entirely as expected, because the 2nd time the password being provided is the same as the existing one: https://phpize.online/sql/mysql80/e3fe87adfaf43f216faf397fbc143a32/php/php84/bbe666fcd06dc763331064830314fac4/"^^ . + "<p>I’m encountering issues while trying to log in to Platform.sh using the command-line interface (CLI). When I run platform login, the CLI opens a URL in my browser (<a href="http://127.0.0.1:5000" rel="nofollow noreferrer">http://127.0.0.1:5000</a>), but the browser displays an error: “This page isn’t working. 127.0.0.1 is currently unable to handle this request.”</p>\n<p>The CLI output is:</p>\n<pre><code>Opened URL: http://127.0.0.1:5000\nPlease use the browser to log in.\n\nHelp:\nLeave this command running during login.\nIf you need to quit, use Ctrl+C.\n</code></pre>\n<p>If I try to run platform create without logging in, the CLI prompts me to log in. When I confirm, I receive a fatal error:</p>\n<pre><code>Fatal error: Uncaught Error: Class &quot;Symfony\\Component\\Console\\Event\\ConsoleErrorEvent&quot; not found in phar://C:/Users/Макар/AppData/Local/Temp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/vendor/symfony/console/Application.php:1027\nStack trace:\n#0 phar://C:/Users/Макар/AppData/Local/Temp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/src/Application.php(429): Symfony\\Component\\Console\\Application-&gt;doRunCommand()\n#1 phar://C:/Users/Макар/AppData/Local/Temp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/vendor/symfony/console/Application.php(255): Platformsh\\Cli\\Application-&gt;doRunCommand()\n#2 phar://C:/Users/Макар/AppData/Local/Temp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/vendor/symfony/console/Application.php(148): Symfony\\Component\\Console\\Application-&gt;doRun()\n#3 phar://C:/Users/Макар/AppData/Local/Temp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/bin/platform(37): Symfony\\Component\\Console\\Application-&gt;run()\n#4 C:\\Users\\Макар\\AppData\\Local\\Temp\\platformsh-cli-8.2.26-4.22.0\\phar-4.22.0(10): require('...')\n#5 {main}\n thrown in phar://C:/Users/Макар/AppData/Local/Temp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/vendor/symfony/console/Application.php on line 1027\n</code></pre>\n<p>If I run 'platform login -vvv', CLI output is:</p>\n<pre><code>DEBUG Determined CA bundle path: C:\\Users\\28E4~1\\AppData\\Local\\Temp/platformsh-cli-8.2.26-4.22.0\\php\\extras\\cacert.pem \nDEBUG Using Docker credential helper for session storage \nDEBUG Loading session Starting local web server with command: C:\\Users\\28E4~1\\AppData\\Local\\Temp\\platformsh-cli-8.2.26-4.22.0\\php\\php.exe\n-dvariables_order=egps -S 127.0.0.1:5000 -t &quot;C:\\Users\\user\\.platformsh/oauth-listener&quot;\n# Running command: start &quot;&quot; &quot;http://127.0.0.1:5000&quot; Opened URL: http://127.0.0.1:5000 Please use the browser to log in.\n\nHelp: Leave this command running during login. If you need to quit, use Ctrl+C.\n</code></pre>\n<p>I’ve tried:</p>\n<p>Checking if port 5000 is in use (it doesn’t seem to be).\nUsing a different browser.\nDisabling browser extensions.\nTemporarily disabling my firewall.\nI am using Windows. I am trying to deploy a Django project.</p>\n<p>Any suggestions on how to resolve this login issue and the subsequent Symfony console error?</p>\n"^^ . + "<p>I just upgraded my Typo3 System from 11 to 12 and now I am facing the that the Html Element inside my Carousel is changing my video tag to entities when I save my changes. I already looked inside the Html.html template of bootstrap and made sure that it was the one being used. I also tried allowing video, source and track tags directly via TypoScript:</p>\n<blockquote>\n<p>lib.parseFunc.allowTags := addToList(video,source,track)</p>\n<p>lib.parseFunc_RTE.allowTags := addToList(video,source,track)</p>\n</blockquote>\n<p>After that I tried the same for RTE's even if I knew the bodytext element is type=input</p>\n<blockquote>\n<p>RTE.default.proc.allowTags := addToList(video,source,track)</p>\n<p>RTE.default.proc.allowTagsOutside := addToList(video,source,track)</p>\n</blockquote>\n<p>lib.parseFunc_RTE.allowTags := addToList(video,source,track)</p>\n<p>Html.html:</p>\n<blockquote>\n<p><code>&lt;html xmlns:f=&quot;http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers&quot; data-namespace-typo3-fluid=&quot;true&quot;&gt; {item.data.bodytext-&gt;f:format.raw()} &lt;/html&gt;</code></p>\n</blockquote>\n<p><strong>Issue</strong>\nDespite these changes, TYPO3 still encodes</p>\n<pre><code> &lt;video&gt;, &lt;source&gt;, and &lt;track&gt;\n</code></pre>\n<p>into entities upon saving.</p>\n<p><strong>Question</strong>\nIs there a way to prevent TYPO3 from encoding these tags while keeping security intact? Am I missing a setting or additional processing step?</p>\n"^^ . + . + . + . + "It do not help my friend, but since their are some additional functionalities to be added in future, hence it has been on hold, but an apt solution is always appreciated."^^ . + . + "0"^^ . + . + "-1"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + "<blockquote>\n<p>only web middleware applied for this route, I have check using this command php artisan route:list -v</p>\n</blockquote>\n<p>This is the point in order to have authenticated user, the route must be in auth middleware group (auth or auth:api)</p>\n<pre class="lang-php prettyprint-override"><code>Route::group(['middleware' =&gt; 'auth'], function(){\n /** your routes go here */\n});\n</code></pre>\n<p>or for single route</p>\n<pre><code>Route::get('someroute', [Controller::class, 'method'])-&gt;middleware('auth');\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + "<p>I followed all the upgrade guide requirements, but when I run php artisan, I get the following error:</p>\n<pre><code>Undefined array key &quot;driver&quot;\n\n at vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemServiceProvider.php:117\n 113▕ * @return bool\n 114▕ */\n 115▕ protected function shouldServeFiles(array $config)\n 116▕ {\n ➜ 117▕ return $config['driver'] === 'local' &amp;&amp; ($config['serve'] ?? false);\n 118▕ }\n 119▕ \n 120▕ /**\n 121▕ * Get the default file driver.\n</code></pre>\n<p>I checked the vendor files and found the function responsible:</p>\n<pre><code>/**\n * Determine if the disk is serveable.\n *\n * @param array $config\n * @return bool\n */\nprotected function shouldServeFiles(array $config)\n{\n return $config['driver'] === 'local' &amp;&amp; ($config['serve'] ?? false);\n}\n</code></pre>\n<p>To debug, I dumped the $config and got:</p>\n<pre><code>array:3 [\n &quot;driver&quot; =&gt; &quot;local&quot;\n &quot;root&quot; =&gt; &quot;/var/www/html/storage/app&quot;\n &quot;throw&quot; =&gt; false\n]\n</code></pre>\n<p>When I dd() the full condition, it returns false:</p>\n<pre><code>dd($config['driver'] === 'local' &amp;&amp; ($config['serve'] ?? false));\n</code></pre>\n<p>If I modify the vendor file to return false, php artisan starts working again—but obviously, modifying vendor files isn’t a proper solution.</p>\n<p>My filestems.php file</p>\n<pre><code> 's3' =&gt; [\n 'blog' =&gt; [\n 'driver' =&gt; 's3',\n 'key' =&gt; env('AWS_ACCESS_KEY_ID'),\n 'secret' =&gt; env('AWS_SECRET_ACCESS_KEY'),\n 'region' =&gt; env('AWS_DEFAULT_REGION'),\n 'bucket' =&gt; 'blog',\n 'url' =&gt; env('AWS_URL').'/blog',\n 'endpoint' =&gt; env('AWS_ENDPOINT'),\n 'use_path_style_endpoint' =&gt; env('AWS_USE_PATH_STYLE_ENDPOINT', true),\n 'throw' =&gt; true,\n ],\n 'verifications' =&gt; [\n 'driver' =&gt; 's3',\n 'key' =&gt; env('AWS_ACCESS_KEY_ID'),\n 'secret' =&gt; env('AWS_SECRET_ACCESS_KEY'),\n 'region' =&gt; env('AWS_DEFAULT_REGION'),\n 'bucket' =&gt; 'verifications',\n 'url' =&gt; env('AWS_URL').'/verifications',\n 'endpoint' =&gt; env('AWS_ENDPOINT'),\n 'use_path_style_endpoint' =&gt; env('AWS_USE_PATH_STYLE_ENDPOINT', true),\n 'throw' =&gt; true,\n ],\n 'contracts' =&gt; [\n 'driver' =&gt; 's3',\n 'key' =&gt; env('AWS_ACCESS_KEY_ID'),\n 'secret' =&gt; env('AWS_SECRET_ACCESS_KEY'),\n 'region' =&gt; env('AWS_DEFAULT_REGION'),\n 'bucket' =&gt; 'contracts',\n 'url' =&gt; env('AWS_URL').'/contracts',\n 'endpoint' =&gt; env('AWS_ENDPOINT'),\n 'use_path_style_endpoint' =&gt; env('AWS_USE_PATH_STYLE_ENDPOINT', true),\n 'throw' =&gt; true,\n ],\n 'preliminary' =&gt; [\n 'driver' =&gt; 's3',\n 'key' =&gt; env('AWS_ACCESS_KEY_ID'),\n 'secret' =&gt; env('AWS_SECRET_ACCESS_KEY'),\n 'region' =&gt; env('AWS_DEFAULT_REGION'),\n 'bucket' =&gt; 'preliminary',\n 'url' =&gt; env('AWS_URL').'/preliminary',\n 'endpoint' =&gt; env('AWS_ENDPOINT'),\n 'use_path_style_endpoint' =&gt; env('AWS_USE_PATH_STYLE_ENDPOINT', true),\n 'throw' =&gt; true,\n ],\n 'temporary' =&gt; [\n 'driver' =&gt; 's3',\n 'key' =&gt; env('AWS_ACCESS_KEY_ID'),\n 'secret' =&gt; env('AWS_SECRET_ACCESS_KEY'),\n 'region' =&gt; env('AWS_DEFAULT_REGION'),\n 'bucket' =&gt; 'temporary',\n 'url' =&gt; env('AWS_URL').'/temporary',\n 'endpoint' =&gt; env('AWS_ENDPOINT'),\n 'use_path_style_endpoint' =&gt; env('AWS_USE_PATH_STYLE_ENDPOINT', true),\n 'throw' =&gt; true,\n ],\n 'internal' =&gt; [\n 'driver' =&gt; 's3',\n 'key' =&gt; env('AWS_ACCESS_KEY_ID'),\n 'secret' =&gt; env('AWS_SECRET_ACCESS_KEY'),\n 'region' =&gt; env('AWS_DEFAULT_REGION'),\n 'bucket' =&gt; 'internal',\n 'url' =&gt; env('AWS_URL').'/internal',\n 'endpoint' =&gt; env('AWS_ENDPOINT'),\n 'use_path_style_endpoint' =&gt; env('AWS_USE_PATH_STYLE_ENDPOINT', true),\n 'throw' =&gt; true,\n ],\n 'listing-images' =&gt; [\n 'driver' =&gt; 's3',\n 'key' =&gt; env('AWS_ACCESS_KEY_ID'),\n 'secret' =&gt; env('AWS_SECRET_ACCESS_KEY'),\n 'region' =&gt; env('AWS_DEFAULT_REGION'),\n 'bucket' =&gt; 'listing-images',\n 'url' =&gt; env('AWS_URL').'/listing-images',\n 'endpoint' =&gt; env('AWS_ENDPOINT'),\n 'use_path_style_endpoint' =&gt; env('AWS_USE_PATH_STYLE_ENDPOINT', true),\n 'throw' =&gt; true,\n ],\n 'payout-invoices' =&gt; [\n 'driver' =&gt; 's3',\n 'key' =&gt; env('AWS_ACCESS_KEY_ID'),\n 'secret' =&gt; env('AWS_SECRET_ACCESS_KEY'),\n 'region' =&gt; env('AWS_DEFAULT_REGION'),\n 'bucket' =&gt; 'payout-invoices',\n 'url' =&gt; env('AWS_URL').'/payout-invoices',\n 'endpoint' =&gt; env('AWS_ENDPOINT'),\n 'use_path_style_endpoint' =&gt; env('AWS_USE_PATH_STYLE_ENDPOINT', true),\n 'throw' =&gt; true,\n ],\n 'listing-payment-invoices' =&gt; [\n 'driver' =&gt; 's3',\n 'key' =&gt; env('AWS_ACCESS_KEY_ID'),\n 'secret' =&gt; env('AWS_SECRET_ACCESS_KEY'),\n 'region' =&gt; env('AWS_DEFAULT_REGION'),\n 'bucket' =&gt; 'listing-payment-invoices',\n 'url' =&gt; env('AWS_URL').'/listing-payment-invoices',\n 'endpoint' =&gt; env('AWS_ENDPOINT'),\n 'use_path_style_endpoint' =&gt; env('AWS_USE_PATH_STYLE_ENDPOINT', true),\n 'throw' =&gt; true,\n ],\n ],\n</code></pre>\n<p>Has anyone encountered this issue before? Any insights on how to fix it properly?</p>\n"^^ . + . + . + . + . + . + . + "libjpeg not found building PHP from source at configure stage, FreeBSD"^^ . + . + "1"^^ . + . + "Did you try `json_decode`? https://www.php.net/manual/en/function.json-decode.php Should be able to do `$obj = json_decode($response->getBody());`, then `$obj->data->name->nameText` would output `'Dolly Parton'`. That should point you in the right direction "^^ . + "0"^^ . + . + "<p>In a Zend@1.12 project, I use decorators.</p>\n<p>Those decorators are registered via:</p>\n<pre><code>elementPrefixPath.decorator.prefix = &quot;My_Form_Decorator&quot;\nelementPrefixPath.decorator.path = &quot;My/Form/Decorator/&quot;\n</code></pre>\n<p>They exist in that folder, they can be found most of the time.</p>\n<p>Yet now I run into an issue, that sometimes the prefix path is not set when rendering a form.</p>\n<p>(I haven't figured out why exactly, as the decorators work in other contexts just fine. My working theory is that it relates to <code>DisplayGroup</code>, yet cannot really tell as of now.)</p>\n<p>On error, I run into a <code>Zend_Loader_PluginLoader_Exception</code>:</p>\n<pre><code>Plugin by name 'MyExistingAndWorkingDecorator' was not found in the registry;\nused paths: Zend_Form_Decorator_: Zend/Form/Decorator/\n</code></pre>\n<p>The error makes it clear that decorator will only be searched in:</p>\n<p><code>Zend/Form/Decorator/</code> and not in the <code>My/Form/Decorator/</code> directory.</p>\n<p>I can get the project temporarily working by changing the Zend vendor file:</p>\n<p><code>Zend/Form/Element.php</code></p>\n<pre><code> /**\n * Instantiate a decorator based on class name or class name fragment\n *\n * @param string $name\n * @param null|array $options\n * @return Zend_Form_Decorator_Interface\n */\n protected function _getDecorator($name, $options)\n {\n $loader = $this-&gt;getPluginLoader(self::DECORATOR);\n \n $loader-&gt;addPrefixPath('My_Form_Decorator', '/var/www/project/library/My/Form/Decorator/'); // I added this line, this should be set via config, yet somehow it is lost.\n\n $class = $loader-&gt;load($name);\n if (null === $options) {\n $decorator = new $class;\n } else {\n $decorator = new $class($options);\n }\n\n return $decorator;\n }\n</code></pre>\n<p>Yet I don't want to change the vendor file of course.</p>\n<p>My assumption is that this should be a configuration, and I am confused why it is not applied / lost.</p>\n"^^ . + . + . + . + . + . + . + . + "Is there nothing [here](https://www.google.com/search?q=php+download+from+bittorrent) that would help you already?"^^ . + ""*I suspect it is something to do with the Select statement that includes a JOIN and several WHERE arguments.*" Why not check it? You could remove it and see if you get a different output."^^ . + "... but compared to library that's had 1000s of hours of structured and real-life testing, made by people with expert knowledge of email systems, the associated regulations, protocols, security risks etc, there's no contest. It also likely covers all the unexpected edge cases, formatting issues, security slip-ups etc that you and I probably don't even know exist, and it will continue to be updated when external factors require changes, or bugs are reported and fixed etc. The value-add to your app **even for the apparently simple task of sending 1 mail** is enormous."^^ . + . + . + . + . + "So as I said above, if you want that content to go into your page somewhere, you need to add a line of JS code which will do that."^^ . + . + . + . + . + "`whereHas` returns if **any** of the relationship items meet the conditions, i'm looking for a method that return if **all** of the relationship items meet the conditions."^^ . + . + . + . + "dns"^^ . + . + . + "0"^^ . + "Thank you. `var_dump(exec('which php'));` gives **"/bin/php"**, while `var_dump(exec('which php-cli'));` gives **""**. (Incidentally, PHP version is 8.1.31.) I will look at alternatives if I can't get this problem fixed... :-/"^^ . + . + "OROCRM Change entitiy ACL's after created"^^ . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + "Query with nulls and apostrophes returning syntax error using PDO bindParam (PHP)"^^ . + "<p>I've been working on a revision to a hierarchical search and now have to go down more than 3 levels. Issue is I'm having to convert a single level array to a multi-level. I've attempted to use array_search + array_column together but my array is not counted numerically. I need to add children to their parent matching them from their parent array key. I'll share the structures and the expected result.</p>\n<p>Here is the current array (main) structure:</p>\n<pre><code>$menu = array (\n 207705 =&gt; \n array (\n 'ID' =&gt; 207705,\n 'title' =&gt; 'Home',\n 'url' =&gt; 'https://example.com/',\n 'description' =&gt; '',\n 'children' =&gt; \n array (\n ),\n ),\n 207795 =&gt; \n array (\n 'ID' =&gt; 207795,\n 'title' =&gt; 'Category',\n 'url' =&gt; 'https://example.com/cat/',\n 'description' =&gt; 'Lorem ipsum',\n 'children' =&gt; \n array (\n 207892 =&gt; \n array (\n 'ID' =&gt; 207892,\n 'title' =&gt; 'Subcategory0',\n 'url' =&gt; 'https://example.com/cat/subcat0/',\n 'description' =&gt; '',\n ),\n 207791 =&gt; \n array (\n 'ID' =&gt; 207791,\n 'title' =&gt; 'Subcategory1',\n 'url' =&gt; 'https://example.com/cat/subcat1/',\n 'description' =&gt; '',\n ),\n ),\n ),\n)\n</code></pre>\n<p>Here is the array of the children I need to merge into main under the corresponding ID:</p>\n<pre><code>$children = array (\n 207892 =&gt; \n array (\n 0 =&gt; \n array (\n 'ID' =&gt; 207789,\n 'title' =&gt; 'SubSubCat1',\n 'url' =&gt; 'https://example.com/cat/subcat0/sub1',\n ),\n 1 =&gt; \n array (\n 'ID' =&gt; 207786,\n 'title' =&gt; 'SubSubCat2',\n 'url' =&gt; 'https://example.com/cat/subcat0/sub2',\n ),\n 2 =&gt; \n array (\n 'ID' =&gt; 207788,\n 'title' =&gt; 'SubSubCat3',\n 'url' =&gt; 'https://example.com/cat/subcat0/sub3',\n ),\n 3 =&gt; \n array (\n 'ID' =&gt; 207787,\n 'title' =&gt; 'SubSubCat4',\n 'url' =&gt; 'https://example.com/cat/subcat0/sub4',\n ),\n ),\n) \n</code></pre>\n<p>The final result I want is:</p>\n<pre><code>array (\n 207705 =&gt; \n array (\n 'ID' =&gt; 207705,\n 'title' =&gt; 'Home',\n 'url' =&gt; 'https://example.com/',\n 'description' =&gt; '',\n 'children' =&gt; \n array (\n ),\n ),\n 207795 =&gt; \n array (\n 'ID' =&gt; 207795,\n 'title' =&gt; 'Category',\n 'url' =&gt; 'https://example.com/cat/',\n 'description' =&gt; 'Lorem ipsum',\n 'children' =&gt; \n array (\n 207892 =&gt; \n array (\n 'ID' =&gt; 207892,\n 'title' =&gt; 'Subcategory0',\n 'url' =&gt; 'https://example.com/cat/subcat0/',\n 'description' =&gt; '',\n 'children' =&gt; array (\n 0 =&gt; \n array (\n 'ID' =&gt; 207789,\n 'title' =&gt; 'SubSubCat1',\n 'url' =&gt; 'https://example.com/cat/subcat0/sub1',\n ),\n 1 =&gt; \n array (\n 'ID' =&gt; 207786,\n 'title' =&gt; 'SubSubCat2',\n 'url' =&gt; 'https://example.com/cat/subcat0/sub2',\n ),\n 2 =&gt; \n array (\n 'ID' =&gt; 207788,\n 'title' =&gt; 'SubSubCat3',\n 'url' =&gt; 'https://example.com/cat/subcat0/sub3',\n ),\n 3 =&gt; \n array (\n 'ID' =&gt; 207787,\n 'title' =&gt; 'SubSubCat4',\n 'url' =&gt; 'https://example.com/cat/subcat0/sub4',\n ),\n ),\n ),\n 207791 =&gt; \n array (\n 'ID' =&gt; 207791,\n 'title' =&gt; 'Subcategory1',\n 'url' =&gt; 'https://example.com/cat/subcat1/',\n 'description' =&gt; '',\n ),\n ),\n ),\n)\n</code></pre>\n<p>So far, I've tried many solutions from <a href="https://stackoverflow.com/questions/6661530/get-the-first-level-key-of-the-first-row-containing-a-specified-column-value-in">this thread</a>. Everything either returns false, null, or only the first level of array keys.\nIs there a function or even a one-liner I can use?</p>\n<p>My current code is this:</p>\n<pre><code>foreach($children as $id =&gt; $item) {\n $parent = array_search($id, $menu);\n if($show == true) {\n //In this case looking to add the current item array to the ['children'] of the found matching element in the $menu array\n $search = array_map(function($v){return $v['ID'];},$menu);\n \n $menu[$search] = $item;\n }\n}\n</code></pre>\n"^^ . + . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + "Yes I'm agree, but why one some other websites there is no step like this ? I tried on etsy[dot]com and when we already logged one time and accept all auth, login after don't redirect on a facebook modal ..."^^ . + "Laravel 11 - how to call the old 'Handler.php' class from app.php - withExceptions"^^ . + "0"^^ . + "<p>I am currently using Spatie media library for my personal project using Laravel 11.41.3 with Filament 3.2.137 and Filament's Spatie Media library 3.2.137. I have followed the installation from Filament's Spatie Media library and successfully migrated the related media tables. Afterwards, I went over to Spatie media library documentation to setup the Laravel model for using the media library as follows:</p>\n<pre><code>use Spatie\\MediaLibrary\\HasMedia;\nuse Illuminate\\Database\\Eloquent\\Model;\nuse Spatie\\MediaLibrary\\InteractsWithMedia;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Spatie\\MediaLibrary\\MediaCollections\\Models\\Media;\n \nclass Product extends Model implements HasMedia\n\n{\n\nuse InteractsWithMedia;\n\n public function registerMediaConversions(?Media $media = null): void\n {\n $this-&gt;addMediaConversion('thumb')\n -&gt;width(100);\n\n $this-&gt;addMediaConversion('small')\n -&gt;width(480);\n\n $this-&gt;addMediaConversion('large')\n -&gt;width(1200);\n }\n</code></pre>\n<p>Note that I also setup the media conversion here as well. Then, I setup the form for uploading the images with Filament resource page as follows:</p>\n<pre><code>&lt;?php\n\nnamespace App\\Filament\\Resources\\ProductResource\\Pages;\n\nuse Filament\\Actions;\nuse Filament\\Forms\\Form;\nuse Filament\\Resources\\Pages\\EditRecord;\nuse App\\Filament\\Resources\\ProductResource;\nuse Filament\\Forms\\Components\\SpatieMediaLibraryFileUpload;\n\nclass ProductImages extends EditRecord\n{\n protected static string $resource = ProductResource::class;\n\n public function form(Form $form): Form {\n\n return $form-&gt;schema([\n SpatieMediaLibraryFileUpload::make('images')\n -&gt;image()\n -&gt;multiple()\n -&gt;openable()\n -&gt;panelLayout('grid')\n -&gt;collection('images')\n -&gt;reorderable()\n -&gt;appendFiles()\n -&gt;preserveFilenames()\n -&gt;columnSpan(2)\n ]);\n }\n\n protected function getHeaderActions(): array\n {\n return [\n Actions\\DeleteAction::make(),\n ];\n }\n}\n</code></pre>\n<p>And in Filament resource file, I added additional configuration for accessing the image upload page.</p>\n<pre><code>public static function getPages(): array\n{\n return [\n 'index' =&gt; Pages\\ListProducts::route('/'),\n 'create' =&gt; Pages\\CreateProduct::route('/create'),\n 'edit' =&gt; Pages\\EditProduct::route('/{record}/edit'),\n 'images' =&gt; Pages\\ProductImages::route('/{record}/images'), &lt;--- Added this line\n ];\n}\n\npublic static function getRecordSubNavigation(Page $page): array {\n\n return $page-&gt;generateNavigationItems([\n EditProduct::class,\n ProductImages::class, &lt;--- Added this sub-navigation\n ]);\n}\n</code></pre>\n<p>The original images were uploaded to the disk storage as well as store to the database successfully. However, the image conversion fails during the Laravel queue whether on listen or work. The following image shows the terminal output of the error:</p>\n<p><a href="https://i.sstatic.net/ZM3YIMmS.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZM3YIMmS.png" alt="error output from laravel queue listener/worker" /></a></p>\n<p>I have searched through forums related to this issue but none exist. I would appreciate any guidance on why this issue occurs. Thank you!</p>\n"^^ . + . + "0"^^ . + . + "0"^^ . + "<p>I have a function that calls an API to send some data to be inserted into a MySQL table.</p>\n<p>As of right now, when a user submits a form, the function takes the parameters and sets it to a series of variables that go into an array. The array is then sent to the final Endpoint where it is overwriting the data that is already present in the table.</p>\n<p>When a user submits a form, the parameters are not all required fields. Some users may enter data, some may not.</p>\n<p>Here is the code:</p>\n<pre><code>&lt;?php\n add_action('gform_submission', 'capture_leads', 10, 2); // form submission\n\n // this function gets the form submission data\n function capture_leads($form) {\n $formID = $form['id'];\n // below variables are set to blank, but may be filled by form parameters\n $phone = &quot;&quot;;\n $email = &quot;&quot;;\n $first_name = &quot;&quot;;\n $last_name = &quot;&quot;;\n\n foreach ($form['fields'] as $field) {\n switch ($field-&gt;label) {\n case &quot;Phone&quot;:\n $phone = rgar($entry, (string)$field-&gt;id);\n break;\n case &quot;Email Address&quot;:\n $email = rgar($entry, (string)$field-&gt;id);\n break;\n case &quot;First Name&quot;:\n $first_name = rgar($entry, (string)$field-&gt;id);\n break;\n case &quot;Last Name&quot;:\n $last_name = rgar($entry, (string)$field-&gt;id);\n break; \n default:\n break; \n }\n }\n\n // this is the function in reference - I send these parameters to the function\n overwrite_action($formID, $email, $first_name, $last_name, $phone); \n }\n\n function overwrite_action($formID, $email, $first_name, $last_name, $phone) {\n $url &quot;https.myapi.com/update/contact&quot;;\n $user = USER_NAME;\n $pass = PASS_WORD;\n $code = ACCT_CODE;\n\n $content = json_encode(array(\n 'email' =&gt; $email,\n 'overwrite' =&gt; true,\n 'fields' =&gt; array(\n 'phone' =&gt; $phone,\n 'first_name' =&gt; $first_name,\n 'last_name' =&gt; $last_name\n )\n ));\n // all my cURL stuff is after this point, but I don't think I need to show that code\n }\n?&gt;\n</code></pre>\n<p>So in the above code, you will see that I build an array. The array is what will be sent to the API Endpoint.</p>\n<p>The problem is when a user leaves the phone, first_name, or last_name blank. The previous data in the table may be overwritten with the blank values.</p>\n<p>How can I prevent this from happening?</p>\n<p>I attempted to check/create a different array for each time a variable is empty, but quickly realized that would be a lot of code.</p>\n"^^ . + "Why does PHP sum values of similar array items differently?"^^ . + . + . + "0"^^ . + . + . + . + "Please clarify what data you are sending, and how. The value of `$slug` doesn't get used anywhere in the code you have shown us so far, and what you are actually passing to the API endpoint we also can't tell based on `example.com/rest/V1/…`"^^ . + . + . + . + . + "Alternative: `php -v | awk '{print $2}' | head -n 1`"^^ . + . + "0"^^ . + . + . + . + . + "3"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + "2"^^ . + . + "I'm not using Sublime Text, but anyway: how about you use "Xdebug Watch" tab -- you should be able to add the desired variable there to watch after."^^ . + . + "<p>For some reason when I remove the use statement (both WithPagination and WithoutUrlPagination) the styling on my pagination links matches that which I've put in the tailwind.blade.php file within the <code>resources/views/vendor/pagination</code> folder. How do I get it to use the pagination in tailwind.blade.php?</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nnamespace App\\Livewire;\n\nuse Carbon\\Carbon;\nuse App\\Models\\Project;\nuse Livewire\\Component;\nuse Livewire\\WithPagination;\nuse Livewire\\WithoutUrlPagination;\n\nclass ProjectDetail extends Component\n{\n \n use WithPagination, WithoutUrlPagination; \n\n public function render()\n {\n $projects = Project::where('start_date', '&gt;', Carbon::now())-&gt;paginate(5);\n return view('livewire.project-detail', ['projects' =&gt; $projects]);\n }\n}\n</code></pre>\n"^^ . + "<p>The following works perfect and was put into production yesterday, thanks to all.</p>\n<pre><code>&lt;?php\n$authKey = $_POST[&quot;auth_key&quot;];\n$_text = $_POST[&quot;text&quot;];\n$target_lang = $_POST[&quot;target_lang&quot;];\n$formality = $_POST[&quot;formality&quot;];\n$glossary_id = $_POST[&quot;glossary_id&quot;];\n\n$source_lang = &quot;en&quot;;\n$tag_handling = &quot;xml&quot;;\n$ignore_tags = &quot;x&quot;;\n\n$url = &quot;https://api.deepl.com/v2/translate&quot;;\n\n$curl = curl_init($url);\ncurl_setopt($curl, CURLOPT_URL, $url);\ncurl_setopt($curl, CURLOPT_POST, true);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n$headers = array(\n &quot;Authorization: DeepL-Auth-Key $authKey&quot;,\n &quot;Content-Type: application/x-www-form-urlencoded&quot;,\n);\ncurl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\n$data = array(\n 'text' =&gt; $_text,\n 'source_lang' =&gt; $source_lang,\n 'target_lang' =&gt; $target_lang,\n 'tag_handling' =&gt; $tag_handling,\n 'ignore_tags' =&gt; $ignore_tags,\n 'formality' =&gt; $formality,\n 'glossary' =&gt; $glossary_id\n);\ncurl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\n\n//for debug only!\n//curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);\n//curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n$resp = curl_exec($curl);\n\n// Check HTTP status code and display the error message\nif (!curl_errno($curl)) {\n switch ($http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE)) {\n case 200: # OK\n break;\n default:\n echo 'DeepL Error: Unexpected HTTP code: ', $http_code;\n }\n}\n\n// Check for errors and display the error message\nif($errno = curl_errno($curl)) {\n $error_message = curl_strerror($errno);\n echo &quot;DeepL Error: cURL error ({$errno}):\\n {$error_message}&quot;;\n}\n\ncurl_close($curl);\necho $resp;\n?&gt;\n</code></pre>\n"^^ . + . + . + . + "<p>How could I set partitioned cookies in PHP ? (&quot;CHIPS&quot;) ?</p>\n<p>From my understanding the <code>setcookie()</code> cannot do that, I assume this can be done by <code>header()</code> but I cannot find any info regarding partitioned cookies and php header.</p>\n<p>I had the below code but it complains about the <code>Partitioned</code> atribute:</p>\n<pre><code>&lt;?php \n$cookie_array['expires'] = time() + 60*60*24;\n$cookie_array['path'] = '/'; \n$cookie_array['domain'] = '.example4.com';\n$cookie_array['secure'] = true;\n$cookie_array['httponly'] = false; \n$cookie_array['samesite'] = 'None';\n$cookie_array['Partitioned'] = true; // &lt;&lt;&lt; ???\n\nsetcookie('my_test_cookie', 'my_cookie_value', $cookie_array); \n?&gt;\n</code></pre>\n<pre><code>Fatal error: Uncaught ValueError: setcookie(): option &quot;Partitioned&quot; is invalid\n</code></pre>\n"^^ . + . + . + "0"^^ . + . + . + . + "<p>You can do everything with a single query, which will filter the <code>name</code> field which must be exactly 7 characters, and use <code>SUBSTRING</code> and <code>RIGHT</code> to get the number and the last letter (assuming the number is always 4 characters at the same place in the string)</p>\n<pre><code>$klassenstufe = $DB-&gt;get_records_sql(&quot;\nSELECT \n c.id, \n c.name, \n c.idnumber, \n c.description, \n cm.cohortid, \n cm.userid,\n SUBSTRING(c.name FROM 3 FOR 4) AS number_part, -- Extracts '2030'\n RIGHT(c.name, 1) AS last_letter -- Extracts 'b'\nFROM {cohort} AS c\nINNER JOIN {cohort_members} AS cm ON c.id = cm.cohortid\nWHERE cm.userid = {$get_userid}\nAND LENGTH(c.name) = 7\n&quot;);\n</code></pre>\n<p>With the aliases you'll get <code>$klassenstufe-&gt;number_part</code> and <code>$klassenstufe-&gt;last_letter</code></p>\n"^^ . + "<p>The following PHP code is perfectly valid and runs without an error:</p>\n<pre><code>&lt;?php\nclass MyClass {\n const CONST_VALUE = 'A constant value';\n}\n\n$classname = 'MyClass';\n$identifier = 'CONST_VALUE';\necho $classname::{$identifier}, &quot;\\n&quot;;\n</code></pre>\n<p>with the following output:</p>\n<pre><code>A constant value\n</code></pre>\n<p>So what is it and how it works? If you can reference me to the PHP documentation on the matter, it would be lovely.</p>\n"^^ . + . + "You might want to read this https://learn.microsoft.com/en-us/answers/questions/1299007/wincache-for-php8-pre-build-available As Microsoft ended its commercial support for PHP on Windows/IIS and not a very large community remains, migrating to Linux is more realistic an option."^^ . + . + "0"^^ . + "1"^^ . + "Do you have to pivot with SQL?"^^ . + . + . + "In my totally humble and subjective opinion, that is precisely how _Expand Selection_ should work, and failing to do so means oversight or flawed implementation, so it wouldn't make sense to have a different command. What would it be, "Expand Selection Semantically"? It's a totally valid question, anyway."^^ . + "1"^^ . + "1"^^ . + . + "foreach"^^ . + . + . + . + "You obviously don't have to take any advice at all, but you are very much on your own here compared to the currrent practices of almost the entire software development community. You may want to consider why that is. History shows crowds are not always wise, but in this case they appear to have some pretty rational justifications for what they do, as I've outlined above. By all means you can try your approach - but as I said, it was an approach that was last used 40 years ago and we've largely moved onto a system which people have found improves their software quality and development speed"^^ . + "user-roles"^^ . + . + "<p><strong>the_field('is_neighborhood')</strong> directly prints the value. it returns null. Use <strong>get_field('is_neighborhood')</strong> on place of it.</p>\n<pre><code>$is_neighborhood = get_field('is_neighborhood'); // Get the field value\n echo $is_neighborhood; // Print it to verify\n\n if ($is_neighborhood == 'Yes') {\n</code></pre>\n"^^ . + . + . + . + "The ??= was introduced in 7.4 - https://stackoverflow.com/questions/59102708/what-is-null-coalescing-assignment-operator-in-php-7-4"^^ . + "laragon"^^ . + "0"^^ . + "1"^^ . + . + . + "0"^^ . + "<p>I am trying to send a notification to a group of devices (topic) usin Auth2.\nSo first I tried to send a message to single device, and it worked OK.</p>\n<p>Now I want to create the topic.\nSo I use this code that is attached at the bottom, but I get the result:</p>\n<blockquote>\n<p>result= {&quot;error&quot;:&quot;Authentication using server key is deprecated. Please use an OAuth2 token instead.&quot;}</p>\n</blockquote>\n<p>The access-token is the same as I use for sending one message.</p>\n<p>The code:</p>\n<pre><code>$topic=&quot;{$card_id}_{$type}_{$locale}&quot;;\n$url = &quot;https://iid.googleapis.com/iid/v1:batchAdd&quot;;\n$json=[&quot;to&quot; =&gt; &quot;/topics/{$topic}&quot;, &quot;registration_tokens&quot; =&gt; [$fcm_token]];\n$result=send_2_FCM($json,$url);\n</code></pre>\n<pre><code>function send_2_FCM($data,$url)\n{\n require_once('firebase_access_token.php');\n $access_token=getAccessToken();\n\n $headers = array(\n &quot;Authorization: Bearer $access_token&quot;,\n &quot;Content-Type: application/json&quot;\n );\n\n $ch = curl_init();\n curl_setopt( $ch,CURLOPT_URL,$url);\n curl_setopt( $ch,CURLOPT_POST,true);\n curl_setopt( $ch,CURLOPT_HTTPHEADER,$headers);\n curl_setopt( $ch,CURLOPT_RETURNTRANSFER,true);\n curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER,false);\n curl_setopt( $ch,CURLOPT_CAINFO, &quot;cacert.pem&quot;);\n if ($data)\n {\n curl_setopt( $ch,CURLOPT_POSTFIELDS,json_encode($data));\n }\n $result = curl_exec($ch);\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n debug_log(&quot;send_2_FCM: result= $result&quot;);\n if ($result &amp;&amp; strpos($result,'&quot;error&quot;')) return 0;\n return 1;\n}\n</code></pre>\n"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + "-1"^^ . + . + . + . + . + . + "1"^^ . + "What error did you get?\nBTW I'm assuming when you say the functions are in the same controller, they belong to the same class."^^ . + . + . + . + "macos"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + "<p>Originally, I only needed to disable coupons from working on one product, so this filter worked well. However, over time, I've added to it a few times. But it looks messy!</p>\n<p>Is there a better way to format this?</p>\n<pre><code>add_filter( 'woocommerce_coupon_is_valid_for_product', 'quadlayers_exclude_product_from_product_promotions', 9999, 4 );\nfunction quadlayers_exclude_product_from_product_promotions( $valid, $product, $coupon, $values ) {\n if ( 49134 == $product-&gt;get_id() ) {\n $valid = false;\n }\n if ( 49137 == $product-&gt;get_id() ) {\n $valid = false;\n }\n if ( 29873 == $product-&gt;get_id() ) {\n $valid = false;\n }\n if ( 43181 == $product-&gt;get_id() ) {\n $valid = false;\n }\n if ( 49317 == $product-&gt;get_id() ) {\n $valid = false;\n }\n if ( 114863 == $product-&gt;get_id() ) {\n $valid = false;\n }\n if ( 117949 == $product-&gt;get_id() ) {\n $valid = false;\n }\n if ( 120076 == $product-&gt;get_id() ) {\n $valid = false;\n }\n if ( 122660 == $product-&gt;get_id() ) {\n $valid = false;\n }\n if ( 129323 == $product-&gt;get_id() ) {\n $valid = false;\n }\n return $valid;\n}\n</code></pre>\n"^^ . + . + "There's nothing stopping you running other queries first in a migration (`$this->getEntityManager()->getConnection()->createQueryBuilder()...`) and then checking the result. But I'd echo the comment about the design: why do you need to set a relationship to an "empty" row rather than just leaving it as null? What's the difference?"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + "how can i use google cloud speech to text to stream live audio in PHP"^^ . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + "<p>I have 2 datepickers From and To, one submit button in PHP.\nWhen selected the dates in two datepickers and click the submit button, the datepicker's values return to default. Here is the code I used.</p>\n<pre><code>&lt;div class=&quot;col-md-8&quot;&gt;\n &lt;form autocomplete=&quot;off&quot; class=&quot;form-inline&quot; method=&quot;POST&quot; action=&quot;&quot;&gt;\n &lt;?php\n $firstday = date('Y-m-01');\n $lastday = date('Y-m-t');\n ?&gt;\n &lt;label&gt;Date:&lt;/label&gt;\n &lt;input type=&quot;date&quot; id=&quot;myDate1&quot; name=&quot;date1&quot; value=&quot;&lt;?php echo $firstday;?&gt;&quot;&gt;\n &lt;label&gt;To&lt;/label&gt;\n &lt;input type=&quot;date&quot; id=&quot;myDate2&quot; name=&quot;date2&quot; value=&quot;&lt;?php echo $lastday;?&gt;&quot;&gt;\n &lt;button class=&quot;btn btn-primary&quot; name=&quot;search&quot;&gt;&lt;span class=&quot;glyphicon glyphicon-search&quot;&gt;&lt;/span&gt;&lt;/button&gt;\n&lt;/form&gt;\n</code></pre>\n<p><a href="https://i.sstatic.net/zW6mJr5n.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/zW6mJr5n.png" alt="enter image description here" /></a></p>\n<p>What i need is to retain the selected values after submit.\nThank you!</p>\n"^^ . + "1"^^ . + "1"^^ . + . + "Hello again, I just woke up and for the line $headers = fgetcsv($handle, escape: '') ? : []; I get the error: Parse error: syntax error, unexpected ':' in /home.... I still use the old PHP version perhaps this type of code is only available in the latest PHP? Is there an older version equivalent to that code if that is the problem? After testing it it turns out colon from the escape: part is causing the error. I removed it then the next error is about the double question mark from $row[$col] = $values[$map[$col]] ?? null I edited that part out too and my output has all NULL values now"^^ . + . + "@NicoHaase do you actually read any of the previous comments or answers, or the question history, before posting these boilerplate comments everywhere?"^^ . + "There's several other binaries in there for diff architectures... I tried the linux-darwin one and the plain heicToJpg one (segmentation fault)... I am on a AWS ubuntu server."^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + "@ADyson Thats it displaying now, my error was simply not passing in $pdo which had been defined in db.inc.php, but it is displaying side to side instead of following on inside the select query I cant currently edit my OP to show how it now looks but essentially it is just displaying 2 selects next to each other (because i have 2 strikers in my DB) instead of options inside 1 select any idea why?"^^ . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "<p>I'm developing a Node.js application that automates the creation of Nginx server blocks on a DigitalOcean droplet. I need to dynamically determine the installed PHP version on the droplet so I can correctly configure the fastcgi_pass directive in my Nginx server block.</p>\n<p>Here's the Node.js function I'm using to generate the server block script:</p>\n<pre class="lang-js prettyprint-override"><code>function createNginxServerBlockScript(domain, rootDir = &quot;/var/www&quot;) {\n const sitePath = `${rootDir}/${domain}`;\n\n return `\n echo &quot;Creating Nginx server block...&quot;\n\n # Get PHP version dynamically\n PHP_VERSION=$(php -r 'echo PHP_VERSION;')\n\n # Print PHP version to check if it's set correctly\n echo &quot;PHP Version: \\${PHP_VERSION}&quot;\n\n cat &gt; /etc/nginx/sites-available/${domain} &lt;&lt;EOF\n server {\n listen 80;\n listen [::]:80;\n server_name ${domain};\n root ${sitePath};\n index index.php index.html index.htm;\n\n # WordPress permalinks\n location / {\n try_files \\\\\\$uri \\\\\\$uri/ /index.php?\\\\\\$args;\n }\n\n # Pass PHP scripts to FastCGI server\n location ~ \\\\.php\\\\\\$ {\n include fastcgi_params;\n fastcgi_pass unix:/var/run/php/php\\${PHP_VERSION}-fpm.sock;\n fastcgi_index index.php;\n fastcgi_param SCRIPT_FILENAME \\\\\\$document_root\\\\\\$fastcgi_script_name;\n }\n\n # Static files (caching images, CSS, JS)\n location ~* \\\\\\\\.(jpg|jpeg|png|gif|ico|css|js|woff|woff2|ttf|svg|eot)\\\\\\$ {\n expires max;\n log_not_found off;\n }\n\n # Deny access to hidden files\n location ~ /\\\\\\\\. {\n deny all;\n }\n\n # Log files\n access_log /var/log/nginx/${domain}.access.log;\n error_log /var/log/nginx/${domain}.error.log;\n }\nEOF\n `;\n}\n\nfunction completeScript(domain) {\n return `#!/bin/bash\n \n ${createNginxServerBlockScript(domain)}\n \n `;\n}\n</code></pre>\n<p>Result:</p>\n<pre class="lang-none prettyprint-override"><code>Executing complete script...\nstdout: awk: \nstdout: cmd. line:1: {print $1 \\&quot;.\\&quot; $2}\nawk: cmd. line:1: ^ backslash not last character on line\n\nstdout: Setting up site directory...\n\nstdout: Creating Nginx server block...\n\nstdout: PHP Version: \nstdout: \n\nstdout: Enabling Nginx site...\n\nstdout: Enabled Nginx site configuration.\n\nstdout: Testing Nginx configuration...\nstdout: \nstdout: \n\nstdout: 2025/03/10 18:13:14 [emerg] 75030#75030: invalid number of arguments in &quot;fastcgi_param&quot; directive in /etc/nginx/sites-enabled/test.outreachbuddy.com:18\nnginx: configuration file /etc/nginx/nginx.conf test failed\n\nstdout: Nginx configuration test failed\n\nRemote script finished with exit code: 1\nError executing the complete script: Error: Script failed with code 1\nOutput:\nawk: cmd. line:1: {print $1 \\&quot;.\\&quot; $2}\nawk: cmd. line:1: ^ backslash not last character on line\nSetting up site directory...\nCreating Nginx server block...\nPHP Version: \nEnabling Nginx site...\nEnabled Nginx site configuration.\nTesting Nginx configuration...\n2025/03/10 18:13:14 [emerg] 75030#75030: invalid number of arguments &gt; in &quot;fastcgi_param&quot; directive in /etc/nginx/sites-enabled/test.outreachbuddy.com:18\nnginx: configuration file /etc/nginx/nginx.conf test failed\nNginx configuration test failed\n</code></pre>\n<p>Why is <code>PHP_VERSION=$(php -r 'echo PHP_VERSION;')</code> not working as expected within the generated bash script on the DigitalOcean droplet?</p>\n<p>Are there alternative methods to reliably determine the installed PHP version from within the script?</p>\n"^^ . + . + "phpcodesniffer"^^ . + . + . + . + . + . + . + "2"^^ . + . + "no, when adding you need to use attach but when updating you need to use sync or syncWithoutDetaching"^^ . + "0"^^ . + "Note that there's a bug in some versions of phpmyadmin that adds extra quotes to passwords added via phpmyadmin's user interface with the password_hash option. So if you added the password `password` via phpmyadmin's user interface, try logging in with `'password'` (note the extra quotes). See also: https://github.com/phpmyadmin/phpmyadmin/issues/17121"^^ . + "Just a wild guess: The bash process executed by the git command does not have this setting turned on. Did you try my suggestion of using `BASH_ENV`? At least this allows you to debug whether _git_ really invokes a fully-blown bash. For if it would invoke the bash executable under the name sh, the shell would behave differently. Hence, as a first step, you create a BASH_ENV file and put into it something like `shopt`, export the variable, and call git. If you don't get any output, git does not run bash, but sh."^^ . + . + "Mysql parameter issue on update. Parameter invalid for some reason"^^ . + . + "0"^^ . + "You should only do htmlspecialchars or html_entity_encode when it is necessary for the output."^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + "You never send `$xml_post_string`. And you're using `GET` instead of `POST`. How do you expect it to work?"^^ . + "1"^^ . + . + "3"^^ . + "2"^^ . + . + "<p>It's because the <code>exec()</code> and <code>proc_open()</code> functions don't respect the changes made to the user ID (<code>UID</code>) or group ID (<code>GID</code>) with <code>posix_setuid()</code> and <code>posix_setgid()</code> within the PHP script.</p>\n<p>You'll need to run the PHP script with the desired user privileges from the start, or explicitly specify the user in the command line</p>\n<p>OR</p>\n<p>You can use another methods like <code>sudo</code> to control the user under which the command runs.</p>\n"^^ . + "0"^^ . + "laravel-12"^^ . + . + "1"^^ . + . + . + "So what did you find when you checked the server error logs?"^^ . + "1"^^ . + "@C3roe Once it was in N++, explicitly changing the encoding only slightly modified which mojibake garbage appeared, and there was no way to tell it to expect CRLF. But someone answered after you telling me how to add the right BOM. Apparently BOM was not necessary in Shift-JIS."^^ . + "1"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "True - SOAP is entirely XML-based. But to be honest, you seem to be in control of both server and client here. So unless you have a really specific reason to use SOAP here (e.g. you need it to integrate with an existing legacy application), I would say don't bother - it's cumbersome, fiddly and overly verbose. A JSON-based API, perhaps designed on REST principles, is generally far simpler to implement and far simpler to test."^^ . + . + . + . + "1"^^ . + . + . + "2"^^ . + "2"^^ . + "How to update user role after woocommerce order for a free item"^^ . + "0"^^ . + . + . + "<p>I'm using the Divi theme and wanted to load the header and footer on an external php page.</p>\n<p>I have tried the following code but it loads the default header and footer:</p>\n<pre><code>&lt;?php\nrequire($_SERVER['DOCUMENT_ROOT'].&quot;/wp-load.php&quot;);\nget_header();\n\n//\n// my other php content\n//\n\nget_footer();\n?&gt;\n</code></pre>\n<p>How can I load the header and footer from the Divi theme?</p>\n"^^ . + . + ""What I want to achieve is to do a simple select in the table my_model" - did you check whether your code really generated the query you wanted to use?"^^ . + . + "<p>When doing a composer update on my Laminas projects with composer (on a Windows Machine with PHP 8.3 and Apache 2.4) out of the blue this error appeared 2 days ago (before that I used it with success):</p>\n<p>curl error 60 while downloading <a href="https://repo.packagist.org/packages.json" rel="nofollow noreferrer">https://repo.packagist.org/packages.json</a>: SSL certificate\nproblem: unable to get local issuer certificate</p>\n<p>What I tried (without success):</p>\n<ol>\n<li>Disabling Anti Virus (caveat: <a href="https://stackoverflow.com/a/79443652/367456">see answer</a>)</li>\n<li>Downloading latest cacert.pem and changed php.ini to the location with the certificate (curl.cainfo and openssl.cafile).</li>\n<li>Update composer version (I had to change &quot;disable-tls&quot;: false in composer config.json and then it worked)</li>\n<li>Removed latest windows update</li>\n<li>composer self-update --update-keys</li>\n</ol>\n<p>I'm running out of options and I am googling for 2 days now and tried a lot, but was unable to find a solution for this problem.</p>\n<pre class="lang-none prettyprint-override"><code>composer diagnose\n\nChecking composer.json: OK\nChecking platform settings: OK\nChecking git settings: No git process found\nChecking http connectivity to packagist: OK\nChecking https connectivity to packagist: FAIL\n[Composer\\Downloader\\TransportException] curl error 60 while downloading https://repo.packagist.org/packages.json: SSL certificate problem: unable to get local issuer certificate\nChecking github.com rate limit: FAIL\n[Composer\\Downloader\\TransportException] curl error 60 while downloading https://api.github.com/rate_limit: SSL certificate problem: unable to get local issuer certificate\nChecking disk free space: OK\nChecking pubkeys:\nTags Public Key Fingerprint: ***\nDev Public Key Fingerprint: ***\nOK\nChecking Composer version: FAIL\n[Composer\\Downloader\\TransportException] curl error 60 while downloading https://getcomposer.org/versions: SSL certificate problem: unable to get local issuer certificate\nChecking Composer and its dependencies for vulnerabilities: Failed performing audit: curl error 60 while downloading https://repo.packagist.org/packages.json: SSL certificate problem: unable to get local issuer certificate\nComposer version: 2.8.5\nPHP version: 8.3.17\nPHP binary path: C:\\PHP\\php.exe\nOpenSSL version: OpenSSL 3.0.15 3 Sep 2024\ncurl version: 8.7.0-DEV libz 1.2.12 ssl OpenSSL/3.0.15\nzip: extension present, unzip not available, 7-Zip not available\n</code></pre>\n<p>Procedure to download cacert.pem</p>\n<ol>\n<li>Go to <a href="https://curl.se/docs/caextract.html" rel="nofollow noreferrer">https://curl.se/docs/caextract.html</a></li>\n<li>Downloaded cacert.pem</li>\n<li>uploaded it to cert location of composers config.php</li>\n<li>To check the hash i added this line to some PHP file: echo hash_file('sha256', 'example.txt', false);</li>\n</ol>\n<ul>\n<li>That hash does not match the hash in the downloaded certificate or the &quot;Here's the sha256sum of the current PEM file&quot; link</li>\n</ul>\n<p>HASH in downloaded cacert.pem -&gt; SHA256: ***d3aca3c05c566d8dc98e116</p>\n<p>HASH in PHP file -&gt; ***b934ca495991b7852b855</p>\n<p>HASH when using link <a href="https://curl.se/ca/cacert.pem.sha256" rel="nofollow noreferrer">https://curl.se/ca/cacert.pem.sha256</a> -&gt; ***90425d7da901a11531b3aa5</p>\n"^^ . + . + "1"^^ . + . + . + . + . + "You are connecting to the database twice. Why? Remove one of them and also remove that redundant error checking. Make sure that your mysqli error reporting isn't switched off."^^ . + "<p>Hallo i get a trouble when i want to import excel with another data in mysql.</p>\n<p>This is the controller</p>\n<pre><code>public function upload(Request $request){\n\n $file = $request-&gt;filebabp;\n if($file) {\n $nama_file = Carbon::now()-&gt;setTimezone('Asia/Jakarta')-&gt;format('Ymd-His').'-'.$file-&gt;getClientOriginalName();\n\n $datasubmit['file'] = $file;\n $datasubmit['upload_date'] = Carbon::now()-&gt;setTimezone('Europe/Belarusia')-&gt;format('Y-m-d H:i:s');\n $datasubmit['nama_file'] = $nama_file;\n $datasubmit['version'] = 'NEW';\n\n $file-&gt;move(public_path('files/'), $nama_file);\n $upload = Excel::import(new TargetUpload($datasubmit), base_path('public/files/'.$nama_file));\n}\n return $this-&gt;sendResponse($file, 'Submit successfully');\n}\n</code></pre>\n<p>And this is the Import Multiple Sheet</p>\n<pre><code>use Importable;\n// /**\n// * @param array $row\n// *\n// * @return \\Illuminate\\Database\\Eloquent\\Model|null\n// */\nprotected $data;\n\nfunction __construct($data) {\n $this-&gt;data = $data;\n}\n\npublic function sheets($data): array\n{\n return [\n 0 =&gt; new TargetHeaderImport($data),\n ];\n}\n</code></pre>\n<p>I want sending the datasubmit to Import multiple sheet, and i just get a error in this.</p>\n<blockquote>\n<p>Undefined property: App\\Imports\\\\TargetSheetImport::$data</p>\n</blockquote>\n<p>If i import on direct 'TargetHeaderImport' its safe, but in excel i have a 2 sheets and i just only want one sheet to import.</p>\n<p>or do you have a another script to send the 'submitdata' ?</p>\n"^^ . + . + . + . + . + . + . + . + "Image not showing in admin dashboard of product list (PHP and HTML)"^^ . + "_"Yes all pages are php"_ - that doesn't change the fact that `/page/123.php` apparently does _not_ exist, yet you are rewriting the request for `/page/123` to that path. You probably need to rewrite it to `/page.php/123` instead?"^^ . + . + . + . + . + "Thanks so much for adding that, unfortunately - it looks good. I assume you're using AssetMapper? Does your importmap.php contain both the `@symfony/stimulus-bundle` and `@symfony/ux-live-component` entries? The weird thing is that you should at least see this one in console: `console.log('This log comes from assets/app.js - welcome to AssetMapper! ');` As an additional check, you don't compile the assets in dev right, using `php bin/console asset-map:compile`? If you do, delete `public/assets` dir and refresh your page and try again without compiling."^^ . + "This error is coming from elsewhere, perhaps an unbalanced brace earlier in the file. Maybe comment out this whole function and see if it still occurs."^^ . + . + . + "1"^^ . + "What exactly do you want to "build in" there? You're passing _a string_. That's the entire interface to that function. As long as a single string is all there is, _you_ need to take care to format that string correctly so it expresses what you want. That's all any escaping/encoding/injection is about. For SQL, you have prepared statements as alternative, where the security comes from passing statements and values completely separately to the API. The equivalent for calling external programs there is actually passing an array to [`proc_open`](https://www.php.net/proc_open)."^^ . + . + "0"^^ . + "Are you struggling with the HTML itself, or with PHP to generate it properly?"^^ . + . + . + . + "Need to enable wincache DLL extension into IIS & PHP 8.3 version?"^^ . + "1"^^ . + "Ok, so then you need to break it down, rather than thinking you need to put it all together at once. Make a simple PHP script which gets a GraphServiceClient can can download a file from OneDrive, and get it working - the sample there pretty much does that for you out of the box. Then you could maybe try to put a front-end on that - make the script accept an item ID as input (e.g. as a GET parameter) and test that. Then you can have a HTML table listing all the docs in your database, with hyperlinks to your download script, passing in the item ID in the URL so you can download any of the files"^^ . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + "I've solved it thanks to a comment by @c-shubh against an SO article 'Apache isn't loading PHP extensions'. \nThe clue came from the disparity between the CLI and web results. This led me to this article and the magic answer: "In my case the problem was that I had apache and php in user env vars only and not on system env vars. Adding those to system env vars fixed the problem.""^^ . + . + "1"^^ . + . + . + . + . + "Don't know if it's a typo error, but make sure the meta key matches exactly. In your code, the ID is `'namespace/newsletter-opt-in'`, but you're trying to retrieve it with `'szf/newsletter-opt-in'`."^^ . + "0"^^ . + "4"^^ . + . + "2"^^ . + "Of course, you can place your AppName folder anywhere, but I wouldn't put it in htdocs. And wherever you place it, you should be able to reference it relatively from the index.php."^^ . + "0"^^ . + "driver"^^ . + . + . + . + . + . + . + "<p><code>get_class($a)</code> returns something like <code>class@anonymous&lt;somepath&gt;/foo.php:6$0</code> which clearly shows that the <code>class</code> is the location where it was defined, hence the same anonymous class name was generated. It does not depend on the method, see:</p>\n<pre><code>&lt;?php\n\nfunction test($test, $case) {\n switch ($case) {\n case 1: return new class($test) {};\n case 2: return new class($test) {};\n case 3: return new class($test) {};\n case 4: return new class($test) {};\n }\n}\n\nvar_dump([\n get_class(test(1, 1)),\n get_class(test(1, 2)),\n get_class(test(1, 3)),\n get_class(test(1, 4)),\n]);\n</code></pre>\n<p>the result is:</p>\n<pre><code>array(4) {\n [0]=&gt;\n string(62) &quot;class@anonymous/var/www/html/rk/recept-management/foo.php:5$0&quot;\n [1]=&gt;\n string(62) &quot;class@anonymous/var/www/html/rk/recept-management/foo.php:6$1&quot;\n [2]=&gt;\n string(62) &quot;class@anonymous/var/www/html/rk/recept-management/foo.php:7$2&quot;\n [3]=&gt;\n string(62) &quot;class@anonymous/var/www/html/rk/recept-management/foo.php:8$3&quot;\n}\n</code></pre>\n<p>so they actually are different classes if they were created in a different line. Your <code>eval</code>-based solution of</p>\n<pre><code>function test3($test) {\n return eval(&quot;return new class($test) {\n public function __construct(public \\$test) {}};&quot;\n );\n}\ncompare(test3(1), test3(1)); // false, false, false,\n</code></pre>\n<p>has <code>get_class</code> value of the like of <code>class@anonymous&lt;somepath&gt;/foo.php(30) : eval()'d code:1$2</code></p>\n<p>so it is actually a solution, but I advise against this solution due to general problems with eval. Because if you allow a string like this to be executed, then, if that string was written by malicious intent, it could cause huge problems. If that eval is exposed to user-defined parameterized templates, then you will end up in a special depth of Hell. If you are still sure that this is what you want, then of course you can do it.</p>\n<p>But, quite frankly, if you want to differentiate between your classes, you can use named classes instead of anonymous classes. So all this scenario seems very hacky and even if it's benign now, later it might become malicious without you or your team noticing the tipping point.</p>\n"^^ . + . + "The php script in your question looks like it'd just discard stderr, are you sure you're seeing the stderr? I know you said the output is being logged to the db but are you sure that's both stdout and stderr output? If not, where do you see stderr? Does the output change if you change your PHP line to `$commandOutput = shell_exec("/bin/bash ./sync.sh --repo=" . $hook["repo"] . " --branch=" . $hook["branch"] . " --subdomain=" . $subdomain . " 2>&1");` (or whatever the correct syntax is to add the shell instruction `2>&1` to the end of the string PHP is going to call bash to execute)?"^^ . + . + . + "Not working. Slack doesn't even hit the endpoint."^^ . + "Thanks for the attempts. The doctype of #1 would seem the most obvious but I haven't been able to get it to work with the anonymous function structure. What's more, my testing shows you don't even need the doctype on it! It's as though PHPStan is assuming object shape with the anonymous function that it isn't with an actual function. So I'm still left without the answer as to how to explicitly set the shape to override PHPStan's assumptions. #3 and #4 are feeling the most viable but I hate to unnecessary warp code just to appease PHPStan."^^ . + "2"^^ . + "shopware6-api"^^ . + . + "<p>I am trying to deploy a Symfony PHP application to AWS ECS, using Nginx as a web server. An Application Load Balancer (ALB) handles SSL termination and forwards HTTPS traffic to the ECS service. However, my Nginx container is unable to forward requests to the PHP container, resulting in errors logged in the Nginx container logs:</p>\n<pre><code>February 08, 2025 at 16:57 (UTC-8:00)[09-Feb-2025 00:57:54] NOTICE: exiting, bye-bye!\nphp\nFebruary 08, 2025 at 16:57 (UTC-8:00)[09-Feb-2025 00:57:54] NOTICE: Terminating ...\nphp\nFebruary 08, 2025 at 16:57 (UTC-8:00)2025/02/09 00:57:54 [emerg] 1#1: host not found in upstream &quot;php:9000&quot; in /etc/nginx/conf.d/default.conf:2\nnginx\nFebruary 08, 2025 at 16:57 (UTC-8:00)nginx: [emerg] host not found in upstream &quot;php:9000&quot; in /etc/nginx/conf.d/default.conf:2\nnginx\nFebruary 08, 2025 at 16:57 (UTC-8:00)/docker-entrypoint.sh: Configuration complete; ready for start up\nnginx\nFebruary 08, 2025 at 16:57 (UTC-8:00)/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh\nnginx\nFebruary 08, 2025 at 16:57 (UTC-8:00)10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version\nnginx\nFebruary 08, 2025 at 16:57 (UTC-8:00)/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh\nnginx\nFebruary 08, 2025 at 16:57 (UTC-8:00)10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf\nnginx\nFebruary 08, 2025 at 16:57 (UTC-8:00)/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh\nnginx\nFebruary 08, 2025 at 16:57 (UTC-8:00)/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration\nnginx\nFebruary 08, 2025 at 16:57 (UTC-8:00)/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/\nnginx\nFebruary 08, 2025 at 16:57 (UTC-8:00)[09-Feb-2025 00:57:54] NOTICE: ready to handle connections\nphp\nFebruary 08, 2025 at 16:57 (UTC-8:00)[09-Feb-2025 00:57:54] NOTICE: fpm is running, pid 1\n</code></pre>\n<h2>I am using this nginx default.conf file:</h2>\n<pre><code>upstream php {\n server php:9000;\n}\n\nserver {\n listen 8080;\n server_name _;\n\n root /var/www/html/public;\n index index.php index.html;\n\n location / {\n try_files $uri $uri/ /index.php?$query_string;\n }\n\n location ~ \\.php$ {\n include fastcgi_params;\n fastcgi_pass php:9000;\n fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;\n fastcgi_param DOCUMENT_ROOT $realpath_root;\n }\n}\n</code></pre>\n<h2>And this docker file for nginx:</h2>\n<pre><code>FROM nginx:1.24-alpine\nWORKDIR /var/www/html\nCOPY ./docker/nginx/default.conf /etc/nginx/conf.d/default.conf\nCOPY ./public /var/www/html\nEXPOSE 8080\nCMD [&quot;nginx&quot;, &quot;-g&quot;, &quot;daemon off;&quot;]\n</code></pre>\n<h2>And this is the docker file for php:</h2>\n<pre><code>FROM php:8.2-fpm\nRUN apt-get update &amp;&amp; apt-get install -y \\\n unzip git curl libpng-dev libjpeg-dev libfreetype6-dev \\\n &amp;&amp; docker-php-ext-configure gd --with-freetype --with-jpeg \\\n &amp;&amp; docker-php-ext-install pdo pdo_mysql gd opcache \\\n &amp;&amp; rm -rf /var/lib/apt/lists/* # Reduce image size\nWORKDIR /var/www/html\nCOPY . /var/www/html\nCOPY ./docker/php/conf.d/custom.ini /usr/local/etc/php/conf.d/custom.ini\nRUN chown -R www-data:www-data /var/www/html \\\n &amp;&amp; chmod -R 755 /var/www/html\nRUN sed -i 's/^user = ./user = www-data/' /usr/local/etc/php-fpm.d/www.conf \\\n &amp;&amp; sed -i 's/^group = ./group = www-data/' /usr/local/etc/php-fpm.d/www.conf \\\n &amp;&amp; sed -i 's/^listen.owner = ./listen.owner = www-data/' /usr/local/etc/php-fpm.d/www.conf \\\n &amp;&amp; sed -i 's/^listen.group = ./listen.group = www-data/' /usr/local/etc/php-fpm.d/www.conf \\\n &amp;&amp; sed -i 's/^listen.mode = .*/listen.mode = 0660/' /usr/local/etc/php-fpm.d/www.conf\nCMD [&quot;php-fpm&quot;, &quot;-F&quot;]\n</code></pre>\n<h2>And this is the ECS task definition:</h2>\n<pre><code>{\n &quot;taskDefinitionArn&quot;: &quot;arn:aws:ecs:ca-central-1:537124965615:task-definition/outlier-academy-backend:88&quot;,\n &quot;containerDefinitions&quot;: [\n {\n &quot;name&quot;: &quot;php&quot;,\n &quot;image&quot;: &quot;537124965615.dkr.ecr.ca-central-1.amazonaws.com/backend/php:latest&quot;,\n &quot;cpu&quot;: 512,\n &quot;memory&quot;: 1024,\n &quot;portMappings&quot;: [\n {\n &quot;containerPort&quot;: 9000,\n &quot;hostPort&quot;: 9000,\n &quot;protocol&quot;: &quot;tcp&quot;\n }\n ],\n &quot;essential&quot;: true,\n &quot;environment&quot;: [\n {\n &quot;name&quot;: &quot;APP_DEBUG&quot;,\n &quot;value&quot;: &quot;false&quot;\n },\n {\n &quot;name&quot;: &quot;APP_ENV&quot;,\n &quot;value&quot;: &quot;prod&quot;\n }\n ],\n &quot;mountPoints&quot;: [\n {\n &quot;sourceVolume&quot;: &quot;efs-volume&quot;,\n &quot;containerPath&quot;: &quot;/var/www/html&quot;\n }\n ],\n &quot;volumesFrom&quot;: [],\n &quot;secrets&quot;: [\n {\n &quot;name&quot;: &quot;MYSQL_HOST&quot;,\n &quot;valueFrom&quot;: &quot;arn:aws:secretsmanager:ca-central-1:537124965615:secret:outlier-academy-secrets-uDY75N:DATABASE_HOST::&quot;\n },\n {\n &quot;name&quot;: &quot;MYSQL_DATABASE&quot;,\n &quot;valueFrom&quot;: &quot;arn:aws:secretsmanager:ca-central-1:537124965615:secret:outlier-academy-secrets-uDY75N:DATABASE_NAME::&quot;\n },\n {\n &quot;name&quot;: &quot;MYSQL_USER&quot;,\n &quot;valueFrom&quot;: &quot;arn:aws:secretsmanager:ca-central-1:537124965615:secret:outlier-academy-secrets-uDY75N:DATABASE_USERNAME::&quot;\n },\n {\n &quot;name&quot;: &quot;MYSQL_PASSWORD&quot;,\n &quot;valueFrom&quot;: &quot;arn:aws:secretsmanager:ca-central-1:537124965615:secret:outlier-academy-secrets-uDY75N:DATABASE_PASSWORD::&quot;\n }\n ],\n &quot;logConfiguration&quot;: {\n &quot;logDriver&quot;: &quot;awslogs&quot;,\n &quot;options&quot;: {\n &quot;awslogs-group&quot;: &quot;/ecs/outlier-academy-backend&quot;,\n &quot;awslogs-region&quot;: &quot;ca-central-1&quot;,\n &quot;awslogs-stream-prefix&quot;: &quot;php&quot;\n }\n },\n &quot;healthCheck&quot;: {\n &quot;command&quot;: [\n &quot;CMD-SHELL&quot;,\n &quot;curl -f http://localhost/health-check || exit 1&quot;\n ],\n &quot;interval&quot;: 30,\n &quot;timeout&quot;: 10,\n &quot;retries&quot;: 3\n },\n &quot;systemControls&quot;: []\n },\n {\n &quot;name&quot;: &quot;nginx&quot;,\n &quot;image&quot;: &quot;537124965615.dkr.ecr.ca-central-1.amazonaws.com/backend/nginx:latest&quot;,\n &quot;cpu&quot;: 512,\n &quot;memory&quot;: 1024,\n &quot;portMappings&quot;: [\n {\n &quot;containerPort&quot;: 8080,\n &quot;hostPort&quot;: 8080,\n &quot;protocol&quot;: &quot;tcp&quot;\n }\n ],\n &quot;essential&quot;: true,\n &quot;environment&quot;: [],\n &quot;mountPoints&quot;: [\n {\n &quot;sourceVolume&quot;: &quot;efs-volume&quot;,\n &quot;containerPath&quot;: &quot;/var/www/html&quot;\n }\n ],\n &quot;volumesFrom&quot;: [],\n &quot;dependsOn&quot;: [\n {\n &quot;containerName&quot;: &quot;php&quot;,\n &quot;condition&quot;: &quot;START&quot;\n }\n ],\n &quot;logConfiguration&quot;: {\n &quot;logDriver&quot;: &quot;awslogs&quot;,\n &quot;options&quot;: {\n &quot;awslogs-group&quot;: &quot;/ecs/outlier-academy-backend&quot;,\n &quot;awslogs-region&quot;: &quot;ca-central-1&quot;,\n &quot;awslogs-stream-prefix&quot;: &quot;nginx&quot;\n }\n },\n &quot;systemControls&quot;: []\n }\n ],\n &quot;family&quot;: &quot;outlier-academy-backend&quot;,\n &quot;taskRoleArn&quot;: &quot;arn:aws:iam::537124965615:role/ecsTaskRole&quot;,\n &quot;executionRoleArn&quot;: &quot;arn:aws:iam::537124965615:role/ecsTaskExecutionRole&quot;,\n &quot;networkMode&quot;: &quot;awsvpc&quot;,\n &quot;revision&quot;: 88,\n &quot;volumes&quot;: [\n {\n &quot;name&quot;: &quot;efs-volume&quot;,\n &quot;efsVolumeConfiguration&quot;: {\n &quot;fileSystemId&quot;: &quot;fs-0eb470888836bb681&quot;,\n &quot;rootDirectory&quot;: &quot;/&quot;,\n &quot;transitEncryption&quot;: &quot;ENABLED&quot;,\n &quot;authorizationConfig&quot;: {\n &quot;accessPointId&quot;: &quot;fsap-0bb93651afb6e5a92&quot;,\n &quot;iam&quot;: &quot;ENABLED&quot;\n }\n }\n }\n ],\n &quot;status&quot;: &quot;ACTIVE&quot;,\n &quot;requiresAttributes&quot;: [\n {\n &quot;name&quot;: &quot;ecs.capability.execution-role-awslogs&quot;\n },\n {\n &quot;name&quot;: &quot;com.amazonaws.ecs.capability.ecr-auth&quot;\n },\n {\n &quot;name&quot;: &quot;com.amazonaws.ecs.capability.task-iam-role&quot;\n },\n {\n &quot;name&quot;: &quot;ecs.capability.container-health-check&quot;\n },\n {\n &quot;name&quot;: &quot;ecs.capability.execution-role-ecr-pull&quot;\n },\n {\n &quot;name&quot;: &quot;com.amazonaws.ecs.capability.docker-remote-api.1.18&quot;\n },\n {\n &quot;name&quot;: &quot;ecs.capability.task-eni&quot;\n },\n {\n &quot;name&quot;: &quot;com.amazonaws.ecs.capability.logging-driver.awslogs&quot;\n },\n {\n &quot;name&quot;: &quot;com.amazonaws.ecs.capability.docker-remote-api.1.24&quot;\n },\n {\n &quot;name&quot;: &quot;ecs.capability.efsAuth&quot;\n },\n {\n &quot;name&quot;: &quot;com.amazonaws.ecs.capability.docker-remote-api.1.19&quot;\n },\n {\n &quot;name&quot;: &quot;ecs.capability.secrets.asm.environment-variables&quot;\n },\n {\n &quot;name&quot;: &quot;ecs.capability.efs&quot;\n },\n {\n &quot;name&quot;: &quot;ecs.capability.container-ordering&quot;\n },\n {\n &quot;name&quot;: &quot;com.amazonaws.ecs.capability.docker-remote-api.1.25&quot;\n }\n ],\n &quot;placementConstraints&quot;: [],\n &quot;compatibilities&quot;: [\n &quot;EC2&quot;,\n &quot;FARGATE&quot;\n ],\n &quot;requiresCompatibilities&quot;: [\n &quot;FARGATE&quot;\n ],\n &quot;cpu&quot;: &quot;1024&quot;,\n &quot;memory&quot;: &quot;2048&quot;,\n &quot;registeredAt&quot;: &quot;2025-02-09T00:56:30.287Z&quot;,\n &quot;registeredBy&quot;: &quot;arn:aws:iam::537124965615:user/ahmed-elkhouly&quot;,\n &quot;tags&quot;: []\n}\n</code></pre>\n<h2>And this Github actions pipeline for CICD:</h2>\n<pre><code>on:\n push:\n branches:\n - deploy-on-cloud\n\nenv:\n AWS_REGION: ${{ secrets.AWS_REGION }}\n ECR_PHP_REPOSITORY: backend/php\n ECR_NGINX_REPOSITORY: backend/nginx\n IMAGE_TAG: ${{ github.sha }}\n\njobs:\n deploy:\n name: Deploy to AWS ECS\n runs-on: ubuntu-latest\n\n steps:\n - name: Checkout Code\n uses: actions/checkout@v3\n\n - name: Configure AWS Credentials\n uses: aws-actions/configure-aws-credentials@v3\n with:\n aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n aws-region: ${{ env.AWS_REGION }}\n\n - name: Login to Amazon ECR\n id: login-ecr\n uses: aws-actions/amazon-ecr-login@v2\n\n - name: Build &amp; Push Docker Images\n env:\n ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}\n run: |\n for service in php nginx; do\n docker build -t $ECR_REGISTRY/backend/$service:$IMAGE_TAG \\\n -t $ECR_REGISTRY/backend/$service:latest \\\n -f docker/$service/Dockerfile .\n docker push $ECR_REGISTRY/backend/$service --all-tags\n done\n\n - name: Download ECS Task Definition\n run: aws ecs describe-task-definition \\\n --task-definition ${{ secrets.ECS_TASK_DEFINITION }} \\\n --query taskDefinition &gt; task-definition.json\n\n - name: Update ECS Task Definition (PHP)\n id: task-def\n uses: aws-actions/amazon-ecs-render-task-definition@v1\n with:\n task-definition: task-definition.json\n container-name: php\n image: ${{ steps.login-ecr.outputs.registry }}/backend/php:${{ env.IMAGE_TAG }}\n\n - name: Update ECS Task Definition (Nginx)\n id: task-def-updated\n uses: aws-actions/amazon-ecs-render-task-definition@v1\n with:\n task-definition: ${{ steps.task-def.outputs.task-definition }}\n container-name: nginx\n image: ${{ steps.login-ecr.outputs.registry }}/backend/nginx:${{ env.IMAGE_TAG }}\n\n - name: Deploy to ECS\n uses: aws-actions/amazon-ecs-deploy-task-definition@v1\n with:\n task-definition: ${{ steps.task-def-updated.outputs.task-definition }}\n service: ${{ secrets.ECS_SERVICE }}\n cluster: ${{ secrets.ECS_CLUSTER }}\n wait-for-service-stability: true\n\n - name: Clean Up Old Images\n if: always()\n run: |\n for repo in backend/php backend/nginx; do\n aws ecr list-images --repository-name $repo \\\n --query 'imageIds[?imageTag!=`latest`]|[0].imageDigest' --output text | \\\n head -n -5 | while read digest; do\n [ -n &quot;$digest&quot; ] &amp;&amp; aws ecr batch-delete-image --repository-name $repo --image-ids imageDigest=$digest\n done\n done\n</code></pre>\n<p>I have created the ALB in 2 public subnets and the ECS cluster in 2 private subnets and i have a sg for ALB and sg for ECS and a sg for efs and i allowed all traffic between them for now until i fix my issue. Do i have something wrong in my config that doesn't allow nginx container to talk to php container, i suppose they can resolve normally using container name since both are in the same ECS task?</p>\n<p>I tried to change the nginx configurations many times but didn't solve the issue, and i am expecting any expert here to help me with any hints to try.</p>\n"^^ . + . + "1"^^ . + . + . + "How to show the default fallback using the file upload?"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + "@IonicăBizău the last paragraph of this answer describes two options: the first is to pass a string as the second parameter, like `$pinecone = new Pinecone($pineconeApiKey, $yoursecondparameter);` and the second is to refresh PineCone's version in which case you do not need to change the way you instantiate it."^^ . + . + . + "0"^^ . + "but if you resize (downsize) the image and crop, obviously displaying it in the same container width/height like the original, the quality is lower..."^^ . + . + "0"^^ . + . + . + . + . + "2"^^ . + . + . + . + "`'/../', '$0 '` -- no capture group is needed."^^ . + . + . + "1"^^ . + . + . + "Failed `require` directives trigger: "Fatal error: Uncaught Error: Failed opening required 'resources/includes/PHPMailer/src/Exception.php'". BTW, if you are avoiding Composer because you believe it needs to be installed on the server, know that it isn't the case. You can run it in your machine and just upload the resulting files."^^ . + "i have updated my prb for clarity \nthanks"^^ . + . + "0"^^ . + . + "1"^^ . + . + . + . + "Im very grateful for your help, Im starting to debug it right now. Additionally, before your reply I was testing bunch of approaches and now I have `unique()` in my table:\n\n `$table->unique(['recipe_id', 'step_number']);`"^^ . + . + . + "0"^^ . + . + . + . + "<p>I'm facing an issue with my multi-guard authentication setup in Laravel involving impersonation. I have four guards defined: admin, distributor, customer, and user. My system allows a customer to impersonate a user (for example for support purposes).When I impersonate a customer by logging in as a user, I cannot &quot;go back&quot; to the customer. Instead, I'm redirected to /home.</p>\n<p>The strange part is that my log statements inside the &quot;back-to-user&quot; (or &quot;back-to-customer&quot;) function are not executed at all—it’s as if the function isn’t being called. I've implemented similar impersonation functionality for Admin and Distributor, and those work fine; the issue only occurs when going back from a user impersonation.</p>\n<p>In the logs, I only see a 302 redirect (with no errors) and nothing is logged from the back function. It appears that somewhere the application is redirecting me to /home instead of calling the function.</p>\n<pre><code>Route::get('back-to-customer', [\\App\\core\\auth\\LoginController::class, 'backToCustomer'])-&gt;name('back-to-customer');\n\n\npublic function backToCustomer(Request $request)\n{\n Auth::guard('user')-&gt;logout();\n\n if(Auth::guard('customer')-&gt;check()) {\n return redirect('/');\n }\n return redirect('/');\n}\n\npublic function impersonate(User $user)\n{\n Auth::guard('user')-&gt;login($user);\n\n return redirect()-&gt;route('customers::dashboard.show');\n}\n\nLog:\nts=2025-03-27T16:17:13.551637+00:00 lvl=DEBUG chan=local msg=&quot;request processed&quot; method=GET endpoint=/back-to-customer action=App\\core\\auth\\LoginController@backToCustomer status_code=302 duration=&quot;394ms 120µs&quot; user.customer=cust@cust.at user.admin=admin@admin.at user=&quot;customer:cust@cust.at, admin:admin@admin.at&quot;\n</code></pre>\n<p>I suspect that the redirection to /home happens because I defined the HOME constant in my RouteServiceProvider. But why is this happening. But that shouldn't be the problem, it should redirect me to my routes or execute the function.</p>\n<p>What I've tried so far:</p>\n<ol>\n<li>Verified that the /back-to-customer route is properly defined (artisan route:list) and that similar routes for Admin and Distributor work as expected.</li>\n<li>Confirmed that there are no error logs—just a 302 redirect to /home.</li>\n</ol>\n<p>Can anyone help me or tell me something I can use to find out what the problem might be. Maybe someone has experience with unexpected redirects</p>\n"^^ . + . + . + . + "Also when writing multi-line strings, you can and should use nowdoc syntax since PHP 7.3 (circa 2018). See manual: https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + "1"^^ . + "<p>I'm currently developing a custom backend module in TYPO3 12 and want to store a checkbox value so that I can retrieve it in the frontend (Fluid template).</p>\n<p>I successfully created the backend module using this video:\n▶ <a href="https://www.youtube.com/watch?v=hnksXYtFgbY" rel="nofollow noreferrer">https://www.youtube.com/watch?v=hnksXYtFgbY</a></p>\n<p>However, the video (and all other resources I found) do not explain how to store form inputs and retrieve them later.</p>\n<p>My current setup:</p>\n<p><strong>BackendController.php</strong></p>\n<pre><code>\n&lt;?php\n\nnamespace LjBarrierefrei\\Controller;\n\nuse TYPO3\\CMS\\Backend\\Attribute\\AsController;\nuse TYPO3\\CMS\\Backend\\Template\\ModuleTemplateFactory;\nuse TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n#[AsController]\nfinal class BackendController extends ActionController\n{\n public function __construct(\n protected readonly ModuleTemplateFactory $moduleTemplateFactory,\n ) {\n }\n public function indexAction(): ResponseInterface\n {\n $this-&gt;view-&gt;assign('someVar', 'someContent');\n $moduleTemplate = $this-&gt;moduleTemplateFactory-&gt;create($this-&gt;request);\n\n $moduleTemplate-&gt;setContent($this-&gt;view-&gt;render());\n return $this-&gt;htmlResponse($moduleTemplate-&gt;renderContent());\n\n }\n}\n\n</code></pre>\n<p>Fluid Template Index.html (Backend module UI)</p>\n<pre><code>\n\n&lt;div class=&quot;m-lg-5 border p-4&quot;&gt;\n&lt;h1&gt;Barrierefrei Einstellungen&lt;/h1&gt;\n &lt;p&gt;Hier können Sie die Moduleinstellungen konfigurieren.!!!!&lt;/p&gt;\n &lt;f:form action=&quot;save&quot;&gt;\n &lt;label&gt;\n &lt;f:form.checkbox name=&quot;enable_barrierefrei&quot; value=&quot;1&quot; checked=&quot;{enableBarrierefrei}&quot; /&gt;\n Barrierefreiheit aktivieren\n &lt;/label&gt;\n &lt;f:form.submit value=&quot;Speichern&quot; /&gt;\n &lt;/f:form&gt;\n\n&lt;/div&gt;\n\n</code></pre>\n<p>My question:</p>\n<p>How can I properly store the checkbox value so that:\nThe setting is persisted after saving\nI can retrieve the value in the frontend (e.g., in Fluid {settings.enableBarrierFree})</p>\n<p>I am unsure about the best way to store the checkbox value:</p>\n<p>Should I store it in a TYPO3 database table?</p>\n<p>Can I store it using TYPO3 configuration ($GLOBALS['TYPO3_CONF_VARS'])?</p>\n<p>What is the best practice in TYPO3 12 backend modules for storing such settings?</p>\n<p>If anyone has a clear explanation or example, I would really appreciate your help! </p>\n<p>TYPO3 Version: 12.4.3\nPHP Version: 8.1</p>\n<p>Thanks in advance for any help!</p>\n"^^ . + . + . + . + . + . + "-1"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + "0"^^ . + "1"^^ . + "you should never use a length unless you really know what you are doing."^^ . + . + "0"^^ . + . + . + . + . + "you called `exit` - that stops php"^^ . + "0"^^ . + "FCM Auth2 subscribe to topic erro: Authentication using"^^ . + "<p>I am working on a Laravel 11 project using Spatie's Laravel Permission package for role-based access control.</p>\n<p>I have the following Blade template where I want to conditionally display a sidebar link based on whether the authenticated user has the view_permission_categories permission.</p>\n<pre><code>`@php\n $userPermissions = Auth::user()-&gt;getAllPermissions()-&gt;pluck('name')- &gt;toArray();\n@endphp\n\n@if(in_array('view_permission_categories', $userPermissions))\n&lt;li&gt;\n &lt;x-nav-link href=&quot;/permissioncategories&quot; :active=&quot;request()- &gt;is('permissioncategories')&quot;&gt;Permission Categories&lt;/x-nav-link&gt;\n&lt;/li&gt;\n@endif\n\n@can('view_permission_categories')\n&lt;li&gt;\n &lt;x-nav-link href=&quot;/permissioncategories&quot; :active=&quot;request()- &gt;is('permissioncategories')&quot;&gt;Permission Categories&lt;/x-nav-link&gt;\n&lt;/li&gt;\n@endcan\n</code></pre>\n<p>`</p>\n<p>The Issue:\nThe @if(in_array(...)) condition works as expected, and the link appears.\nThe @can(...) condition does NOT work, meaning the <li> inside it does not show up.</p>\n<p>My Questions:\nWhy does @can('view_permission_categories') fail, while in_array(Auth::user()-&gt;getAllPermissions()-&gt;pluck('name')-&gt;toArray()) works?\nHow can I debug why @can is not recognizing the permission?\nIs there something specific I need to configure for Spatie's Laravel Permission to make @can work correctly?\nAny help would be greatly appreciated!</p>\n<p>What I Have Tried:</p>\n<ol>\n<li>Checked If the User Has the Permission:\n<code>dd(Auth::user()-&gt;can('view_permission_categories')); </code></li>\n</ol>\n<p>2.Ensured Roles &amp; Permissions Are Loaded:\n$currentUser = Auth::user()-&gt;load('roles.permissions');</p>\n<p>Still, @can does not work.</p>\n<p>3.Cleared Cache:\nphp artisan cache:clear\nphp artisan config:clear\nphp artisan view:clear\nphp artisan route:clear\nphp artisan permission:cache-reset</p>\n<p>4.Checked AuthServiceProvider.php for Gate Definitions:</p>\n<pre><code>`use Illuminate\\Support\\Facades\\Gate;\npublic function boot()\n{\n Gate::define('view_permission_categories', function ($user) {\n return $user-&gt;hasPermissionTo('view_permission_categories');\n});\n}\n`\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + "Maybe it was like David said - the meta thing did the job sufficiently (albeit it's a bit clunky compared to ajax)? I don't know why your post is closed by the way, it seems clear enough to me"^^ . + . + . + . + "listbox"^^ . + . + . + . + "1"^^ . + . + . + "Removed the . (dot) and changed the header to Content-Type: application/xml and got Unexpected HTTP code: 400 string(45) "{"message":"Parameter 'text' not specified."}" also tried http_build_querry() and got the same output. Tried hard wired test as text=Hi There&... Same out put"^^ . + "week-number"^^ . + "is this specific to some env key or for all?"^^ . + "0"^^ . + "So what do you suggest as a solution in my case?"^^ . + "0"^^ . + . + . + . + "4"^^ . + . + . + "4"^^ . + "<p>I am trying to add a custom template to get the ATUM location to show in the packing slips. I have tried a couple of codes to retrieve the information but nothing shows up. I do not get any error I just will not get the information. The ATUM location works fine because I do get it on the orders in woocommerce.</p>\n<p>What I am doing wrong to retrieve the information from atum?</p>\n<p>This is what I have tried to add:</p>\n<pre class="lang-php prettyprint-override"><code>add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_atum_location', 10, 2 );\nfunction wpo_wcpdf_atum_location($template_type, $order) {\n if ($template_type == 'packing-slip') {\n $document = wcpdf_get_document( $template_type, $order );\n $atum_location = get_post_meta( $order-&gt;get_id(), '_atum_location', true );\n\n if ( ! empty( $atum_location ) ) {\n ?&gt;\n &lt;tr class=&quot;atum-location&quot;&gt;\n &lt;th&gt;ATUM Location:&lt;/th&gt;\n &lt;td&gt;&lt;?php echo esc_html( $atum_location ); ?&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php\n } \n } \n} \n</code></pre>\n<hr />\n<pre><code>&lt;?php\n$locations = wp_get_object_terms ( $summary_item, 'atum_location', array( 'fields' =&gt; 'names' ) );\n$locations_list = ! empty( $locations ) ? implode( ', ', $locations ) : '&amp;ndash;';\n?&gt;\n&lt;?php echo esc_html( $locations_list ) ?&gt;\n</code></pre>\n<p>Here is the whole code for the template with one code I tried:</p>\n<pre class="lang-html prettyprint-override"><code>&lt;tbody&gt;\n &lt;?php foreach ( $this-&gt;get_order_items() as $item_id =&gt; $item ) : ?&gt;\n &lt;tr class=&quot;&lt;?php echo esc_html( $item['row_class'] ); ?&gt;&quot;&gt;\n &lt;td class=&quot;product&quot;&gt;\n &lt;p class=&quot;item-name&quot;&gt;&lt;?php echo esc_html( $item['name'] ); ?&gt;&lt;/p&gt;\n &lt;?php do_action( 'wpo_wcpdf_before_item_meta', $this-&gt;get_type(), $item, $this-&gt;order ); ?&gt;\n &lt;div class=&quot;item-meta&quot;&gt;\n &lt;?php if ( ! empty( $item['sku'] ) ) : ?&gt;\n &lt;p class=&quot;sku&quot;&gt;&lt;span class=&quot;label&quot;&gt;&lt;?php $this-&gt;sku_title(); ?&gt;&lt;/span&gt; &lt;?php echo esc_attr( $item['sku'] ); ?&gt;&lt;/p&gt;\n &lt;?php endif; ?&gt;\n &lt;?php if ( ! empty( $item['weight'] ) ) : ?&gt;\n &lt;p class=&quot;weight&quot;&gt;&lt;span class=&quot;label&quot;&gt;&lt;?php $this-&gt;weight_title(); ?&gt;&lt;/span&gt; &lt;?php echo esc_attr( $item['weight'] ); ?&gt;&lt;?php echo esc_attr( get_option( 'woocommerce_weight_unit' ) ); ?&gt;&lt;/p&gt;\n &lt;?php endif; ?&gt;\n &lt;?php if ( ! empty( $location['wp_list_filter'] ) ) : ?&gt;\n &lt;p class=&quot;item_location&quot;&gt;&lt;span class=&quot;inventory_labels&quot;&gt;&lt;?php $this-&gt;inventory_labels(); ?&gt;&lt;/span&gt; &lt;?php echo esc_html( $inventory_labels); ?&gt;&lt;?php echo esc_html( get_option( 'get_location_labels' ) ); ?&gt;&lt;/\n &lt;?php endif; ?&gt;\n &lt;!-- ul.wc-item-meta --&gt;\n &lt;?php if ( ! empty( $item['meta'] ) ) : ?&gt;\n &lt;?php echo wp_kses_post( $item['meta'] ); ?&gt;\n &lt;?php endif; ?&gt;\n &lt;!-- / ul.wc-item-meta --&gt;\n &lt;/div&gt;\n &lt;?php do_action( 'wpo_wcpdf_after_item_meta', $this-&gt;get_type(), $item, $this-&gt;order ); ?&gt;\n &lt;/td&gt;\n &lt;td class=&quot;quantity&quot;&gt;&lt;?php echo esc_html( $item['quantity'] ); ?&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php endforeach; ?&gt;\n&lt;/tbody&gt;\n</code></pre>\n"^^ . + . + "What is the correct way to create api examples in NelmioApiDocBundle?"^^ . + . + . + "0"^^ . + . + . + "<p>You can use <code>disabled</code> method to disable the field. The disabled field will not store the value in database. If you want the field value to remain stored in database, you can use <code>dehydrated</code> method like this</p>\n<pre class="lang-php prettyprint-override"><code>-&gt;disabled(fn () =&gt; ! auth()-&gt;user()?-&gt;hasRole('admin')) // change the function\n-&gt;dehydrated()\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + "1"^^ . + . + "-1"^^ . + "0"^^ . + "0"^^ . + . + "<p>Your expectation that <code>$_GET</code> should remain <code>array&lt;mixed&gt;</code> makes sense in some cases because:</p>\n<ul>\n<li><p>The <code>empty()</code> check only provides information about a single key (<code>ssid</code>), but PHPStan refines the entire <code>$_GET</code> array.</p>\n</li>\n<li><p>This could lead to incorrect inferences if the code is modified <code>$_GET</code> dynamically later.</p>\n<p>-&gt; Use <code>isset()</code> instead of <code>empty()</code>, which might not refine the type in the same way.</p>\n</li>\n</ul>\n"^^ . + . + . + . + . + . + "2"^^ . + . + . + "<p>Have your class implement <a href="https://www.php.net/manual/en/class.jsonserializable.php" rel="nofollow noreferrer"><code>JsonSerializable</code></a> and have its <a href="https://www.php.net/manual/en/jsonserializable.jsonserialize.php" rel="nofollow noreferrer"><code>jsonSerialize</code></a> throw:</p>\n<pre><code>class ValueObject implements JsonSerializable\n{\n public function __construct(public string $someProperty)\n {\n }\n\n public function jsonSerialize()\n {\n throw new LogicException('cant serialize');\n }\n}\n</code></pre>\n<p>You may also fix your JSON encoding by actually implementing the <code>jsonSerialize()</code> method here, instead of having the transformation happen elsewhere.</p>\n"^^ . + . + . + . + "4"^^ . + "1"^^ . + . + . + . + "Thank you for all your help! I will take note of everything."^^ . + "2"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "swagger"^^ . + . + . + . + "Why `application/xml`? You're not sending XML."^^ . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + "1"^^ . + . + . + . + "Please post your .htaccess file"^^ . + . + "telegram"^^ . + "Why not use `$this->count()`? This is how to call functions in classes in general PHP, completely unrelated to Laravel"^^ . + . + . + "Answer to @Olivier \nI just think, maybe that is concurrent, because i just request multiple that from Laravel API. That "fake request" it means the API from Fake API. I already add the refrence of the worked if one of them using Fake API."^^ . + . + . + . + . + . + "1"^^ . + . + . + "1"^^ . + . + "0"^^ . + . + . + . + . + "Remove product quantity column from WooCommerce email notifications"^^ . + . + "Laravel: route not defined but it is"^^ . + . + "And as you have already diagnosed, this is not an issue with your browser. Just FYI."^^ . + . + . + "rate"^^ . + "1"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + "1"^^ . + "Note that the assignment in the loop frees the previous value of `$image`, so there is no accumulation even if you don't explicitly free the variable (no more than 2 images are allocated at the same time)."^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + "Filament php modal is not working correctly"^^ . + . + "0"^^ . + . + "csh - I also tried to copy the .pc file to /usr/local/lib but still not working - site is suggesting we move to chat, is that ok?"^^ . + "0"^^ . + . + "That's the isue I explain bellow."^^ . + . + . + "1"^^ . + . + . + . + . + . + . + "1"^^ . + . + . + "1"^^ . + . + "php export data to excel / csv with dynamic column names"^^ . + . + . + "0"^^ . + . + "0"^^ . + "@YourCommonSense They can be used in any type constraint, not just return types - see for instance this demo of a property that allows `false` but rejects `true`: https://3v4l.org/WWcEk"^^ . + . + . + . + . + "How to set private parent properties when restoring from `var_export()` in `__set_state()`?"^^ . + "<?php\n\nuse Illuminate\\Contracts\\Http\\Kernel;\nuse Illuminate\\Http\\Request;\n\ndefine('LARAVEL_START', microtime(true));\n\nif (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {\n require $maintenance;\n}\n\n\n\nrequire __DIR__.'/../vendor/autoload.php';\n\n\n\n$app = require_once __DIR__.'/../bootstrap/app.php';\n\n$kernel = $app->make(Kernel::class);\n\n$response = $kernel->handle(\n $request = Request::capture()\n)->send();\n\n$kernel->terminate($request, $response);"^^ . + . + "1"^^ . + . + "-2"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + "Note that [this is the code in the question](https://github.com/ilovepdf/ilovepdf-php/blob/master/samples/compress_basic.php). This is github-repository-code from ilovepdf and it talks about a manual installation. I think this comment isn't valid anymore, since there's no `init.php` in the parent directory. This is what this question is about: Can this code be used without Composer?"^^ . + . + . + . + . + "<p>I have a series of strings of numbers of different lengths that I need to split into chunks of 2 characters. The last chunk should be 3 characters long, if it would be 1 character long.</p>\n<p>For example, <code>22334455</code> needs to become <code>22 33 44 55</code>, but <code>2233444</code> needs to become <code>22 33 444</code>.</p>\n<p>I have:</p>\n<pre><code>implode(&quot; &quot;, str_split($string, 2));\n</code></pre>\n<p>but that returns <code>22 33 44 4</code>.</p>\n<p>What can I do?</p>\n<p>I have thought of:</p>\n<ul>\n<li>check the length of the array that <code>str_split</code> returns</li>\n<li>check the length of the last item in the array</li>\n<li>combine it with the next to last item, if it is of length 1, and drop the last item</li>\n<li>then <code>implode</code></li>\n</ul>\n<p>but that seems extremely complicated for something that a human would approach like this:</p>\n<ul>\n<li>if the string is longer than three characters, split the first two characters off</li>\n<li>if the remainder of the string is longer than three characters, split the next two characters off</li>\n<li>repeat until the string is three characters long or shorter</li>\n</ul>\n<p>That's a recursive function and in PHP might perhaps look something like:</p>\n<pre><code>$chunks = array();\nwhile(strlen($string) &gt; 3) {\n $chunks[] = substr($string, 0, 2);\n $string = substr($string, 2);\n}\n$chunks[] = $string;\nimplode(&quot; &quot;, $chunks);\n</code></pre>\n<p>But that still seems overly complicated compared to a human who would just <code>evaluate, cut, evaluate, cut, evaluate, not cut</code>.</p>\n<p>Is there a more straightforward, less roundabout way?</p>\n"^^ . + . + "2"^^ . + "OK, I will re-install everything from scratch. You may wish to delete the post as I agree that it is not a programming issue."^^ . + "This comes with framework by default:\n\n```\n<IfModule mod_rewrite.c>\n RewriteEngine On\n\n # Removing trailing slash\n RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]\n\n # Handle Front Controller...\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteRule ^(.*)$ /index.php/$1 [L]\n\n</IfModule>\n```"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + "On the endpoint wp/v2/vehica_car, I can see the car names, but the metadata is missing. How can I make it appear in the REST API? I'm using the Vehica theme on WordPress, and I have enabled debug.log but still can't figure out what's wrong."^^ . + . + "4"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + "<p>I have a scheduler that sends a recurring message every five minutes to update some cached external data. I added a feature that allows a user to change this interval in the front-end. However, I am unable to change the schedule such that the recurring messages occurs according to the new interval.</p>\n<p>I tried to get the existing schedule in order to clear the schedule and add a new recurring message with the new interval. Unfortunately, I am always creating a new schedule instead of getting the existing one. This would be fine if the message handler used the newly created schedule, but it continues to use the old scheduled messages instead. The schedule provider and the class that handles updating the schedule are given below. I also tried to make the schedule variable static, but this did not change my results. Even when using the <code>PreRunEvent</code> from the schedule's <code>before</code> function I am unable to get the existing schedule.</p>\n<pre><code>#[AsSchedule('update_cache')]\nfinal class UpdateCacheTaskProvider implements ScheduleProviderInterface\n{\n public function getSchedule(): Schedule\n {\n return $this-&gt;schedule ??= (new Schedule())-&gt;with(\n RecurringMessage::every($this-&gt;getRefreshRateInterval(), new UpdateCacheMessage())\n );\n }\n}\n\nclass RefreshRateSubscriber implements EventSubscriberInterface\n{\n public function __construct(private UpdateCacheTaskProvider $updateCacheTaskProvider) {}\n\n public function onRefreshRateChanged(RefreshRateChangedEvent $event): void\n {\n $this-&gt;updateCacheTaskProvider\n -&gt;getSchedule()\n -&gt;clear()\n -&gt;add(RecurringMessage::every($event-&gt;getRefreshRateInterval(), new UpdateCacheMessage()));\n }\n\n public static function getSubscribedEvents(): array\n {\n return [\n RefreshRateChangedEvent::NAME =&gt; 'onRefreshRateChanged'\n ];\n }\n}\n</code></pre>\n"^^ . + . + . + . + "You need to set up a local web server with properly integrated PHP first of all."^^ . + . + . + . + . + . + . + "0"^^ . + "<blockquote>\n<p>I was manually just changing the array numbers when they did this,\nbut they change it a lot so I am wondering if I can add some code to\nwhere the Symbol column would always be 0 and Price would always be\nin column 3 and the same applies to all of the column names.</p>\n</blockquote>\n<p>It's not of much magic actually, perhaps the perception of your\nown history of trials (and errors) block your mind a bit.</p>\n<p>Let's see if we can shake this up.</p>\n<p>First the good news: Especially with your array, this is straight\nforward as the CSV file is already parsed.</p>\n<p>And this all boils down to a single function, <em>array_keys()</em>.</p>\n<p>Good!</p>\n<p>But first things first. Let's be clear we're talking about an array here:</p>\n<pre><code>if (!is_array($array))\n{\n throw new Error('Array required, got ' . gettype($array));\n}\n</code></pre>\n<p>Okay, perhaps no news so far. But better safe than sorry!</p>\n<p>Now, let's be clear about another thing, and that is,\nthat this <code>$array</code> is a <em>list</em>:</p>\n<pre><code>if (!array_is_list($array))\n{\n throw new Error('Array is not a list');\n}\n</code></pre>\n<p>A <em>list</em> means, that each <em>key</em> in the the array is a consecutive\ninteger number starting at zero. That is, each key has the value\nof the previous key plus one (+1 or ++).</p>\n<p>And if there was no previous key, that <em>virtually</em> previous number\nwould be minus one (-1).</p>\n<p>An array with no members is an example of such a <em>list</em>, as would\nbe the return value of <em>array(&quot;one&quot;)</em> or <em>array(&quot;one&quot;, &quot;two&quot;)</em> etc.</p>\n<p>For mathematicians it feels quite <em>natural</em>, they only have to\nspecify whether or not the number zero is part of <em>natural\nnumbers</em>. In PHP, the <em>array</em> first index (key) is always zero (0).</p>\n<p>So, as speaking about <em>array_keys()</em> here, for a non-empty array,\nwe can always say:</p>\n<pre><code>assert(is_array($array) &amp;&amp; !empty($array));\n\nrange(0, -1 + count($array)) === array_keys($array);\n //^^^^^^^^(......)\n</code></pre>\n<p>Or to even better understand <em>array_keys()</em>, as it returns the\n<em>list</em> of keys:</p>\n<pre><code>array_keys($array) === array_keys(array_keys($array));\n//^^^^^^^^(......) ^^^^^^^^^^(^^^^^^^^^^(......))\n</code></pre>\n<p>Good to know!</p>\n<p>But enough with the <em>array_keys()</em> recursion for now and let's take\na look at the bigger picture of this beloved array.</p>\n<p>The given <code>$array</code> is all CSV parsed, with the following common\nlayout of such a CSV file:</p>\n<pre><code>TITLE\n[... TEXT]\n\nSYMBOLS\n[... DATA]\n</code></pre>\n<p>This layout is line based, and the <code>$array</code> is a <em>list</em> (see above) of\nsuch lines.</p>\n<p>Let's first obtain the title, as it is first in list, we can assign it with list deconstruction. It actually looks like assigning to an array:</p>\n<pre><code>[$title] = $array;\n</code></pre>\n<p>Now, the next thing is finding the <strong>SYMBOLS</strong>. We are looking for the\nfirst empty line.</p>\n<pre><code>[$indexOfFirstEmpty] = array_keys($array, null);\n</code></pre>\n<p>Good to know: <em>array_keys()</em> in action for the keys of <em>value</em>.</p>\n<p>And then I've to admit that I cheated on you: It's not <em>all</em> about <em>array_keys()</em>, there is also <em>array_slice()</em> and <em>array_shift()</em>:</p>\n<pre><code>$data = array_slice($array, 1 + $indexOfFirstEmpty);\n$symbols = array_shift($data);\n</code></pre>\n<p>Okay, that's probably a bit fast now, all those functions remain documented in the PHP manual at <a href="https://php.net/manual" rel="nofollow noreferrer">https://php.net/manual</a>, therefore, take your time for reading if you need to. You can always continue later here.</p>\n<p>Let's peek what we got so far:</p>\n<pre><code>print_r($symbols);\n\nArray\n(\n [0] =&gt; Symbol\n [1] =&gt; Description\n [2] =&gt; Qty (Quantity)\n [3] =&gt; Price\n [4] =&gt; Price Chng % (Price Change %)\n [5] =&gt; Price Chng (Price Change )\n[ ... 11 more lines ]\n\nprint_r($data);\n\nArray\n(\n [0] =&gt; Array\n (\n [0] =&gt; Test1\n [1] =&gt; test desc\n [2] =&gt; 820\n [3] =&gt; 19.505\n[ ... 51 more lines ]\n</code></pre>\n<p>The output shows us already how the symbol keys match with the data keys.</p>\n<p>If those of each date can be combined with their symbol, you get the\nmapping and can access by name next to the numeric index.</p>\n<p>As each symbol (string) will represent an array key, the symbols need\nto be checked if they are fitting, e.g. a duplicate symbol would ruin\nthe game. Table flip:</p>\n<pre><code>$keys = array_flip($symbols);\nassert($symbols === array_keys($keys));\n</code></pre>\n<p>If this asserts, we can now go on and use the keys by symbol (string)\nto obtain the index (integer). In case there is no such index, we can\nuse the null coalescing operator and NULL as fallback.</p>\n<pre><code>foreach ($data as $index =&gt; $date)\n{\n printf(\n &quot;#%d: %s %s\\n&quot;,\n $index,\n var_export($date[$keys['Symbol']] ?? null, true),\n var_export($date[$keys['Last Div (Last Dividend)']] ?? null, true),\n );\n}\n\n#0: 'Test1' '0.72025'\n#1: 'Test2' NULL\n#2: 'Test3' '2.0216'\n</code></pre>\n<p>So far for the arrays. All in all it works this way.</p>\n<p>Naturally it's possible to wrap this up more but then it becomes more\nabstract.</p>\n<p>For example, I personally prefer the <em>ArrayAccess</em> interface for symbolic\nkeys (key aliasing) and <em>SplFileObject</em> for comma separated values (CSV).</p>\n<p>From what I remember one example I've put on Stackoverflow\nwas <a href="https://stackoverflow.com/a/10181302/367456">Process CSV Into Array With Column Headings For Key</a>.</p>\n"^^ . + . + . + . + . + "_"Is the RewriteRule overwriting the FilesMatch directive?"_ - shouldn't be, because the preceding RewriteCond makes it apply only if the requested URL does not match any existing file. Not sure why you wrapped the `FilesMatch` into `<IfModule mod_headers.c>` though - that directive is not provided by mod_headers, but part of Apache core. So try and remove that If-Wrapper, and see what happens then."^^ . + . + . + "0"^^ . + "`The file could not be found under the paths specified by Options::chroot.` - what is `Options::chroot` set to?"^^ . + . + . + . + . + . + "-1"^^ . + . + "<p>I have got a problem with Laravel.</p>\n<p>I have created a custom Form Request - let's call it CustomFormRequest. It is authorized and have got rules as it should be.</p>\n<p>In one of the classes I use this request this way:</p>\n<pre><code>class CustomClass {\n\n public function __construct(CustomFormRequest $customFormRequest) {\n\n // Code only run from there after a successful validation.\n // If there was an error in validation then HTTP 422 error was send by Laravel\n\n }\n\n}\n</code></pre>\n<p>From a Controller, usually I use this CustomClass in this way:</p>\n<pre><code>public function Custom(CustomClass $customClass) {\n\n // Code only run from there after a successful validation.\n\n}\n</code></pre>\n<p>But, sometimes, I also try to access this class in this way from either a controller or from other class:</p>\n<pre><code>$customRequest = new CustomRequest();\n$customRequest-&gt;sendMethod('POST');\n$customRequest-&gt;request-&gt;add(...array of data...);\nnew CustomClass($customRequest);\n</code></pre>\n<p>But it turned out when I use the class this way Laravel somehow skips the validation and even when I gave an invalid data for the class, it will run and tries to put those invalid data into the database!</p>\n<p>Is there anything that I missing!? Is another line needed to enforcing the validation!?</p>\n<p>Thanks for any further help!</p>\n<p>I also tried using $request-&gt;validate($request-&gt;rules()) but it leads to ERR_TOO_MANY_REDIRECTS.</p>\n<p><strong>----------------------------------\nEdit\n----------------------------------</strong></p>\n<p>Thanks @matthew-bradley! #2 worked for me with changes:</p>\n<p>From this:</p>\n<pre><code>$data = [...];\n$validator = Validator::make($data, (new CustomRequest())-&gt;rules());\n</code></pre>\n<p>To this:</p>\n<pre><code>$data = [...]; \n$request = new CustomRequest();\n$request-&gt;setMethod('POST');\n$request-&gt;request-&gt;add($data);\n$validator = Validator::make($data, $request-&gt;rules());\n</code></pre>\n<p>Reason for changes:</p>\n<p>When using new CustomRequest())-&gt;rules() then $this-&gt;request-&gt;get(...) does not receive $data at all inside the rules() of CustomRequest()!</p>\n<p>And I need those $data for my CustomRule() for further validation.</p>\n<p>So first we should create a new CustomRequest with adding our data to it.</p>\n<p>Then as the second parameter of Validator::make() we should use $request-&gt;rules() instead of new CustomRequest())-&gt;rules() so $this-&gt;request-&gt;get(...) finally can receive the $data.</p>\n<p><strong>----------------------------------\nEdit 2.\n----------------------------------</strong></p>\n<p>And after doing $validator:</p>\n<pre><code>if($validator-&gt;fails()) { \n response()-&gt;json(['errors' =&gt; $validator-&gt;messages()-&gt;getMessages()], 422)-&gt;send();\n die;\n} else {\n new CustomClass($request);\n};\n</code></pre>\n"^^ . + "1"^^ . + . + . + . + "Thank you for your tips. Although I did as you say, it unfortunately didn't solve the problem.\n@Chris Haas: pagination seems to work only with standard variable 'paged'"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + "<p>In cpanel i changed php version from MultiPHP Manager of my domain.com to 8.1\nbut when i connect terminal and try to upgrade magento version giving me error of old php version</p>\n<pre><code>Problem 1\n - Root composer.json requires magento/product-community-edition 2.4.7-p4 -&gt; satisfiable by magento/product-community-edition[2.4.7-p4].\n - magento/product-community-edition 2.4.7-p4 requires php ~8.1.0||~8.2.0||~8.3.0 -&gt; your php version (7.4.33) does not satisfy that requirement.\n</code></pre>\n<p>when i cd to domain and run php -v it says 8.1\nbut when i go back to root directory and php -v it says 7.4</p>\n<p>i tried\n/usr/local/bin/ea-php81 /opt/cpanel/composer/bin/composer update\nand still takin old php version</p>\n<p><a href="https://i.sstatic.net/xQDa1viI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/xQDa1viI.png" alt="enter image description here" /></a></p>\n"^^ . + "Skip a statement in Doctrine migration if there if there is a certain value in a table"^^ . + "This code return 123\n\npublic function showLoginForm():\n {\n session(['test' => 123]);\n dd(session('test'));\n return view('admin.auth.login');\n }\n\nAfter that I replace line\npublic function showLoginForm(): Factory|Application|View\n {\n dd(session('test'));\n session(['test' => 123]);\n return view('admin.auth.login');\n }\n\nthis code returns NULL"^^ . + . + "amazon-web-services"^^ . + . + . + "0"^^ . + . + "@Barmar No, if i am fetching through cURL, it will see my web server public IP not my ISP IP Address. but the question is not about which IP, they see. it about what referrer they see."^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + "highperformance"^^ . + . + . + "<p>You haven't given your radio buttons any values. So, as per the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio" rel="nofollow noreferrer">radio button documentation</a>:</p>\n<blockquote>\n<p>If you omit the <code>value</code> attribute in the HTML, the submitted form data assigns the value <code>on</code> to the group.</p>\n</blockquote>\n<p>You seem to be under the impression that the <code>id</code> attribute assigns the value of the radio button, but it doesn't - that just sets a unique identifier for that particular HTML element within the document / page, <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/id" rel="nofollow noreferrer">just like any other HTML element</a>. It has nothing to do with a form field's value.</p>\n<p>To correct this, change the <code>id</code> to <code>value</code> on all your buttons, e.g.</p>\n<pre><code> &lt;input type=&quot;radio&quot; name=&quot;reviewType&quot; value=&quot;movie&quot;&gt;\n</code></pre>\n"^^ . + . + . + . + "php Form Client IP Grap is returning NULL"^^ . + . + "0"^^ . + "1"^^ . + . + "0"^^ . + . + "0"^^ . + "<p>I'm new to php and one problem I am facing is every time I have to type the '$' symbol before my variables is there a way I can just type the variable name and get its suggestion\n(I am using vs code)</p>\n<p>I have tried many solutions like php inteliphense but it still does not work</p>\n<p>clarifying my problem i have declared variables using the '$' symbol but next when i have to do some task on that variable i have to type $ symbol every time\nis there a way i can get the variable suggestion without using the $ symbol?</p>\n"^^ . + "-4"^^ . + "<p>Thank you both for answering, turns out, a simple restart solved the issue. If anyone else runs into this, try restarting your system first before diving into complex fixes lol.</p>\n"^^ . + . + . + . + . + . + "-1"^^ . + . + "Well, PHP scrips, running under the same domain, share their session cookies, and therefore their session values in `$_SESSION`. That is, if F3 uses that. The solution would be to use different (sub)domains for different apps, or to write code in such a way that apps can share their sessions."^^ . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "<p>PHPstan seems to incorrectly narrow type after <code>if (empty(...))</code>.</p>\n<pre><code>\\PHPStan\\dumpType($_GET); // array&lt;mixed&gt;\n \nif (empty($_GET['ssid'])) { /* do nothing */ }\n\n\\PHPStan\\dumpType($_GET); // non-empty-array&amp;hasOffsetValue('ssid', mixed~(0|0.0|''|'0'|array{}|false|null))\n</code></pre>\n<p>In my opinion the type should remain <code>array&lt;mixed&gt;</code> even after the <code>if</code> test (which may result false). Does this narrowing make sense somehow or is it a bug?</p>\n<p>(PHPstan 2.1.10, level 10)</p>\n"^^ . + "phpmailer"^^ . + . + . + . + . + "1"^^ . + . + . + "I made a factory reset (I was afraid of the 755 permissions, I don't fully understand them and I usually prefer to make a clean install when I break something) and rn I don't have anymore all the errors I had untill this time, I am wondering rn if I should insist more in a way to do things or am I doing something wrong and I should do all this in another way, idk.."^^ . + . + . + "<p>For your original question, the part where you ask:</p>\n<blockquote>\n<p>However, I was wondering if there is an option in Composer that would allow me to divide one package into smaller segments that can be excluded during installation, and I do not mean creating separate projects. ...</p>\n</blockquote>\n<p>Composer offers the <a href="https://getcomposer.org/doc/04-schema.md#type" rel="nofollow noreferrer"><em>type</em> (for installing packages of that)</a> for it.</p>\n<hr />\n<p>For what you have in <em>EDIT 2</em> suggests that you could just use a <em>path repository</em>. There is very little overhead in the projects ./vendor folder for ./vendor/autoload.php and the files from ./vendor/composer only. The rest should be symlinked. So unless you do not put digital waste of composer.lock and additional vendor folders into the packages you require of yours (all these files are superfluous, only a ./composer.json is required) you would keep the number of files at the bare minimum across a system.</p>\n<p>But you wrote initially, that you do not want to create additional packages anyway, therefore I do not really understand why in <em>EDIT 2</em> you provide an example that does.</p>\n<hr />\n<p>Given you actually want to have a single library project, there is always the option to use a build manager with a <em>dist</em> target that produces multiple packages out of a single package. You can then add an <em>install</em> target to install them on a system, e.g. in a path or artifact repository (that perhaps already during <em>dist</em>), and publish them on git-lab/hub/XXX and bind them in packagist.org. Only one remote repository is needed per package.</p>\n<hr />\n<p>Finally Composer has <em>virtual packages</em> ¹ that could circulate around your interfaces. E.g. Given you create the sub-packages distribution with your build manager, then each of those packages could group around your _ interface ValueObject_ and <em>provide</em> theirs for that virtual package only.</p>\n<p>It should do without writing, but naturally you can do all this without a build manager and a single repository only.</p>\n<p>¹ <a href="https://stackoverflow.com/questions/58453855/creating-a-new-composer-virtual-package-type">Creating a new Composer Virtual Package Type</a></p>\n"^^ . + . + . + . + "Thanks for the answer, but I myself tried GPT before updating it here."^^ . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + . + "<p>I have a table named <strong>gym_sessions</strong> it has <strong>user_id | status</strong> columns.<br />\nstatus column can contains: 1 ==&gt; active; 2 ==&gt; completed; 3 ==&gt; declined;<br />\n<strong>Conditions:</strong></p>\n<ul>\n<li>User must have sufficient balance to start new session.</li>\n<li>User can't have two active sessions at the same time.</li>\n<li>User can have many sessions of status: 2 | 3;</li>\n</ul>\n<p>This is my method for creating new session for a user:</p>\n<pre><code>// Start new gym session.\n public function startGymSession(Request $request){\n $validator = Validator::make($request-&gt;all(),[\n 'gym_id' =&gt; ['required', 'exists:gyms,id'],\n 'payment_method_id' =&gt; ['required', 'exists:payment_methods,id'],\n 'gym_pricing_id' =&gt; ['required',\n Rule::exists('gym_pricings', 'id')-&gt;where(function ($query) use ($request) {\n $query-&gt;where('gym_id', $request-&gt;input('gym_id'));\n }),\n ],\n ]);\n if($validator-&gt;fails()){\n return $this-&gt;sendError('Validation error!');\n }\n\n $user = Auth::user();\n\n // Check if the user have enough balance to start a gym session.\n $userbalance = $user-&gt;wallet_balance;\n $gymPricing = GymPricing::find($request-&gt;gym_pricing_id)-&gt;first();\n if($userbalance &lt; $gymPricing-&gt;price){\n return $this-&gt;sendError('Insufficient balance.');\n }\n\n\n // Check if the user have active gym sessions.\n // If the user have active gym sessions, he can't start a new one.\n // Prevent race condition.\n\n /** @var \\App\\Models\\User $user */\n if($user-&gt;gymSessions()-&gt;where('status', 1)-&gt;count() &gt; 0){\n return $this-&gt;sendError('You have an active gym session.');\n }\n\n $now = Carbon::now();\n\n // Start the gym session.\n $gymSession = GymSession::create([\n 'user_id' =&gt; $user-&gt;id,\n 'gym_id' =&gt; $request-&gt;gym_id,\n 'payment_method_id' =&gt; $request-&gt;payment_method_id,\n 'gym_pricing_id' =&gt; $request-&gt;gym_pricing_id,\n 'entry_time' =&gt; $now,\n\n ]);\n if($gymSession){\n return $this-&gt;sendResponse([], 'Gym session started.');\n }\n\n\n return $this-&gt;sendError('Failed to start gym session.');\n }\n</code></pre>\n<p><strong>Attack Scenario:</strong>(Race Condition)<br />\nIf the user sent multiple requests in parallel, the system will create many sessions with status 1.</p>\n<p>I want to know how to prevent this problem on application level (using Laravel methods) not on database level?</p>\n<p><strong>Envi</strong><br />\nLaravel 11<br />\nMySql<br />\nphp 8.2.8</p>\n"^^ . + "`It sounds like you're saying that it is my code` - YES. That's exactly what I am saying. And even providing a **LIVE EXAMPLE** that proves my words and which you are welcome to visit. `But I'm not doing any such thing that I'm aware of.` - THAT is the point. So you are to find out and become aware. Only it just occurred to me that it could be your browser doing such a conversion, if your site tells it that it don't understand utf-8. Either way, it is not a database does this conversion. Simply echo strlen of this $_POST value before saving it."^^ . + . + . + . + "Please [edit] your question to include the attempts in converting your code and the errors/problems you get with these attempts."^^ . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + "Thank you that fixed it, I appreciate the help"^^ . + . + "@Ben If 0.133 seconds is fast enough, by all means do the simple thing. Otherwise a binary tree solution will scale like `O(n log(n))`, but is somewhat complex. However I won't try to implement it in PHP because I don't know PHP."^^ . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + "@shingo As stated the code works perfect if run on top of windows OS instead of Ubuntu. It has a password. The code also works with any other server I have ever tried."^^ . + "woocommerce"^^ . + . + . + . + . + "<p>I installed <a href="https://log-viewer.opcodes.io/" rel="nofollow noreferrer">Log Viewer</a> in my laravel 11 protect, and works like a charm. But i want to limit who has access to the Log Viewer in production.</p>\n<p>So,i create a middleware</p>\n<pre><code>&lt;?php\n\nnamespace App\\Http\\Middleware;\n\nuse Closure;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Auth;\n\nclass ViewLogs\n{\n public function handle(Request $request, Closure $next)\n {\n if (Auth::check() &amp;&amp; Auth::user()-&gt;hasRole('admin')) {\n return $next($request);\n }\n\n abort(401, 'Unauthorised');\n }\n}\n</code></pre>\n<p>Add the following to $middlewareAliases array In app\\Http\\Kernel.php</p>\n<pre><code> 'view-logs' =&gt; \\App\\Http\\Middleware\\ViewLogs::class,\n</code></pre>\n<p>And add middleware to the the log viewer config</p>\n<pre><code> /*\n |--------------------------------------------------------------------------\n | Log Viewer route middleware.\n |--------------------------------------------------------------------------\n | Optional middleware to use when loading the initial Log Viewer page.\n |\n */\n\n 'middleware' =&gt; [\n 'web',\n 'view-logs',\n \\Opcodes\\LogViewer\\Http\\Middleware\\AuthorizeLogViewer::class,\n ],\n</code></pre>\n<p>If i try to debug <strong>Auth::check()</strong>, it's always return <strong>false</strong>.</p>\n<p>For information, i use Laravel Passport in my project.</p>\n<p>Thanks in advance for your help !</p>\n"^^ . + . + . + "0"^^ . + "0"^^ . + "I tried this but I get - Error: Call to undefined method Illuminate\\Foundation\\Configuration\\Exceptions::handler() in file /var/www/html/appName/bootstrap/app.php on line 71"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + "Now I have error SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?,?,?)' at line 1 when I try return in response 'res' => db()->query('EXPLAIN ' . 'INSERT INTO item_schemas (table_name,created_at,updated_at) VALUES (?,?,?)')->execute()"^^ . + . + . + . + . + . + "contacts"^^ . + "1"^^ . + . + "2"^^ . + . + "1"^^ . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + "5"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + "How to load a vuejs build into another vuejs?"^^ . + "1"^^ . + . + "2"^^ . + . + . + . + "<p>I am trying to install Apache2.4 to run php (and Mysql) in dreamweaver and I have followed the instructions but when I run httpd.exe it gives me :<br />\n<strong>%1 is not a valid Win32 application</strong></p>\n<ul>\n<li>I installed VC_redist.x64.exe (MVC++ 2015-2022 Red. (x64))</li>\n<li>I instaleld Apache2.4 via httpd-2.4.63-250207-win64-VS17</li>\n<li>I installed php8.4 via php-8.4.4-Win32-vs17-x64.zip</li>\n</ul>\n<p>Added these in the httpd.conf\nLoadModule php8_module &quot;C:/php/php8apache2_4.dll&quot;\nAddType application/x-httpd-php .php\nPHPIniDir &quot;C:/PHP&quot;\nLoadFile &quot;C:/PHP/php8ts.dll&quot;</p>\n<p>php runs wells (phpinfo() working) but httpd gives the error above.</p>\n<p>I am stuck and hopeless. No error logs visible</p>\n<p>I want to have Apache 2.4 server running and was not expecting that error.</p>\n"^^ . + . + "<p>Looks like <strong>EPEL</strong> is not installed or enabled\nas it provides missing dependencies</p>\n<p>As explained in the <a href="https://blog.remirepo.net/pages/English-FAQ#deps" rel="nofollow noreferrer">FAQ</a></p>\n<p>For memory for a proper repository configuration and usage\nfollow the <a href="https://rpms.remirepo.net/wizard/" rel="nofollow noreferrer">Wizard instructions</a></p>\n"^^ . + . + . + . + . + . + "iis"^^ . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + . + "Do you have multiple versions of PHP installed? If so, you need to tell PECL which one to compile the extension for."^^ . + . + . + . + . + . + "0"^^ . + "I edited my code and I have in array property 'errors' value 'No errors'"^^ . + . + "rust"^^ . + . + . + "1"^^ . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + "trim"^^ . + "1"^^ . + . + . + . + . + . + "PWA emoticons are shown in chrome but not safari"^^ . + "@Barmar, does that mean that I need to use the same class? a sub class is not accepted? If so, what can you suggest in regards to my concern?"^^ . + . + . + "1"^^ . + . + . + . + "<p>You shouldn't mock <code>Facades</code> like that.\nLaravel provides its own mocking support and I would advise you to use them.</p>\n<p><code>Facades</code> in Laravel should be mocked directly from their methods.\nInside <code>Illuminate\\Support\\Facades\\Facade</code> are protected methods that creates mocked instance called <code>createFreshMockInstance</code> and <code>createMock</code> which simple calls <code>Mockery::mock</code> but their I wrapper insinde other methods to avoid mocking same instance more than once, so to get that objects you should use\n<code>Illuminate\\Support\\Facades\\DB::shouldReceive();</code></p>\n"^^ . + "P.S. MS Graph API only has v1.0 and beta versions. By v2 do you really mean the version of the Graph SDK for PHP?"^^ . + "0"^^ . + . + "<p>Let say, my website is <code>https://www.example.com</code> and i am using cURL to pull <code>https://stackoverflow.com</code></p>\n<p>I am using cURL HTTP Header to spoof referer value like this</p>\n<pre><code>curl_setopt($ch, CURLOPT_HTTPHEADER, ['Referer: https://www.google.com/']\n</code></pre>\n<p>(or)</p>\n<pre><code>curl_setopt($ch, CURLOPT_REFERER, &quot;http://www.google.com&quot;);\n</code></pre>\n<p><strong>So, now for <code>stackoverflow.com</code> it look like traffic coming from <code>Google.com</code> instead of my website <code>example.com</code> ?</strong></p>\n"^^ . + . + "Parsing XML snippets contained in a log file"^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + "0"^^ . + . + . + "<p>Something like this should work:</p>\n<pre class="lang-php prettyprint-override"><code>foreach ($menu as $menuID =&gt; $menuItem) {\n foreach ($menuItem['children'] as $childID =&gt; $childItem) {\n if (isset($children[$childID])) {\n $menu[$menuID]['children'][$childID]['children'] = $children[$childID];\n }\n }\n}\n</code></pre>\n"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "apache2.4"^^ . + . + . + "0"^^ . + . + . + . + . + . + "<p>I am new to working with an API. I am using guzzle and Laravel. How to I output specific data such as just the actor's name and image?</p>\n<pre><code>\n $client = new \\GuzzleHttp\\Client();\n\n //$client = new GuzzleHttpClient();\n\n $response = $client->request('GET', 'https://imdb232.p.rapidapi.com/api/actors/get-bio?nm=nm0000573', [\n 'headers' => [\n 'x-rapidapi-host' => 'imdb232.p.rapidapi.com',\n 'x-rapidapi-key' => 'xxxxxx',\n ],\n]);\n\n echo $response->getBody();\n\n {"data":{"name":{"__typename":"Name","id":"nm0000573","nameText":{"text":"Dolly Parton"}\n</code></pre>\n<p>Here is the data for the image.\n<code><pre>&quot;primaryImage&quot;:{&quot;__typename&quot;:&quot;Image&quot;,&quot;id&quot;:&quot;rm2099682048&quot;,&quot;url&quot;:&quot;https://m.media-amazon.com/images/M/MV5BMTQxNjI5MjI2NV5BMl5BanBnXkFtZTYwMzExMzI1.<em>V1</em>.jpg&quot;,</pre></code></p>\n"^^ . + "1"^^ . + . + "<p>I made a SPA with laravel + vuejs3 (inertia).</p>\n<p>My SPA works without worries, but I made a module that is on several sites (WP) which is a js file that loads on a tag with the <code>id=&quot;form&quot;</code>.</p>\n<p>It works well on the several sites but here since I use a SPA I have the impression that it does not work.</p>\n<p>As soon as I navigate elsewhere with a <code>&lt;Link&gt;</code> from inertia (so in SPA without refreshing the browser) and I come back to the form it does not work. So it only works the first time, do you have any idea what to do? Because currently I am going through a complete PHP page but I do not like it if I would like to find a solution!</p>\n<p>so in my controller I simply have:</p>\n<p><code>return Inertia::render('Form');</code></p>\n<p>and at this point in my view I simply do:</p>\n<p><code>&lt;div id=&quot;form&quot;&gt;&lt;/div&gt;</code></p>\n<p>and in my app.blade.php</p>\n<p><code>&lt;script type=&quot;module&quot; crossorigin src=&quot;{{ asset('/js/index-8AJeVKiN.js') }}&quot;&gt;&lt;/script&gt;</code></p>\n<p>when I do that the module does not load, so I did this in the .vue file:</p>\n<pre><code> mounted(){\n this.loadScript('/js/index-8AJeVKiN.js', () =&gt; {\n });\n },\n watch:{\n },\n methods:{\n loadScript(src, callback) {\n if (!document.querySelector(`script[src=&quot;${src}&quot;]`)) {\n const script = document.createElement('script');\n script.src = src;\n script.type = 'module'; // Ajoute type=&quot;module&quot; si nécessaire\n script.onload = callback; // Appeler la fonction callback une fois chargé\n document.head.appendChild(script);\n } else {\n callback(); // Appeler la fonction directement si déjà chargé\n }\n },\n },\n\n</code></pre>\n"^^ . + . + . + . + . + . + "`I think if it can be loaded by composer it can be loaded also manually`...correct. But if there are a lot of dependencies on other packages, and/or subfolders etc it can get complicated."^^ . + . + . + . + "<p>I have installed and activated the ActiveITzone Active eCommerce CMS found here: <a href="https://codecanyon.net/item/active-ecommerce-cms/23471405?s_rank=26" rel="nofollow noreferrer">https://codecanyon.net/item/active-ecommerce-cms/23471405?s_rank=26</a></p>\n<p>Go to there <a href="https://preview.codecanyon.net/item/active-ecommerce-cms/full_screen_preview/23471405" rel="nofollow noreferrer">website</a> and try &quot;Browse frontend&quot; then in console, try <code>console.log('fff')</code></p>\n<p>The result is <code>undefined</code></p>\n<p>Problem is, there is extra code in the vendors.js that comes with it, that completely blocks the browser <code>console.log</code></p>\n<p>The part I commented out sits within the <a href="https://github.com/nextapps-de/spotlight" rel="nofollow noreferrer">spotlight</a> plugin, the original plugin does not have this code, so I am wondering, how did that obfuscated code end up in the vendors? and how can the console.log be reactivated?</p>\n"^^ . + "This is a test, however, 98% of the time it will be xml with 2% plain, I was thought that pain text would not cause any issues, was I wrong?"^^ . + . + "<p>When a checkbox is unchecked, it doesn't send any data in the form request. So, Laravel won't see the checkbox as part of the request unless you explicitly make sure it is sent.To resolve this, you can add a hidden input field before the checkbox to ensure the checkbox always gets a value sent.</p>\n<pre><code>&lt;input type=&quot;hidden&quot; name=&quot;checkbox&quot; value=&quot;0&quot;&gt;\n&lt;input type=&quot;checkbox&quot; name=&quot;checkbox&quot; id=&quot;basic_checkbox_1&quot; class=&quot;me-2&quot; value=&quot;1&quot;&gt;\n</code></pre>\n<p>Also try to debug the value yo are receiving after the request is made.</p>\n<pre><code>dd($request-&gt;all());\n</code></pre>\n"^^ . + "2"^^ . + . + . + . + . + . + "Webdav: Listing files and folder"^^ . + . + "0"^^ . + . + . + . + . + "css"^^ . + . + "2"^^ . + . + . + "1"^^ . + . + . + . + "3"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + "1"^^ . + . + "server"^^ . + "0"^^ . + . + . + . + "SQL query with UNION works directly in database, but not in PHP"^^ . + . + . + . + "Encoding/decoding Richtext from database for Excel export"^^ . + "0"^^ . + . + "For the _Other_ scanner mode put this task before the Maven/Gradle task, then tick the 'Run SonarQube Analysis' checkbox in the Maven/Gradle task configuration. But your question sounds a bit like an x/y problem. If you don't have a build step, add it if you need it. What prevents you from doing so, if I may ask?"^^ . + . + . + "0"^^ . + . + . + . + "Paginate a table which has multiple-spanning rows and columns"^^ . + . + "3"^^ . + "For this solution I get an error saying `foreach() argument must be of type array|object, string given`. If I wrap the $mainImage in an array `$component->state([$mainImage])` that error disappears, but I get the field loading forever and it wont show the actual image nor let me interact with it."^^ . + . + "<p>You are not using the correct hooks to add a custom select field to WooCommerce Attributes terms.</p>\n<p>Try the following instead:</p>\n<pre class="lang-php prettyprint-override"><code>// Loop through existing WooCommerce Attribute Taxonomies\nforeach ( wc_get_attribute_taxonomies() as $attr_taxonomies ) {\n $attribute_name = $attr_taxonomies-&gt;attribute_name; // Get attribute name\n\n // Add the attribute name to the composite related hooks for each attribute taxonomy\n add_action( &quot;pa_{$attribute_name}_add_form_fields&quot;, 'add_wc_attribute_term_custom_field', 20, 1 );\n add_action( &quot;pa_{$attribute_name}_edit_form_fields&quot;, 'edit_wc_attribute_term_custom_field', 20, 2 );\n add_action( &quot;created_pa_{$attribute_name}&quot;, 'save_wc_attribute_term_custom_field' );\n add_action( &quot;edited_pa_{$attribute_name}&quot;, 'save_wc_attribute_term_custom_field' );\n}\n\n// Display the select field when adding a new term to WooCommerce taxonomies\nfunction add_wc_attribute_term_custom_field( $taxonomy ) {\n $value = 'no';\n ?&gt;\n &lt;div class=&quot;form-field&quot;&gt;\n &lt;label for=&quot;pr_addon_field&quot;&gt;&lt;?php esc_html_e( 'Product Add-on', 'woocommerce' ); ?&gt;&lt;/label&gt;\n &lt;select name=&quot;pr_addon&quot; id=&quot;pr_addon_field&quot;&gt;\n &lt;option value=&quot;no&quot;&gt;&lt;?php esc_html_e( 'No', 'woocommerce' ); ?&gt;&lt;/option&gt;\n &lt;option value=&quot;yes&quot;&gt;&lt;?php esc_html_e( 'Yes', 'woocommerce' ); ?&gt;&lt;/option&gt;\n &lt;/select&gt;\n &lt;p&gt;&lt;?php esc_html_e( 'Field description may go here.', 'woocommerce' ); ?&gt;&lt;/p&gt;\n &lt;/div&gt;\n &lt;?php\n}\n\n// Display the select field when editing the term of a WooCommerce taxonomy\nfunction edit_wc_attribute_term_custom_field( $term, $taxonomy ) {\n $value = get_term_meta($term-&gt;term_id, 'pr_addon', true);\n $value = $value ?: 'no';\n ?&gt;\n &lt;tr class=&quot;form-field term-pr_addon-wrap&quot;&gt;\n &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;pr_addon_field&quot;&gt;&lt;?php esc_html_e( 'Product Add-on', 'woocommerce' ); ?&gt;&lt;/label&gt;&lt;/th&gt;\n &lt;td&gt;\n &lt;select name=&quot;pr_addon&quot; id=&quot;pr_addon_field&quot;&gt;\n &lt;option value=&quot;no&quot; &lt;?php selected( $value, 'no' ); ?&gt;&gt;&lt;?php esc_html_e( 'No', 'woocommerce' ); ?&gt;&lt;/option&gt;\n &lt;option value=&quot;yes&quot; &lt;?php selected( $value, 'yes' ); ?&gt;&gt;&lt;?php esc_html_e( 'Yes', 'woocommerce' ); ?&gt;&lt;/option&gt;\n &lt;/select&gt;\n &lt;p&gt;&lt;?php esc_html_e( 'Field description may go here.', 'woocommerce' ); ?&gt;&lt;/p&gt;\n &lt;/td&gt;\n &lt;/tr&gt;&lt;?php\n}\n\n// Save the select field value for the term of a WooCommerce taxonomy\nfunction save_wc_attribute_term_custom_field( $term_id ) {\n if ( isset($_POST['pr_addon']) ) {\n update_term_meta( $term_id, 'pr_addon', esc_attr($_POST['pr_addon']) );\n }\n}\n</code></pre>\n<p>Code goes in functions.php file of your child theme (or in a plugin).</p>\n<p>You will get the following when adding or editing a term from a product attribute:</p>\n<p><a href="https://i.sstatic.net/8CqHWVTK.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8CqHWVTK.png" alt="Editing WC product attribute term" /></a></p>\n<p>To get the value from that custom field from a defined product attribute term ID, you will use WordPress <code>get_term_meta(</code>) function like:</p>\n<pre class="lang-php prettyprint-override"><code>$value = get_term_meta($term_id, 'pr_addon', true);\n</code></pre>\n"^^ . + "0"^^ . + . + "1"^^ . + "custom php function ignored in functions.php in wordpress"^^ . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + "This question is similar to: [How do I install Composer PHP packages without Composer?](https://stackoverflow.com/questions/40545795/how-do-i-install-composer-php-packages-without-composer). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem."^^ . + "0"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + "hemm, codeigniter version ? if codeigniter version 3, check file config.php , find code `$config['index_page'] = 'index.php';`\nand remove to be `$config['index_page'] = '';`"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "3"^^ . + . + . + "As this looks like an error in the platform.sh provided phar file, I'd suggest to report this issue to your software vendor (where you obtained that file from). You can leave your question open here so that you can also use the link to it for your report (and, additionally, if you solved it, you can even answer your own question.)"^^ . + "If you already have mysql on your system, xampp will try to install mariadb which is similar. You can just opt not to add that, and only install php and apache. P.s. note that workbench is just the UI tool for managing your databases, the actual mysql _server_ is where your databases are stored, and what your php code would connect to, and is supplied and installed separately. Make sure you're clear what components you have, what they're called, and what they do, otherwise you just end up even more confused"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + "How do I get a flexform value in my repository?"^^ . + . + . + . + . + "Unable to Broadcast message to connected clients in websocket server"^^ . + "0"^^ . + . + . + "2"^^ . + . + . + . + . + "1"^^ . + . + . + "You could use the general `object` type in your method: `public function store(object $request);`. And then check the object type you get in the method itself: `if ($request instanceof BaseFormRequest) { ... }` or `if ($request instanceof StorePostRequest) { ... }`."^^ . + "If we remove the UPDATE statement from the SQL, and just let PHP set the password, then we also get the expected behaviour: https://phpize.online/sql/mysql80/e3fe87adfaf43f216faf397fbc143a32/php/php84/85c3c791d6f7994e9982c120085a81f1/ - this time affected rows is 1 because the password being set is different than what was in the table."^^ . + "0"^^ . + . + . + . + . + . + . + "-2"^^ . + "2"^^ . + "ECONNRESET error in postman when inserting document to Firestore from Laravel"^^ . + . + . + . + "0"^^ . + "1"^^ . + . + "In the end, this question turned out to be a duplicate of that "UTF-8 all the way through" you were directed to earlier. But given you provided no example, we had to guess based on your verbal description only. Yet if you did read it more carefully, you would have noted the importance of setting the charset header."^^ . + . + . + "@IMSoP perhaps not, but then if you google "cd with spaces in directory name" or anything similar, the quote option comes up pretty fast. So whilst not everyone knows everything, we do also expect a bit of basic research into the problem space. As we see, this is a clear duplicate of several questions just on Stackoverflow, and no doubt the same information exists in many other places too. Instead the OP seems to have just assumed a solution rather than checking potential options - which are extremely easy to find."^^ . + . + "Can I pass a segment of a url as a variable via embedded JS?"^^ . + . + . + "<p>I found multiple solutions to my question, while dealing with my question. All these solutions have in common that they only render the link on the front-end of the checkout page. I have tried and tested each one of these solutions, and I will try and explain them.</p>\n<p><strong>Please note:</strong></p>\n<blockquote>\n<p>These solutions are specifically tailored to be applicable only to setups using the <a href="https://woocommerce.com/document/woocommerce-shortcodes/" rel="nofollow noreferrer">legacy checkout shortcode</a>. They are not compatible and will not work with <a href="https://woocommerce.com/document/woocommerce-store-editing/customizing-cart-and-checkout/checkout-block/" rel="nofollow noreferrer">Checkout Blocks</a>, which have been enabled by default in WooCommerce for a few years. Checkout Blocks use a completely different architecture and rendering method.</p>\n</blockquote>\n<p><strong>Solution 1 - PHP solution for appending link to fee using filter:</strong></p>\n<p>If you are looking for a simple solution using WooCommerce filter, the <code>woocommerce_cart_totals_fee_html</code> filter is likely the best option. WooCommerce currently doesn't provide other <a href="https://woocommerce.github.io/code-reference/hooks/hooks.html" rel="nofollow noreferrer">filters</a> specifically targeting the fee name output for appending links on the front-end. This hook works well if you're okay with the link displaying alongside the fee, instead of directly within the fee name.</p>\n<p><strong>Example:</strong></p>\n<pre><code>add_filter( 'woocommerce_cart_totals_fee_html', 'custom_handling_fee_link', 10, 2 );\nfunction custom_handling_fee_link( $fee_html, $fee ) {\n // Check if the current page is the checkout page &amp; fee name\n // Change fee name with name of your own fee (exact match)\n if ( is_checkout() &amp;&amp; $fee-&gt;name === 'Handling fee - dangerous goods' ) {\n $fee_html .= ' &lt;span style=&quot;display:block;&quot;&gt;&lt;a href=&quot;https://example.com&quot; target=&quot;_blank&quot;&gt;(Learn More)&lt;/a&gt;&lt;/span&gt;';\n }\n return $fee_html;\n}\n</code></pre>\n<p>The code should be added to your <code>functions.php</code> file, of your active child theme. The pro of this solution is, it's simple to implement, but link appears outside the fee name.</p>\n<p><strong>Solution 2 - Template override to append link to fee name:</strong></p>\n<p>Another option is to <a href="https://developer.woocommerce.com/docs/template-structure-overriding-templates-via-a-theme/" rel="nofollow noreferrer">override and edit the woocommerce template file</a> <code>review-order.php</code>. This is the file responsible for rendering the checkout table. For this you will need to create a child theme so your customizations remain intact during updates. Here are the steps:</p>\n<ol>\n<li><p>Copy the template file from: <code>wp-content/plugins/woocommerce/templates/checkout/review-order.php</code></p>\n</li>\n<li><p>Paste it into your child theme under: <code>wp-content/themes/your-child-theme/woocommerce/checkout/review-order.php</code></p>\n</li>\n<li><p>Locate the section of the table, within the template that outputs the fees. Should look something like this:</p>\n<pre><code>&lt;tr class=&quot;fee&quot;&gt;\n &lt;th&gt;&lt;?php echo esc_html( $fee-&gt;name ); ?&gt;&lt;/th&gt;\n &lt;td&gt;&lt;?php wc_cart_totals_fee_html( $fee ); ?&gt;&lt;/td&gt;\n&lt;/tr&gt;\n</code></pre>\n</li>\n<li><p>Update the code to append the clickable link to the fee name, using condition:</p>\n</li>\n</ol>\n<pre><code>&lt;tr class=&quot;fee&quot;&gt;\n &lt;th&gt;&lt;?php echo esc_html( $fee-&gt;name );\n // Check for fee name and echo link\n if ( 'Handling fee - dangerous goods' === $fee-&gt;name ) {\n echo ' &lt;a href=&quot;https://example.com&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;(Learn More)&lt;/a&gt;';\n }\n ?&gt;\n &lt;/th&gt;\n &lt;td&gt;&lt;?php wc_cart_totals_fee_html( $fee ); ?&gt;&lt;/td&gt;\n&lt;/tr&gt;\n</code></pre>\n<p>I don't recommend this approach, unless you know what you are doing. Also, keep in mind that themes (especially custom themes) may update, so it's essential to maintain your customizations carefully. Document the changes you've made to ensure compatibility with future WooCommerce updates. So while there is greater control, it requires careful maintenance during updates.</p>\n<p><strong>Solution 3 - Appending link to fee name using Javascript</strong></p>\n<p>It is possible to use JavaScript (via jQuery) to add the clickable link to the fee name. I managed to do this with the following code, which I will try to explain via comments:</p>\n<pre><code>// Hook the function to the footer of the website\nadd_action('wp_footer', 'append_fee_link_to_custom_fee_via_js');\nfunction append_fee_link_to_custom_fee_via_js() {\n // Only run on checkout page\n if (is_checkout()) {\n ?&gt;\n &lt;script type=&quot;text/javascript&quot;&gt;\n jQuery(document).ready(function($) {\n // Function to add the link to the fee name\n function addReadMoreLink() {\n // Target the specific fee row and avoid redundant operations\n $(&quot;tr.fee&quot;).each(function() {\n const feeLabel = $(this).find(&quot;th&quot;).text().trim();\n \n // If the fee name matches and the link doesn't already exist, append the link\n if (feeLabel === 'Handling fee - dangerous goods' &amp;&amp; !$(this).find(&quot;th a&quot;).length) {\n $(this).find(&quot;th&quot;).append(\n $('&lt;a&gt;', {\n href: 'https://example-link.com', // Replace with your own link\n text: ' Read more', // Text for the link\n target: '_blank', // Open link in a new tab\n rel: 'noopener noreferrer', // Security attributes for the link\n style: 'color: #0073aa; font-size: 14px;' // Custom styling for the link\n })\n );\n }\n });\n }\n\n // Execute the function when the page is loaded\n addReadMoreLink();\n \n // Re-run the function after WooCommerce updates the checkout via AJAX\n // Ensures the link remains visible only when necessary\n $(document.body).on('updated_checkout', function() {\n addReadMoreLink();\n });\n });\n &lt;/script&gt;\n &lt;?php\n }\n}\n</code></pre>\n<p>This code can be added to <code>functions.php</code> file of your active child theme. Alternatively, you can move the JavaScript code to a separate <code>.js</code> file and enqueue it using <code>wp_enqueue_script</code>.</p>\n<p>There probably is a better and cleaner JS solution than the one I provided, since my knowledge of JavaScript isn't very advanced. But it adds the link to the fee name, which was my goal.</p>\n<p><strong>Conclusion:</strong></p>\n<ul>\n<li><p>In all my solutions, I check for exact fee name match, this means that if you change your fee name, you will need to adjust accordingly.</p>\n</li>\n<li><p>All the solutions assume you have already created your custom fee, using <code>woocommerce_cart_calculate_fees</code> hook. For more reading on how to add custom fee.</p>\n</li>\n</ul>\n<p>Each solution has its strengths and limitations. If you prefer simplicity and don’t mind the link appearing next to the fee, Solution 1 (PHP filter) is a great choice. For those comfortable with template customizations, Solution 2 offers complete control, though it requires maintenance during updates. Finally, Solution 3 (JavaScript) provides flexibility for dynamic front-end updates, without modifying PHP code.</p>\n"^^ . + "3"^^ . + . + . + "1"^^ . + . + . + "keycloak"^^ . + . + . + . + "1"^^ . + . + . + "0"^^ . + "<p>I have a PHP site with a MySQL DB which I've had for some time. Been working fine. I've been asked to make a simple change to allow a non techie user to change a users password.</p>\n<p><code>DB is 'users' field is password and it is a VARCHAR(512). id is autoinc and is mediumint(8) username is unique and VARCHAR(32) </code>\nWhen original creating I use\n<code>$passwordhash = password_hash($postpass, PASSWORD_DEFAULT); $sql = &quot;INSERT INTO </code>users<code>( username, email, validated, password, etc ) VALUES ( '$postname', '$postemail', '$validateemailflag', '$passwordhash', 'etc' )&quot;;</code>\nCreates account and allows me to login with the username and password.</p>\n<p>The users can also modify their passwords with\n<code>$passwordhash = password_hash($newpass, PASSWORD_DEFAULT); $sql = &quot;UPDATE </code>users<code>SET</code>password<code>= '$passwordhash' WHERE</code>username<code> = '$loggedin_user'&quot;;</code></p>\n<p>Works fine. Now I come to add in a facility for us to change the passwords and I use;</p>\n<p><code>$passwordhash = password_hash($password, PASSWORD_DEFAULT); $sql = &quot;UPDATE </code>users<code>SET</code>password<code>= '$passwordhash' WHERE</code>id<code> = '$id'&quot;;</code></p>\n<p>An example is;\n<code>UPDATE </code>users<code>SET</code>password<code>= '$2y$10$LMVq3s0VNdVlgFPEE5XBE.eFlgo47N2GpoEoojg40up6T8rrfPwuG' WHERE</code>id<code> = '156'</code></p>\n<p>This does not modify the record and returns 0 rows affected. I've taken the UPDATE line to MyPHPAdmin and put it in directly. Still does not update the record.\nNow here is an interesting part. If I edit the password field. I can remove any single character and it updates the DB. Obviously I can't use it as I have no idea what the password is.\nNow a final twist. If I edit any character is also works. So I can change it to any other and it is fine. However if it change it to itself or a lower case version it fails again.</p>\n<p>Any ideas? I clearly does like the password at all and I have no idea how to progress this.</p>\n<p>As it is the SQL itself that is of issue I spent some time in MyPHPAdmin changing the parameters. Changing the password text fixes it but is of no use. I'm puzzled why the changing a character works. Makes me think some kind of checksum but changing an 'F' for an 'f' doesn't work either. Deleting the 'F' or changing it to an 's' works. I've tried lots of different substitutes, number, chars, etc. all work except case changes.</p>\n"^^ . + "The sending of a parameter is not, in itself, a problem - websites do that all the time. As the comment above says, everything depends on what you do with it after that. You can't assess the risk until you know the intended use of the data. That said, an email address specifically in a GET parameter isn't great, because it can get logged, as the commenter above also mentioned. That's a risk to the person whose email address it is, though, not a risk to your PHP application. So again...depends what risk you're thinking of."^^ . + . + . + "@TangentiallyPerpendicular That code is from some plugin I'm using. I wouldn't know how to do that. Sorry!"^^ . + . + . + "How to use ngrok with Laravel Breeze (Inertia + Vue.js) when using two different ports?"^^ . + "0"^^ . + . + . + . + . + "1"^^ . + . + "0"^^ . + . + "wordpress-gutenberg"^^ . + . + . + "0"^^ . + . + . + "1"^^ . + "Also, could you clarifying where you are seeing this? You say stdout, but do you specifically mean it is being included in the HTTP response stream? Further, is your Symfony environment set to `PROD`?"^^ . + . + . + . + . + "-2"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "I guess we could even replace `(?<=[a-zA-Z])` with a `\\b` word boundary ([example](https://regex101.com/r/iJCBfn/1)). Not sure!"^^ . + . + . + . + . + "Although I steered you in the direction, you ultimately found the solution, and I'm fine with you writing and accepting your own answer. Glad it worked!"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + "0"^^ . + "2"^^ . + . + "0"^^ . + . + . + . + . + "0"^^ . + "Well, which bit of the code you do think is supposed to populate it? You've written code to handle the "change" event on the thumbnails dropdown, and send an AJAX request to `DDM2.php` with the selected category. So far so good. But then... you've got: `success: function(response) { console.log(response); }`. This just logs the response to the browser's Console and then stops. It does not attempt to update the page with the new dropdown. So, quite simply, it's not working because you haven't written any code to make it work, and it's unclear why you seem to think it should already work."^^ . + . + "0"^^ . + "1"^^ . + "0"^^ . + . + . + "1"^^ . + . + "And https://stackoverflow.com/q/40412396/367456 suggests that it is totally possible to yield a ERR_CONNECTION_REFUSED from Laravel. However, not yet clear on how to do that for a single route only to me. After you get the error message, do the other routes still work or do you need to restart the server to get them back online?"^^ . + "1"^^ . + "Here's what I would do. First, ignore the API for the sake of conversation. You have some HTML that you want to convert from an `iframe` to an `embed`. As C3roe said, I don't know if that ultimately works, but I'm going to trust that you've tested that already. Second, ignore WordPress and RegEx, and attack this with a DOM-aware parser. WordPress has a native one, but it doesn't support transformations, so check out [DOMDocument](https://www.php.net/manual/en/class.domdocument.php). Load the HTML, [find and replace](https://stackoverflow.com/a/3195048/231316), get the new HTML."^^ . + . + . + . + "0"^^ . + "1"^^ . + . + "If you run a python script that accesses the filesystem it would likely have a similar problem, if its a permissions issue. Another possibility is that the file path it's trying to access doesn't exist"^^ . + . + . + . + "1"^^ . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + "Allow letters, space and dots in php using preg_match"^^ . + "echo"^^ . + "“I checked that i'm using the right ini file using the phpinfo" - can you be more specific about how you tested this? For instance, if you tested on the CLI, that might have been a different SAPI."^^ . + . + . + "1"^^ . + . + . + . + . + "laravel-breeze"^^ . + "0"^^ . + "<p>There were two mistakes in my code. Here is how I solved it (relevant lines commented).</p>\n<p>In the controller:</p>\n<pre><code>public function edit($id)\n {\n $article = Article::find($id);\n // Get the IDs of the tags currently attached to the article.\n $attached_tags = $article-&gt;tags()-&gt;get()-&gt;pluck('id')-&gt;toArray();\n \n return view(\n 'dashboard/edit-article',\n [\n 'categories' =&gt; $this-&gt;categories(),\n 'tags' =&gt; $this-&gt;tags(),\n 'attached_tags' =&gt; $attached_tags,\n 'article' =&gt; $article\n ]\n );\n }\n\n public function update(Request $request, $id)\n {\n $validator = Validator::make($request-&gt;all(), $this-&gt;rules, $this-&gt;messages);\n\n if ($validator-&gt;fails()) {\n return redirect()-&gt;back()-&gt;withErrors($validator-&gt;errors())-&gt;withInput();\n }\n\n $fields = $validator-&gt;validated();\n $article = Article::find($id);\n\n // If a new image is uploaded, set it as the article image\n // Otherwise, set the old image...\n if (isset($request-&gt;image)) {\n $imageName = md5(time()) . Auth::user()-&gt;id . '.' . $request-&gt;image-&gt;extension();\n $request-&gt;image-&gt;move(public_path('images/articles'), $imageName);\n } else {\n $imageName = $article-&gt;image;\n }\n\n $article-&gt;title = $request-&gt;get('title');\n $article-&gt;short_description = $request-&gt;get('short_description');\n $article-&gt;category_id = $request-&gt;get('category_id');\n $article-&gt;tags[] = $request-&gt;get('tags[]');\n $article-&gt;featured = $request-&gt;has('featured');\n $article-&gt;image = $request-&gt;get('image') == 'default.jpg' ? 'default.jpg' : $imageName;\n $article-&gt;content = $request-&gt;get('content');\n // Save changes to the article\n $article-&gt;save();\n\n //Attach tags to article\n if (isset($request-&gt;tags)) {\n $article-&gt;tags()-&gt;sync($request-&gt;tags);\n } else {\n $article-&gt;tags()-&gt;sync([]);\n }\n\n return redirect()-&gt;route('dashboard.articles')-&gt;with('success', 'The article titled &quot;' . $article-&gt;title . '&quot; was updated');\n }\n</code></pre>\n<p>Show current tags as selected I the view:</p>\n<pre><code> &lt;select name=&quot;tags[]&quot; id=&quot;tags&quot; class=&quot;form-control&quot; multiple=&quot;multiple&quot;&gt;\n @foreach ($tags as $tag)\n &lt;option value=&quot;{{ $tag-&gt;id }}&quot; {{ (in_array($tag-&gt;id, $attached_tags)) ? 'selected' : '' }}&gt;{{ $tag-&gt;name }}&lt;/option&gt;\n @endforeach\n&lt;/select&gt;\n</code></pre>\n"^^ . + "1"^^ . + "Remember that in modern mail infrastructure you can't just put arbitrary 'from' email addresses - generally your mailserver needs certain permissions set up to be able to send mail 'from' a certain address. Without these permissions, although the `mail()` function might succeed, the email is likely to be dropped and never reach its recipient"^^ . + "0"^^ . + . + . + "0"^^ . + "(For comparison, when you do a regular, non-ajax form submission or link navigation, this sends a HTTP request to the server. The browser discards the entire page that it was displaying, and then replaces it with whatever output it gets from the server in reponse to that request. In an ajax HTTP request, the browser keeps the current page as-is, and any output provided back by the server is sent back to the JS instead. This allows you to (optionally) do small changes to the page rather than replacing the whole thing every time. It's more efficient, but you have to write more JS to achieve it)"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + "And have you filed a feature request?"^^ . + "Since the only difference between those links is, if it returns data or not, try to (partially) download it and check, if you get anything."^^ . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + . + . + . + . + . + "<p>You might want to still use PHP's <code>NumberFormatter</code> and set the <code>PARSE_INT_ONLY</code> attribute. Here's its manual: <a href="https://www.php.net/manual/en/class.numberformatter.php" rel="nofollow noreferrer">https://www.php.net/manual/en/class.numberformatter.php</a>. You can try something like this:</p>\n<pre><code>function romanToInt(string $roman) {\n static $nf = null;\n\n if ($nf === null) {\n $nf = new \\NumberFormatter('@numbers=roman', \\NumberFormatter::DECIMAL);\n $nf-&gt;setAttribute(\\NumberFormatter::PARSE_INT_ONLY, true);\n }\n\n return $nf-&gt;parse($roman);\n}\n</code></pre>\n<p>The code above seems to work with an online PHP compiler, such as <a href="https://www.mycompiler.io/new/php" rel="nofollow noreferrer">https://www.mycompiler.io/new/php</a>. You can test that code with test cases, such as:</p>\n<pre><code>echo romanToInt('DCCCXLV'); // 845\n</code></pre>\n"^^ . + "0"^^ . + . + . + "Does the behavior change, when you explicitly save one of those imported posts again using the admin backend?"^^ . + . + . + "<p>In Symfony I want to dynamically create routes that are parsed from a JSON file like this</p>\n<pre><code>{\n&quot;home&quot;: {\n &quot;path&quot;: &quot;/home&quot;,\n &quot;controller&quot;: &quot;website\\\\Controller::home&quot;\n },\n &quot;newsGrid&quot;: {\n &quot;path&quot;: &quot;/news&quot;,\n &quot;controller&quot;: &quot;website\\\\Controller::newsGrid&quot;\n }\n}\n</code></pre>\n<p>However the path of the file depends on the host.\nEg for <code>www.foo.org</code> the path is <code>/app/instances/foo/routes.json</code> and for <code>www.bar.org</code> the path is <code>/app/instances/bar/routes.json</code></p>\n<p>I then want to load the controller from the instance folder, eg. <code>/app/instances/foo/Controller.php</code> for foo and <code>/app/instances/bar/Controller.php</code> for bar.</p>\n<p>I load the <code>Controller.php</code> for the specific instance before I initialize the Symfony Kernel via <code>require_once</code></p>\n<p>I managed to get it working and the controller can respond with a simple <code>return new Response()</code>. However I want to render a Twig template. To do that I extend the controller to <code>AbstractController</code>.\nThis gives me the error</p>\n<pre><code>The controller for URI &quot;/news&quot; is not callable: Controller &quot;website\\Controller&quot; has required constructor arguments and does not exist in the container. Did you forget to define the controller as a service?\n</code></pre>\n<p>To fix this I added</p>\n<pre><code> website\\Controller:\n tags: [ 'controller.service_arguments' ]\n</code></pre>\n<p>to my <code>services.yaml</code>. This doesn't fix my problem, as then the cli does not work anymore</p>\n<pre><code>#message: &quot;Class &quot;&quot; used for service &quot;website\\Controller&quot; cannot be found.&quot;\n</code></pre>\n<p>What can I do to fix this? I would be happy as well with a completely different solution as long as it satisfies these requirements</p>\n<ul>\n<li>Routes must be loaded from a json file inside the <code>/app/instances/&lt;instance&gt;/*</code> folder</li>\n<li>Controller must be loaded from the <code>/app/instances/&lt;instance&gt;/*</code>folder</li>\n<li><code>services.yaml</code> or similar must not include a list of all possible instances</li>\n<li>Parsing via Twig must be possible</li>\n</ul>\n"^^ . + . + . + . + "<p>I’m developing a small extension for managing vouchers in my WooCommerce store, a custom plugin with a PDF export.</p>\n<p>It works in French, but is corrupted in English: the returned PDF is empty.</p>\n<p>In my code, I add a new &quot;Vouchers&quot; section to the customer's dashboard menu, allowing them to view the vouchers they have purchased since creating their account and re-download them if needed.</p>\n<p>Next to each voucher, there is a &quot;Download&quot; button. When clicked, a PDF file is generated and returned to the customer. This works perfectly when using the default language of my store, but as soon as I switch to English (with &quot;/en/&quot; in the URL), the returned PDF is empty.</p>\n<p>Here is the code for the vouchers section:</p>\n<pre><code>function display_vouchers_in_dashboard() \n{\n $user_id = get_current_user_id();\n\n if ($user_id &gt; 0) \n {\n $args = array(\n 'customer_id' =&gt; $user_id,\n 'post_type' =&gt; 'shop_order',\n 'posts_per_page' =&gt; -1, \n );\n \n $orders = wc_get_orders($args);\n \n $voucher_found = false;\n \n if ($orders) \n {\n echo '&lt;h2&gt;Vos Vouchers&lt;/h2&gt;';\n echo '&lt;table&gt;';\n echo '&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date d\\'achat&lt;/th&gt;&lt;th&gt;Montant&lt;/th&gt;&lt;th&gt;À l\\'attention de&lt;/th&gt;&lt;th&gt;Référence&lt;/th&gt;&lt;th&gt;Action&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;';\n echo '&lt;tbody&gt;';\n \n foreach ($orders as $order) \n {\n foreach ($order-&gt;get_items() as $item_id =&gt; $item) \n {\n $product = $item-&gt;get_product(); \n \n if ($product) \n {\n $categories = wp_get_post_terms($product-&gt;get_id(), 'product_cat');\n \n foreach ($categories as $category) \n {\n \n if ($category-&gt;slug === 'bons-cadeaux')\n {\n $voucher_reference = wc_get_order_item_meta($item_id, '_voucher_reference', true);\n $recipient_name = wc_get_order_item_meta($item_id, '_gift_card_recipient', true);\n \n $voucher_amount = $item-&gt;get_total(); \n \n $order_date = $order-&gt;get_date_created()-&gt;date('Y-m-d');\n \n if (!empty($voucher_reference) &amp;&amp; !empty($recipient_name))\n {\n $voucher_found = true; \n echo '&lt;tr&gt;';\n echo '&lt;td&gt;' . esc_html($order_date) . '&lt;/td&gt;';\n echo '&lt;td&gt;' . wc_price($voucher_amount) . '&lt;/td&gt;';\n echo '&lt;td&gt;' . esc_html($recipient_name) . '&lt;/td&gt;';\n echo '&lt;td&gt;' . esc_html($voucher_reference) . '&lt;/td&gt;';\n echo '&lt;td&gt;';\n echo '&lt;form method=&quot;POST&quot; action=&quot;&quot;&gt;';\n echo '&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;download_voucher&quot;&gt;';\n echo '&lt;input type=&quot;hidden&quot; name=&quot;order_id&quot; value=&quot;' . $order-&gt;get_id() . '&quot;&gt;';\n echo '&lt;input type=&quot;hidden&quot; name=&quot;item_id&quot; value=&quot;' . esc_attr($item_id) . '&quot;&gt;';\n echo '&lt;button type=&quot;submit&quot; class=&quot;button&quot;&gt;Télécharger&lt;/button&gt;';\n echo '&lt;/form&gt;';\n echo '&lt;/td&gt;';\n echo '&lt;/tr&gt;';\n }\n }\n }\n }\n }\n }\n \n echo '&lt;/tbody&gt;';\n echo '&lt;/table&gt;';\n }\n \n if (!$voucher_found) \n {\n echo '\n &lt;div class=&quot;woocommerce-info&quot;&gt;\n Vous n\\'avez pas encore acheté de vouchers. \n &lt;a class=&quot;woocommerce-Button wc-forward button&quot; href=&quot;https://radici.lu/boutique/&quot;&gt;Parcourir les produits&lt;/a&gt; \n &lt;/div&gt;';\n }\n }\n}\n\nadd_action('woocommerce_account_vouchers_endpoint', 'display_vouchers_in_dashboard');\n \nfunction process_voucher_download() \n{\n if (isset($_POST['action']) &amp;&amp; $_POST['action'] === 'download_voucher' &amp;&amp; isset($_POST['order_id']) &amp;&amp; isset($_POST['item_id']))\n {\n $order_id = absint($_POST['order_id']);\n $item_id = absint($_POST['item_id']);\n $user_id = get_current_user_id();\n \n $order = wc_get_order($order_id);\n \n if ($order &amp;&amp; $order-&gt;get_user_id() === $user_id) \n {\n generate_pdf($order_id, $item_id);\n exit;\n } else {\n wp_redirect(home_url('/404'));\n exit;\n }\n }\n}\n \nadd_action('template_redirect', 'process_voucher_download');\n</code></pre>\n<p>And here is the code for my generate_pdf function:</p>\n<pre><code>function generate_pdf($order_id, $item_id) \n{\n $order = wc_get_order($order_id);\n $current_user = wp_get_current_user();\n $language = get_locale();\n \n if ($order-&gt;get_user_id() != $current_user-&gt;ID) \n {\n wp_die('You are not authorized to generate vouchers for this order');\n }\n \n $item = $order-&gt;get_item($item_id);\n $product_id = $item-&gt;get_product_id(); \n $pdf = new Fpdi();\n \n if ($language === &quot;en_GB&quot;) \n {\n $pdf-&gt;setSourceFile(plugin_dir_path(__FILE__) . 'template_voucher_en.pdf');\n $tplIdx = $pdf-&gt;importPage(1); \n \n if (has_term('bons-cadeaux', 'product_cat', $product_id))\n { \n $recipient_name = $item-&gt;get_meta('_gift_card_recipient', true); \n $reference = $item-&gt;get_meta('_voucher_reference', true); \n $sender_name = $order-&gt;get_billing_first_name() . ' ' . $order-&gt;get_billing_last_name();\n \n $pdf-&gt;AddPage('L'); \n $pdf-&gt;useTemplate($tplIdx); \n $pdf-&gt;SetFont('Helvetica', '', 14);\n \n $pdf-&gt;SetXY(52.5, 13.5);\n $pdf-&gt;Write(0, $reference);\n \n $pdf-&gt;SetXY(93, 136.5);\n $pdf-&gt;Write(0, $item-&gt;get_total() . '€');\n \n $pdf-&gt;SetXY(118, 147);\n $pdf-&gt;Write(0, $recipient_name);\n \n $pdf-&gt;SetXY(87.5, 157.5);\n $pdf-&gt;Write(0, $sender_name);\n \n $pdf-&gt;SetXY(103, 168);\n $pdf-&gt;Write(0, date('d/m/Y', strtotime('+1 year', strtotime($order-&gt;get_date_created()))));\n }\n } else {\n $pdf-&gt;setSourceFile(plugin_dir_path(__FILE__) . 'template_voucher_fr.pdf');\n $tplIdx = $pdf-&gt;importPage(1); \n \n if (has_term('bons-cadeaux', 'product_cat', $product_id))\n { \n $recipient_name = $item-&gt;get_meta('_gift_card_recipient', true); \n $reference = $item-&gt;get_meta('_voucher_reference', true); \n $sender_name = $order-&gt;get_billing_first_name() . ' ' . $order-&gt;get_billing_last_name();\n \n $pdf-&gt;AddPage('L'); \n $pdf-&gt;useTemplate($tplIdx); \n \n $pdf-&gt;SetFont('Helvetica', '', 14);\n \n $pdf-&gt;SetXY(53, 13.5);\n $pdf-&gt;Write(0, $reference);\n \n $pdf-&gt;SetXY(94.5, 136.5);\n $pdf-&gt;Write(0, $item-&gt;get_total() . '€');\n \n $pdf-&gt;SetXY(109, 147);\n $pdf-&gt;Write(0, $recipient_name);\n \n $pdf-&gt;SetXY(104, 157.5);\n $pdf-&gt;Write(0, $sender_name);\n \n $pdf-&gt;SetXY(109.5, 168);\n $pdf-&gt;Write(0, date('d/m/Y', strtotime('+1 year', strtotime($order-&gt;get_date_created()))));\n }\n }\n \n return $pdf-&gt;Output(&quot;voucher_&quot;.$reference.&quot;.pdf&quot;, &quot;D&quot;); \n}\n</code></pre>\n<p>When I dump <em>$pdf</em> before the Output, whether in French or English, I get the complete FPDI object with the correct information: The right uploaded PDF file according to the language, as well as the customer's data.</p>\n<p>For your information, I’m using the TranslatePress plugin for the site translation.</p>\n<p>I have no more idea where the issue might be coming from.</p>\n"^^ . + "1"^^ . + . + . + . + "0"^^ . + "shopware6"^^ . + . + "0"^^ . + "1"^^ . + "0"^^ . + . + "0"^^ . + "Just to triple-check, can you run `php -r "var_dump(extension_loaded('openssl'));"` on the CLI. If that comes back as `true`, then I think Apache is loading a different config, or overriding the config with additional settings."^^ . + "0"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + . + . + . + "*"php associative array with the data [...]"* - That's the JSON; the PHP array would actually be: `["data" => ["name" => ["__typename" => "Name", "id" => "nm0000573", "nameText" => ["text" => "Dolly Parton"]]]]`"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + "Tried against a request bin (https://cln.sh/HXzX045ZXvD33xT83Pbb), and it works. The file is correctly uploaded from a string. So the issue you are experiencing happens because of something else that's not evident from the information in the question."^^ . + . + . + . + . + . + . + . + . + "0"^^ . + "variable-names"^^ . + . + "Thank you very much! Problem solved!"^^ . + "<p>Upon my symfony application, I try to configure s3 as a service:</p>\n<pre><code>services:\n\n Aws\\S3\\S3Client:\n public: true\n arguments:\n $args:\n version: 'latest'\n region: '%env(AWS_REGION)%'\n endpoint: 'http://s3:9000'\n use_path_style_endpoint: true\n credentials:\n key: '%env(S3_CLIENT_KEY)%'\n secret: '%env(S3_CLIENT_SECRET)%'\n</code></pre>\n<p>And I made a simple command that is <code>Aws\\S3\\S3Client</code> is injected upon. It does a simple thing it generates a txt file and uploads it into Aws s3:</p>\n<pre><code>namespace App\\Command;\n\nuse Aws\\S3\\S3Client;\nuse Symfony\\Component\\Console\\Attribute\\AsCommand;\nuse Symfony\\Component\\Console\\Command\\Command;\nuse Symfony\\Component\\Console\\Input\\InputArgument;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\nuse Symfony\\Component\\Console\\Input\\InputOption;\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\nuse Symfony\\Component\\Console\\Style\\SymfonyStyle;\n\n#[AsCommand(\n name: 'test:s3',\n description: 'Add a short description for your command',\n)]\nclass TestS3Command extends Command\n{\n public function __construct(private S3Client $s3Client)\n {\n parent::__construct();\n }\n\n protected function configure(): void\n {\n }\n\n protected function execute(InputInterface $input, OutputInterface $output): int\n {\n\n $bucketName = 'test'; // Replace with your actual bucket name\n $objectKey = 'example.txt'; // The key (file name) in S3\n $text = &quot;Hello&quot;;\n\n try {\n $this-&gt;s3Client-&gt;putObject([\n 'Bucket' =&gt; $bucketName,\n 'Key' =&gt; $objectKey,\n 'Body' =&gt; $text,\n 'ContentType' =&gt; 'text/plain',\n ]);\n\n $output-&gt;writeln(&quot;File uploaded successfully to s3://{$bucketName}/{$objectKey}&quot;);\n return Command::SUCCESS;\n } catch (\\Exception $e) {\n $output-&gt;writeln(&quot;&lt;error&gt;Upload failed: {$e-&gt;getMessage()}&lt;/error&gt;&quot;);\n return Command::FAILURE;\n }\n\n return Command::SUCCESS;\n }\n}\n\n</code></pre>\n<p>But Once I run the command in console:</p>\n<pre><code>php bin/console test:s3\n</code></pre>\n<p>I got:</p>\n<pre><code>TypeError {#108\n #message: &quot;Aws\\S3\\S3Client::__construct(): Argument #1 ($args) must be of type array, null given, called in /var/www/html/var/cache/dev/Container9KJ5J9E/getTestS3CommandService.php on line 31&quot;\n #code: 0\n #file: &quot;./vendor/aws/aws-sdk-php/src/S3/S3Client.php&quot;\n #line: 412\n trace: {\n ./vendor/aws/aws-sdk-php/src/S3/S3Client.php:412 { …}\n ./var/cache/dev/Container9KJ5J9E/getTestS3CommandService.php:31 {\n Container9KJ5J9E\\getTestS3CommandService::do($container, $lazyLoad = true)^\n › \n › $container-&gt;privates['App\\\\Command\\\\TestS3Command'] = $instance = new \\App\\Command\\TestS3Command(new \\Aws\\S3\\S3Client(NULL));\n › \n arguments: {\n $args: null\n }\n }\n ./var/cache/dev/Container9KJ5J9E/App_KernelDevDebugContainer.php:169 { …}\n ./var/cache/dev/Container9KJ5J9E/getTestS3Command_LazyService.php:24 { …}\n ./vendor/symfony/console/Command/LazyCommand.php:189 { …}\n ./vendor/symfony/console/Application.php:338 { …}\n ./vendor/symfony/framework-bundle/Console/Application.php:77 { …}\n ./vendor/symfony/console/Application.php:193 { …}\n ./vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:49 { …}\n ./vendor/autoload_runtime.php:29 { …}\n ./bin/console:15 { …}\n }\n}\n\n</code></pre>\n<p>Why ??? Another approach I tried was:</p>\n<pre><code> Aws\\S3\\S3Client:\n public: true\n arguments:\n -\n version: 'latest'\n region: '%env(AWS_REGION)%'\n endpoint: 'http://s3:9000'\n use_path_style_endpoint: true\n credentials:\n key: '%env(S3_CLIENT_KEY)%'\n secret: '%env(S3_CLIENT_SECRET)%'\n</code></pre>\n<p>But I still fail to initialize the S3 object upon service container.</p>\n"^^ . + . + . + . + . + "where are you stuck exactly? what have you tried and what issue do you have with it?"^^ . + . + "1"^^ . + . + . + "-1"^^ . + . + . + . + . + "<p>If you read the docu <a href="https://www.php.net/manual/en/class.ziparchive.php" rel="nofollow noreferrer">https://www.php.net/manual/en/class.ziparchive.php</a> you will find the function <code>statIndex()</code> (<a href="https://www.php.net/manual/en/ziparchive.statindex.php" rel="nofollow noreferrer">https://www.php.net/manual/en/ziparchive.statindex.php</a>). Use it instead of function <code>getNameIndex()</code>.</p>\n"^^ . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + . + "1"^^ . + "I tried putting sudo in front of the script and the same error occurred. Guess I'll try and learn some Python!"^^ . + "0"^^ . + . + . + "typo3-11.x"^^ . + "0"^^ . + . + . + . + . + . + "<p>If you're using 0.0.0.0 for your local server address, try making changes to your vite.config.js file</p>\n<pre><code>export default defineConfig({\n server: {\n host: '0.0.0.0'\n },\n});\n</code></pre>\n<p>Port 8000 is the default Laravel port. Have you tried running php artisan serve without defining the host? I run the same setup on my local computer at the default localhost ip (127.0.0.1) and then set up the port forwarding on the router to point to my local IP (192.168.X.X). Also, try building the project in vite rather than running npm run dev if that is what you are doing.</p>\n"^^ . + . + . + . + "<p>I'm working on a leave/holiday management system.</p>\n<p>As well as booking full days leave/holiday they can book half days (morning or afternoon off).</p>\n<p>I need to calculate the total amount of days during a requested period. 3 and a half days would be presented as 3.5</p>\n<p>To make calculations easier for half days, the maths is based on a day starting at 00:00 and ending at 23:59:59.999999</p>\n<p>I can do this with the following but it doesn't exclude weekends which are counted as part of a users leave quota.</p>\n<pre><code>if($validated['leave_start_day_part'] == 'AM'){\n //Leave starts at the beginning of the day \n $startDate = Carbon::createFromDate($validated['leave_start_date'])-&gt;startOfDay();\n}else{\n //Leave starts midday (half day)\n $startDate = Carbon::createFromDate($validated['leave_start_date'])-&gt;midDay();\n}\n\nif($validated['leave_end_day_part'] == 'AM'){\n //Leave ends at midday (half day)\n $endDate = Carbon::createFromDate($validated['leave_end_date'])-&gt;midDay();\n}else{\n //Leave ends at the end of the day\n $endDate = Carbon::createFromDate($validated['leave_end_date'])-&gt;endOfDay();\n}\n\n$dayCount = $startDate-&gt;copy()-&gt;diffInDays($endDate);\n</code></pre>\n<p>diffInDays returns a float which is perfect but also includes weekend days.</p>\n<p>However if I switch that to the following it returns a whole integer (3.5 is returned as 3)</p>\n<pre><code>$dayCount = $startDate-&gt;copy()-&gt;diffInWeekdays($endDate);\n</code></pre>\n<p>I've considered using diffInDaysFiltered but that also only returns an integer. The decimal is crucial to calculate the total used leave. Is there another method of Carbon that can achieve this and output float or is it time to consider another route?</p>\n"^^ . + . + . + "Display Chart.js chart(s) depending on Livewire form submission"^^ . + . + . + . + "3"^^ . + . + . + "API Error: HTTP Error: 202 - {"rejectedDocuments":[{"receiptNumber":"11111","uuid":"12EA4F6A2399445077232FD50FD2E605949D29E30DE02AF5F5EC7A6BF613678C","error":{"message":"Validation Error","target":"12EA4F6A2399445077232FD50FD2E605949D29E30DE02AF5F5EC7A6BF613678C","details":[{"code":"CF440","message":"Valid UUID is required","target":"uuid","propertyPath":"header.uuid"}]}}],"header":{"statusCode":"Success","code":"Success","details":[],"correlationId":"0HNAR040EIOSG:00000002","requestTime":"2025-03-22T09:26:50.9192819Z","responseProcessingTimeInTicks":392660}}"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + . + "0"^^ . + . + . + . + "2"^^ . + "0"^^ . + . + "3"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "symfony"^^ . + . + "4"^^ . + "0"^^ . + "0"^^ . + "<p>Found a nice and easy answer. For laravel 11.x you can just add to the User model and will do the trick</p>\n<pre><code>protected static function boot() {\n parent::boot();\n\n static::deleting(function($user) {\n $user-&gt;projects()-&gt;update(['user_id' =&gt; null]);\n });\n}\n</code></pre>\n"^^ . + . + . + . + . + . + . + "add-filter"^^ . + . + "It is related to Doctrine's Query builder."^^ . + "-1"^^ . + . + "@Aquaholic: *"without any client side scripts that are prone to be manipulated"* - Then you can't use HTML as part of this either (e.g. your `<meta>` tag idea), because HTML is also on the client. You may be artificially limiting yourself to a point where your own requirements are mutually exclusive. If you truly want **no** client-side functionality **at all** then what you have is server-side code waiting for the client to make a request. Which is exactly what you already have now. So what are you looking to change?"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + "Presumably that folder/file is missing, or uploaded in the wrong place. We can't see your environment"^^ . + . + "Perhaps, yes. What are you interested in specifically? What on the linked Q&A material has left you puzzled with what specifically? Also please elaborate for others, it's unclear to me who they are and why they can't comment their own."^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "docker-compose"^^ . + . + . + "array_sum() is internally implemented in C and is most efficient than any loop."^^ . + . + "1"^^ . + "0"^^ . + . + "1"^^ . + "3"^^ . + "0"^^ . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + "<p>Consider this case:</p>\n<pre><code>$que = &quot;aa bb33cc 5.po&quot;;\n$que = preg_replace(&quot;/([^0-9,. ])([0-9,.])/&quot;,&quot;$1 $2&quot;,$que);\n$que = preg_replace(&quot;/([0-9,.])([^0-9,. ])/&quot;,&quot;$1 $2&quot;,$que);\necho $que;\n</code></pre>\n<p>I decided to join these 2 regex into this:</p>\n<pre><code>$que = &quot;aa bb33cc 5.po&quot;;\n$que = preg_replace(&quot;/(?:([^0-9,. ])([0-9,.])|([0-9,.])([^0-9,. ]))/&quot;,&quot;$1 $2$3 $4&quot;,$que);\necho $que;\n</code></pre>\n<p>However the first case returns <code>aa bb 33 cc 5. po</code> and the second returns <code>aa bb 3 3 cc 5 . po</code>. Why? How can I make the second return the same as the first?</p>\n"^^ . + . + "I feel like it's super close, but I can't make some model without database."^^ . + . + "How to choose size/length when creating a Unique Index on a MYSQL table"^^ . + . + "1"^^ . + "1"^^ . + "1"^^ . + . + . + "1"^^ . + . + "0"^^ . + "Yes you absolutely right However, for requests coming from allowed, stateful domains, browsers automatically include cookies. This is where the CSRF token comes in—it acts as a secondary check to ensure that even if cookies are sent automatically, the request was genuinely initiated from your own frontend. Essentially, while SANCTUM_STATEFUL_DOMAINS protects against cross-domain cookie sharing, the CSRF token secures stateful requests from potential forgery within those trusted domains."^^ . + . + . + . + . + . + "With the `path` argument you can specify which URL path a cookie is valid for, so you could try and set a session cookie with different settings specifically for those."^^ . + "<p>I see bots accessing print pages in an <a href="https://www.translatum.gr/forum/index.php?topic=501750.0" rel="nofollow noreferrer">SMF forum</a> (bots not respecting robots.txt, the print link is the print icon, penultimate from the right), is there a way to stop them from doing that? For example changing the print link code from plain URL to a JavaScript produced one? This is how the print link is constructed (From theme's Display.template.php file), I guess the <code>?action=printpage;topic=</code> needs to be adapted somehow or the whole string?</p>\n<pre><code>// Build the normal button array.\n.....\n'print' =&gt; array('text' =&gt; 'print', 'image' =&gt; 'print.gif', 'lang' =&gt; true, 'custom' =&gt; 'rel=&quot;new_win nofollow&quot;', 'url' =&gt; $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),\n );\n</code></pre>\n"^^ . + "How to change shortcode after user interacts with front-end button?"^^ . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + "1"^^ . + "IP address is really not a reliable indicator of the country someone is from"^^ . + "1"^^ . + "0"^^ . + "forms"^^ . + . + "`const new_block_0 = html.getElementById('Article_blocks_0');` Does `new_block_0` have an `interHTML` property when you debug this? And does `block_0` have an `innerHTML` property?"^^ . + . + "@IMSoP Anyway, thanks for the help. Although I think trying to convince someone that there is no problem is one of the many reasons why StackOverflow is dying, and I've seen this approach more than once. But thanks for the answer, it's not something groundbreaking for me, but thanks."^^ . + "Have you tried if you just switch it from .html to .php?"^^ . + . + . + . + . + . + . + "2"^^ . + "<p>Fixed : Thanks to everyone for their help. The correct regex was</p>\n<pre><code>/(.*?)Player &quot;(.*)&quot; \\(DEAD\\)\\ \\(id=(.*) pos=&lt;(.*)&gt;\\)\\[HP: 0\\] hit by Player &quot;(.*)&quot; \\(id=(.*)\\ pos=&lt;(.*)&gt;\\) into (.*)\\((.*)\\) for(.*)damage (.*) with (.*) from (.*)\\s*(.*) | Player &quot;(.*)&quot; \\(DEAD\\) (id=(.*)) (.*) killed by Player/\n</code></pre>\n<p>I ran the above on a larger log file and the returned data was as below</p>\n<pre><code>[0] =&gt; 22:09:04 | Player &quot;GigglingCobra52&quot; (DEAD) (id=BE2ABB8084EEC781014AC8E6B5C88A5A90F855BF pos=&lt;1658.8, 15056.8, 451.4&gt;)[HP: 0] hit by Player &quot;Cogito8434&quot; (id=26DE70CAEF00AE579AF8CA21ED3F1648DB316F1E pos=&lt;1659.4, 14990.8, 441.4&gt;) into Head(0) for 36.7336 damage (Bullet_308WinTracer) with M70 Tundra from 66.7822 meters \n22:09:04 | Player &quot;GigglingCobra52&quot; (DEAD) (id=BE2ABB8084EEC781014AC8E6B5C88A5A90F855BF pos=&lt;1658.8, 15056.8, 451.4&gt;) killed by Player &quot;Cogito8434&quot; (id=26DE70CAEF00AE579AF8CA21ED3F1648DB316F1E pos=&lt;1659.4, 14990.8, 441.4&gt;) with M70 Tundra from 66.7822 meters\n\n[1] =&gt; 22:12:08 | Player &quot;Cogito8434&quot; (DEAD) (id=26DE70CAEF00AE579AF8CA21ED3F1648DB316F1E pos=&lt;1656.3, 15053.1, 444.8&gt;)[HP: 0] hit by Player &quot;GigglingCobra52&quot; (id=BE2ABB8084EEC781014AC8E6B5C88A5A90F855BF pos=&lt;1654.7, 15052.8, 444.8&gt;) into Torso(12) for 29.0213 damage (Bullet_556x45) with M4-A1 from 1.57712 meters \n22:12:08 | Player &quot;Cogito8434&quot; (DEAD) (id=26DE70CAEF00AE579AF8CA21ED3F1648DB316F1E pos=&lt;1656.3, 15053.1, 444.8&gt;) killed by Player &quot;GigglingCobra52&quot; (id=BE2ABB8084EEC781014AC8E6B5C88A5A90F855BF pos=&lt;1654.7, 15052.8, 444.8&gt;) with M4-A1 from 1.57712 meters\n</code></pre>\n<p>I can now use the returned array data and pull info I need. Thanks again for everyone's help in guiding me how to figure this out</p>\n"^^ . + . + "Any update the issue?"^^ . + . + . + . + . + "@ackerchez You're welcome!"^^ . + "1"^^ . + . + . + "<p>I am building a PHP menu and I want to have an array used to define the menu items. The array would be something like this:</p>\n<pre><code>$menuItems = [\n &quot;menu_title&quot; =&gt; [\n &quot;view_type&quot; =&gt; [\n &quot;name&quot; =&gt; &quot;display_name&quot;,\n &quot;url&quot; =&gt; &quot;?p=view_type&amp;t=menu_title&quot;,\n ],\n ],\n];\n</code></pre>\n<p>where &quot;menu_title&quot; and &quot;view_type&quot; would act as keys for the main array and secondary array, but would also act as URL paramenters values. For example:</p>\n<pre><code>$menuItems = [\n &quot;user_accounts&quot; =&gt; [\n &quot;list&quot; =&gt; [\n &quot;name&quot; =&gt; &quot;User list&quot;,\n &quot;url&quot; =&gt; &quot;?p=list&amp;t=user_accounts&quot;,\n ],\n &quot;edit&quot; =&gt; [\n &quot;name&quot; =&gt; &quot;Edit user&quot;,\n &quot;url&quot; =&gt; &quot;?p=edit&amp;t=user_accounts&quot;,\n ],\n ],\n &quot;user_profile&quot; =&gt; [\n &quot;list&quot; =&gt; [\n &quot;name&quot; =&gt; &quot;Profile list&quot;,\n &quot;url&quot; =&gt; &quot;?p=list&amp;t=user_profile&quot;,\n ],\n ],\n];\n</code></pre>\n<p>Is there a way in which I could refrence within the array value it's own key name? Something along the lines of</p>\n<pre><code>$menuItems = [\n &quot;menu_title&quot; =&gt; [\n &quot;view_type&quot; =&gt; [\n &quot;name&quot; =&gt; &quot;display_name&quot;,\n &quot;url&quot; =&gt; &quot;?p=&lt;&lt;name of key holding the key holding this value&gt;&gt;&amp;t=&lt;&lt;name of key holding the key holding the key holding this value&gt;&gt;&quot;,\n ],\n ],\n];\n</code></pre>\n<p>For further context, after defining the array, I use it to define the menu itself with a function:</p>\n<pre><code>$this-&gt;addMenu(&quot;Users&quot;, [\n $menuItems[&quot;user_accounts&quot;][&quot;list&quot;][&quot;name&quot;] =&gt; $menuItems[&quot;user_accounts&quot;][&quot;list&quot;][&quot;url&quot;],\n]);\n</code></pre>\n<p>I know I can use key(), or array_search(), or array_keys() and so on, but everything I've found so far requires me to iterate through the array after its being declared - what I want to achieve is refrencing the key name while the array is built, so that I don't have to needlesly loop through the array just to do this.</p>\n<p>Or I could just go around and define the piece that needs url values while defining the menu itself, or just type the values myself if I'm typing the keynames anyways:</p>\n<pre><code>$this-&gt;addMenu(&quot;Users&quot;, [\n $menuItems[&quot;user_accounts&quot;][&quot;list&quot;][&quot;name&quot;] =&gt; &quot;?p=list&amp;t=user_accounts&quot;,\n]);\n</code></pre>\n<p>But I'm looking for a way to avoid doing that because people other than myself will be using this to define new menu items or edit them and whenever there's an user-input involved, there's bound to be typing errors, or they miss changing the url values and so on. My endgoal would be:</p>\n<ul>\n<li><p>If the user wants to rename a menu item or change the url, they only have to do it in the &quot;main&quot; array, and the change will automatically propagate to the menu generating function</p>\n</li>\n<li><p>If the user defines a new menu item, I only need them to define it's name, view and display name, without them having to pay attention to the url itself</p>\n</li>\n</ul>\n<p>My logic/intuition tells me that's not really possible, as if the array has no been built yet, it's not stored/defined anywhere and the key names are not &quot;mapped&quot; - is there a way I am wrong and this is actually achievable?</p>\n"^^ . + . + "To challenge the question more directly: is there actually an observed problem with the current situation, or are you just _assuming_ that a large number of files is "bad" in some way?"^^ . + . + "<p>your &quot;random name substitution&quot; analogy is close, but the key is that the &quot;name&quot; is tied to the location of the new class expression in the code.</p>\n<p>To generate truly distinct anonymous classes with identical structure but different names (and thus pass your <code>::class</code> check), you need to generate the definition itself dynamically.</p>\n"^^ . + . + . + . + . + . + . + "1"^^ . + "<p>Do composer installation instead of manual</p>\n<p><code>composer update mpdf/mpdf</code></p>\n<p>Try to Install PSR Log as well.</p>\n<p><code>composer require psr/log</code></p>\n<p>I hope it will help.</p>\n<blockquote>\n<p>I advise you not to modify any code in the vendor files until required.</p>\n</blockquote>\n"^^ . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + "Thanks for the response. I was able to fix it. There was a Java code at the bottom which removes disabled attributes. I added the field to that list: document.querySelector('select[name="followup"]').removeAttribute('disabled'); I had not seen the Java Code."^^ . + . + "spl-autoload-register"^^ . + "Not to mention that, contrary to the initial title, the $browser_user_agent = $_SERVER['HTTP_USER_AGENT']; line actally works, while the problem is in having the word Mobile in the result"^^ . + . + "Failed to Generate UUID for ETX Receipt php"^^ . + "1"^^ . + . + "extends"^^ . + . + . + "You suppress error messages, most often they already show where changes are applied during loading. Not helpful while asking the question. And then as has been pointed out, you should provide a [mre] in your question so that your specific question becomes more clear. Using a document abstraction when you ask how to prevent that in the first place generically is kind of a very bad way to ask as you are painting yourself into a corner already (probably an x/y problem here?) Checkout the Tidy library it has a more basic node abstraction (but may modify as well)."^^ . + . + . + . + "How to Remove the Closing Slash from Meta and Link Tags in WordPress (Astra Theme)"^^ . + . + "0"^^ . + "0"^^ . + . + "amazon-elasticache"^^ . + . + . + "Yes, the patterns are equivalent. TheFourthBird and I have known the beauty of the fullstring match meta character and lookarounds for many years. The patterns are functionally the same, the difference is that I am advising the most direct PHP function for the task. `preg_split()` creates an array which must be imploded. `preg_replace()` simply injects delimiting spaces into the input string. `preg_replace()` just makes the most sense."^^ . + "0"^^ . + "Intermittent Deprecation Warnings After Upgrading to PHP 8.4"^^ . + "1"^^ . + . + . + "Please do not add answers to the question. If you found a solution you want to share, post it as an answer."^^ . + "<p>Using laravel in xampp by pointing URL's to public/ is not a good practice. It would create a lot of issues when you need to move to server.</p>\n<p>You should either create a virtual host for the same or use <code>php artisan serve</code>.</p>\n<p>And then replace your action to <code>{{ route('register') }}</code> as mentioned by <a href="https://stackoverflow.com/a/79470153/21264067">Marcello</a> or use <code>{{ url('register') }}</code></p>\n"^^ . + . + . + . + . + "Changing the custom post type URL to use a custom taxonomy"^^ . + "1"^^ . + . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + "0"^^ . + "<p>In my Laravel project, I'm successfully tracking frontend events using the JavaScript code <code>fbq('track', 'PageView')</code>, which works well for tracking page views.</p>\n<p>However, when attempting to use the <code>MetaPixel::track()</code> method within a Laravel controller, I used the following code:</p>\n<pre><code>use Combindma\\FacebookPixel\\Facades\\MetaPixel;\nMetaPixel::track('SignIn', [\n 'User_Email' =&gt; $customer-&gt;email,\n 'Status' =&gt; 'logged in successfully'\n]);\n</code></pre>\n<p>Despite installing all the necessary dependencies and adding the required code in the config file, the event tracking does not seem to function as expected.</p>\n<pre><code>&lt;?php\n\nreturn [\n /*\n * The Meta pixel id, should be a code that looks something like &quot;1202417153106158&quot;.\n */\n 'pixel_id' =&gt; env('META_PIXEL_ID', ''),\n\n /*\n * The key under which data is saved to the session with flash.\n */\n 'session_key' =&gt; env('META_PIXEL_SESSION_KEY', config('app.name').'_metaPixel'),\n\n /*\n * Only if you plan using Conversions API for server events\n * To use the Conversions API, you need an access token. For Documentation please see: https://developers.facebook.com/docs/marketing-api/conversions-api/get-started\n */\n 'token' =&gt; env('META_PIXEL_TOKEN', ''),\n\n /*\n * Enable or disable advanced matching. Useful for adjusting user privacy.\n */\n 'advanced_matching_enabled' =&gt; env('META_PIXEL_ADVANCED_MATCHING_ENABLED', true),\n\n /*\n * Enable or disable script rendering. Useful for local development.\n */\n 'enabled' =&gt; env('META_PIXEL_ENABLED', true),\n\n /*\n * Enable or disable logging. Useful for debugging.\n */\n 'logging' =&gt; env('META_PIXEL_LOGGING', true),\n\n /*\n * This is used to test server events\n */\n 'test_event_code' =&gt; env('META_TEST_EVENT_CODE'),\n];\n</code></pre>\n<p>Can anyone help me out, so that i can track my events in laravel</p>\n"^^ . + . + "multibyte"^^ . + . + "0"^^ . + "1"^^ . + "0"^^ . + "openswoole"^^ . + "Redirects to the “Thank you” page depending on the selected language in WordPress"^^ . + . + . + "0"^^ . + . + "Can't see anything wrong with the shown snippet, or the DOM inspector view. Needs more context - are you submitting a form the normal way here, or via JavaScript? Is the element actually part of a form to begin with? (It might not be, if you have errors in your HTML structure.)"^^ . + . + . + . + "1"^^ . + . + "<p>Suppose I have a static callable like <code>\\Foo::bar</code>.</p>\n<p>I can assign this to a variable like this and then call it:</p>\n<pre><code>$myCallable = \\Foo::class . '::bar';\n// This works.\n$myCallable('calling this works!');\n</code></pre>\n<p>But if I assign it to a static class property like this:</p>\n<pre><code>class MyClass {\n\n function myFunc() {\n static::$myCallable = \\Foo::class . '::bar';\n\n static::$myCallable('this does not work');\n }\n\n}\n</code></pre>\n<p>it fails, because it tries to call <code>MyClass::Foo::bar()</code>.</p>\n<p>Is there a way to fix this, other than using <code>call_user_func()</code>?</p>\n"^^ . + . + "0"^^ . + . + . + "Do this test without a database... My guess is, that the underlying db client library caches the result set."^^ . + . + . + . + "ini"^^ . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + "how to disable select component on filament 3.x based on user login"^^ . + "mod-security"^^ . + . + . + "-1"^^ . + "<p>Please note that I am not a Python/PHP expert but I need to solve C++ to PHP case on overloaded constructors.</p>\n<p>I have C++ code like:</p>\n<pre class="lang-cpp prettyprint-override"><code>enum Enum_Foo {\n Foo_A.\n Foo_B,\n Foo_C\n};\n\nenum Enum_Bar {\n Bar_A.\n Bar_B,\n Bar_C\n};\n\nclass Creator\n{\npublic:\n Creator();\n Creator(Enum_Foo);\n Creator(Enum_Bar);\n};\n</code></pre>\n<p>SWIG complains on overloaded methods and it is ok. Recomendation is to use <code>%rename</code> for the second method (constructor) and I do that as:</p>\n<p><code>Python.i</code>:</p>\n<pre class="lang-none prettyprint-override"><code>%rename (CreatorFromBar) Creator::Creator(Enum_Bar);\n</code></pre>\n<p>The Python result is a function (reworked a bit from original):</p>\n<pre class="lang-py prettyprint-override"><code>def CreatorFromBar(in_enum_bar):\n val = _SomeNamespacePython.new_CreatorFromBar(in_enum_bar)\n return val\n</code></pre>\n<p>which could be used in final Python code as:</p>\n<pre class="lang-py prettyprint-override"><code> bar = Enum_Bar.Bar_A\n creator = CreatorFromBar(bar)\n</code></pre>\n<p>But PHP is a different case:</p>\n<p><code>PHP.i</code>:</p>\n<pre class="lang-none prettyprint-override"><code>%rename (CreateFromBar) Creator::Creator(Enum_Bar);\n</code></pre>\n<p>The PHP result is a class method (reworked a bit from original):</p>\n<pre class="lang-php prettyprint-override"><code>class Creator {\n ...\n function CreateFromBar($in_enum_bar_type) {\n ...\n return new Creator(new_CreateFromBar($in_enum_bar_type));\n }\n ...\n}\n</code></pre>\n<p>which could be used in final PHP code <strong>only</strong> as:</p>\n<pre class="lang-php prettyprint-override"><code> $enum_bar = Enum_Bar::Bar_A;\n $dummy = new Creator();\n $correct = $dummy-&gt;CreatorFromBar($enum_bar);\n</code></pre>\n<p>If the SWIG result was with <code>static</code> qualifier - it would be called as:</p>\n<pre class="lang-php prettyprint-override"><code> $enum_bar = Enum_Bar::Bar_A;\n $correct = Creator::CreatorFromBar($enum_bar);\n</code></pre>\n<p><strong>Questions</strong>:</p>\n<ul>\n<li>Is there any way to force <code>static</code> in front of PHP function SWIG result?</li>\n<li>Is there any other way to avoid <code>dummy</code> instance?</li>\n</ul>\n"^^ . + "<p>I'm trying to show related news inside one news object - I've gotten probably halfway there, but I'm stuck where I need to remove duplicates.</p>\n<pre><code>&lt;f:for each=&quot;{newsItem.related}&quot; as=&quot;related&quot;&gt;\n &lt;f:link.page pageUid=&quot;{related.pid}&quot; class=&quot;mt-2 fsrem13 col-12 link fw-bold text-decoration-none lh-sm d-flex align-items-center&quot;&gt;\n &lt;f:cObject typoscriptObjectPath=&quot;lib.pageInfo&quot; data=&quot;{pageUid: '{related.pid}', pageField: 'title'}&quot; /&gt;\n &lt;i class=&quot;bi bi-box-arrow-in-right fs22 ms-1 d-flex&quot;&gt;&lt;/i&gt;\n &lt;/f:link.page&gt;\n&lt;/f:for&gt;\n</code></pre>\n<p>In the docs, I found that I could use a custom hook for this - so I added the fol</p>\n<pre><code>$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['Domain/Repository/AbstractDemandedRepository.php']['findDemanded'][$_EXTKEY] = \\REDACTED\\NewsExtended\\Hooks\\Repository::class . '-&gt;modify';\n</code></pre>\n<p>And in the Repository.php:</p>\n<pre><code>namespace REDACTED\\NewsExtended\\Hooks;\n\nuse TYPO3\\CMS\\Core\\Utility\\GeneralUtility;\nuse \\GeorgRinger\\News\\Domain\\Repository\\NewsRepository;\n\nclass Repository\n{\n public function modify(array $params, NewsRepository $newsRepository)\n {\n $this-&gt;updateConstraints($params['demand'], $params['respectEnableFields'], $params['query'], $params['constraints']);\n }\n\n /**\n * @param \\GeorgRinger\\News\\Domain\\Model\\Dto\\NewsDemand $demand\n * @param bool $respectEnableFields\n * @param \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface $query\n * @param array $constraints\n */\n protected function updateConstraints($demand, $respectEnableFields, \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface $query, array &amp;$constraints)\n {\n //$constraints[] = $query-&gt;like('title', '%' . $subject . '%');\n //$constraints[] = $query-&gt;equals('related', 0);\n //echo $query-&gt;matching($query-&gt;contains('likedPosts', $post))-&gt;count(); \n }\n}\n</code></pre>\n<p>I'm having trouble setting constraints here. I want to filter, so in all places, news that have <code>relatedfrom</code> set, are not shown. For some reason, <code>relatedfrom</code> is empty in the database, but in TYPO3 I can freely loop through it.\nI've through about just using javascript and remove them, but that would break pagination.</p>\n<p>Do I have to build a custom controller? If yes - I can't find any way, how I could just &quot;extend&quot; the existing one (e.g. the extended controller would just call the paren't methods and modify the output if required).</p>\n"^^ . + "1"^^ . + "[mbstring is a non-default extension. This means it is not enabled by default. You must explicitly enable the module with the configure option.](https://www.php.net/manual/en/mbstring.installation.php) It seems like you tried that, but it didn't work. Why? I can't tell. Did you restart Apache/PHP?"^^ . + . + "Need help lazy loading pagination by using twitter typehead library"^^ . + . + . + "1"^^ . + . + . + "_"However, when arrays are passed as function arguments, trailing commas cause a syntax error in versions prior to PHP 7.3."_ This is not true. Trailing commas are allowed in array definitions regardless of context."^^ . + . + "@Hoang so I don't understand the solution, what am I supposed to put as a APP_URL in a dev environment?"^^ . + . + "You've shown the query, but you haven't shown the PHP code that builds and runs that query. I would guess you're not using query parameters, and your `LIKE` pattern contains a single-quote."^^ . + . + . + "0"^^ . + . + "How can I disable the “Linking and Embedding” feature of Wordpress REST API?"^^ . + . + . + "0"^^ . + . + "-3"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + "This worked until i installed the 5.1 version now it gets the script error again."^^ . + . + . + "<p>There is no direct way to achieve this in DomPDF, but you can try alternative techniques. However, they may not be effective if the images change frequently.</p>\n<pre><code>&lt;div style=&quot;position: relative; width: 250px; height: auto;&quot;&gt;\n&lt;img\n src=&quot;path/to/soft-shadow.png&quot;\n style=&quot;\n position: absolute;\n top: 0;\n left: 0;\n width: 250px;\n height: 200px;\n &quot;\n alt=&quot;&quot;\n/&gt;\n&lt;img\n src=&quot;path/to/main-image.jpg&quot;\n style=&quot;\n position: relative;\n width: 250px;\n height: 200px;\n &quot;\n alt=&quot;&quot;\n/&gt;\n</code></pre>\n\n"^^ . + . + "1"^^ . + . + . + . + . + . + . + "Yajra not making ajax call and not rendering any data"^^ . + "0"^^ . + "Please make sure that your code before and after your "echo json_encode" line outputs **NOTHING**. json_encode always return valid JSON (unless there is bug in PHP core library), so this is unlikely the problem."^^ . + . + "1"^^ . + . + . + . + . + . + "@IMSoP I currently have no problem with this and do not assume that there will ever be a problem with this. I consider it more "academically". Although it seems reasonable to imagine that this project will exceed 10 mb, which may be important for some client, why use a 10mb package if the real value that is needed is 40kb."^^ . + "0"^^ . + "Issue after Upgrading to Laravel 11: Undefined array key “driver”"^^ . + . + . + . + . + "Looks like this is part of a WordPress system? Then you should mention that / appropriately _tag_ the question."^^ . + . + "0"^^ . + . + . + . + "The code I shared uses your `$platenumber` in the path, as you said in your question. Did you try the code I shared? What did it do?"^^ . + . + . + . + . + "-2"^^ . + . + . + . + . + . + . + "<p>I created a form and I want to handle the hook hookDisplayAdminProductsMainStepLeftColumnMiddle directly from the controller in /controllers/admin/AjaxSeoScore.php. The view to be displayed is located in /views/templates/admin/test.tpl</p>\n<pre><code> public function hookDisplayAdminProductsMainStepLeftColumnMiddle($params)\n{\n $controller = new AdminAjaxSeoScore();\n return $controller-&gt;display();\n} \n</code></pre>\n<p>and then my controller</p>\n<pre><code>class AdminAjaxSeoScore extends ModuleAdminController\n{\n public function __construct()\n {\n // Chiamata al costruttore della classe base\n parent::__construct();\n\n // Setta il template per la visualizzazione\n $this-&gt;template = 'seoscore_header.tpl';\n }\n\n // Funzione per la visualizzazione dell'hook\n public function display()\n {\n // Aggiungi variabili da passare al template se necessario\n $this-&gt;context-&gt;smarty-&gt;assign(array(\n 'some_variable' =&gt; 'Some value', // Esempio di variabile da assegnare\n ));\n\n // Visualizza il template\n parent::display();\n }\n} \n</code></pre>\n<p>Is this the correct way to work? I can't visualize anything. How do I pass for example the product id to the controller?</p>\n"^^ . + . + . + . + . + . + . + "<p>I'm trying to install the moodle cms on debian12 and php8.2.</p>\n<p>I have followed the official guide.</p>\n<p>I'm trying to set the variable <code>max_input_vars</code> to the value of 5000 editing the system php.ini file at the path <code>/etc/php/apache2/php.ini</code> but both the OS and moodle read the default value of 1000.</p>\n<p>I checked that i'm using the right ini file using the phpinfo function\nI rebooted apache service after editing the php.ini file\nI checked typos and if the line was duplicated or commented out</p>\n<p>Neither moodle nor the OS do recognize the changes i made.</p>\n<p>Any idea on how i can let moodle or the system read mine value and no the default one?\nThanks</p>\n"^^ . + "0"^^ . + . + . + "It turns out proc_open() does respect the changes made with posix_setuid() but does not respect changes made with posix_seteuid().\n\nI consider this a security bug, but perhaps someone could tell me otherwise."^^ . + "<p>I'm working on a PHP project where we want to ensure that all include, require, include_once, and require_once statements use the <em>__DIR</em>__ constant for path resolution.</p>\n<p>I couldn’t find an existing sniff that enforces this rule, so I decided to write my own.</p>\n<hr />\n<h3>1. Creating the Custom Sniff File</h3>\n<p>First, create a file that defines your custom sniff. In my project, I placed it in a folder named <code>_dev</code> (which I later exclude from production). I named the file <code>IncludeUsingDirSniff.php</code> and used the namespace <code>MyCustom</code>.</p>\n<p>Below is the code for the custom sniff:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php declare(strict_types=1);\n\nnamespace MyCustom;\n\nuse PHP_CodeSniffer\\Files\\File;\nuse PHP_CodeSniffer\\Sniffs\\Sniff;\n\n/**\n * Checks that all require/require_once/include/include_once statements use __DIR__ for file paths.\n *\n * Correct usage:\n * require_once __DIR__ . '/../settings.php';\n */\nclass IncludeUsingDirSniff implements Sniff\n{\n /**\n * Returns an array of token types that this sniff is interested in.\n *\n * @return int[]\n */\n public function register(): array\n {\n return [\n T_REQUIRE,\n T_REQUIRE_ONCE,\n T_INCLUDE,\n T_INCLUDE_ONCE,\n ];\n }\n\n /**\n * Processes the token.\n *\n * Iterates over all tokens of the statement to check if &quot;__DIR__&quot; is present.\n *\n * @param File $phpcsFile The file being scanned.\n * @param int $stackPtr The position of the token in the token stack.\n *\n * @return void\n */\n public function process(File $phpcsFile, $stackPtr): void\n {\n $tokens = $phpcsFile-&gt;getTokens();\n\n // Determine the end of the current statement (typically until the semicolon)\n $end = $phpcsFile-&gt;findEndOfStatement($stackPtr);\n if ($end === false) {\n $end = count($tokens) - 1;\n }\n\n $foundDir = false;\n for ($i = $stackPtr; $i &lt;= $end; $i++) {\n if (strpos($tokens[$i]['content'], '__DIR__') !== false) {\n $foundDir = true;\n break;\n }\n }\n\n if (!$foundDir) {\n $error = 'The %s statement must use __DIR__ for the file path.';\n $phpcsFile-&gt;addError(sprintf($error, $tokens[$stackPtr]['content']), $stackPtr, 'MissingDirUsage');\n }\n }\n}\n</code></pre>\n<hr />\n<h3>2. Setting Up the Ruleset</h3>\n<p>To ensure that PHP CodeSniffer uses my custom sniff, I added a ruleset that explicitly loads my sniff file. I created a ruleset file (e.g., <code>phpcs.xml</code>) in the project root with the following content:</p>\n<pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;ruleset name=&quot;Custom Coding Standard&quot;&gt;\n &lt;description&gt;\n My Stuff\n &lt;/description&gt;\n\n &lt;!-- the important 2 lines --&gt;\n &lt;config name=&quot;sniffPaths&quot; value=&quot;/var/www/buero/_dev&quot; /&gt;\n &lt;file name=&quot;/var/www/buero/_dev/IncludeUsingDirSniff.php&quot;/&gt;\n\n\n &lt;rule ref=&quot;PSR12&quot;&gt;\n &lt;exclude name=&quot;Generic.WhiteSpace.DisallowTabIndent&quot;/&gt;\n &lt;exclude name=&quot;Generic.ControlStructures.InlineControlStructure&quot;/&gt;\n &lt;/rule&gt;\n &lt;arg name=&quot;tab-width&quot; value=&quot;4&quot;/&gt;\n\n\n &lt;rule ref=&quot;Generic.PHP.ForbiddenFunctions&quot;&gt;\n &lt;properties&gt;\n &lt;property name=&quot;forbiddenFunctions&quot; type=&quot;array&quot;&gt;\n &lt;element key=&quot;var_dump&quot; value=&quot;true&quot;/&gt;\n &lt;element key=&quot;print_r&quot; value=&quot;true&quot;/&gt;\n &lt;element key=&quot;echo&quot; value=&quot;true&quot;/&gt;\n &lt;/property&gt;\n &lt;/properties&gt;\n &lt;/rule&gt;\n&lt;/ruleset&gt;\n</code></pre>\n<p><strong>Key Points:</strong></p>\n<hr />\n<h3>3. Running PHP CodeSniffer</h3>\n<p>Now, when running PHP CodeSniffer from the project root:</p>\n<pre class="lang-bash prettyprint-override"><code>$phpcs --standard=_dev/phpcs.xml /var/www/buero\nERROR: Referenced sniff &quot;MyCustom.IncludeUsingDirSniff&quot; does not exist\n</code></pre>\n<p>What am I doing wrong?</p>\n"^^ . + . + "`How would i fix this`...by doing what the error message tells you. You need to pass in an actual PDO connection _object_ (i.e. the result of a `new PDO...` command, to create a database connection), instead of a _string_ containing the word "pdo". And I'd guess that somewhere in your `db.inc.php` code is hopefully some code which creates that connection already, so all you have to do is use it."^^ . + . + . + . + "0"^^ . + . + . + "bitbucket"^^ . + . + . + . + "Hi Michael Sivolobov,\n\nThanks for your suggestions. I tried both approaches, but I still encountered issues:\n\nWith the first solution, I got this error:\n\nInvalid service "Symfony\\Component\\AssetMapper\\ImportMap\\HttpClient\\PackageDownloader": class "Symfony\\Component\\AssetMapper\\ImportMap\\HttpClient\\PackageDownloader" does not exist.\n\nI’m aiming to integrate FilePond locally (i.e., without relying on a CDN). Could it be that I’ve missed a configuration step or perhaps used the wrong namespace? Any pointers on what might be wrong with my setup ?\n\nThanks in advance for your help."^^ . + . + . + . + . + . + . + . + "<p>I am building a webpage through Azures web app in WordPress. I want to have one of my pages allow the user to upload a file, that file go to a python script which returns and image based on that file back to WordPress for the user to see.</p>\n<p>Through mcuh trial and error I am now attempting to use webjobs for this since the python file takes awhile to run. I am very new to azure and web development as my main domain is data science so please be patient.</p>\n<p>I am running this on my page to pull the file and access webjob functions -</p>\n<pre><code>&lt;!-- wp:html --&gt;\n&lt;form id=&quot;webjob-form&quot; enctype=&quot;multipart/form-data&quot;&gt;\n&lt;input type=&quot;file&quot; id=&quot;file&quot; name=&quot;file&quot; required&gt;\n&lt;button type=&quot;submit&quot;&gt;Run WebJob&lt;/button&gt;\n&lt;/form&gt;\n\n&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;\n&lt;img id=&quot;stitched-image&quot; style=&quot;max-width: 100%; display: none;&quot; /&gt;\n\n&lt;script&gt;\ndocument.getElementById('webjob-form').addEventListener('submit', async (e) =&gt; {\ne.preventDefault();\n\nconst formData = new FormData();\nformData.append('file', document.getElementById('file').files[0]);\n\nconst response = await fetch('&lt;?php echo admin_url('admin-ajax.php? \naction=trigger_webjob'); ?&gt;', {\n method: 'POST',\n body: formData\n});\n\nconst result = await response.json();\n\nif (result.success) {\n // Display output or stitched image\n const imageUrl = result.data.match(/https:\\/\\/[^\\s]+/)[0]; // Extract URL from \nresponse\n document.getElementById('stitched-image').src = imageUrl;\n document.getElementById('stitched-image').style.display = 'block';\n} else {\n document.getElementById('output').innerHTML = `&lt;pre style=&quot;color: red;&quot;&gt;Failed: ${result.data}&lt;/pre&gt;`;\n}\n});\n&lt;/script&gt;\n</code></pre>\n<p>The in my functions.php File in theme editor I have -</p>\n<pre><code>function trigger_webjob_with_file() {\nif (isset($_FILES['file'])) {\n $file = $_FILES['file'];\n $upload_dir = wp_upload_dir()['path'];\n if (!file_exists($upload_dir)) {\n mkdir($upload_dir, 0755, true);\n}\n $file_path = $upload_dir . '/' . basename($file['name']);\n \n if (move_uploaded_file($file['tmp_name'], $file_path)) {\n $url = \n'https://omitted.scm.azurewebsites.net/api/triggeredwebjobs/StitchImages/run';\n $username = 'omitted';\n $password = 'omitted';\n\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_USERPWD, &quot;$username:$password&quot;);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, array(\n 'file' =&gt; curl_file_create($file_path)\n ));\n\n $response = curl_exec($curl);\n $error = curl_error($curl);\n curl_close($curl);\n\n if ($error) {\n wp_send_json_error(&quot;Error triggering WebJob: $error&quot;);\n } else {\n wp_send_json_success($response); // Return WebJob output to JS\n }\n } else {\n wp_send_json_error('Failed to upload file');\n }\n }\n}\n\nadd_action('wp_ajax_trigger_webjob', 'trigger_webjob_with_file');\nadd_action('wp_ajax_nopriv_trigger_webjob', 'trigger_webjob_with_file');\n</code></pre>\n<p>I am not going to include my python script but it is ran with a shell file that just says</p>\n<pre><code>#!/bin/bash\npython3 stitchImages.py &quot;$1&quot;\n</code></pre>\n<p>and for full context of what the python script provides the file ends with -</p>\n<pre><code>if status == cv2.Stitcher_OK:\n\n\nprint(&quot;Stitching successful!&quot;)\noutput_filename = &quot;stitched_image.png&quot;\nwp_uploads_folder = os.path.join(os.getcwd(), 'wp-content', 'uploads')\nif not os.path.exists(wp_uploads_folder):\n os.makedirs(wp_uploads_folder)\n\noutput_path = os.path.join(wp_uploads_folder, output_filename)\ncv2.imwrite(output_path, cv2.cvtColor(stitched_image_rgb, cv2.COLOR_RGB2BGR))\n\n# Return the URL instead of file path\noutput_url = f&quot;https://omitted.azurewebsites.net/wp-content/uploads/{output_filename}&quot;\nprint(f&quot;Stitched image URL: {output_url}&quot;)\n</code></pre>\n<p>When I click the Run WebJobs button on the page it loads for a few seconds then just returns back to its original page with nothing uplaoded. Azure has no logged webjob triggers or errors.</p>\n<p>Any Suggestions or spotted errors? I am open to maneuvering this another way if something makes more logical sense as I do want my sight to be usable and make some type of sense if another engineer were to look at its makeup. Again new to azure and wordpress so forgive me if this makes no sense.</p>\n"^^ . + . + . + "<blockquote>\n<p>Is it possible to convert full XML code to array in PHP?</p>\n</blockquote>\n<p>Yes, it is, but mind that SimpleXMLElement already provides ArrayAccess so there is normally no need to do that as it has already been implemented. And for recursive traversal there is SimpleXMLIterator and RecursiveIteratorIterator.</p>\n<p>And for SimpleXML to JSON there is a three-part series on my blog.</p>\n<p>It is a bit dated but towards the end it is discussing writing custom replacers via JsonSerializable.</p>\n<p>As outlined, when we go more towards the leaf-nodes, SimpleXMLElement does some common tree normalization and therefore tends to shortcut attributes from time to time. Or even element names.</p>\n<p>The following is an example that merges attributes onto the object itself and puts the node-text on a property named as the element if necessary then. Only as a last resort creates tagged objects. That keeps the output dense:</p>\n<pre><code>$sxml = new class ($xmlString) extends SimpleXMLElement implements JsonSerializable\n{\n public function jsonSerialize(): mixed\n {\n $name = $this-&gt;getName();\n $attributes = iterator_to_array($this-&gt;attributes());\n $count = $this-&gt;count();\n $named = iterator_to_array($this);\n $names = count($named);\n $list = iterator_to_array($this, false);\n\n return match (true)\n {\n !$attributes =&gt; match (true)\n {\n !$count =&gt; (string)$this,\n 1 === $count,\n $names === $count =&gt; $named,\n 1 === $names =&gt; $list,\n default =&gt; array_map(fn($tag) =&gt; [$tag-&gt;getName() =&gt; $tag], $list)\n },\n !$count =&gt; $attributes + [$name =&gt; (string)$this],\n 1 === $count =&gt; $attributes + $named,\n default =&gt; $this,\n };\n }\n};\n\necho json_encode($sxml, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES), &quot;\\n&quot;;\n</code></pre>\n<pre class="lang-json prettyprint-override"><code>{\n &quot;header&quot;: {\n &quot;information&quot;: &quot;Example information&quot;,\n &quot;agency&quot;: &quot;1@test.uk&quot;,\n &quot;date&quot;: &quot;2025-03-19 16:13:44&quot;,\n &quot;version&quot;: &quot;0.4&quot;,\n &quot;path&quot;: &quot;mail@mail.uk&quot;,\n &quot;value&quot;: &quot;full&quot;\n },\n &quot;offers_list&quot;: {\n &quot;department&quot;: {\n &quot;tab&quot;: &quot;local&quot;,\n &quot;type&quot;: &quot;sell&quot;,\n &quot;offert&quot;: {\n &quot;param&quot;: {\n &quot;name&quot;: &quot;id&quot;,\n &quot;param&quot;: &quot;445/443/TS&quot;\n },\n &quot;location&quot;: [\n {\n &quot;level&quot;: &quot;1&quot;,\n &quot;area&quot;: &quot;UK&quot;\n },\n {\n &quot;level&quot;: &quot;2&quot;,\n &quot;area&quot;: &quot;ON&quot;\n },\n {\n &quot;level&quot;: &quot;3&quot;,\n &quot;area&quot;: &quot;PIN&quot;\n },\n {\n &quot;level&quot;: &quot;4&quot;,\n &quot;area&quot;: &quot;As&quot;\n },\n {\n &quot;level&quot;: &quot;5&quot;,\n &quot;area&quot;: &quot;Ord&quot;\n }\n ],\n &quot;price&quot;: {\n &quot;currency&quot;: &quot;USD&quot;,\n &quot;price&quot;: &quot;1059000.00&quot;\n },\n &quot;n_geo_y&quot;: &quot;51.1894791&quot;,\n &quot;n_geo_x&quot;: &quot;19.9072292&quot;,\n &quot;street&quot;: &quot;Example&quot;\n }\n }\n }\n}\n</code></pre>\n"^^ . + "1"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "Also you still didn't actually explain what problem/error you're trying to solve."^^ . + . + . + . + "0"^^ . + "<p>I'm creating a symfony bundle that integrate another library into Symfony, by tagging some classes and loading the library translations.<br />\nThis bundle is a composer package that requires another package (<code>axi/mycalendar</code>).</p>\n<p>It works but I'm aware that <code>/vendor</code> dir shouldn't be hardcoded as it can be changed by composer property <a href="https://getcomposer.org/doc/06-config.md#vendor-dir" rel="nofollow noreferrer">vendor-dir</a>.</p>\n<p>How can I can ensure / find the proper vendor dir ?<br />\nI was thinking about parsing the main <code>composer.json</code> file but it feels dirty.</p>\n<p>PS: <code>axi/mycalendar</code> is psr-4 autoloaded by composer</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nnamespace Axi\\MyBundle;\n\nuse Symfony\\Component\\DependencyInjection\\ContainerBuilder;\nuse Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;\nuse Symfony\\Component\\HttpKernel\\Bundle\\AbstractBundle;\n\nclass MyBundle extends AbstractBundle\n{\n public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void\n {\n // Declare vendor recipes to Sf\n $container-&gt;services()-&gt;load(\n 'Axi\\\\MyCalendar\\\\Recipe\\\\',\n '%kernel.project_dir%/vendor/axi/mycalendar/src/Recipe/*'\n )-&gt;autoconfigure();\n\n // more code ...\n }\n\n public function prependExtension(ContainerConfigurator $container, ContainerBuilder $builder): void\n {\n // Add library translation path to translator pathes\n $builder-&gt;prependExtensionConfig(\n 'framework',\n [\n 'translator' =&gt; [\n 'paths' =&gt; [\n '%kernel.project_dir%/vendor/axi/mycalendar/translations',\n ],\n ],\n ]\n );\n }\n}\n</code></pre>\n"^^ . + "The third row looks like the HTML entity."^^ . + . + . + . + "3"^^ . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + "2"^^ . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + "2"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + . + "I have tried <img src="/wp-content/uploads/myimage.png" alt="">, too. It doesn't work."^^ . + "<p>Someone submits a text field on my website and their submission is stored in my mysql database. Their comment contains an emoji character. If I store the comment as is, it will be stored as an html entity, such as <code>&amp;#128512;</code>.</p>\n<p>I read in another post that you should not convert special characters to html entities when storing them in your mysql database. But how about the opposite: are special characters so preferable to html entities that I should take the extra step and convert the visitor's comment from an html entity to a special character before storing it in the database?</p>\n<p>EDIT: In case anyone is interested, the reason the emoji characters were being submitted as html entities is that my html page lacked the correct charset setting. Once I set its charset to utf-8, emojis started to get stored as is, rendering my entire question moot.</p>\n"^^ . + . + "0"^^ . + . + . + . + . + . + . + "More about the different authentication methods: https://docs.x.com/resources/fundamentals/authentication/oauth-2-0/overview and https://docs.x.com/resources/fundamentals/authentication/oauth-1-0a/api-key-and-secret . API authentication reference: https://docs.x.com/resources/fundamentals/authentication/api-reference"^^ . + "3"^^ . + . + . + "0"^^ . + . + . + . + . + . + "hubleto"^^ . + . + . + . + . + . + . + . + . + "https://stackoverflow.com/questions/79443441/windows-11-curl-35-schannel-next-initializesecuritycontext-failed-crypt-e-n"^^ . + . + . + . + . + . + "1"^^ . + . + . + "<p>I've successfully managed to do it ,</p>\n<pre><code>-&gt;assertScript('window.fbq.queue.length === 0'); //assumes that no fb events are pending\n</code></pre>\n<p>When user successfully register, a pixel event is fired.</p>\n<pre><code>fbq('track', 'Lead', {}, {eventID})\n</code></pre>\n<p>My task was to write a test case in laravel dusk for this event that, it is actually dispatches or not when user registers.</p>\n<p>You can also check that fbq is actually exists or not</p>\n<pre><code>$fbqExists = $browser-&gt;script('return typeof window.fbq !== &quot;undefined&quot;');\n</code></pre>\n"^^ . + . + . + . + . + . + "Just FYI there's no official support from Micrsoft for PHP on IIS anymore (since PHP 8), so if you have uncovered a bug in the integration with IIS (as opposed to something in your own code) the chances of anyone fixing it are probably quite low"^^ . + . + . + . + . + . + . + "Is there a reason why you are trying to link against a static `libz` to begin with?"^^ . + . + . + . + "Thank you so much! This was driving me nuts!"^^ . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + "1"^^ . + "0"^^ . + "docker"^^ . + . + . + . + . + "0"^^ . + . + . + "<p>Presuming you've checked similar questions and they didn't solve the problem. Check if your system clock is correct and in the right timezone - SSL will fail if the clock is incorrect.</p>\n<p>Similar questions:</p>\n<p><a href="https://stackoverflow.com/questions/79471736/composer-is-not-install-in-windows-11-and-php-8-2-12">Composer is not install in Windows 11 and PHP 8.2.12</a></p>\n<p><a href="https://stackoverflow.com/questions/55857565/cant-install-composer-error-in-install-already-try-several-solutions">Can&#39;t install Composer, error in install already try several solutions</a></p>\n"^^ . + . + . + "As noted, parentheses such as `(DEAD)` need to be escaped as `\\(DEAD\\)` so that they count as a literal character and not a meta one: https://regex101.com/r/yNUrCZ/1"^^ . + . + "<p>My question to get code completion working in a set of classes that I have.</p>\n<pre><code>+ abstract Model :: make(array{...})\n +- SubModel\n +- AnotherSubModel\n +- ...\n</code></pre>\n<p>I have an abstract Model class, and several child classes extending it. The Model class has a make function which accepts an array of properties and returns a new static instance of whichever child class it's called on. It uses reflection to assign each property from the array to the correct property in the child class.</p>\n<p>Sample Code:</p>\n<pre><code>abstract class Model {\n\n public static function make(array $props): static\n {\n // ... magic\n }\n\n}\n\nclass SubModel extends Model {\n\n protected ?string $subModelProp = null;\n\n}\n\n$instance = SubModel::make(['subModelProp' =&gt; 'Hello, World']);\n\n// I'd like code completion in the IDE to tell me notAProp isn't valid:\n$instanceTwo = SubModel::make(['notAProp' =&gt; 'Whoops']);\n</code></pre>\n<p>I'm trying to figure out how to get completion to work in PhpStorm so that only valid array keys are passed. Each sub model has a distinct list of properties which can be set. Ideally I'd like to be able to declare the shape of the properties array in the child class, and have the IDE alert me if an invalid property is in the array, a property is missing, and just general completion support to know which properties are allowed.</p>\n<p>The phpstan docs for array shapes, e.g. <code>array{'foo': int, &quot;bar&quot;: string}</code> seems like an ideal way of describing the shape my input array needs to match the associated model class. However, I can't figure out how/where to declare the array shape in my sub class without re-implementing the make method in every sub class.</p>\n"^^ . + "<p>the html file:</p>\n<pre><code>&lt;meta charset=&quot;UTF-8&quot; /&gt;\n&lt;title&gt;AJAX calls xml&lt;/title&gt;\n\n\n&lt;script&gt;\nfunction display(word)\n{\nif (word.length==0) { \n document.getElementById(&quot;show_char&quot;).innerHTML=&quot;&quot;;\n return;\n} else {\n var xmlhttp=new XMLHttpRequest();\n xmlhttp.onreadystatechange=function() {\n if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) {\n document.getElementById(&quot;show_char&quot;).innerHTML=xmlhttp.responseText;\n }\n }\n \n xmlhttp.open(&quot;GET&quot;,&quot;quiz2.php?q=&quot;+word,true);\n xmlhttp.send();\n} \n}\n\n&lt;/script&gt;\n&lt;/head&gt;\n&lt;body style=&quot;background-color:lightgreen;color:black&quot;&gt;\n\n\n&lt;form &gt; \nFind the number &lt;input type=&quot;text&quot; onkeyup=&quot;display(this.value)&quot;&gt;\n \n&lt;/form&gt;\n\n&lt;p id=&quot;show_char&quot;&gt; &lt;/p&gt; \n\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<p>The quiz2.php file:</p>\n<pre><code>&lt;?php\n\n$r = 239;\n$q = $_REQUEST[&quot;q&quot;];\n\necho &quot;Your number is $q&quot;;\nif (intval($q) &gt; $r) {\n echo &quot;Your number is bigger from the number we are searching&quot;;\n}\nif (intval($q) == $r) {\n echo &quot;Congrads you found the number!!!!!!!!&quot;;\n}\nif (intval($q) &lt; $r) {\n echo &quot;Your number is smaller from the number we are searching&quot;;\n}\n\n?&gt;\n</code></pre>\n<p>The error on the html and console:\n<a href="https://i.sstatic.net/UmrjubtE.jpg" rel="nofollow noreferrer">console and html</a></p>\n<p>When you enter a number you are supposed to get a response form the php file with echo, compairing your number with the default number r. But instead php code is returned. You can see the error in the image. It is supposed to return &quot;Your number is&quot;+the number you typed etc. I use phoenix code and win 11. Perhaps it works on other machines??</p>\n"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "solr"^^ . + "0"^^ . + . + . + . + . + "<p>Steps to Reproduce:</p>\n<ol>\n<li><p>Open Postman and create a new POST request.</p>\n</li>\n<li><p>Set the URL to <a href="http://127.0.0.1:8000/api/admin/register" rel="nofollow noreferrer">http://127.0.0.1:8000/api/admin/register</a>.</p>\n</li>\n<li><p>Set the Headers:</p>\n<pre><code>Content-Type: application/json\n</code></pre>\n</li>\n<li><p>Set the Body (JSON):</p>\n<pre><code>{\n &quot;name&quot;: &quot;Admin Name&quot;,\n &quot;email&quot;: &quot;admin@example.com&quot;,\n &quot;password&quot;: &quot;password&quot;,\n &quot;password_confirmation&quot;: &quot;password&quot;\n}\n</code></pre>\n</li>\n<li><p>Send the request.</p>\n</li>\n</ol>\n<p>Expected result: A JSON response indicating successful registration:</p>\n<pre><code>{\n &quot;message&quot;: &quot;Admin registered successfully&quot;\n}\n</code></pre>\n<p>Actual result: The default Laravel welcome page is returned.</p>\n<p>routes/api.php</p>\n<pre><code>&lt;?php\n// filepath: /c:/Users/youss/Desktop/Fyp2/QROrderingSystem/routes/api.php\n&lt;?php\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Route;\nuse App\\Http\\Controllers\\AdminAuthController;\nuse App\\Http\\Controllers\\MenuController;\nuse App\\Http\\Controllers\\OrderController;\nuse App\\Http\\Controllers\\PaymentController;\nuse App\\Http\\Controllers\\FeedbackController;\n\n/*\n|--------------------------------------------------------------------------\n| API Routes\n|--------------------------------------------------------------------------\n|\n| Here is where you can register API routes for your application. These\n| routes are loaded by the RouteServiceProvider within a group which\n| is assigned the &quot;api&quot; middleware group. Enjoy building your API!\n|\n*/\n\nRoute::middleware('api')-&gt;group(function () {\n Route::post('/admin/register', [AdminAuthController::class, 'register']);\n Route::post('/admin/login', [AdminAuthController::class, 'login']);\n});\n\nRoute::post('admin/logout', [AdminAuthController::class, 'logout'])-&gt;middleware('auth:sanctum');\n\nRoute::middleware('auth:sanctum')-&gt;group(function () {\n Route::get('menu', [MenuController::class, 'index']);\n Route::post('menu', [MenuController::class, 'store']);\n Route::put('menu/{id}', [MenuController::class, 'update']);\n Route::delete('menu/{id}', [MenuController::class, 'destroy']);\n\n Route::post('order', [OrderController::class, 'store']);\n Route::get('orders', [OrderController::class, 'index']);\n Route::get('order/{id}', [OrderController::class, 'show']);\n Route::put('order/{id}/status', [OrderController::class, 'updateStatus']);\n\n Route::post('payment', [PaymentController::class, 'store']);\n Route::get('payments', [PaymentController::class, 'index']);\n\n Route::post('feedback', [FeedbackController::class, 'store']);\n Route::get('feedback', [FeedbackController::class, 'index']);\n});\n\nRoute::middleware('auth:sanctum')-&gt;get('/user', function (Request $request) {\n return $request-&gt;user();\n});\n</code></pre>\n<p>app/Http/Controllers/AdminAuthController.php</p>\n<pre><code>&lt;?php\n// filepath: /c:/Users/youss/Desktop/Fyp2/QROrderingSystem/app/Http/Controllers/AdminAuthController.php\n&lt;?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Http\\Request;\nuse App\\Models\\User;\nuse Illuminate\\Support\\Facades\\Hash;\nuse Illuminate\\Support\\Facades\\Auth;\n\nclass AdminAuthController extends Controller\n{\n public function register(Request $request)\n {\n \\Log::info('Register method called'); // Add this line for debugging\n\n $request-&gt;validate([\n 'name' =&gt; 'required|string|max:255',\n 'email' =&gt; 'required|string|email|max:255|unique:users',\n 'password' =&gt; 'required|string|min:8|confirmed',\n ]);\n\n $user = User::create([\n 'name' =&gt; $request-&gt;name,\n 'email' =&gt; $request-&gt;email,\n 'password' =&gt; Hash::make($request-&gt;password),\n 'role' =&gt; 'admin',\n ]);\n\n return response()-&gt;json(['message' =&gt; 'Admin registered successfully'], 201);\n }\n\n public function login(Request $request)\n {\n $request-&gt;validate([\n 'email' =&gt; 'required|string|email',\n 'password' =&gt; 'required|string',\n ]);\n\n if (!Auth::attempt($request-&gt;only('email', 'password'))) {\n return response()-&gt;json(['message' =&gt; 'Invalid login credentials'], 401);\n }\n\n $user = Auth::user();\n $token = $user-&gt;createToken('auth_token')-&gt;plainTextToken;\n\n return response()-&gt;json(['token' =&gt; $token, 'user' =&gt; $user], 200);\n }\n\n public function logout(Request $request)\n {\n $request-&gt;user()-&gt;tokens()-&gt;delete();\n\n return response()-&gt;json(['message' =&gt; 'Logged out successfully'], 200);\n }\n}\n</code></pre>\n<p>app/Providers/RouteServiceProvider.php</p>\n<pre><code>&lt;?php\n// filepath: /c:/Users/youss/Desktop/Fyp2/QROrderingSystem/app/Providers/RouteServiceProvider.php\n&lt;?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Support\\Facades\\Route;\nuse Illuminate\\Foundation\\Support\\Providers\\RouteServiceProvider as ServiceProvider;\n\nclass RouteServiceProvider extends ServiceProvider\n{\n /**\n * This namespace is applied to your controller routes.\n *\n * In addition, it is set as the URL generator's root namespace.\n *\n * @var string\n */\n protected $namespace = 'App\\Http\\Controllers';\n\n /**\n * Define your route model bindings, pattern filters, etc.\n *\n * @return void\n */\n public function boot()\n {\n parent::boot();\n }\n\n /**\n * Define the routes for the application.\n *\n * @return void\n */\n public function map()\n {\n $this-&gt;mapApiRoutes();\n\n $this-&gt;mapWebRoutes();\n }\n\n /**\n * Define the &quot;web&quot; routes for the application.\n *\n * These routes all receive session state, CSRF protection, etc.\n *\n * @return void\n */\n protected function mapWebRoutes()\n {\n Route::middleware('web')\n -&gt;namespace($this-&gt;namespace)\n -&gt;group(base_path('routes/web.php'));\n }\n\n /**\n * Define the &quot;api&quot; routes for the application.\n *\n * These routes are typically stateless.\n *\n * @return void\n */\n protected function mapApiRoutes()\n {\n Route::prefix('api')\n -&gt;middleware('api')\n -&gt;namespace($this-&gt;namespace)\n -&gt;group(base_path('routes/api.php'));\n }\n}\n</code></pre>\n<h3>.env</h3>\n<pre><code>APP_NAME=Laravel\nAPP_ENV=local\nAPP_KEY=base64:a5rAm8ogzWPLPNJ9Zyd7wrceX2gsKcg7NcJWbbFvPhc=\nAPP_DEBUG=true\nAPP_URL=http://127.0.0.1:8000\n\nLOG_CHANNEL=stack\nLOG_DEPRECATIONS_CHANNEL=null\nLOG_LEVEL=debug\n\nDB_CONNECTION=mysql\nDB_HOST=127.0.0.1\nDB_PORT=3306\nDB_DATABASE=qr_ordering_system\nDB_USERNAME=root\nDB_PASSWORD=\n\nBROADCAST_DRIVER=log\nCACHE_DRIVER=file\nFILESYSTEM_DISK=local\nQUEUE_CONNECTION=sync\nSESSION_DRIVER=file\nSESSION_LIFETIME=120\n\nMEMCACHED_HOST=127.0.0.1\n\nREDIS_HOST=127.0.0.1\nREDIS_PASSWORD=null\nREDIS_PORT=6379\n\nMAIL_MAILER=smtp\nMAIL_HOST=mailpit\nMAIL_PORT=1025\nMAIL_USERNAME=null\nMAIL_PASSWORD=null\nMAIL_ENCRYPTION=null\nMAIL_FROM_ADDRESS=&quot;hello@example.com&quot;\nMAIL_FROM_NAME=&quot;${APP_NAME}&quot;\n\nAWS_ACCESS_KEY_ID=\nAWS_SECRET_ACCESS_KEY=\nAWS_DEFAULT_REGION=us-east-1\nAWS_BUCKET=\nAWS_USE_PATH_STYLE_ENDPOINT=false\n\nPUSHER_APP_ID=\nPUSHER_APP_KEY=\nPUSHER_APP_SECRET=\nPUSHER_HOST=\nPUSHER_PORT=443\nPUSHER_SCHEME=https\nPUSHER_APP_CLUSTER=mt1\n\nVITE_PUSHER_APP_KEY=&quot;${PUSHER_APP_KEY}&quot;\nVITE_PUSHER_HOST=&quot;${PUSHER_HOST}&quot;\nVITE_PUSHER_PORT=&quot;${PUSHER_PORT}&quot;\nVITE_PUSHER_SCHEME=&quot;${PUSHER_SCHEME}&quot;\nVITE_PUSHER_APP_CLUSTER=&quot;${PUSHER_APP_CLUSTER}&quot;\n</code></pre>\n<p>Please provide any insights or suggestions on why the API request is returning the Laravel welcome page instead of the expected JSON response.</p>\n"^^ . + "Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 62914592 bytes) in public/wp-includes/class-wpdb.php"^^ . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + "Problem with ajax and php. the code is simple but it does not work on my pc. I use win 11 and phoenix code"^^ . + . + . + . + "2"^^ . + . + . + "I managed to solve using GS. In fact I discovered that the code I was using to try to downgrade PDF version was corrupting almost every single file before joining them in a single file, which is why it wasn't working. Without modifying the files, GS was more than enough to this task. Thanks to every comment, specially to @KJ for the help!"^^ . + "<p><code>exit</code> stops the script. You should not call it. Instead, do this:</p>\n<pre><code>$path = $_GET[&quot;potus&quot;] ?? &quot;&quot;;\nif (file_exists($path) &amp;&amp; isValidPath($path) &amp;&amp; ($file = fopen($path . &quot;.txt&quot;, &quot;r&quot;))) {\n //do your stuff here\n}\n</code></pre>\n<p>We have three criteria here:</p>\n<ol>\n<li><code>file_exists</code> checks whether the file exists at all. It is important to have this before you open the file to avoid getting warnings due to the file not being found if that happens. If <code>file_exists</code> returns false, the other operands will not even be evaluated and the <code>if</code> block will be skipped</li>\n<li><code>isValidPath</code> is a function that you need to implement in order to make sure that malicious users will not get files from places that you do not want them to get files from, for example, passing a filename of <code>/var/www/html/your-repo/.env</code>. We cannot possibly determine what's a valid path in your project, so I leave the implementation of this function to you</li>\n<li>The actual <code>fopen</code> call which attempts to open the file. If it returns a truey result, then the file can be processed inside the if block</li>\n</ol>\n<p>After the <code>if</code> block you can have whatever you want to be executed independently of whether the file has been found or not.</p>\n"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + "Could be related (after a quick search): https://youtrack.jetbrains.com/issue/WI-67397 . Seems to be related to how `self` is resolved when used in a trait (your screenshot show that: `ContextTrait|Transaction` -- no `Invoice` mentioned there)."^^ . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + "@siggemannen according to the Laravel issue discussions the precision affects what underlying type is used. Setting a precision prevents the use of `datetime`, which has no precision. `datetime2` and the newer types are NOT affected by `DATEFORMAT` so if Laravel generates strings in ISO8601 format, they won't be misinterpreted. The `datetime` type is still affected because that was the original behavior before 2005."^^ . + "chmod -R 775 storage does fix the problem, but the project name is not fixedwho may not fix the problem, and I want to be able to automatically give permissions to /var/www/html automatically."^^ . + . + "I see, the solution is below my nose and i am looking elsewhere.\nso regadless of XAMPP all i need is a scrpipt to start my app and MySql?\njust add a task ? in task scheduler?"^^ . + "yii2-model"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + "The error is pretty clear: you're missing the `wp-load.php` file in your main directory. How did WP core get installed?"^^ . + "0"^^ . + . + . + . + . + . + "2"^^ . + "microsoft-fabric"^^ . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + "<p>So, as an exercise in ORM modeling with laravel, I'm trying to implement this model:</p>\n<p><a href="https://www.softwareideas.net/a/1597/food-ordering-system-er-diagram-" rel="nofollow noreferrer">Food Ordering System</a></p>\n<p>It's a bit tricky for me to write the factories and seeders for the Restaurant - OpeningHours relationship.</p>\n<p>How do I make a factory for opening hours that increments the &quot;Day&quot; attribute for each OpeningHour belonging to One restaurant?</p>\n<p>By that, I mean there must be 7 OpeningHours for each restaurant, and each should have a &quot;Day&quot; attribute from 1 to 7.</p>\n<p>Any Ideas?</p>\n<p>here's the code for the OpeningHours Factory:</p>\n<pre><code>&lt;?php\n\nnamespace Database\\Factories;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\Factory;\n\n/**\n * @extends \\Illuminate\\Database\\Eloquent\\Factories\\Factory&lt;\\App\\Models\\OpeningHours&gt;\n */\nclass OpeningHoursFactory extends Factory\n{\n /**\n * Define the model's default state.\n *\n * @return array&lt;string, mixed&gt;\n */\n public function definition(): array\n {\n return [\n &quot;day&quot; =&gt; fake()-&gt;numberBetween(0,6),\n &quot;from_hour&quot; =&gt; 0,\n &quot;from_minute&quot; =&gt; 0,\n &quot;to_hour&quot; =&gt; 23,\n &quot;to_minute&quot; =&gt; 59,\n ];\n }\n}\n\n</code></pre>\n<p>Here's the code for the Restaurant Factory</p>\n<pre><code>&lt;?php\n\nnamespace Database\\Factories;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\Factory;\n\n/**\n * @extends \\Illuminate\\Database\\Eloquent\\Factories\\Factory&lt;\\App\\Models\\Restaurant&gt;\n */\nclass RestaurantFactory extends Factory\n{\n /**\n * Define the model's default state.\n *\n * @return array&lt;string, mixed&gt;\n */\n public function definition(): array\n {\n return [\n 'name' =&gt; fake()-&gt;company(),\n &quot;short_description&quot; =&gt; fake()-&gt;text(127),\n &quot;description&quot; =&gt; fake()-&gt;text(254),\n &quot;image&quot; =&gt; fake()-&gt;image(),\n &quot;is_active&quot; =&gt; fake()-&gt;boolean()\n ];\n }\n}\n\n</code></pre>\n<p>And here's the Restaurant Seeder</p>\n<pre><code>\n&lt;?php\n\nnamespace Database\\Seeders;\n\nuse App\\Models\\OpeningHours;\nuse App\\Models\\Restaurant;\nuse Database\\Factories\\RestaurantFactory;\nuse Illuminate\\Database\\Seeder;\n\nclass RestaurantSeeder extends Seeder\n{\n /**\n * Run the database seeds.\n */\n public function run(): void\n {\n Restaurant::factory()-&gt;has(OpeningHours::factory()-&gt;count(7) )-&gt;count(10)-&gt;create();\n }\n}\n</code></pre>\n"^^ . + . + . + . + . + . + "But how did he get this solution? I did not find this at all in my Laravel documentation"^^ . + "@ADyson Thanks for your input, it has given me some direction. I still have Google Cloud and AWS to integrate."^^ . + "0"^^ . + "`$this->subject` is always null , so `$this->subject ?? ''` will be always `''`, so it's never in array."^^ . + . + . + . + . + . + . + "meta-boxes"^^ . + "for the SQL version it is 10.4.17-MariaDB-1:10.4.17+maria~jessie-log"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + "[Github issue on phpunit's project site](https://github.com/sebastianbergmann/phpunit/issues/836)"^^ . + . + "2"^^ . + . + . + . + . + "1"^^ . + . + "@Olivier In PHP a regex can generally be 1MB, so your use case is nowhere near the limit. Performance is another thing, and regex is usually not the most performant option."^^ . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + "Notice that ' around the POLYGON expression? It means this whole stuff is treated as a single chunk of data. And you need to provide is to the query as a single chunk of data."^^ . + . + "ups"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + "<p>I am pretty new to deploying things myself with azure so bare with me here.</p>\n<p>I created a web app in azure and connected it to github. I have never set up a configuration myself just added to work related ones so I am not sure if the error is in my configuration or a misunderstanding of azure abilites.</p>\n<p>Running Linux with a PHP Stack</p>\n<p>Basically my page is an HTML page -&gt; PHP file which runs an uploaded file through a python program -&gt; loading.html page while the python runs -&gt; Display.html of the given python result</p>\n<p>My field is data science so I am sure my methodology of html-&gt;php-&gt;python is not ideal but that was about the extent of the web developing I was taught and just want a streamlined webpage to display my python essentially.</p>\n<p>Really any help recommended, not sure what other configuration information would be needed but comment please. As far as I can tell the logs do not show anything - then again my logs may be configured wrong.</p>\n<p>Github reports these two things upon attempting to use the page -</p>\n<ul>\n<li>Failed to deploy web package to App Service.</li>\n<li>Deployment Failed, Package deployment using ZIP Deploy failed.</li>\n</ul>\n<p>Also, final detail, the initial html page does appear the &quot;502 - Web server received an invalid response while acting as a gateway or proxy server.&quot; Occurs when pressing the first button which maps to the PHP.</p>\n<p>Any help greatly appreciated, trying to expand skills outside of my normal field.</p>\n"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + "4"^^ . + "https://polylang.pro/doc/function-reference/ - there is an `echo` option, which should determine whether this outputs directly, or returns the code. (It should not be doing both at the same time though.)"^^ . + "0"^^ . + . + "<p>I found the problem. If u're testing with postman, add <code>X-Requested-With : XMLHttpRequest </code>to headers and everything should work.</p>\n"^^ . + "0"^^ . + "0"^^ . + "3"^^ . + "cookies"^^ . + . + . + "setcookie"^^ . + . + . + . + "<p>I am formatting the dates of all weeks in a date range that exceeds 1 year using <code>CarbonPeriod</code>:</p>\n<pre class="lang-php prettyprint-override"><code>$period = CarbonPeriod::create('2024-01-01', '1 week', '2025-01-31');\n\nforeach ($period as $date) {\n echo $date-&gt;format('W Y') .&quot;\\r\\n&quot;;\n}\n\ndd();\n</code></pre>\n<p>But I am not getting my expected result, it is missing <code>01 2025</code>.</p>\n<p>Instead, it gave me another <code>01 2024</code> which is duplicated. That looks wrong to me and I hope someone can explain it.</p>\n"^^ . + . + . + "<pre><code>$this-&gt;count(1);\n</code></pre>\n<p>is the correct way to call a method from the same class.</p>\n<p>You are correctly passing the $count variable to the view. I think the problem resides in how you are calculating the count in the function. Try correcting how you retrive the records from the database and avoid subtracting 2 eloquent models. Try with something like this:</p>\n<pre><code>public function count($column)\n {\n $lastNumber = Number::orderBy('created_at', 'DESC')-&gt;first();\n $lastColumn = Number::where('column', $column)-&gt;first();\n\n // $count = $lastNumber - $lastColumn;\n $count = ($lastNumber-&gt;number ?? 0) - ($lastColumn-&gt;column ?? 0); // is this what you were trying to do?\n return $count;\n }\n</code></pre>\n"^^ . + . + . + . + . + . + "0"^^ . + "<p>I have installed latest Laravel 11.30 and it works good with MySQL. Now I need to connect to another server that is using SQL Server and read some data from a table. I have installed sqlsrv and pdo driver and odbc 18 but I am not sure should I config something else for using them or not? Both servers are windows, firewall on both are disabled. I am using xamp on windows to run php and mydql where Laravel istalled. Add SQL Server connection data to confug-&gt;database and add connection data to .ENV file write a little code to test it. Code follows:</p>\n<p><strong>Config-&gt;database</strong></p>\n<pre><code>'sqlsrv_attendance' =&gt; [\n 'driver' =&gt; 'sqlsrv',\n 'host' =&gt; '192.168.10.13',\n 'database' =&gt; 'dbname',\n 'username' =&gt; 'user',\n 'password' =&gt; 'pass',\n 'charset' =&gt; 'utf8',\n 'prefix' =&gt; '',\n ],\n</code></pre>\n<p><strong>env</strong></p>\n<pre><code>#####SQL Server Added\nDB_SQLSRV_HOST=192.168.10.13\nDB_SQLSRV_PORT=1433\nDB_SQLSRV_DATABASE=dbname\nDB_SQLSRV_USERNAME=user\nDB_SQLSRV_PASSWORD=pass\nDB_OPTIONS=&quot;TrustServerCertificate=true&quot;\nDB_ODBC=0\n#####################\n</code></pre>\n<p><strong>Route</strong></p>\n<pre><code>Route::middleware(['auth'])-&gt;group(function () {\n\n\n Route::get('/test-query', function () {\n try {\n $data = DB::connection('sqlsrv_attendance')-&gt;select('SELECT TOP 1 * FROM DataFile');\n dd($data);\n } catch (\\Exception $e) {\n return $e-&gt;getMessage();\n }\n });\n</code></pre>\n<p>but I got this error.</p>\n<blockquote>\n<p>SQLSTATE[08001]: [Microsoft][ODBC Driver 18 for SQL Server]SQL Server Network Interfaces: Connection string is not valid [87]. (Connection: sqlsrv_attendance, SQL: SELECT TOP 1 * FROM DataFile)</p>\n</blockquote>\n<p>Googling the problem shows solving it with adding <code>DB_OPTIONS=&quot;TrustServerCertificate=true&quot;</code> in nodejs. What can I do? Should I config ODBC or DSN? I appreciate any help.</p>\n"^^ . + "0"^^ . + . + "0"^^ . + "<p>You can't open a PHP file with live server. Instead, type localhost/ on any browser. I think there is an other extension called Five Server which could normally open PHP files but i don't use it so I can't tell you if it really works.</p>\n"^^ . + . + . + . + "0"^^ . + . + . + . + "If you want to do it with one loop, then you have to turn the logic around. You can not output the data for the _current_ row within your loop, because you need data from the _next_ row. So fetch the first row _before_ your loop, and then inside your loop, use that data of the previous row and the current one to do your calculation, and then _output_ the value from the previous row, plus the increase you have calculated. That'll leave you with one last row you'll have to output _after_ your loop then."^^ . + . + "1"^^ . + . + . + "This answer appears similar to @Thefourthbird 's [answer](https://stackoverflow.com/a/79514577/17856705) - is there any difference between using `preg_replace` or `preg_split` - or is this just another way to slice it."^^ . + . + . + . + . + . + "Laravel: undefined variable $component un non-cached blade views"^^ . + "0"^^ . + . + . + . + . + . + "PHP: mb_convert_encoding() to UTF-16LE doesn't work"^^ . + . + . + . + . + . + "The token is just a header value, that shouldn't complicate anything about the rest of the request"^^ . + . + "codeigniter base_url configuration"^^ . + . + "How Can I Make an Input Tag Submit Button Read Something Different from Value Attribute via Screen Reader?"^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + "How do I get the type meta data for a Pod's field in WordPress?"^^ . + "1"^^ . + "Do I need to install and use Dependency Walker to determine what dependencies libmysql.dll has or is there another way? libmysql.dll was copied to windows/system32 to see if this would solve the problem. I have removed it from /system32"^^ . + "0"^^ . + . + . + . + "@Richard I don't think that's the issue."^^ . + . + "graphql"^^ . + "@KIKOSoftware I have elaborated my question now."^^ . + "2"^^ . + . + . + . + . + . + . + "1"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + "Still same error (i also had npm run dev before)"^^ . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + "1"^^ . + . + "how to compare time periods (months) when months can have different lengts"^^ . + . + . + "0"^^ . + "0"^^ . + "This snippet shows `"Uncaught SyntaxError: Unexpected token '<'"` unrelated to the question. Please fix it."^^ . + "0"^^ . + . + . + . + "0"^^ . + . + "@hakre I fixed it, thanks a lot for your help. I will share the full code shortly as an answer"^^ . + "How to dynamically change the interval of a recurring message using scheduler?"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "Encode CSV file with UTF-8 PHP fopen"^^ . + . + . + "1"^^ . + . + . + "1"^^ . + "openid-connect"^^ . + "1"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + "magnet-uri"^^ . + "Also strange is that when i put the failed https://getcomposer.org/versions in the browser there are no problems. So it has to be in composer somewhere"^^ . + . + . + "1"^^ . + "<p>Ok, so here are the two parts. Don't be afraid, I made this very verbose to hopefully carry you towards the goal. Also note, I'm a human and not an AI bot, isn't this great? :-)</p>\n<p><strong>Question One: Accessing Arguments</strong></p>\n<p>You are using the Extbase ActionController, so the best way would be to actually make use of the simple extbase variable registrion.</p>\n<p><strong>Step One: Adjust form</strong></p>\n<p>First, I suggest you to add <code>method=&quot;post&quot;</code> to your <code>&lt;f:form&gt;</code> call. For the time being, ignore the <code>checked=&quot;{enableBarrierefrei}&quot;</code> attribute, we'll get to that.</p>\n<p><strong>Step Two: Register new action</strong></p>\n<p>Since you already set &quot;save&quot; as the target action, you will need to implement a <code>saveAction()</code> method to your Backend Controller, and also be sure to register that action in your file <code>Configuration/Backend/Modules.php</code> like this:</p>\n<pre><code> 'controllerActions' =&gt; [\n BackendController::class =&gt; [\n 'index', 'save',\n ],\n ],\n\n</code></pre>\n<p><strong>Step Three and always in between: Do the 'Clear cache' dance</strong></p>\n<p>(Be sure to clear your cache after making this change, otherwise POSTing to your action will probably lead to the same indexAction.</p>\n<p><strong>Step Four: Implement saveAction</strong></p>\n<p>The next part is the new action in your Controller:</p>\n<pre><code> public function saveAction(bool $enable_barrierefrei = false): ResponseInterface\n {\n return $this-&gt;htmlResponse($enable_barrierefrei ? 'Checkbox checked' : 'Checkbox not checked');\n }\n\n</code></pre>\n<p>All that extbase needs here is to use the same <code>f:form.checkbox</code> name in the method signature (with a <code>bool</code> type) so you can access it.</p>\n<p>(You could otherwise also access it via <code>$this-&gt;arguments-&gt;getArgument('enable_barrierefrei')</code>, but using the method signature is IMO more revealing and clear).</p>\n<p>So the implementation above just returns a plain text output if it's checked or not. Of course you now want to access it, that's your second question</p>\n<p><strong>Second Question: Persisting data</strong></p>\n<p>As you mentioned, you have several possibilities:</p>\n<ul>\n<li><p>Create a custom database record table (using TCA and extbase domain models). Many extensions do this if they have specific configuration that applies to parts of the page tree. This variant of course has a large overhead/footprint.</p>\n</li>\n<li><p>Storing a value in <code>TYPO3_CONF_VARS['EXTCONF']</code> - in this case you would NOT do this with a backend controller, but actually use the global extension configuration API: <a href="https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ExtensionArchitecture/FileStructure/ExtConfTemplate.html" rel="nofollow noreferrer">https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ExtensionArchitecture/FileStructure/ExtConfTemplate.html</a> - I figure you will later use your backend controller not only for this single value, but also do some more customized tasks. This API is meant for very specific configuration items with a fixed GUI that you cannot influence. So while you might want to think about this, this is not the scope of what I try to teach here. ;)</p>\n</li>\n<li><p>You can use the Registry API <a href="https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/SystemRegistry/Index.html" rel="nofollow noreferrer">https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/SystemRegistry/Index.html</a> to store single simple values. This is a global database table exactly for single configuration values like yours. This is what I would probably recommend.</p>\n</li>\n</ul>\n<p><strong>Step One: Use the Registry API for writing</strong></p>\n<p>So let's change your saveAction to this:</p>\n<pre><code> public function saveAction(bool $enable_barrierefrei = false): ResponseInterface\n {\n $this-&gt;registry-&gt;set('tx_myextensionname', 'enabled', $enable_barrierefrei);\n return $this-&gt;redirect('action');\n }\n</code></pre>\n<p>That's so easy - and we forward back again to your index action after saving.</p>\n<p><strong>Step Two: Actually register the Registry API</strong></p>\n<p>You may have seen that I use <code>$this-&gt;registry</code> for access. By default that isn't known to your BackendController. You need to make it available either by using GeneralUtility::makeInstance() as an easy way, but you want to do it properly, so use Dependency Injection and create a <code>__construct</code> method in your BackendController:</p>\n<pre><code> public function __construct(\n protected readonly Registry $registry,\n ) {}\n</code></pre>\n<p>Since that is only the shorthand notation, you also need to import the proper full class name:</p>\n<pre><code>use TYPO3\\CMS\\Core\\Registry;\n</code></pre>\n<p><strong>Step Three: Use Registry API for reading</strong></p>\n<p>Now you want to also ready the current state for your backend indexAction of course. So you'll do this:</p>\n<pre><code> public function indexAction(): ResponseInterface\n {\n $this-&gt;view-&gt;assign('enableBarrierefrei', $this-&gt;registry-&gt;get('tx_myextensionname', 'enabled'));\n $moduleTemplate = $this-&gt;moduleTemplateFactory-&gt;create($this-&gt;request);\n\n $moduleTemplate-&gt;setContent($this-&gt;view-&gt;render());\n return $this-&gt;htmlResponse($moduleTemplate-&gt;renderContent());\n }\n</code></pre>\n<p>As you can see, only the <code>$this-&gt;view-&gt;assign()</code> call was exchanged to access the registry. That's lightweight, right? :-)</p>\n<p>You may have remembered earlier when I set &quot;we'll get back to <code>checked=&quot;{enableBarrierefrei}&quot;</code>, and that's what this does. It just propagates the current state to your checkbox.</p>\n<p>I hope this helps.</p>\n"^^ . + . + "<p>I have a strange problem. I have a very simple HTML form which calls a PHP script. This works flawlessly on Desktop browsers (as it should), but on Safari on iOS, it regularly crashes if I use &quot;method=post&quot; and the PHP is called through https; with http it works.</p>\n<p>PHP is installed with Homebrew, and from what I see, this is where the problem lies. It has something to with Opcache and SSL, but I can't figure out what's going wrong.</p>\n<p>This is the page with the form:</p>\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;de&quot;&gt;\n&lt;head&gt;\n &lt;meta charset=&quot;utf-8&quot;&gt;\n &lt;title&gt;Test&lt;/title&gt;\n \n&lt;/head&gt;\n&lt;body&gt;\n&lt;form action=&quot;test2.php&quot; method=&quot;post&quot;&gt;\n &lt;input type=&quot;text&quot; name=&quot;test&quot;&gt;\n &lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;\n&lt;/form&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<p>And this is the PHP script:</p>\n<pre><code>&lt;?php\nphpinfo();\n?&gt;\n</code></pre>\n<p>When I try this on an iPhone, I get the following error messages from Apache:</p>\n<pre><code>'/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/php/8.4.5_1/lib/php/20240924/opcache.so' (no such file), '/opt/homebrew/Cellar/php/8.4.5_1/lib/php/20240924/opcache.so' (code signature in &lt;43D11FAA-215F-3188-8E3B-E5D1BB04CCEF&gt; '/opt/homebrew/Cellar/php/8.4.5_1/lib/php/20240924/opcache.so' not valid for use in process: mapping process is a platform binary, but mapped file is not)\n[Fri Mar 28 15:19:39.516227 2025] [core:notice] [pid 504] AH00052: child pid 39750 exit signal Segmentation fault (11)\n</code></pre>\n<p><strong>EDIT</strong>\nIt's my understanding that this doesn't even &quot;reach&quot; PHP. For reasons I don't understand, apache actually crashes.</p>\n<p>Here's the crash report:</p>\n<pre><code>Translated Report (Full Report Below)\n-------------------------------------\n\nProcess: httpd [88039]\nPath: /usr/sbin/httpd\nIdentifier: httpd\nVersion: ???\nCode Type: ARM-64 (Native)\nParent Process: httpd [505]\nUser ID: 502\n\nDate/Time: 2025-03-29 10:19:25.7144 +0100\nOS Version: macOS 14.5 (23F79)\nReport Version: 12\nAnonymous UUID: EC0B9AA6-BC9E-8A89-F47F-ACD017017EC6\n\n\nTime Awake Since Boot: 52000 seconds\n\nSystem Integrity Protection: enabled\n\nCrashed Thread: 0 Dispatch queue: com.apple.main-thread\n\nException Type: EXC_BAD_ACCESS (SIGSEGV)\nException Codes: KERN_INVALID_ADDRESS at 0x000000000000000b\nException Codes: 0x0000000000000001, 0x000000000000000b\n\nVM Region Info: 0xb is not in any region. Bytes before following region: 4374740981\n REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL\n UNUSED SPACE AT START\n---&gt; \n __TEXT 104c14000-104cac000 [ 608K] r-x/r-x SM=COW /usr/sbin/httpd\n\nApplication Specific Information:\n*** multi-threaded process forked ***\ncrashed on child side of fork pre-exec\n\n\nThread 0 Crashed:: Dispatch queue: com.apple.main-thread\n0 libsystem_pthread.dylib 0x1904fd4f8 pthread_mutex_lock + 12\n1 libapr-1.0.dylib 0x2573ec4a8 0x2573de000 + 58536\n2 libaprutil-1.0.dylib 0x2573fe88c apr_bucket_alloc + 64\n3 libaprutil-1.0.dylib 0x2573fe310 apr_brigade_writev + 428\n4 httpd 0x104c90f30 basic_http_header + 268\n5 httpd 0x104c943f4 ap_http_header_filter + 2636\n6 httpd 0x104c479d8 ap_pass_brigade + 292\n7 httpd 0x104c56738 ap_content_length_filter + 1456\n8 httpd 0x104c479d8 ap_pass_brigade + 292\n9 httpd 0x104c96900 ap_byterange_filter + 712\n10 httpd 0x104c479d8 ap_pass_brigade + 292\n11 mod_headers.so 0x104ebdc90 ap_headers_output_filter + 584\n12 httpd 0x104c479d8 ap_pass_brigade + 292\n13 httpd 0x104c482b8 ap_filter_flush + 52\n14 httpd 0x104c56c74 buffer_output + 420\n15 httpd 0x104c56d00 ap_rwrite + 116\n16 libphp.so 0x106c196a8 php_apache_sapi_ub_write + 36\n17 libphp.so 0x106ac6d08 php_output_op + 248\n18 libphp.so 0x106ac6bf8 php_output_write + 76\n19 libphp.so 0x106ba6fe4 ZEND_ECHO_SPEC_CV_HANDLER + 76\n20 libphp.so 0x106b653e0 execute_ex + 100\n21 libphp.so 0x106b655d0 zend_execute + 280\n22 libphp.so 0x106c18138 zend_execute_script + 96\n23 libphp.so 0x106ac40ec php_execute_script_ex + 480\n24 libphp.so 0x106c194bc php_handler + 1024\n25 httpd 0x104c16924 ap_run_handler + 156\n26 httpd 0x104c173a8 ap_invoke_handler + 480\n27 httpd 0x104c8be90 ap_process_async_request + 2868\n28 httpd 0x104c8bfa8 ap_process_request + 84\n29 httpd 0x104c86124 ap_process_http_sync_connection + 272\n30 httpd 0x104c85be0 ap_process_http_connection + 96\n31 httpd 0x104c3a330 ap_run_process_connection + 156\n32 httpd 0x104c3ac70 ap_process_connection + 76\n33 mod_mpm_prefork.so 0x104f0e398 child_main + 3004\n34 mod_mpm_prefork.so 0x104f0cf78 make_child + 596\n35 mod_mpm_prefork.so 0x104f0d66c perform_idle_server_maintenance + 1348\n36 mod_mpm_prefork.so 0x104f0c394 prefork_run + 2796\n37 httpd 0x104c3ea64 ap_run_mpm + 172\n38 httpd 0x104c245f0 main + 4560\n39 dyld 0x19017a0e0 start + 2360\n\n\nThread 0 crashed with ARM Thread State (64-bit):\n x0: 0x000000000000000b x1: 0x0000000000001f60 x2: 0x0000000000000000 x3: 0x000000016b1e9fd8\n x4: 0x0000000000000004 x5: 0x0000000000000020 x6: 0x697a6f4d53545249 x7: 0x0000000111811300\n x8: 0x0000000000000002 x9: 0x0000000000002000 x10: 0x0000000000000002 x11: 0x0000000000000018\n x12: 0x00000000cccccccd x13: 0x00000000000000f6 x14: 0x0000000000000002 x15: 0x0000000000000064\n x16: 0x00000001904fd4ec x17: 0x000000026eb5be08 x18: 0x0000000000000000 x19: 0x00000001087050e0\n x20: 0x0000000000001f60 x21: 0x0000000000002000 x22: 0x0000000000000001 x23: 0x0000000000000002\n x24: 0x0000000109024708 x25: 0x000000016b1e9fd8 x26: 0x0000000000000011 x27: 0x0000000109024708\n x28: 0x0000000000000000 fp: 0x000000016b1e9c20 lr: 0xb87b0002573ec4a8\n sp: 0x000000016b1e9c20 pc: 0x00000001904fd4f8 cpsr: 0x80001000\n far: 0x0000000000000000 esr: 0x56000080 Address size fault\n\nBinary Images:\n 0x106110000 - 0x106113fff mod_hfs_apple.so (*) &lt;4c7bb85f-edde-32f9-bd1c-43ced892c75a&gt; /usr/libexec/apache2/mod_hfs_apple.so\n 0x10529c000 - 0x10529ffff mod_version.so (*) &lt;843fd54d-eb28-3bfd-9bff-9e9a3045c974&gt; /usr/libexec/apache2/mod_version.so\n 0x105218000 - 0x10521bfff mod_unixd.so (*) &lt;e15b8e69-9096-3738-8709-405779ab9b95&gt; /usr/libexec/apache2/mod_unixd.so\n 0x105284000 - 0x10528bfff mod_status.so (*) &lt;61f48293-9e05-3f20-9440-c4d501b42195&gt; /usr/libexec/apache2/mod_status.so\n 0x105318000 - 0x105363fff mod_ssl.so (*) &lt;32a7acd9-7710-3cfb-92e0-21d8df776651&gt; /usr/libexec/apache2/mod_ssl.so\n 0x10526c000 - 0x105273fff mod_socache_shmcb.so (*) &lt;c5ac1319-55d4-36b9-bc37-2951a54755e1&gt; /usr/libexec/apache2/mod_socache_shmcb.so\n 0x1051b0000 - 0x1051b7fff mod_slotmem_shm.so (*) &lt;e9dcb862-26c9-3165-9c12-6ef4923ac0f9&gt; /usr/libexec/apache2/mod_slotmem_shm.so\n 0x1051d4000 - 0x1051d7fff mod_setenvif.so (*) &lt;fa23fd1b-f750-3163-93b5-cf36fa41eadc&gt; /usr/libexec/apache2/mod_setenvif.so\n 0x1051f4000 - 0x105207fff mod_rewrite.so (*) &lt;9a7b1deb-a5d1-3418-b8ec-9fec67b22d33&gt; /usr/libexec/apache2/mod_rewrite.so\n 0x1050e8000 - 0x1050ebfff mod_reqtimeout.so (*) &lt;ca6bd869-8146-332e-9b96-60efd943b3cd&gt; /usr/libexec/apache2/mod_reqtimeout.so\n 0x10508c000 - 0x105093fff mod_proxy_wstunnel.so (*) &lt;f475fa07-85cf-3460-8271-e883c14da94f&gt; /usr/libexec/apache2/mod_proxy_wstunnel.so\n 0x1050b0000 - 0x1050b3fff mod_proxy_scgi.so (*) &lt;68047c7b-1dc9-3865-af93-67bb48ad5ca7&gt; /usr/libexec/apache2/mod_proxy_scgi.so\n 0x105194000 - 0x10519ffff mod_proxy_http.so (*) &lt;28f2d968-20b6-3c0d-85f4-9360c139e83d&gt; /usr/libexec/apache2/mod_proxy_http.so\n 0x1050c8000 - 0x1050d7fff mod_proxy_ftp.so (*) &lt;7a2a1921-d1f4-313e-b323-60fa03a92d39&gt; /usr/libexec/apache2/mod_proxy_ftp.so\n 0x105054000 - 0x10505bfff mod_proxy_fcgi.so (*) &lt;7e77e1a5-edf4-3e7c-8242-fecde8c82325&gt; /usr/libexec/apache2/mod_proxy_fcgi.so\n 0x105078000 - 0x10507bfff mod_proxy_express.so (*) &lt;490ad845-3024-3c30-bcef-491693b09d51&gt; /usr/libexec/apache2/mod_proxy_express.so\n 0x104f8c000 - 0x104f8ffff mod_proxy_connect.so (*) &lt;244ce9eb-cc4e-3d35-96e0-c21f2340b8d3&gt; /usr/libexec/apache2/mod_proxy_connect.so\n 0x104ffc000 - 0x104ffffff mod_lbmethod_bytraffic.so (*) &lt;d79f367a-a3e8-3a38-a44f-791f38beff64&gt; /usr/libexec/apache2/mod_lbmethod_bytraffic.so\n 0x104fe8000 - 0x104febfff mod_lbmethod_byrequests.so (*) &lt;f7aa4778-702b-3f95-a6ca-a1db61199145&gt; /usr/libexec/apache2/mod_lbmethod_byrequests.so\n 0x104fac000 - 0x104faffff mod_lbmethod_bybusyness.so (*) &lt;2771cf11-9315-368c-8d71-f91630c3dc5a&gt; /usr/libexec/apache2/mod_lbmethod_bybusyness.so\n 0x104fc8000 - 0x104fd7fff mod_proxy_balancer.so (*) &lt;b9059786-1d1d-3939-be73-9611b4af3a38&gt; /usr/libexec/apache2/mod_proxy_balancer.so\n 0x104f40000 - 0x104f53fff mod_proxy_ajp.so (*) &lt;8f01df02-150a-30a6-a29a-f12246166b0e&gt; /usr/libexec/apache2/mod_proxy_ajp.so\n 0x105010000 - 0x10503ffff mod_proxy.so (*) &lt;02f481a0-eef9-3692-b069-ceacade08103&gt; /usr/libexec/apache2/mod_proxy.so\n 0x104f70000 - 0x104f7bfff mod_negotiation.so (*) &lt;97f10bcc-99a2-3420-ade7-dd2c660220c0&gt; /usr/libexec/apache2/mod_negotiation.so\n 0x104f08000 - 0x104f0ffff mod_mpm_prefork.so (*) &lt;75438153-147d-3522-8ba5-79903d1b5076&gt; /usr/libexec/apache2/mod_mpm_prefork.so\n 0x104f2c000 - 0x104f2ffff mod_mime.so (*) &lt;dd7fb7bb-2d48-3f36-b3e6-6ea987b2cc27&gt; /usr/libexec/apache2/mod_mime.so\n 0x104ed0000 - 0x104ed7fff mod_mime_magic.so (*) &lt;c9848a36-8019-34fe-880f-2bc1d22bdb47&gt; /usr/libexec/apache2/mod_mime_magic.so\n 0x104ef4000 - 0x104ef7fff mod_logio.so (*) &lt;7e835cd1-e2d5-3833-b83a-f1acb7bd5608&gt; /usr/libexec/apache2/mod_logio.so\n 0x104e78000 - 0x104e7ffff mod_log_config.so (*) &lt;49d48227-9a5d-3540-91b2-85bf6bedc6a1&gt; /usr/libexec/apache2/mod_log_config.so\n 0x104eb8000 - 0x104ebffff mod_headers.so (*) &lt;86f174c6-2cf1-3ab7-b2b5-2577211d7225&gt; /usr/libexec/apache2/mod_headers.so\n 0x104ea0000 - 0x104ea7fff mod_filter.so (*) &lt;ac741581-d78b-3c1b-a885-90e108ee1794&gt; /usr/libexec/apache2/mod_filter.so\n 0x104e30000 - 0x104e33fff mod_expires.so (*) &lt;e11f076f-d13a-349e-a318-fdb6d353d9eb&gt; /usr/libexec/apache2/mod_expires.so\n 0x104e64000 - 0x104e67fff mod_env.so (*) &lt;61a0f06a-8c32-3d56-afe4-039181f95f06&gt; /usr/libexec/apache2/mod_env.so\n 0x104e50000 - 0x104e53fff mod_dir.so (*) &lt;0d5e31ca-91ce-3d7e-86d6-df835844d886&gt; /usr/libexec/apache2/mod_dir.so\n 0x104dd0000 - 0x104ddbfff mod_deflate.so (*) &lt;9bb57449-f949-3e35-9a7f-a558c39fa226&gt; /usr/libexec/apache2/mod_deflate.so\n 0x104e1c000 - 0x104e1ffff mod_authz_user.so (*) &lt;938c686b-eae4-3a09-b6e0-cf8950ada811&gt; /usr/libexec/apache2/mod_authz_user.so\n 0x104e08000 - 0x104e0bfff mod_authz_host.so (*) &lt;b12b3e3a-b16d-3075-91cb-8c2f0ec7ea79&gt; /usr/libexec/apache2/mod_authz_host.so\n 0x104df4000 - 0x104df7fff mod_authz_groupfile.so (*) &lt;79f51c27-1980-345e-b8c4-6318f5a661cf&gt; /usr/libexec/apache2/mod_authz_groupfile.so\n 0x104d84000 - 0x104d8bfff mod_authz_core.so (*) &lt;d9072582-de6b-3e4e-a0ed-07a28e9e357d&gt; /usr/libexec/apache2/mod_authz_core.so\n 0x104dbc000 - 0x104dbffff mod_authn_core.so (*) &lt;4d9c5143-1272-30bb-87d1-0a4583d37739&gt; /usr/libexec/apache2/mod_authn_core.so\n 0x104da8000 - 0x104dabfff mod_auth_basic.so (*) &lt;d1abd6b3-1f21-36ea-bcaf-3e9babb4592a&gt; /usr/libexec/apache2/mod_auth_basic.so\n 0x104d50000 - 0x104d53fff mod_alias.so (*) &lt;44a0f239-3586-36b0-a8e3-963794977437&gt; /usr/libexec/apache2/mod_alias.so\n 0x104d70000 - 0x104d73fff mod_access_compat.so (*) &lt;92d8cf58-93d2-3b19-802f-e8c48a630d6e&gt; /usr/libexec/apache2/mod_access_compat.so\n 0x106730000 - 0x10787bfff libphp.so (*) &lt;2a6bf09c-ed65-3099-9f37-76e2164a8b5a&gt; /opt/homebrew/*/libphp.so\n 0x1052e4000 - 0x1052fffff libaprutil-1.0.dylib (*) &lt;ff4e99e5-c8b3-3ba3-8980-4e6f832057e4&gt; /opt/homebrew/*/libaprutil-1.0.dylib\n 0x1053c8000 - 0x1053e7fff libapr-1.0.dylib (*) &lt;f29d7d17-2d2d-3a0f-937c-4d839ad6bc1b&gt; /opt/homebrew/*/libapr-1.0.dylib\n 0x1054e0000 - 0x105573fff libtidy.5.8.0.dylib (*) &lt;a20cb3ce-48a1-35ff-8ca8-57d53c48d818&gt; /opt/homebrew/*/libtidy.5.8.0.dylib\n 0x105470000 - 0x1054bffff libsybdb.5.dylib (*) &lt;e6763ff4-a60d-3928-981d-853c89d18d72&gt; /opt/homebrew/*/libsybdb.5.dylib\n 0x1055bc000 - 0x1055f7fff libldap.2.dylib (*) &lt;36bd5697-68d9-3655-b022-dceea0c9e9a7&gt; /opt/homebrew/*/libldap.2.dylib\n 0x1052b0000 - 0x1052bbfff liblber.2.dylib (*) &lt;700121dd-8246-39ac-967a-17306e1fa3c7&gt; /opt/homebrew/*/liblber.2.dylib\n 0x10538c000 - 0x10539ffff libintl.8.dylib (*) &lt;ecb8fe68-eafe-3b09-b472-72262afc9f73&gt; /opt/homebrew/*/libintl.8.dylib\n 0x1056f0000 - 0x10577bfff libssl.3.dylib (*) &lt;c0c1d5da-bc36-3582-ad05-315e2f6294de&gt; /opt/homebrew/*/libssl.3.dylib\n 0x105be0000 - 0x105ecffff libcrypto.3.dylib (*) &lt;031cf7ae-9394-3e39-86a1-adba19a67f37&gt; /opt/homebrew/*/libcrypto.3.dylib\n 0x1057c4000 - 0x10583ffff libpcre2-8.0.dylib (*) &lt;e5960cda-25a2-3c73-b372-03bf0234355a&gt; /opt/homebrew/*/libpcre2-8.0.dylib\n 0x105984000 - 0x105a83fff libsqlite3.3.49.1.dylib (*) &lt;ba6090c0-e96c-32ad-9a76-bd2a2d54e100&gt; /opt/homebrew/*/libsqlite3.3.49.1.dylib\n 0x105854000 - 0x1058ebfff libcurl.4.dylib (*) &lt;2195d903-e85c-3c12-88e3-78877abda855&gt; /opt/homebrew/*/libcurl.4.dylib\n 0x10561c000 - 0x105643fff libgd.3.dylib (*) &lt;38c15567-d9de-35c2-a52b-decbecd18826&gt; /opt/homebrew/*/libgd.3.dylib\n 0x105ab4000 - 0x105b0bfff libgmp.10.dylib (*) &lt;f6a7b957-4314-3ea5-ac52-39a649bd3a58&gt; /opt/homebrew/*/libgmp.10.dylib\n 0x105404000 - 0x10540ffff libicuio.77.1.dylib (*) &lt;38a43692-3529-37d1-a59c-b4a18b0e3355&gt; /opt/homebrew/*/libicuio.77.1.dylib\n 0x106304000 - 0x1064b7fff libicui18n.77.1.dylib (*) &lt;95818f28-576c-33a2-bc67-8a8d7369cfed&gt; /opt/homebrew/*/libicui18n.77.1.dylib\n 0x107af8000 - 0x107c2ffff libicuuc.77.1.dylib (*) &lt;db75e962-94cb-3436-acc8-f6ba670a0143&gt; /opt/homebrew/*/libicuuc.77.1.dylib\n 0x105ffc000 - 0x106073fff libonig.5.dylib (*) &lt;48797a95-2a2d-3bdd-8415-8da571324276&gt; /opt/homebrew/*/libonig.5.dylib\n 0x105918000 - 0x10595ffff libodbc.2.dylib (*) &lt;c16a7694-1d88-3fb6-8001-54bb55b78fca&gt; /opt/homebrew/*/libodbc.2.dylib\n 0x105b24000 - 0x105b5ffff libpq.5.dylib (*) &lt;5718675a-b34e-3f8a-9a44-efd5d5ebe93a&gt; /opt/homebrew/*/libpq.5.dylib\n 0x106098000 - 0x1060e7fff libnetsnmp.40.dylib (*) &lt;1892ad53-cda5-32bb-b3b3-9942999802d6&gt; /opt/homebrew/*/libnetsnmp.40.dylib\n 0x10567c000 - 0x1056a7fff libsodium.26.dylib (*) &lt;56c8d86f-7358-3639-8b41-7605cb5e8c7c&gt; /opt/homebrew/*/libsodium.26.dylib\n 0x1053b0000 - 0x1053b7fff libargon2.1.dylib (*) &lt;1c1359ab-f0e1-3d46-a39a-f737f2e4b325&gt; /opt/homebrew/*/libargon2.1.dylib\n 0x105424000 - 0x105437fff libzip.5.5.dylib (*) &lt;def39ea5-612d-345c-b08b-7934687eb091&gt; /opt/homebrew/*/libzip.5.5.dylib\n 0x105bac000 - 0x105bc7fff libnghttp2.14.dylib (*) &lt;f25a0010-8c99-36ea-94cf-628d339c26f9&gt; /opt/homebrew/*/libnghttp2.14.dylib\n 0x1056c4000 - 0x1056d7fff librtmp.1.dylib (*) &lt;82c3a1b5-1b65-3163-8127-78fe14cc3f1b&gt; /opt/homebrew/*/librtmp.1.dylib\n 0x106158000 - 0x106187fff libssh2.1.dylib (*) &lt;3695d4de-8d5d-368b-b4c9-7559e2a3d1ff&gt; /opt/homebrew/*/libssh2.1.dylib\n 0x106244000 - 0x1062cffff libzstd.1.5.7.dylib (*) &lt;a101f9a2-32da-3484-ac68-4d3a5f26da31&gt; /opt/homebrew/*/libzstd.1.5.7.dylib\n 0x10544c000 - 0x105457fff libbrotlidec.1.1.0.dylib (*) &lt;29d3e67d-2a3c-36c9-a0cc-98e9e402f9e5&gt; /opt/homebrew/*/libbrotlidec.1.1.0.dylib\n 0x105b78000 - 0x105b97fff libbrotlicommon.1.1.0.dylib (*) &lt;606edea9-235c-3707-b338-2d3e5c178e79&gt; /opt/homebrew/*/libbrotlicommon.1.1.0.dylib\n 0x1061a0000 - 0x1061c3fff libpng16.16.dylib (*) &lt;4f596dd0-4ba2-309f-9575-d3f39e457def&gt; /opt/homebrew/*/libpng16.16.dylib\n 0x107cc0000 - 0x107d3bfff libfreetype.6.dylib (*) &lt;26d566c1-3b1f-30fb-ba97-0413177dae5e&gt; /opt/homebrew/*/libfreetype.6.dylib\n 0x10660c000 - 0x10663ffff libfontconfig.1.dylib (*) &lt;d6bfe9ad-5063-3782-9baf-3c000574dedd&gt; /opt/homebrew/*/libfontconfig.1.dylib\n 0x107d60000 - 0x107dbbfff libjpeg.8.3.2.dylib (*) &lt;b8b227c5-164c-383c-be6e-00f17e52aa00&gt; /opt/homebrew/*/libjpeg.8.3.2.dylib\n 0x107dd4000 - 0x107e37fff libtiff.6.dylib (*) &lt;9105fa36-7cf0-369b-8334-1fa1027e5dd9&gt; /opt/homebrew/*/libtiff.6.dylib\n 0x106658000 - 0x106697fff libwebp.7.1.10.dylib (*) &lt;bf8ea8d8-cafd-3b6e-85f8-edeb717f4259&gt; /opt/homebrew/*/libwebp.7.1.10.dylib\n 0x1061d4000 - 0x1061f7fff libavif.16.2.1.dylib (*) &lt;3bb0fca2-c4e2-3077-801e-40ae104ed29b&gt; /opt/homebrew/*/libavif.16.2.1.dylib\n 0x10620c000 - 0x10622bfff liblzma.5.dylib (*) &lt;11bfea8e-54ef-3917-9de3-ed2e45d851e8&gt; /opt/homebrew/*/liblzma.5.dylib\n 0x10522c000 - 0x10522ffff libsharpyuv.0.1.1.dylib (*) &lt;557f60a5-ec78-3b20-8cbf-0953e83cf8e2&gt; /opt/homebrew/*/libsharpyuv.0.1.1.dylib\n 0x108214000 - 0x108553fff libaom.3.12.0.dylib (*) &lt;6d86a487-1310-3b02-9628-8c593ce84285&gt; /opt/homebrew/*/libaom.3.12.0.dylib\n 0x107f10000 - 0x107f37fff libvmaf.3.dylib (*) &lt;51edead5-f090-39d5-8a53-c56d7fabea93&gt; /opt/homebrew/*/libvmaf.3.dylib\n 0x10a4cc000 - 0x10c337fff libicudata.77.1.dylib (*) &lt;2e99eb4a-d52e-3863-8a51-d53ab675fc1d&gt; /opt/homebrew/*/libicudata.77.1.dylib\n 0x106128000 - 0x10612ffff libltdl.7.dylib (*) &lt;18575608-f92e-392c-92ee-1a50621d0613&gt; /opt/homebrew/*/libltdl.7.dylib\n 0x107e58000 - 0x107e8bfff libgssapi_krb5.2.2.dylib (*) &lt;3df8271d-f2e5-384b-953d-224aa8e0bdb7&gt; /opt/homebrew/*/libgssapi_krb5.2.2.dylib\n 0x1080cc000 - 0x10814bfff libkrb5.3.3.dylib (*) &lt;3c834bca-c486-335b-9d18-03b9869dd712&gt; /opt/homebrew/*/libkrb5.3.3.dylib\n 0x1066e4000 - 0x106703fff libk5crypto.3.1.dylib (*) &lt;c1736bd7-1418-34da-bac4-1be9a2785977&gt; /opt/homebrew/*/libk5crypto.3.1.dylib\n 0x1052d0000 - 0x1052d3fff libcom_err.3.0.dylib (*) &lt;41e85d9b-f8cd-3890-a034-add34f6da299&gt; /opt/homebrew/*/libcom_err.3.0.dylib\n 0x106140000 - 0x106147fff libkrb5support.1.1.dylib (*) &lt;1ef8d2c4-63bf-34ed-abf6-cd926f030dae&gt; /opt/homebrew/*/libkrb5support.1.1.dylib\n 0x104c14000 - 0x104cabfff httpd (*) &lt;d94ff33b-6c51-335e-ab88-86ebc793ffb4&gt; /usr/sbin/httpd\n 0x1904fc000 - 0x190508fff libsystem_pthread.dylib (*) &lt;386b0fc1-7873-3328-8e71-43269fd1b2c7&gt; /usr/lib/system/libsystem_pthread.dylib\n 0x2573de000 - 0x2573f9fff libapr-1.0.dylib (*) &lt;d0155b6c-d5f4-3519-b1e9-5cd502865869&gt; /usr/lib/libapr-1.0.dylib\n 0x2573fa000 - 0x257415fff libaprutil-1.0.dylib (*) &lt;f63dfe08-9e78-3cfc-8cae-c33814508286&gt; /usr/lib/libaprutil-1.0.dylib\n 0x190174000 - 0x1901fca17 dyld (*) &lt;37bbc384-0755-31c7-a808-0ed49e44dd8e&gt; /usr/lib/dyld\n 0x0 - 0xffffffffffffffff ??? (*) &lt;00000000-0000-0000-0000-000000000000&gt; ???\n\nExternal Modification Summary:\n Calls made by other processes targeting this process:\n task_for_pid: 0\n thread_create: 0\n thread_set_state: 0\n Calls made by this process:\n task_for_pid: 0\n thread_create: 0\n thread_set_state: 0\n Calls made by all processes on this machine:\n task_for_pid: 0\n thread_create: 0\n thread_set_state: 0\n\nVM Region Summary:\nReadOnly portion of Libraries: Total=738.4M resident=0K(0%) swapped_out_or_unallocated=738.4M(100%)\nWritable regions: Total=1.3G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.3G(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nActivity Tracing 256K 1 \nKernel Alloc Once 32K 1 \nMALLOC 1.3G 35 \nMALLOC guard page 96K 6 \nMemory Tag 250 2048K 1 \nSTACK GUARD 56.0M 1 \nStack 8720K 2 \nStack Guard 16K 1 \nVM_ALLOCATE 896K 2 \nVM_ALLOCATE (reserved) 192K 1 reserved VM address space (unallocated)\n__AUTH 358K 78 \n__AUTH_CONST 4165K 166 \n__DATA 4716K 248 \n__DATA_CONST 7525K 259 \n__DATA_DIRTY 365K 59 \n__LINKEDIT 542.0M 94 \n__OBJC_RO 71.9M 1 \n__OBJC_RW 2199K 1 \n__TEXT 196.3M 268 \ndyld private memory 272K 2 \nshared memory 48K 3 \n=========== ======= ======= \nTOTAL 2.2G 1230 \nTOTAL, minus reserved VM space 2.2G 1230 \n\n</code></pre>\n"^^ . + . + "4"^^ . + "0"^^ . + "Do you have your dependency files on the second machine? Normally they are installed using `composer install`, and yes it is normal to do that on every machine that you install your project on. You can commit the `dompdf/dompodf` files if you want, but it is generally not regarded as good practice."^^ . + "0"^^ . + "@Barmar oh of course, thanks for picking that up for me. @Olivier interesting, if I open in Notepad++ which is what I'm doing for testing, characters like `™` and `©` display with extra characters before them if I don't put the BOM. Maybe I'm looking at the wrong solution? @IMSoP I'm always opening in Notepad++ to check before anything else. I'm not actually using Excel at any point. There is definitely a difference in output :( The end software is an accounting application and the output is for importing product updates."^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + "amazon-lightsail"^^ . + "2"^^ . + . + "<p>I have a specific need to only get models where <strong>all of the related models have a specific value</strong>.</p>\n<p>For example, I have a model called <code>User</code>, and <code>User</code> has a <code>hasMany</code> relationship on a model called <code>Job</code>.</p>\n<pre><code> \n ┌────────┐ ┌───────┐\n │ │ 1:n │ │\n │ USER │ ───────► │ JOB │\n │ │ │ │\n └────────┘ └───────┘\n \n</code></pre>\n<p>Lets say the <code>Job</code> model has a column called <code>Status</code> which can be one of the following Enums</p>\n<ul>\n<li><code>JobStatus::OPEN</code></li>\n<li><code>JobStatus::CLOSED</code></li>\n<li><code>JobStatus::SCHEDULED</code></li>\n<li><code>JobStatus::IN_PROGRESS</code></li>\n</ul>\n<p>I want to be able to create a method on the <code>User</code> model called <code>scopeIsFinished()</code>. The purpose of the scope is to filter users where <strong>every</strong> of their Jobs' status is either <code>JobStatus::CLOSED</code> or <code>JobStatus::SCHEDULED</code> (and henceforth, they have no jobs with <code>JobStatus::OPEN</code> or <code>JobStatus::IN_PROGRESS</code>). If they have one or more jobs that are open or in progress, the user is out of scope.</p>\n<p>In a perfect world, a method like the following would be great</p>\n<pre><code>/**\n * Is finished. Every single one of the users jobs are closed, they have 0 open jobs.\n *\n * @param Builder $query\n * @return Builder\n*/\npublic function scopeIsFinished(Builder $query): Builder\n{\n return $query-&gt;whereOnlyHas('jobs', function($sub){\n $sub-&gt;whereIn('status', [JobStatus::CLOSED, JobStatus::SCHEDULED]);\n });\n}\n</code></pre>\n<p>Does anyone know if this is possible, or a nice clean easy way I can achieve this?</p>\n<p>I want to avoid making relationships like <code>openJobs</code>, <code>closedJobs</code>, <code>scheduledJobs</code>, etc, and have the scope rely on <code>whereHas()</code> and <code>whereDoesntHave()</code>.</p>\n"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + "1"^^ . + . + . + "0"^^ . + "it's only a comment"^^ . + . + . + "0"^^ . + "Feel free to add all clarification **to your question** by editing it"^^ . + . + "What is the error? It can't be. Should work"^^ . + . + . + "0"^^ . + . + . + "swoole"^^ . + . + . + . + . + . + "Let me rephrase myself:\nI added the line export LD_LIBRARY_PATH=/opt/sqlanywhere17/lib64 into /etc/apache2/envvars to make sure apache is looking in the right library.\nIt seems to partially resolve the issue, but introduces me to a new issue:\n[IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed\n[ISQL]ERROR: Could not SQLConnect\n\nThis, I can not wrap my head around why or where its coming from."^^ . + "<p>I try to do a simple SQL query in php but the WHERE clause is not working. If I remove the WHERE condition I get all the results and If I execute the query directly in the SQL Editor of the Database I get the correct response. What am I doing wrong?</p>\n<pre class="lang-php prettyprint-override"><code>$dbConnection = new PDO('mysql:dbname=XYZ;host=XYZ;', 'XYZ', 'XYZ');\n$dbConnection-&gt;setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n$dbConnection-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);\n \n$statement = $dbConnection-&gt;prepare(&quot;\n SELECT produktId, datum_gebucht \n FROM tric.lager_umbuchungen \n WHERE datum_gebucht LIKE '2025-02-25 - 10:40:29'\n&quot;);\n \n$statement-&gt;execute();\n \n$result = $statement-&gt;fetchAll(PDO::FETCH_ASSOC);\nprint_r($result);\n</code></pre>\n<pre><code>Structure:\nproduktid bigint(20)\ndatum_gebucht varchar(50)[1]\n</code></pre>\n<pre><code>Example:\nproduktId datum_gebucht\n5901341895 2025-02-25 - 10:40:29\n</code></pre>\n<p>Query I used in the Editor directly:</p>\n<pre class="lang-sql prettyprint-override"><code>SELECT produktId, datum_gebucht \nFROM lager_umbuchungen \nWHERE datum_gebucht LIKE '2025-02-25 - 10:40:29'\n</code></pre>\n<p>Output of <code>print_r($result)</code></p>\n<pre class="lang-php prettyprint-override"><code>Array ( )\n</code></pre>\n"^^ . + "1"^^ . + "2"^^ . + . + "You need to be sure `$old_role` will be `'pending'`, otherwise the code in the if-statement will never be executed."^^ . + "Instead of debugging the existing project, I created a new one using `composer create-project --prefer-dist yiisoft/yii2-app-basic hello-yii` and `composer require yiisoft/yii2-mongodb`. Then, I created a test model that extends `\\mongodb\\ActiveRecord` with `attributes() {return ['_id', 'name'];}`. If no attributes are explicitly set, calling `(new Model)->toArray()` returns an empty array ([]). So seems like ActiveRecord::toArray returns only explicitly set attributes? How this magic happens is still uknown."^^ . + . + . + . + "<pre class="lang-php prettyprint-override"><code>class ExampleUserService\n{\n\n public function approve($user, $data)\n {\n\n $approvedUser = DB::transaction(function () use ($user, $data) {\n if ($data['approve_by_admin'] == 1) {\n $this-&gt;updateAdminStatus($user);\n }\n\n $user-&gt;update(['approved' =&gt; 1]); // This fires updated event\n });\n }\n\n public function updateAdminStatus($user, $data)\n {\n $user = DB::transaction(function () use ($user, $data) {\n\n //Some Logic\n\n $user-&gt;update(['status' =&gt; 5]); // This doesn't fire event\n });\n }\n}\n</code></pre>\n<p>I have Scenario like above where same model gets updated in nested transactions but observer get only changes of last transaction, i want to get all updates in observer for same model.</p>\n"^^ . + "0"^^ . + . + "0"^^ . + . + . + "4"^^ . + "1"^^ . + . + . + . + "How to insert child node / unique key from my data?"^^ . + "1"^^ . + "<p>I get this error from Laravel:</p>\n<pre><code>Attempt to read property &quot;id&quot; on null\n</code></pre>\n<p>Here is the code line where the error is generated:</p>\n<pre><code> $count = $lastNumber-&gt;id - $lastColumn-&gt;id;\n</code></pre>\n<p>Here is the method with that code inside:</p>\n<pre><code>/**\n * Count last column extraction\n */\npublic function countColumn($column)\n{\n $lastNumber = Number::all()-&gt;sortByDesc('created_at')-&gt;first();\n $lastColumn = Number::all()-&gt;where('column', '=', $column)-&gt;sortByDesc('created_at')-&gt;first();\n $count = $lastNumber-&gt;id - $lastColumn-&gt;id;\n return $count;\n}\n</code></pre>\n<p>This is a method of my NumberController.php.</p>\n<p>I don't understand, what is the problem that generates that error? I had try to dd() the 2 variables $lastNumber and $lastColumn and I see a result so the variable its not empty or null.</p>\n<p>What am I doing wrong?</p>\n"^^ . + . + . + "Most likely this shortcode also adds some JS to the document, to initialize the player - but when you simply switch out the HTML code of the player element, that JS code won't run again."^^ . + "PHP exec() resulting in infinite/forever loop when calling another PHP script"^^ . + . + . + "0"^^ . + . + "1"^^ . + "<p>I am developing a function that gives me the results of sales on a product in a certain period of time, in order to correctly fill in the data to send to Google Merchant. So I created a mysql query that works from phpmyadmin and I transformed it into php. But while in mysql it works perfectly in php it always gives me a result equal to an empty string.</p>\n<p>I need to convert this mysql to php</p>\n<pre><code>SELECT COUNT(product_id) \nFROM wp_wc_order_product_lookup \nWHERE product_id = 4098995 \n AND date_created &lt; '2025-02-11' \n AND date_created &gt; '2017-02-11' \nlimit 50\n</code></pre>\n<p>this is my php</p>\n<pre><code> $sql = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT COUNT(product_id) FROM $wpdb-&gt;wp_wc_order_product_lookup WHERE product_id = 4098995 AND date_created &lt; '2025-02-11' AND date_created &gt; '2017-02-11' limit 50&quot;),$product_id,$date_from,$date_to );\n</code></pre>\n<p>but I don't know why it doesn't give me the results, while if I use phpmyadmin I have 28 as a count</p>\n<p>this is the complete function</p>\n<pre><code>global $product;\nglobal $wpdb;\n\n$sku = $sku.$sex;\n\n$product_id = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT post_id FROM $wpdb-&gt;postmeta WHERE meta_key='_sku' AND meta_value='%s' LIMIT 1&quot;, $sku ) );\n\n$date_to = date(&quot;Y-m-d&quot;, strtotime('-96 months'));\n$date_from = date(&quot;Y-m-d&quot;);\n\n\n$product_id = 4098995;\n\n$tot = get_post_meta($product_id,'total_sales',true);\n\necho &quot;vendite totali &quot;. $tot . &quot; id prodotto &quot;. $product_id. &quot; dalla data &quot;. $date_from . &quot; fino alla data &quot;.$date_to;\n\n$sql = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT COUNT(product_id) FROM $wpdb-&gt;wp_wc_order_product_lookup WHERE product_id = 4098995 AND date_created &lt; '2025-02-11' AND date_created &gt; '2017-02-11' limit 50&quot;),$product_id,$date_from,$date_to );\n\necho &quot; TEST SQL &quot; . $sql;\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + "conditional-statements"^^ . + "0"^^ . + . + . + . + "2"^^ . + . + . + . + "Choose a product from 3 products with trial"^^ . + "<p>Given your input is in <code>$input</code> variable, I made a simple script to parse it line-by-line. If it starts with a timestamp, start collecting a new document. Otherwise append to the current one.</p>\n<pre class="lang-php prettyprint-override"><code>$documents = [];\nforeach (explode(&quot;\\n&quot;, $input) as $line) {\n preg_match('/(?P&lt;timestamp&gt;\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},\\d{3}) - (?P&lt;message&gt;[^&lt;]+) (?P&lt;xml&gt;.*?)$/s', $line, $m);\n if ($m) {\n $documents[] = $m['xml'];\n } else {\n $documents[count($documents)-1] .= &quot;\\n&quot;.$line;\n }\n}\n \n \n$transactions=[];\nforeach ($documents as $document) {\n $xml = simplexml_load_string($document);\n $transactions[(string) $xml-&gt;unique_id] = (string) $xml-&gt;transaction_id;\n}\nvar_dump($transactions);\n</code></pre>\n<p>This might require some tweaks if your input contains more distinct patterns.</p>\n"^^ . + . + "`COUNT(*) OVER (PARTITION BY name)`"^^ . + . + . + "<p>I have a TYPO3 page that lists items using <code>QueryResultInterface</code> filters.</p>\n<p>So I am using <code>setOffset</code> and <code>setLimit</code> to get partial results, and ajax to get more results when required.</p>\n<p>The part I'm not sure about is how to get the total number of filtered results on the frontend so that I can let javascript know when it has reached the end?</p>\n<p>I've figured out that if I do this:</p>\n<pre><code>$query = $this-&gt;createQuery();\n\n...filters...\n\n$total = $query-&gt;count();\n\n$query-&gt;setOffset($myoffset);\n$query-&gt;setLimit($mylimit);\n\n$query2 = $query-&gt;execute();\n$query2[total] = $total;\n\nreturn $query2;\n</code></pre>\n<p>I get the <strong>unfiltered</strong> total as an integer in my array and can access using <code>{myitems.total}</code> in the fluid template.</p>\n<p>If I <code>$total = $query-&gt;execute()-&gt;count();</code> I get the right number but would defeat the purpose of breaking up the data...</p>\n"^^ . + . + . + . + . + . + "Use avatar in other model"^^ . + . + "0"^^ . + . + . + . + . + "The browser only displays one space. Check the generated HTML source code ("view source code" in your browser) or add a `<pre>` tag between the output of `var_dump()`, then you see the two spaces."^^ . + "0"^^ . + . + "I edited my question to include the trace."^^ . + . + "What if I do not use seeder and want to enter data through the site, it will give the same error."^^ . + . + "1"^^ . + "embed"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + "You're welcome. Azure functions can be (among a few other things) an "API endpoint in the cloud". I see you are using JavaScript to call admin-ajax.php. That's an API call. That should be the Azure function endpoint instead. You also mentioned that it takes a while to run. That won't be a problem with the Azure function (whereas app service has a strict 230s limit). You also mentioned the code is python. The Azure function could be python. That means you don't need PHP or a shell script to run it as python. The Azure function will return the raw data or store in blob storage."^^ . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + "0"^^ . + "<p>I assume this is a rented hosting service. You have access to your hosting. In the root directory, you should find a <code>.bashrc</code> file, which allows you to override the default aliases for yourself. (If there is no <code>.bashrc</code>, create one.)</p>\n<p>Add the appropriate aliases for both PHP and Composer to this <code>.bashrc</code> file, like this:</p>\n<pre class="lang-bash prettyprint-override"><code>alias php='/usr/local/bin/ea-php81'\nalias composer='php /opt/cpanel/composer/bin/composer'\n</code></pre>\n<p>Now <code>php -v</code> always will get 8.1 result instead of 7.4. You will now access your Composer through the new alias php. You should know the exact path, but these are the ones I usually recommend for cPanel. I assume it should be similar.</p>\n<p>The default PHP alias considers the version used by the server's cPanel as the main version (currently 7.4), so it can only be updated by the server administrators. However, with the <code>.bashrc</code>, you have the option to override this (to 8.1 or another version) for yourself by setting a new alias.</p>\n"^^ . + "0"^^ . + . + "<h1>Configuration</h1>\n<p>Our system has:</p>\n<ul>\n<li>PHP 8.2</li>\n<li>AWS Memcached library with OpenSSL</li>\n<li>AWS Fargate ECS deployment</li>\n<li>AWS Elasticache</li>\n</ul>\n<h1>Problem</h1>\n<p>The initial login for users appears to write and read from memcached. However, upon opening a second tab, our users are getting logged out.</p>\n<p>Our Memcached connection configuration is:</p>\n<pre><code>// AWS ElastiCache setup\n$this-&gt;_memcached = new Memcached('persistent-id');\n\n// Set options before adding server\n$this-&gt;_memcached-&gt;setOption(Memcached::OPT_CLIENT_MODE, Memcached::DYNAMIC_CLIENT_MODE);\n$this-&gt;_memcached-&gt;setOption(Memcached::OPT_BINARY_PROTOCOL, true);\n$this-&gt;_memcached-&gt;setOption(Memcached::OPT_TCP_NODELAY, true);\n$this-&gt;_memcached-&gt;setOption(Memcached::OPT_NO_BLOCK, true);\n$this-&gt;_memcached-&gt;setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);\n$this-&gt;_memcached-&gt;setOption(Memcached::OPT_DISTRIBUTION, Memcached::DISTRIBUTION_CONSISTENT);\n\n// Set TLS option before adding server\nif (!$this-&gt;_memcached-&gt;setOption(Memcached::OPT_USE_TLS, true)) {\n error_log(&quot;Failed to set TLS option: &quot; . $this-&gt;_memcached-&gt;getLastErrorMessage());\n return false;\n}\n\n// Configure TLS context\n$tls_config = new MemcachedTLSContextConfig();\n$tls_config-&gt;hostname = '*.cache.amazonaws.com'; // More general hostname pattern\n$tls_config-&gt;skip_cert_verify = false;\n$tls_config-&gt;skip_hostname_verify = false;\n\n// Set TLS context before adding server\ntry {\n $this-&gt;_memcached-&gt;createAndSetTLSContext((array)$tls_config);\n} catch (Exception $e) {\n error_log(&quot;Failed to set TLS context: &quot; . $e-&gt;getMessage());\n return false;\n}\n\n// Use TLS port (21211) for AWS ElastiCache with TLS\nif (!$this-&gt;_memcached-&gt;addServer($this-&gt;_host, 21211)) {\n error_log(&quot;Failed to add server: &quot; . $this-&gt;_memcached-&gt;getLastErrorMessage());\n return false;\n}\n\n</code></pre>\n<p>In my php.ini, memcached is configured with the following options:</p>\n<pre><code>memcached.sess_locking = 1\nmemcached.sess_lock_wait_min = 150\nmemcached.sess_lock_wait_max = 150\nmemcached.sess_lock_retries = 200\nmemcached.sess_lock_expire = 0\nmemcached.sess_persistent = 1\nmemcached.sess_prefix = &quot;memc.sess.key.&quot;\nmemcached.sess_consistent_hash = 1\n</code></pre>\n<p>The AWS Documentation does not make any recommendations for a way to configure the memcached library. Our Docker configuration is pulling their extension and enabling it through the following configuration:</p>\n<pre><code># Install and configure Amazon ElastiCache Cluster Client\nRUN curl -L https://elasticache-downloads.s3.amazonaws.com/ClusterClient/PHP-$PHP_VERSION/$MEMCACHED_URL | tar -C /tmp -zx \\\n &amp;&amp; mv /tmp/amazon-elasticache-cluster-client.so /usr/lib/php/20220829/amazon-elasticache-cluster-client.so \\\n &amp;&amp; rm -rf /tmp/Readme.markdown \\\n &amp;&amp; echo &quot;extension=amazon-elasticache-cluster-client.so&quot; &gt;&gt; /etc/php${PHP_VERSION}/php.ini\n</code></pre>\n<p>This appears to enable the amazon elasticache cluster client correctly, as we are not downloading memcached through any other mean and it works as intended on local (connecting to our self-hosted docker/memcached container).</p>\n"^^ . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + "3"^^ . + . + "0"^^ . + . + "0"^^ . + "php-attributes"^^ . + . + "@Sitepor500.com.br OK, see update."^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + "`I tried these steps:`...both these steps seem quite extreme when you haven't even identified a root cause of the problem, or even properly comprehended the error message yet. Don't troubleshoot by guesswork, do some proper debugging first."^^ . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + "Can you also include your route? either `web.php` or `api.php`"^^ . + . + "0"^^ . + "sanitization"^^ . + "Ok did it as per your request. But I'm trying to get in a shortcode based on product ID's"^^ . + . + "<p>The official documentation says that &quot;Note that foreach does not modify the internal array pointer&quot;, but on some <a href="https://www.google.it/books/edition/Essential_PHP_fast/gGwKBwAAQBAJ?hl=en&amp;gbpv=1&amp;dq=php%20array%20%22internal%20pointer%22&amp;pg=PA125&amp;printsec=frontcover" rel="nofollow noreferrer">books</a> I found this:</p>\n<p><a href="https://i.sstatic.net/MBgNajcp.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MBgNajcp.png" alt="enter image description here" /></a></p>\n<p>Maybe both sentences are right because the internal pointer of the original array is not modified by the foreach loop, but the internal pointer of the copied array on which the foreach loop iterates changes?</p>\n<hr />\n<p>EDIT: I'm looking for the implementation of the foreach loop to see what's going on inside.</p>\n"^^ . + "<p>MongoDB does not natively support the relational model and its typical relationships like JOINs, which are commonly used in SQL-based databases and handled by ORMs (Object-Relational Mappers). MongoDB is a NoSQL database, and it uses a document-oriented model instead, where data is stored in JSON-like documents.</p>\n<p>In MongoDB, relationships are typically managed in a different way, like by embedding documents or using manual references between them, but it doesn't have the automatic relationship management features that ORMs provide for relational databases.</p>\n"^^ . + "@hakre They are logging `log_errors = On;`. If PHP is throwing an error then it will be logged according to that directive."^^ . + . + "0"^^ . + "0"^^ . + "When you run `php artisan route:list`, do you see "/chefsUpload"? If you see, is it has prefix like "/prefix/chefsUpload"?"^^ . + . + "1"^^ . + "I think I already explained the concepts you need in order to understand this in the [last set of comments on your previous question](https://stackoverflow.com/questions/79475438/ajax-post-a-variable-without-sending-the-result-to-anything-specific#comment140162401_79475438), which you never responded to. I explained that, in an AJAX request, you have to use JS to actively process the response from the server, and not expect it to automatically update the rest of your page, and linked you to an example showing how that's done. Did you look at any of that? It seems not, judging by this post"^^ . + "0"^^ . + . + . + "2"^^ . + "laravel-cloud"^^ . + . + . + . + "6"^^ . + . + . + . + "<p>In Shopware 6, the <code>bin/console dal:validate</code> command is implemented in the <a href="https://github.com/shopware/shopware/blob/v6.6.9.0/src/Core/Framework/DataAbstractionLayer/Command/DataAbstractionLayerValidateCommand.php" rel="nofollow noreferrer"><code>DataAbstractionLayerValidateCommand</code></a> class.</p>\n<p>When this command is executed, it triggers the <code>execute()</code> method. During execution, the method utilizes the <a href="https://github.com/shopware/shopware/blob/v6.6.9.0/src/Core/Framework/DataAbstractionLayer/DefinitionValidator.php" rel="nofollow noreferrer"><code>DefinitionValidator</code></a> service to run the main validation process for all registered Entity Definitions.</p>\n<p>One of the key steps in this validation process is calling the following code:</p>\n<pre class="lang-php prettyprint-override"><code>$errors = $this-&gt;validator-&gt;validate();\n</code></pre>\n<p>As part of this process, it invokes the <code>validateStruct()</code> method to validate the structure of the entities, checking for the presence of necessary getter and setter methods.</p>\n<p>Here’s the relevant code inside the <code>validate()</code> method:</p>\n<pre class="lang-php prettyprint-override"><code>$violations[$definitionClass] = array_merge(\n $violations[$definitionClass],\n $this-&gt;validateStruct($struct, $definition)\n);\n</code></pre>\n<p>The <code>validateStruct()</code> method ensures that all expected getter and setter methods are present in the Entity Struct. It checks whether each field in the definition has a corresponding getter and setter method, and if not, it generates errors like:</p>\n<pre class="lang-none prettyprint-override"><code>No getter function for property xyz in App\\Entity\\ExampleStruct\nNo setter function for property xyz in App\\Entity\\ExampleStruct\n</code></pre>\n<p>The issue you are facing is related to how the <code>bin/console dal:validate</code> command works. It expects explicit getters and setters for each entity property, which leads to errors when using attributes like <code>#[Field]</code> and <code>#[ManyToMany]</code> without the corresponding methods. To resolve this issue, you can either explicitly define getters and setters for all properties or wait for Shopware to update the validation logic so the command works correctly with entity attributes.</p>\n"^^ . + . + . + . + . + . + . + "Is possible to use Visitor IP Address in cURL"^^ . + . + . + "I know you told me two times but that isn't the case. I run the update. No update. I then change the T for a t making it different. Again no update, I then change another character S to a t and it updates.\n\nThe script on that page runs fine, it just return 0 which is what I am saying. If I had a working example I wouldn't have an issue it is because I can't get it to work. \n\nInterestingly enough the SQL side of the page changes the record fine. so going to play with that. I'll get there in the end. May as well close this down as it isn't going anywhere."^^ . + . + "1"^^ . + "1"^^ . + "0"^^ . + . + . + . + "It looks like that the ActiveRecord::toArray() method only returns explicitly set attributes, while the base/Model returns all attributes, including unset ones. This difference is due to how the attributes() method in DynamicModel works — it only returns the attributes that have been set, as seen in the [code here](https://github.com/yiisoft/yii2/blob/16f50626e1aa81200f109c1a455a5c9b18acfdda/framework/base/DynamicModel.php#L261)"^^ . + "Agreed, if this was the specific problem you're having it's not clear why you didn't mention this before. [Edit] your question to clarify it. Thanks"^^ . + . + "#1 put me on the right track. Turns out there was a setting in FluentSMTP to "Force From Email" that I had to disable."^^ . + "2"^^ . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + "<p>I have a <code>Trait</code> called <code>HasDefault</code>\nits main purpose is to ensure that the class has a static field <code>$default</code> which is callable and returns the default instance of the class using the Trait</p>\n<p>This is what the Trait code looks like:</p>\n<pre><code>private static $default;\n\npublic static function setDefault(callable $fn): void\n{\n self::checkWhetherCallableReturnsClass($fn);\n self::$default = $fn;\n}\n\npublic static function getDefault(): static\n{\n if (!isset(static::$default)) {\n static::initDefault();\n }\n return call_user_func(static::$default);\n}\n\nprotected static function initDefault(): void\n{\n static::$default = function (): static {\n return new static();\n };\n}\n</code></pre>\n<p>What is important is that the Trait call <code>$default</code> must return an object of the class that uses the Trait.</p>\n<p>For example, if the class <code>MySuperClass</code> uses this trait, the object returned for it must be an object of the class <code>MySuperClass</code> or classes that inherit from it.</p>\n<p>Basically, the check if this type is correct is in the <code>getDefault()</code> return tag, but since the function returning the default instance can be replaced with another function, I wanted to make sure that it would return the correct object when calling <code>setDefault</code>, and not when calling the <code>getDefault</code> method.</p>\n<p>For this reason, I added the method <code>checkWhetherCallableReturnsClass</code>, which is private, and its main task is to check, based on Reflection, if the return tag is correct and throw an exception if it is not.</p>\n<p>Generally, the method accepts:</p>\n<ul>\n<li>The class name.</li>\n<li><code>static</code> or <code>self</code> only in the case when <code>static</code>/<code>self</code> refers to a class like the one that uses the Trait.</li>\n<li>Or the above if the return type is IntersectionType e.g. <code>static&amp;SomeInterface</code> (With the caveat as above)</li>\n</ul>\n<h3>Problem</h3>\n<p>Now, the problem is how to test this. In most of these similar scenarios I'm using anonymous classes and it would look like this:</p>\n<pre><code>private function getObjectThatIsCorrect(): object\n{\n return new class(0) {\n use HasDefault;\n\n protected static function initDefault(): void\n {\n static::$default = function (): self {\n return new self(5);\n };\n }\n\n public function __construct(public int $fakeIdToRecognizeObjects)\n {\n }\n\n public function returnThisByStatic(): static\n {\n return $this;\n }\n\n public function returnThisBySelf(): self\n {\n return $this;\n }\n\n public static function returnsNewByStatic(): static\n {\n return new static(1);\n }\n\n public static function returnsNewBySelf(): self\n {\n return new self(2);\n }\n };\n}\n</code></pre>\n<p>And use that annonymous several times to test like this:</p>\n<pre><code>$object = $this-&gt;getObjectThatIsCorrect();\n$object::setDefault([$object, 'returnThisByStatic']);\n\n$this-&gt;assertEquals($object, $object::getDefault());\n\n$object = $this-&gt;getObjectThatIsCorrect();\n$object::setDefault([$object, 'returnThisBySelf']);\n$this-&gt;assertEquals($object, $object::getDefault());\n\n$object = $this-&gt;getObjectThatIsCorrect();\n$object::setDefault([$object, 'returnsNewByStatic']);\n$this-&gt;assertEquals(1, $object::getDefault()-&gt;id);\n\n$object = $this-&gt;getObjectThatIsCorrect();\n$object::setDefault([$object, 'returnsNewBySelf']);\n$this-&gt;assertEquals(2, $object::getDefault()-&gt;id);\n</code></pre>\n<p>And in this case everything will work perfectly, the problem arises when I want to test an anonymous function:</p>\n<pre><code>public function testSetDefault()\n{\n $object = $this-&gt;getObjectThatIsCorrect();\n $object::setDefault(function () use ($object) {\n return $object;\n });\n $this-&gt;assertEquals($object, $object::getDefault());\n}\n</code></pre>\n<p>The problem is that this of course won't work (and rightly so), because the anonymous function doesn't have any return tag declared.</p>\n<p>However, I can't do that, because the class is anonymous, so I don't know how I would put its name there.</p>\n<p>Secondly, even if I skipped this scenario and checked other methods, the problem is that i should also test if it works when that class is child of that class. But how I could extend anonymous class...</p>\n<p>I try other methods like <code>$this-&gt;getMockForTrait()</code>, <code>$this-&gt;getObjectForTrait()</code> but their are deprecated since: <a href="https://github.com/sebastianbergmann/phpunit/issues/5244" rel="nofollow noreferrer">https://github.com/sebastianbergmann/phpunit/issues/5244</a>.</p>\n<p>After reading this I began to question whether what I was doing was even worthwhile, and if not, why not. Not only am I unable to test it, but I also cannot answer the question whether what I am trying to achieve is worth it at all.</p>\n<p>Any ideas?</p>\n"^^ . + . + "Please [edit] your question to specifically and clearly define the problem that you are trying to solve. Additional details — including error messages and debugging logs — will help readers to better understand your problem and [what you are asking]."^^ . + . + . + . + "0"^^ . + . + . + "google-wallet"^^ . + . + "ADyson. Thanks for your help. When adding your tag it doesn't output nothing. I can put all the script for you here although it becomes one line fused together. You can then try it on your laptop if you have apache PHP server."^^ . + "<p>When you use <code>DOMDocument::loadHTML()</code> in PHP, it automatically wraps the provided HTML fragment in <code>&lt;html&gt;</code> and <code>&lt;body&gt;</code> tags if they are not already present. This is because DOMDocument expects a complete HTML document structure.</p>\n<p>The DOMDocument class doesn't support direct CSS-style selectors like <code>body *</code>, but you can work around this by accessing the body element first and then getting its child nodes:</p>\n<pre><code>$doc = new DOMDocument();\n$doc-&gt;loadHTML($product['description']); // comes from db\n\n// Get the body element\n$body = $doc-&gt;getElementsByTagName('body')-&gt;item(0);\n\n// Check if the body element exists\nif ($body) {\n // Get all child elements of the body\n $els = $body-&gt;getElementsByTagName('*');\n\n foreach ($els as $node) {\n echo($node-&gt;nodeName . ' ' . $node-&gt;nodeValue . &quot;\\n&quot;);\n }\n} else {\n echo &quot;Body tag not found.&quot;;\n}\n</code></pre>\n"^^ . + "Share your .htaccess code"^^ . + "Why did you tag this with Laravel 5 and 6? Also, keep in mind that Laravel 6 is EOL since way more than two years. Finally, where's the code that tried to block Postman and cURL? Did you try anything?"^^ . + . + . + . + . + . + . + "<blockquote>\n<p>Am I making a mistake somewhere in my logic?</p>\n</blockquote>\n<p>I guess you want to count elements, and there you make the mistake to count nodes.</p>\n<p>Let's say we create a HTML document with an implied body and a headline:</p>\n<pre class="lang-php prettyprint-override"><code> $html = Dom\\HTMLDocument::createFromString\n (\n source: &quot;&lt;title&gt;{$title}&lt;/title&gt;&lt;h1&gt;{$title}&lt;/h1&gt;&quot;,\n options: LIBXML_NOERROR,\n );\n</code></pre>\n<p>Then we insert the numbers from one up to twenty-five after the headline, separated by a break each:</p>\n<pre><code> foreach (range(1, 25) as $index =&gt; $number)\n {\n if ($index)\n {\n $append[] = $html-&gt;createElement('br');\n }\n\n $append[] = &quot;\\n{$f-&gt;format($number)}\\n&quot;;\n }\n\n $body = $html-&gt;querySelector('body');\n $body-&gt;append(...$append);\n</code></pre>\n<pre class="lang-html prettyprint-override"><code>&lt;h1&gt;Untitled Document&lt;/h1&gt;\n\none\n\n&lt;br&gt;\n\ntwo\n\n&lt;br&gt;\n\nthree\n\n&lt;br&gt;\n\n...\n</code></pre>\n<p>Now we buffer all child-nodes of the body and at every tenth entry the separator:</p>\n<pre><code> $cached = iterator_to_array($body-&gt;childNodes);\n\n $count = 0;\n foreach ($cached as $child)\n {\n $buffer[] = $html-&gt;saveHtml($child);\n\n if (++$count % 10 === 0)\n {\n $buffer[] = &quot;&lt;p&gt;separator every {$f-&gt;format(10)} items: {$f-&gt;format($count)}&lt;/p&gt;&quot;;\n }\n }\n</code></pre>\n<p>This similar, but perhaps more clarified example then shows, that every fifth number, the every tenth separator is inserted:</p>\n<pre class="lang-html prettyprint-override"><code>four\n\n&lt;br&gt;\n\nfive\n\n&lt;p&gt;separator every ten items: ten&lt;/p&gt;\n&lt;br&gt;\n\nsix\n\n&lt;br&gt;\n\nseven\n</code></pre>\n<p>As the output shows, you should perhaps count the elements if you mean it, not the child nodes that can contain text-nodes as well. The text nodes are the written-out numbers, the br-tags are actual tags. Both count as one node.</p>\n"^^ . + "by the way, is that relevant to the issue that the application is not starting automatically on port 8000 or whatever we want to define it?"^^ . + "0"^^ . + "3"^^ . + "2"^^ . + . + "0"^^ . + . + . + . + "<p>Try the below step, for your chirps problem, might this help you out.</p>\n<p><strong>Define the Functional Component with Pagination</strong>\nModify routes/web.php to include pagination:</p>\n<pre><code>use App\\Models\\Chirp;\nuse Livewire\\Livewire;\nuse Livewire\\WithPagination;\n\nLivewire::component('chirps', function () {\n return function () {\n return view('livewire.chirps', [\n 'chirps' =&gt; Chirp::latest()-&gt;paginate(5), // Load 5 chirps per page\n ]);\n };\n});\n</code></pre>\n<p><strong>Create the View File resources/views/livewire/chirps.blade.php</strong></p>\n<pre><code>&lt;div&gt;\n &lt;h2&gt;Chirps&lt;/h2&gt;\n \n &lt;ul&gt;\n @foreach ($chirps as $chirp)\n &lt;li&gt;{{ $chirp-&gt;content }} - &lt;small&gt;{{ $chirp-&gt;created_at-&gt;diffForHumans() }}&lt;/small&gt;&lt;/li&gt;\n @endforeach\n &lt;/ul&gt;\n\n &lt;!-- Pagination Links --&gt;\n {{ $chirps-&gt;links() }}\n&lt;/div&gt;\n</code></pre>\n<p>Use the Livewire component inside any Blade file:</p>\n<pre><code>@livewire('chirps')\n</code></pre>\n<p>I am using the same way in my laravel project and it's working</p>\n"^^ . + . + . + ""I want to use something other than mcrypt due to it being deprecated, but not lose thousands of users passwords" - why not use phpseclib that helps to use the old passwords, and rehash them on the next login?"^^ . + "1"^^ . + "-1"^^ . + "My question is in the title: "How create anonymous classes that aren't the same class" and this is correct answer, check this out: https://3v4l.org/LZLdZ"^^ . + . + . + "5"^^ . + . + "Image is being corrupted when sent through cURL"^^ . + . + . + "<p>I need to filter the product price for products which use the custom-tax-class when the product is added to cart so i can calculate the tax based on the margin = price - purchase price rather than the price.</p>\n<pre class="lang-php prettyprint-override"><code>add_filter('woocommerce_calc_tax', 'modify_price_for_tax_calculation_v4', 10, 5);\nfunction modify_price_for_tax_calculation_v4( $taxes, $price, $rates, $price_includes_tax, $suppress_rounding ) {\n\n if ( is_admin() &amp;&amp; ! defined( 'DOING_AJAX' ) ) {\n return;\n }\n // Get the global cart\n $cart = WC()-&gt;cart;\n if (!$cart) return $taxes; // Ensure cart exists\n\n // Loop through each cart item\n foreach ($cart-&gt;get_cart() as $cart_item_key =&gt; $cart_item) {\n $product = $cart_item['data'];\n\n // Check if the product uses the custom tax class\n if ( 'custom-tax-class' === $product-&gt;get_tax_class() ) {\n // Get the purchase price (replace '_purchase_price' with actual meta key)\n $purchase_price = 100;\n\n // Ensure product price is a float\n $product_price = floatval( $product-&gt;get_price() );\n \n $quantity = intval($cart_item['quantity']);\n\n // Calculate the margin (product price - purchase price)\n $margin = max(($product_price - $purchase_price) * $quantity, 0); // Ensure margin is not negative\n\n // Apply tax rates to margin instead of the product price\n foreach ( $rates as $rate_id =&gt; $rate ) {\n \n // Loop through each cart ite\n \n $rate_percentage = floatval( $rate['rate']); // Convert rate to decimal\n $modified_price = round( $margin * $rate_percentage, 2 ); // Apply margin-based tax calculation\n\n // Set modified tax amount\n $taxes[$rate_id] = $modified_price;\n }\n }\n }\n\n return $taxes; // Return the modified tax values\n}\n</code></pre>\n<p>I tried this code but 1. it doesn't modify the custom tax, it modifies the standard tax and 2. the calculations are all wrong.</p>\n<p>Example : If the product price = $200 and the purchase price = $100 the $margin = $100</p>\n<p>If the tax rate for the custom-tax-class = 10%, the tax should be $10 but its displaying as $20 and modifying the tax for the product with the standard tax class when it should modify the tax for the product with the custom tax class.</p>\n<p><strong>Update 1 :</strong> I think i need to filter the $price used in the tax calculation rather than modify the $taxes variable as i need to modify the price in the cart totals based on the difference between the purchase price and the product price for tax purposes.</p>\n<p><strong>Update 2 :</strong> The new code works when 1 product added to cart but not when more than 1 added.</p>\n"^^ . + . + . + . + . + . + "@Hakre Thank you for your feedback. I was refering to this article which was upvoted into the stars. https://stackoverflow.com/questions/1381364/max-file-size-in-php-whats-the-point . I just noticed it was a very old articel. So you were right, it was limited in the form. Thanks again."^^ . + . + "0"^^ . + "Search engines are wonderful things. Just type "php sqlite", it's a lot quicker than waiting for us to do it for you"^^ . + . + . + . + . + . + "@ADyson I tried, believe me, it didn't work, it's also very complex, so I said let's search here, maybe someone has encountered it and solved it."^^ . + . + . + "1"^^ . + . + "Where is `$videoId` being set?"^^ . + . + . + . + . + "2"^^ . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + "0"^^ . + "Answer for @krisgjika that the refrences for test my cases. I just want two request at once that the backend API is from Laravel too."^^ . + "Thank you, your solution is very creative but in my case the other solution made it easier to read the code."^^ . + . + "github"^^ . + . + "0"^^ . + "<p>Instead of e-mails, use a unique, randomly generated string that is associated to the user's account. For example:</p>\n<pre class="lang-none prettyprint-override"><code>https://example.com/unsubscribe/MyCode.php?param=uaefa987asdfnkajdsfhaf7689aiasdfkhl8\n</code></pre>\n<p>So, you would need to add a column, sort of <code>emailId</code> to your user table.</p>\n<p>Then, when you add or register a user in your website, generate this string and store it with the rest of the user data.</p>\n<pre class="lang-none prettyprint-override"><code>+---------+------------+------------------+--------------------------------+\n| user_id | name | email | email_id |\n+---------+------------+------------------+--------------------------------+\n| 1 | John D. | john@example.com | asdfj87asdfhjahaldsfo87asdf... |\n+---------+------------+------------------+--------------------------------+\n</code></pre>\n<p>Now, when you get a request, look up the e-mail given the <code>emailId</code> param, and log it.</p>\n"^^ . + "0"^^ . + . + . + . + . + "<p>In WooCommerce, I have added a custom fee which applies for products with shipping class &quot;dangerous goods&quot; (<code>dangerous-goods</code>). I now want to append/add a link to this custom fee name on the checkout page, that directs customers to the shipping policy explaining the fee.</p>\n<p>Please note, that I use <a href="https://woocommerce.com/document/woocommerce-shortcodes/#page-shortcodes" rel="nofollow noreferrer">woocommerce legacy shortcode</a> for my checkout page <code>[woocommerce_checkout]</code>.</p>\n<p>However, when adding a link to the fee name using the <code>woocommerce_cart_calculate_fees</code> hook, WooCommerce doesn't render HTML in the fee name, because it escapes the fee label. As a result, the link won't display as a clickable link but rather plain text.</p>\n<p><strong>Example:</strong></p>\n<pre><code>// Add the handling fee with a link\n $fee_label = 'Handling fee - dangerous goods (&lt;a href=&quot;https://example.com&quot; target=&quot;_blank&quot;&gt;Learn More&lt;/a&gt;)';\n $cart-&gt;add_fee( $fee_label, $handling_fee, true );\n</code></pre>\n<p><strong>Outcome:</strong></p>\n<p><a href="https://i.sstatic.net/CbppHy4r.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/CbppHy4r.png" alt="enter image description here" /></a></p>\n<p><strong>Alternative solution:</strong></p>\n<p>I then tried to use the <code>woocommerce_cart_totals_fee_html</code>, filter hook from <a href="https://stackoverflow.com/a/78441685/10497022">this SO</a> solution, that allows to modify or customize the rendered HTML output of the fee displayed.</p>\n<pre><code>add_filter( 'woocommerce_cart_totals_fee_html', 'custom_handling_fee_link', 10, 2 );\nfunction custom_handling_fee_link( $fee_html, $fee ) {\n // Check if the current page is the checkout page &amp; fee name\n if ( is_checkout() &amp;&amp; $fee-&gt;name === 'Handling fee - dangerous goods' ) {\n $fee_html .= ' &lt;span style=&quot;display:block;&quot;&gt;&lt;a href=&quot;https://example.com&quot; target=&quot;_blank&quot;&gt;(Learn More)&lt;/a&gt;&lt;/span&gt;';\n }\n return $fee_html;\n}\n</code></pre>\n<p>This successfully appends the link as an interactive hyperlink, but adds it after the fee itself rather than appending it to the fee name:</p>\n<p><a href="https://i.sstatic.net/H8vtvDOy.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/H8vtvDOy.png" alt="enter image description here" /></a></p>\n<p><strong>Expected result:</strong>\nThis is how i expect the result to look like.</p>\n<p><a href="https://i.sstatic.net/2ikyxPM6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2ikyxPM6.png" alt="enter image description here" /></a></p>\n<p><strong>Question:</strong></p>\n<p>As I understand, it's not possible to bypass the escaping process directly in the fee name itself, as WooCommerce's internal sanitization ensures that fee names remain clean and safe. Given this limitation, are there alternative hooks or filters that could allow me to append a link to the fee name on the front-end?</p>\n<p>Thought I prefer a PHP-based solution, I am also willing to consider JavaScript if PHP alone cannot achieve this.</p>\n<p>Also, the fee name displayed in <em>invoices</em>, <em>emails</em>, or <em>backend</em> must remain clean without the link. So only show the link in the fee name, front-end on the checkout-page.</p>\n"^^ . + "integration"^^ . + "0"^^ . + "0"^^ . + . + "I was going to say the same thing...the "something else" is JavaScript. It's not very clear why you're so keen to avoid using it. It's a completely normal and expected thing to need in a modern web application. Saying you don't want to use it seems like a very arbitrary self-imposed limitation on solving your problem. And as we said before, not a very realistic one either, given what you want to achieve."^^ . + . + "@SupianIDz it doesn't help me... I'm using web hosting, which has set max_execution_time=300 and I can't change this param. 300 seconds it's not enough for large zip file."^^ . + "<p>Those <code>require</code> paths are relative, and while they might be correct relative to your site's root, it's entirely possible that your site's root is not the current working directory from PHP's perspective (that might be somewhere odd, like <code>/usr/bin</code>). You can solve that by making the current file's location the implicit root, like this:</p>\n<pre class="lang-php prettyprint-override"><code>require __DIR__ . '/resources/includes/PHPMailer/src/Exception.php';\nrequire __DIR__ . '/resources/includes/PHPMailer/src/PHPMailer.php';\nrequire __DIR__ . '/resources/includes/PHPMailer/src/SMTP.php';\n</code></pre>\n<p>The <code>__DIR__</code> constant contains the folder containing the file that the current script is in. This should solve your immediate problem.</p>\n<p>In the longer term, <em>please</em> learn how to use composer; you can thank me for it later :)</p>\n"^^ . + "<p>With my laravel livewire application I've the problem, that it does not work and respond at all. It only shows the standard value of my variable <code>$count</code></p>\n<p>Steps I did:</p>\n<ol>\n<li><code>php artisan make:livewire steps</code></li>\n</ol>\n<p>Steps.php</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nnamespace App\\Livewire;\n\nuse Livewire\\Component;\n\nclass Steps extends Component\n{\n public $count = 1;\n\n public function increment()\n {\n $this-&gt;count++;\n }\n\n public function decrement()\n {\n $this-&gt;count--;\n }\n\n public function render()\n {\n return view('livewire.steps');\n }\n}\n</code></pre>\n<p>steps.blade.php:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;div&gt;\n &lt;h1&gt;{{ $count }}&lt;/h1&gt;\n \n &lt;button wire:click=&quot;increment&quot;&gt;+&lt;/button&gt;\n \n &lt;button wire:click=&quot;decrement&quot;&gt;-&lt;/button&gt;\n&lt;/div&gt;\n</code></pre>\n<p>web.php:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nuse Illuminate\\Support\\Facades\\Route;\nuse App\\Livewire\\Steps;\n\nRoute::get('/counter', Steps::class);\n</code></pre>\n<ol start="2">\n<li><code>php artisan livewire:layout</code></li>\n</ol>\n<p>app.blade.php:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;{{ str_replace('_', '-', app()-&gt;getLocale()) }}&quot;&gt;\n &lt;head&gt;\n &lt;meta charset=&quot;utf-8&quot;&gt;\n &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n\n &lt;title&gt;{{ $title ?? 'Page Title' }}&lt;/title&gt;\n &lt;/head&gt;\n &lt;body&gt;\n {{ $slot }}\n &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<ol start="3">\n<li>npm run dev</li>\n</ol>\n<p>Doesnt work:\n<a href="https://i.sstatic.net/Z4Vs3DGm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Z4Vs3DGm.png" alt="website" /></a></p>\n"^^ . + . + . + . + . + . + . + . + . + "<p>I have a PHP website designed using the MVC template. I don't quite understand how the website creation process works, but on the initial loading page, index.php is executed several times each time I receive a request. Therefore, I understand that I'm wasting time and resources loading the page, since I have to reload the entire website configuration. What could be the cause of this? Is this normal behavior in PHP?</p>\n<p>The loading method is fastcgi</p>\n<p>I have put several lines of comments in a file each time it goes through the initial file, and to load only the main page, it goes through the same file about 10 times.</p>\n"^^ . + . + "Class "Memcached" not found"^^ . + "fancybox"^^ . + . + "Didn't know Workerman at all until now. Is this creating threads or is it working with an do while single thread loop?"^^ . + . + . + . + . + . + "1"^^ . + "<p>If you want a fast lookup, you need an associative array with the area codes as the keys. For example (assuming area codes have between 4 and 6 digits):</p>\n<pre><code>$area_codes = array(\n '015019',\n '015020',\n '01511',\n '01512',\n '01514',\n '01515',\n '01516',\n '01517',\n '015180',\n '015181',\n '015182',\n '015183',\n '015184',\n '015185',\n);\n\n// Build an associative array\n$area_lookup = [];\nforeach($area_codes as $code)\n $area_lookup[$code] = 1;\n\nfunction splitNumber(array $area_lookup, string $telephone_number): array\n{\n for($len=4;$len&lt;=6;$len++)\n {\n $prefix = substr($telephone_number, 0, $len);\n if(isset($area_lookup[$prefix]))\n return ['area_code' =&gt; $prefix, 'subscriber_number' =&gt; substr($telephone_number, $len)];\n }\n throw new Exception('Invalid number');\n}\n\n$res1 = splitNumber($area_lookup, '015169999999');\n$res2 = splitNumber($area_lookup, '015180999999');\nvar_dump($res1, $res2);\n</code></pre>\n<p>Output:</p>\n<pre class="lang-none prettyprint-override"><code>array(2) {\n [&quot;area_code&quot;]=&gt;\n string(5) &quot;01516&quot;\n [&quot;subscriber_number&quot;]=&gt;\n string(7) &quot;9999999&quot;\n}\narray(2) {\n [&quot;area_code&quot;]=&gt;\n string(6) &quot;015180&quot;\n [&quot;subscriber_number&quot;]=&gt;\n string(6) &quot;999999&quot;\n}\n</code></pre>\n<p>(<a href="https://3v4l.org/Iajsp" rel="nofollow noreferrer">Demo</a>)</p>\n"^^ . + . + . + . + "4"^^ . + "4"^^ . + . + "<h3>Introduction</h3>\n<p>I created a small package that contains <code>ValueObject</code> type objects for measurement units.\nI have a <code>MeasurementUnitValueObject</code> class (which implement interface <code>ValueObject</code>), which has two properties:\nValue - type <code>float</code>, and a Unit <code>MeasurementUnit</code> which is an interface.</p>\n<p>It serves me in many projects for units that are treated too detailed in the project to be of a simple type.\nFor example: I have a project in which I deal in detail with the length unit, so I have created a length classes especially for this, which <code>Length</code> inherits from <code>MeasurementUnitValueObject</code>. The class has a field <code>$unit</code> of type <code>LengthUnit</code>, which is an Enum implementing <code>MeasurementUnit</code>. In addition, for each unit, a so-called converter is also created named <code>LengthConverter</code>, the purpose of which is to convert the unit for a given quantity.</p>\n<p>In general, the whole thing comes down to the fact that I can create this kind of code:</p>\n<pre><code>$length = new Length(22, LengthUnit::Miles);\n$lenght2 = LengthConverter::toKilometers($length);\n$lenght-&gt;isEqual($lenght2); //true\n$lenght2-&gt;value // 35.405568;\n$lenght2-&gt;toMiles()-&gt;value; //22\n$lenght2-&gt;toMiles()-&gt;unit; // Enum: LenghtUnit::Miles;\n</code></pre>\n<p>And so on.</p>\n<h3>My problem</h3>\n<p>In general, the number of files has grown to quite a large number, and in most projects I simply do not need all of them, and sometimes it happens that, for example, I only need the classes related to <code>Length</code>, but when I load (To be more specific, by this I mean installing and &quot;wasting&quot; disk memory) the entire package I get 50x more than I need.</p>\n<p>In principle, it is not a big problem, because there are generally 3 files for 1 entity: Unit, ValueObject, Converter, and these files are really light, so the whole thing is a matter of a few kilobytes.</p>\n<p>However, I was wondering if there is an option in Composer that would allow me to divide one package into smaller segments that can be excluded during installation, and I do not mean creating separate projects.</p>\n<p>I would like to still enter during loading:</p>\n<pre><code>&quot;require&quot;: {\n &quot;my_units_package&quot;: &quot;^1.0''\n}\n</code></pre>\n<p>But in such a way that I could add a tag that specifies what to load or what not to load. I know that there is such an <code>extra</code>, in which I could specify, for example:</p>\n<pre><code>&quot;extra&quot;: {\n &quot;except&quot;: [&quot;Power&quot;, &quot;Volume&quot;]\n}\n</code></pre>\n<p>or name the tag &quot;only&quot; and pass the entities that it needs.</p>\n<p>I know that composer also has the option of running scripts before/after/during various actions, although I don't know how they work, for one.\nAnd secondly, I immediately encountered the problem of collisions, which I don't know if it is even possible to solve:\nWhat if my project said &quot;load only Length&quot;, but I used another one that said &quot;load only Power&quot;.</p>\n<p>Hence my question, is this type of division of the package into selectable segments possible and How to handle conflicts of this type?</p>\n<p>As I said, it's not a big problem for me, so I didn't delve into it, because for now I treat it as academic considerations, although I wonder if anyone has faced such problems and could share their experience/knowledge. Thanks</p>\n<h3>EDIT</h3>\n<p>To better understand why I don't want to split each entity into a separate package.</p>\n<p>I currently have 50 entities in 1 package. In addition to the classes needed to handle these entities, I have 1x vendor directory, +1 composer.json, +1 composer.lock.</p>\n<p>The vendor directory takes up 5mb of disk space. Together with my 50 entities, the whole thing takes up less than 6mb.</p>\n<p>When I split it into 50 packages: In each package there will be:\n1 entity + 1 vendor +1 composer.json, +1 composer.lock\nThe size of the vendor directory will be unchanged because each package will use exactly the same set of libraries - 5mb.</p>\n<p>So in total my 1 project, which was 6mb, will become 50 projects with a total size of 250mb (50 x 5mb).</p>\n<p>And with each additional entity the size will grow by 5mb, not by a few kilobytes.</p>\n<p>The advantage will be that the projects in which I use this package will be smaller by the number of entities, because there will be 1 vendor directory in them regardless of whether I load 2 entities or 50.</p>\n<p>For each project, you need 1 vendor directory, 1x composer.json, 1x composer.lock. Dividing my package into 50 packages means that I will have 50 projects, in which each will have its own 1x vendor, 1x composer.json, 1x composer.lock.</p>\n<h3>EDIT 2</h3>\n<p>Lets consider only 2 entities, for example:</p>\n<ul>\n<li>Length</li>\n<li>Money</li>\n</ul>\n<p>So by far I have projects:</p>\n<ul>\n<li>EntiesProject</li>\n<li>Project1_thatUseEnties</li>\n<li>Project2_thatUseEnties</li>\n<li>...</li>\n<li>ProjectN_thatUseEnties</li>\n</ul>\n<p>If I split EntiesProject to 2:</p>\n<ul>\n<li>LenghtValueObjectProject</li>\n<li>MoneyValueObjectProject</li>\n</ul>\n<p>Each <code>ProjectX_thatUseEnties</code> which doesn't need one of them\nwill be smaller by 3 classes for example: <code>MoneyUnit</code>, <code>MoneyConverter, </code>Money`</p>\n<p>BUT\nsince <code>EntiesProject</code> is now separated to 2 projects, each need to have their own <code>composer.json</code>, <code>composer.lock</code> and vendor.</p>\n<p>If 3 classes have 10 KB data size, it's true that I saved 10 KB each don't needed package IN PROJECT WHERE I USE IT. But I need loss 5 MB because I've created 1 extra project which has 1 vendor directory which has 5 MB size.</p>\n"^^ . + "0"^^ . + "1"^^ . + . + . + . + "1"^^ . + "<p>I found a solution that uses transient locks for the meta keys in progress.</p>\n<pre><code>function add_postID_to_user_saved_list($post_id) {\n $user_id = get_current_user_id();\n \n $keys = array(\n 'saved'.$user_id,\n );\n if ( !lock_keys( $keys ) ) {\n return false;\n }\n \n $saved = get_user_meta( $user_id, 'saved', true );\n if ( empty($saved) ) {\n $saved = [$post_id];\n } else {\n $saved[] = $post_id;\n }\n if ( !update_user_meta( $user_id, 'saved', $saved ) ) {\n add_user_meta( $user_id, 'saved', $saved, true );\n }\n\n unlock_keys( $keys );\n}\n\n// Used before updating meta keys to check whether they are locked or not (and lock them if not) to avoid classic race conditions\nfunction lock_keys( $keys ) {\n if ( !is_array( $keys ) || empty( $keys ) ) {\n // &quot;No meta keys have been specified to lock!&quot;\n return false;\n }\n \n $attempts_limit = 3;\n $attempts_interval = 1;\n $attempt = 0;\n\n while ( $attempt &lt; $attempts_limit ) {\n $attempt++;\n $locked_keys = get_transient( 'locked_keys' );\n if ( !is_array( $locked_keys ) ) {\n $locked_keys = array();\n }\n // Check if another request is currently updating any of the meta keys\n if ( !empty( array_intersect( $keys, $locked_keys ) ) ) {\n // Another process is already updating, wait for a short period and retry\n sleep( $attempts_interval );\n continue;\n }\n // Set transient locks for the meta keys to indicate that an update is in progress\n set_transient( 'locked_keys', array_merge( $locked_keys, $keys ), 15 ); // secs must be &gt; duration of the longest update process\n return true;\n }\n // All attempts are exhausted in vain, notify the user and handle the failure\n // &quot;The server is busy! Please try again in a few seconds.&quot;\n return false;\n\n}\n \n// Used after updating meta keys to release the transient lock off them and to indicate that the update request is complete allowing other requests to update them\nfunction unlock_keys( $keys ) {\n if ( !is_array( $keys ) || empty( $keys ) ) {\n // &quot;No meta keys have been specified to unlock!&quot;\n return false;\n }\n \n $locked_keys = get_transient( 'locked_keys' );\n\n if ( !is_array( $locked_keys ) ) {\n $locked_keys = array();\n }\n set_transient( 'locked_keys', array_diff( $locked_keys, $keys ), 15 ); // secs must be &gt; duration of the longest update process\n\n return true;\n}\n</code></pre>\n"^^ . + "1"^^ . + "0"^^ . + . + . + . + "@YourCommonSense thank you for your suggestions, it makes sense to do it this way, I guess it will a hit or miss depending on the intervierwers but at least I am not stuck anymore wondering how to approach this"^^ . + "laravel-11"^^ . + "1"^^ . + . + "1"^^ . + ".net-core"^^ . + . + . + . + . + "<p>Try the following commands:</p>\n<pre><code>cd /var/www/html/laravel-12.x/\nphp artisan cache:clear\nchmod -R 775 storage\ncomposer dump-autoload\n</code></pre>\n<p>If the issue persists, try:</p>\n<pre><code>sudo setenforce 0\n</code></pre>\n<p>If that still doesn't work, run:</p>\n<pre><code>sudo chcon -R -t httpd_sys_rw_content_t /var/www/html/laravel-12.x/storage\n</code></pre>\n"^^ . + "0"^^ . + "1"^^ . + . + "0"^^ . + . + . + "Yes I believe you are correct, the json from deepseek api running on my own server is invalid json, so need to figure out how to fix the source code, manipulate the json string or abandon project..."^^ . + . + . + . + . + "chart.js"^^ . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + "inertiajs"^^ . + . + . + . + "There is a typo. It must be `implode(" ", str_split($string, 2));`"^^ . + . + "When trying to register an admin user via Postman, i are receiving the default Laravel welcome page instead of the expected JSON response"^^ . + . + . + . + . + . + . + "2"^^ . + . + . + "0"^^ . + . + "3"^^ . + "0"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + . + "Please also see these [related questions](https://stackoverflow.com/search?q=Polylang+translate+custom+string)"^^ . + . + "http-get"^^ . + . + . + . + . + . + "0"^^ . + "means that identical class names do not necessarily mean that the classes are identical. You must specify the fully qualified class name."^^ . + "0"^^ . + . + . + . + . + "You should specify that this only work with legacy checkout shortcode, but not with Checkout Blocks (enabled by default since few years)."^^ . + . + . + . + "<p>How can I analyze a PHP project that doesn’t have a “Build” stage? I have the following pipeline:</p>\n<pre class="lang-yaml prettyprint-override"><code>trigger:\n branches:\n include:\n - '*'\n\npool:\n vmImage: 'ubuntu-latest'\n\nvariables:\n # Sonar-related variables\n SONARQUBE_ENDPOINT: 'myConnection'\n PROJECT_KEY: 'myKey'\n PROJECT_NAME: MyProject'\n PROJECT_VERSION: '1.0'\n\nsteps:\n- task: SonarQubePrepare@7\n displayName: &quot;Prepare SonarQube analysis&quot;\n inputs:\n SonarQube: $(SONARQUBE_ENDPOINT) \n scannerMode: 'Other' \n configMode: 'manual' \n # Sonar project information\n sonarProjectKey: $(PROJECT_KEY)\n sonarProjectName: $(PROJECT_NAME)\n sonarProjectVersion: $(PROJECT_VERSION)\n extraProperties: |\n sonar.sources=src\n sonar.language=php\n sonar.exclusions=**/*.html,**/*.css,**/*.js\n\n- task: SonarQubeAnalyze@7\n displayName: &quot;Run SonarQube Analysis&quot;\n\n- task: SonarQubePublish@7\n displayName: &quot;Publish SonarQube Quality Gate Result&quot;\n inputs:\n pollingTimeoutSec: '600'\n</code></pre>\n<p>and it doesn’t fail but at the same at the “Publish” stage it says that there’s no analysis to publish!</p>\n<p>What should I do to get this working?</p>\n"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + . + "Pagination is stuck on navbar in laravel"^^ . + . + "Hide a menu item if user has posted a specific post_type"^^ . + . + "1"^^ . + "-3"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + "magento2"^^ . + . + "1"^^ . + . + . + . + . + "<p>I'm a bit confused. Why is the <code>wp_kses_allowed_html</code> hook not triggered on the frontend of my WordPress website, but it is on the wp-admin backend?</p>\n<p>I have added the code below to the very top of my plugin file. I want it to allow a custom data attribute on an <code>&lt;a&gt;</code> element.</p>\n<pre><code>add_filter('wp_kses_allowed_html', function($allowed_tags, $context) {\n\n error_log(&quot;wp_kses_allowed_html triggered&quot;);\n\n if (!isset($allowed_tags['a'])) {\n $allowed_tags['a'] = array();\n }\n \n $allowed_tags['a']['data-custom-attribute'] = true;\n \n return $allowed_tags;\n}, 10, 2);\n</code></pre>\n"^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + "I agree, it's not clear what the use case is. You've been asked to edit the file - do you know why, or how the code is _supposed_ to be use? If not you can't test it in a meaningful way really. I don't think this file is supposed to be run by itself - it looks like it's designed to be added to another application as a form of configuration...perhaps to register a mod/plugin/hook as someone mentioned above. I'd guess that something in that app is then supposed to run the provided PHP snippet at some useful moment. You probably need to test it in that context."^^ . + . + . + . + . + . + "size"^^ . + . + "<p><code>AuthController Code</code>\nRegister a New User (Works)\nThis function registers a user with role-based access control.</p>\n<pre><code>public function register(Request $request)\n{\n$request-\\&gt;validate(\\[\n'name' =\\&gt; 'required|string|max:255',\n'email' =\\&gt; 'required|string|email|unique:users',\n'password' =\\&gt; 'required|string|min:6',\n'role' =\\&gt; 'required|in:admin,superadmin,faculty'\n\\]);\n\n $user = User::create([\n 'name' =&gt; $request-&gt;name,\n 'email' =&gt; $request-&gt;email,\n 'password' =&gt; Hash::make($request-&gt;password),\n 'role' =&gt; $request-&gt;role\n ]);\n \n return response()-&gt;json(['message' =&gt; 'User registered successfully'], 201);\n\n}\n</code></pre>\n<p><code>Login User and Generate Token (Works)</code>\nThis function generates a JWT token for authentication.</p>\n<pre><code>public function login(Request $request)\n{\n$credentials = $request-\\&gt;only('email', 'password');\n\n if (!$token = Auth::attempt($credentials)) {\n return response()-&gt;json(['error' =&gt; 'Unauthorized'], 401);\n }\n \n // Log the login event\n AuthLog::create([\n 'user_id' =&gt; Auth::id(),\n 'action' =&gt; 'login',\n 'ip_address' =&gt; $request-&gt;ip(),\n 'user_agent' =&gt; $request-&gt;header('User-Agent')\n ]);\n \n return $this-&gt;respondWithToken($token);\n\n}\n</code></pre>\n<p><code>Logout User (Issue Here)</code>\nHere is where the issue occurs: logging out does not properly invalidate the token.</p>\n<pre><code>\npublic function logout(Request $request)\n{\nif (!$request-\\&gt;user()) {\nreturn response()-\\&gt;json(\\['error' =\\&gt; 'Unauthorized'\\], 401);\n}\n\n // Log the logout event\n AuthLog::create([\n 'user_id' =&gt; Auth::id(),\n 'action' =&gt; 'logout',\n 'ip_address' =&gt; $request-&gt;ip(),\n 'user_agent' =&gt; $request-&gt;header('User-Agent')\n ]);\n \n // Revoke all tokens for the authenticated user\n $request-&gt;user()-&gt;tokens()-&gt;delete();\n \n return response()-&gt;json(['message' =&gt; 'Logged out successfully'], 200);\n\n}\n</code></pre>\n<p><code>Refresh Token (Works)</code></p>\n<pre><code>public function refresh()\n{\nreturn $this-\\&gt;respondWithToken(Auth::refresh());\n}\n\nprotected function respondWithToken($token)\n{\nreturn response()-\\&gt;json(\\[\n'access_token' =\\&gt; $token,\n'token_type' =\\&gt; 'bearer',\n'expires_in' =\\&gt; Auth::factory()-\\&gt;getTTL() \\* 60,\n'user' =\\&gt; Auth::user()\n\\]);\n}\n</code></pre>\n<p>These are my API routes:</p>\n<pre><code>Route::group(\\['prefix' =\\&gt; 'auth'\\], function () {\nRoute::post('register', \\[AuthController::class, 'register'\\]);\nRoute::post('login', \\[AuthController::class, 'login'\\]);\nRoute::post('logout', \\[AuthController::class, 'logout'\\])-\\&gt;middleware('auth:api');\nRoute::post('refresh', \\[AuthController::class, 'refresh'\\]);\nRoute::get('me', \\[AuthController::class, 'me'\\])-\\&gt;middleware('auth:api');\n});\n\n// Role-based dashboard access\nRoute::group(\\['middleware' =\\&gt; \\['auth:api', 'role:admin'\\]\\], function () {\nRoute::get('/admin/dashboard', function () {\nreturn response()-\\&gt;json(\\['message' =\\&gt; 'Welcome Admin'\\]);\n});\n});\n\nRoute::group(\\['middleware' =\\&gt; \\['auth:api', 'role:superadmin'\\]\\], function () {\nRoute::get('/superadmin/dashboard', function () {\nreturn response()-\\&gt;json(\\['message' =\\&gt; 'Welcome SuperAdmin'\\]);\n});\n});\n\nRoute::group(\\['middleware' =\\&gt; \\['auth:api', 'role:faculty'\\]\\], function () {\nRoute::get('/faculty/dashboard', function () {\nreturn response()-\\&gt;json(\\['message' =\\&gt; 'Welcome Faculty'\\]);\n});\n});\n</code></pre>\n<pre><code>Issue: Logout Not Invalidating Token\nWhat works:\nRegistering a user\nLogging in and receiving a JWT token\nRefreshing the token\nWhat doesn't work:\nLogging out does not invalidate the token. The user can still access protected routes after logout.\nPossible Issues I Suspect\nMaybe Auth::logout() is missing? Should I use this instead of $request-\\&gt;user()-\\&gt;tokens()-\\&gt;delete();?\n</code></pre>\n<p>Should I explicitly invalidate the token using JWTAuth? Something like: <code>Auth::logout()</code>? Am I missing a configuration in config/auth.php or config/jwt.php?</p>\n<p>What I need help with:</p>\n<p>How do I properly invalidate JWT tokens when a user logs out?\nShould I use Auth::logout() instead of <code>$request-&gt;user()-&gt;tokens()-&gt;delete()</code>?\nAny improvements to my logout logic?</p>\n"^^ . + "1"^^ . + "<p>try to clear route cache <code>php artisan route:cache</code></p>\n"^^ . + . + . + . + . + "0"^^ . + . + . + "@maiorano84 I'm trying to get it to work with PHP 7.2 since ubuntu only supports PHP up to 7.2."^^ . + . + . + "I did find [the original init.php](https://github.com/ilovepdf/ilovepdf-php/commit/84d569bda4a9cf033ebe537ab6798467cc5705b6#diff-df264b2fa3997fcbb5026196ea7463043ca8fc681f794b4d188b69a762c90eae) but I doubt it will work with the current version of the package."^^ . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + "Ah ... I suspected it would be something like that. I tried a few other methods without success ... would you happen to know an "equivalent", currently supported method that would deliver the same result? Apparently the fall-back method in the code is very slow."^^ . + "0"^^ . + "<p>You can still use the <code>foreach</code>, and then return an array with 2 values if there is a match, so you return early from the loop.</p>\n<p>Note that you don't need the equals check here because <code>str_starts_with</code> returns a boolean.</p>\n<pre><code>if (str_starts_with($telephone_number, $code)) {\n</code></pre>\n<p>Example</p>\n<pre><code>$telephone_number = &quot;015169999999&quot;;\n\nforeach ($area_codes as $code) {\n if (str_starts_with($telephone_number, $code)) {\n $result = [$code, substr($telephone_number, strlen($code))];\n break;\n }\n}\n\nvar_export($result ?? null);\n</code></pre>\n<p>Output</p>\n<pre><code>array (\n 0 =&gt; '01516',\n 1 =&gt; '9999999',\n)\n</code></pre>\n<p>See a <a href="https://3v4l.org/d0mgZ" rel="nofollow noreferrer">PHP demo</a>.</p>\n<p>I don't know if you can have multiple areacode matches for a single phone number, but if you want the longest to match first, you might sort your array beforehand starting with the longest string.</p>\n"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + "@YourCommonSense A "type declaration" is just a place where you can _use_ types; the types themselves still exist as part of a comprehensive _type system_. The manual could definitely be expanded on _where_/_how_ and _why_ certain types can be used, but what's written there is perfectly accurate: PHP has support for using `true` and `false` as types, and considers them _sub-types_ of the type `bool`. Compare OO types: any instance of a particular interface will also be an instance of some concrete class, but we can still accurately call the interface a type."^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + "1"^^ . + "1"^^ . + . + "20200930 seems to be a version of php 7, as php 8.0 was released in Nov 2020. Perhaps your version of php-dev package is incorrect, it's defined in zend_modules.h."^^ . + "What have you tried to resolve the problem? Where are you stuck? What does "not decoded properly" even mean? Can you remove all irrelevant parts from the code (like the commented sections) such that others can focus on the relevant parts while reading the code?"^^ . + "0"^^ . + "-1"^^ . + . + "Sorry, I am just starting out, I haven't done much backend work. How are you supposed to do it? I tried to just copy the laravel docs for my poject"^^ . + . + "1"^^ . + . + . + "@IMSoP That's fair; I *don't* care about types in this instance. Making these objects is a purely QOL thing for blade maintenance. It's just easier and leaner to deal with object syntax than array syntax in blade files that are already visually cumbersome. I've considered making a small class for it but I'm unsure how well received it'd be since this *is* only a QOL thing. That said, knowing how to apply annotations to this structure has usefulness beyond this specific use case."^^ . + "1"^^ . + . + . + . + . + . + "So it is only necessary for allowed domains, i think i got it, it makes sense, thanks !"^^ . + . + . + . + . + . + "0"^^ . + "<p>I have an issue with this code:</p>\n<pre><code>$manager = WP_Session_Tokens::get_instance(get_current_user_id());\n$manager-&gt;destroy(0);\n</code></pre>\n<p>I want to destroy the session at index 0, but it's not working. How can I properly remove a specific session?\nIf destroying a session is only possible with a token, how can I get the token of a specific session to remove it?</p>\n"^^ . + "I still don't know what `encryption()` does... but I don't think it's that important. I did have some other remarks, concerning coding style. I notice that you use a lot of globals in functions. I prefer normal function arguments. With arguments you exactly know what's important when you call a function, and you don't have to check inside the function itself. The general advice is to [use a few globals as possible](https://palplanner.com/schools/title-understanding-php-global-variables-scope-and-best-practices/), and definitely don't use them to hand over data between functions, as you do."^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + "Can you run the conversion executable directly from the command line under your web user account? ie `sudo -u <yourwebuser> /var/www/vhosts/mydomain.com/httpdocs/app/ThirdParty/HeicToJpg/bin/php-heic-to-jpg-linux-arm64 /var/www/vhosts/mydomain.com/httpdocs/public/assets/image1.heic /var/www/vhosts/mydomain.com/httpdocs/public/assets/image1.jpg`"^^ . + . + "1"^^ . + . + "Seperate approach is to make your own adapter."^^ . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + "TYPO3 12 Backend Module – How to store a checkbox value and use it in the frontend?"^^ . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + "1"^^ . + "^ Yes, I was. Half reading again."^^ . + . + . + . + . + . + . + . + . + . + "<p>It’s a tricky situation because your redirect rule works well on a live domain but on localhost it creates a redirect loop—likely due to the way the URL is structured on localhost (e.g., having an extra directory in the path).</p>\n<p>You can try:</p>\n<pre><code>RewriteCond %{REQUEST_URI} !^/$\nRewriteCond %{REQUEST_URI} /(.*)/$\nRewriteRule ^ /%1 [R=301,L]\n</code></pre>\n"^^ . + . + . + . + . + . + "1"^^ . + "This happened when I upgraded php from 8.3 to 8.4.\nI already tried deleting and reinstalling phpmyadmin, both manually and using apt.\nI have ubuntu server."^^ . + . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + "5"^^ . + . + "<p>I want to use the latest version of sqlite (3.49.0 from this writing) in PHP.</p>\n<p>I'm using docker and for latest docker image cli version (php:8.2-cli) sqlite3 shows the following version:</p>\n<pre class="lang-bash prettyprint-override"><code>$ docker compose run --rm php php -r &quot;echo SQLite3::version()['versionString'] . PHP_EOL;&quot;\n3.40.1\n</code></pre>\n<p>After I manually install the latest sqlite3 version via the following</p>\n<pre><code>RUN curl -L https://www.sqlite.org/2025/sqlite-autoconf-3490000.tar.gz | tar xz &amp;&amp; \\\n cd sqlite-autoconf-3490000 &amp;&amp; \\\n ./configure --prefix=/usr/local &amp;&amp; \\\n make &amp;&amp; make install &amp;&amp; \\\n cd .. &amp;&amp; rm -rf sqlite-*\n</code></pre>\n<p>I can see that sqlite3 is at latest version</p>\n<pre><code>$ docker compose run --rm php sqlite3 --version\n3.49.0 2025-02-06\n</code></pre>\n<p>but the PDO version is still at older version:</p>\n<pre class="lang-bash prettyprint-override"><code>$ docker compose run --rm php php -r &quot;echo SQLite3::version()['versionString'] . PHP_EOL;&quot;\n3.40.1\n</code></pre>\n"^^ . + . + . + . + "0"^^ . + "0"^^ . + "2"^^ . + . + . + "0"^^ . + "@ChrisHaas - I do not have control over this particular API. I'll have to do this in my code. Thank you for that information though. I would agree that the API should take responsibility."^^ . + "<p>I know I can use dataProvider like so:</p>\n<pre class="lang-php prettyprint-override"><code>use PHPUnit\\Framework\\TestCase;\n\nclass DataProviderSetupTest extends TestCase {\n /**\n * @dataProvider basicDataProvider\n */\n public function testDataProvider(string $expected): void\n {\n $actualResult = 'I am the value!'; // generated by some service under test\n $this-&gt;assertSame($expected, $actualResult);\n }\n\n public function basicDataProvider(): \\Generator\n {\n yield 'no state, all fine' =&gt; ['I am the value!'];\n }\n}\n</code></pre>\n<p>This test will run fine.</p>\n<p>Yet if I have a property on the test class which is initialzied via <code>setUp</code>, it is null when the dataProvider is executed:</p>\n<pre class="lang-php prettyprint-override"><code>use PHPUnit\\Framework\\TestCase;\n\nclass DataProviderSetupTest extends TestCase\n{\n protected string $state;\n\n protected function setUp(): void\n {\n $this-&gt;state = 'Thank you for the fish!';\n }\n\n /**\n * @dataProvider statefulDataProvider\n */\n\n public function testDataProviderWithStateDependency(string $expected): void\n {\n $actualResult = 'Thank you for the fish!'; // generated by some service under test\n $this-&gt;assertSame($expected, $actualResult);\n }\n\n public function statefulDataProvider(): \\Generator\n {\n yield 'member not initialized' =&gt; [$this-&gt;state];\n }\n}\n</code></pre>\n<p>This test will fail:</p>\n<pre><code>The data provider specified for DataProviderSetupTest::testDataProviderWithStateDependency is invalid.\nError: Typed property DataProviderSetupTest::$state must not be accessed before initialization\n</code></pre>\n<p>How to initialize test classes members so that I can use them within data providers?</p>\n<hr />\n<p>I also tried <code>setUpBeforeClass</code> yet since that one is static, I cannot set member variables.</p>\n<hr />\n<p>My phpunit version is 9.6.11.</p>\n"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + "<p>The null coalescence operator has a precedent that is different from most other comparators in PHP:</p>\n<h2>Example 1:</h2>\n<p><em>( Incorrect )</em></p>\n<pre><code>$var['x'] = &quot;5&quot;;\nif ((int)$var['x']??0 &lt; 1 ) {\n print &quot;less than 1&quot;; /* outputs this */\n}\nelse {\n print &quot;more than 1&quot;;\n}\n</code></pre>\n<p>This will result in &quot;<code>less</code>&quot; because the comparison seems to be between <code>$var['x']</code> vs <code>0&lt;1</code> but surely that would be <code>$var['x']??(false)</code> which still doesn't seem to me to warrant that <code>if</code> being true.</p>\n<h2>Example 2:</h2>\n<p><em>( Incorrect )</em></p>\n<pre><code>$var['x'] = &quot;5&quot;;\nif ($var['x']??5 &lt; 1 ) {\n print &quot;less than 1&quot;; /* still outputs this */\n}\nelse {\n print &quot;more than 1&quot;;\n}\n</code></pre>\n<p>I DO understand the expected output; but I <strong>DO NOT understand</strong> the steps the PHP takes to get to its chosen conclusion.</p>\n<p>I have read <a href="https://www.php.net/manual/en/language.operators.precedence.php" rel="nofollow noreferrer">https://www.php.net/manual/en/language.operators.precedence.php</a> and <a href="https://stackoverflow.com/questions/34571330/php-short-ternary-elvis-operator-vs-null-coalescing-operator">PHP short-ternary (&quot;Elvis&quot;) operator vs null coalescing operator</a> but these don't explicitly outline the reasoning for what I perceive to be unexpected behaviour on example 1 and example 2.</p>\n<h1>What logic processing steps cause this to work this way?</h1>\n<h2>Example 3:</h2>\n<p><em>( Correct )</em></p>\n<pre><code>$var['x'] = &quot;5&quot;;\nif ((int)($var['x']??0) &lt; 1 ) {\n print &quot;less than 1&quot;;\n}\nelse {\n print &quot;more than 1&quot;;\n}\n</code></pre>\n<p>This will result in the correct &quot;<code>more</code>&quot; output.</p>\n"^^ . + "@Olivier yeah it's a poor example of a loop but was thinking on my feet. Will update with a new example"^^ . + "0"^^ . + . + . + "1"^^ . + . + "0"^^ . + . + "`\\h` just matches any horizontal whitespace."^^ . + . + . + "0"^^ . + . + "node.js"^^ . + "<p>Currently i have integrated agent(from browser) to client(phone) call integration using twilio js sdk but now i want to integrate hold first call, add new call and merge call feature i have tried everything but no resource or conclusions found.</p>\n<p>Following my browser js</p>\n<pre><code>// Fetch Twilio token from PHP backend\n async function fetchToken(agentId, conductedFrom) {\n try {\n const response = await fetch(`${crm_url}/twilio-generate-in-browser-call-token.php`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/x-www-form-urlencoded'\n },\n body: &quot;agentId=&quot; + agentId + &quot;&amp;conductedFrom=&quot; + conductedFrom\n });\n if (!response.ok) {\n throw new Error('Failed to fetch token');\n }\n const data = await response.json();\n return data.token;\n } catch (error) {\n console.error('Error fetching token:', error);\n alert('Failed to fetch token. Please try again.');\n return null;\n }\n }\n\n // Global variables\n let twilioDevice = null;\n let activeConnection = null;\n let callStartTime = null;\n let timerInterval = null;\n\n // Initialize Twilio Client\n async function initializeTwilio(agentId, conductedFrom) {\n const token = await fetchToken(agentId, conductedFrom);\n if (!token) {\n console.error(&quot;Token generation failed&quot;);\n return;\n }\n\n try {\n twilioDevice = new Twilio.Device(token, {\n codecPreferences: ['opus', 'pcmu'],\n enableRingingState: true,\n debug: true, // Enable debugging logs\n closeProtection: true // Prevent accidental page close during calls\n });\n\n // console.log('Twilio Device initialized:', twilioDevice.on);\n\n twilioDevice.on('registered', () =&gt; {\n console.log('Twilio Device is registered and ready to make calls');\n });\n\n twilioDevice.on('error', (error) =&gt; {\n console.error('Twilio.Device Error:', error);\n updateCallStatus('Error: ' + error.message);\n });\n\n twilioDevice.on('incoming', (connection) =&gt; {\n console.log('Incoming call from:', connection.parameters.From);\n updateCallStatus('Incoming call...');\n showIncomingCallModal(connection);\n jQuery(&quot;#newCallingDialerModal&quot;).modal('hide');\n });\n\n twilioDevice.on('disconnect', (connection) =&gt; {\n console.log('Call disconnected');\n updateCallStatus('Call ended');\n stopTimer();\n activeConnection = null; // Reset the active connection\n jQuery('#newCallingStatusModal').modal('hide'); // Close the modal immediately\n jQuery(&quot;#newCallingDialerModal&quot;).modal('hide');\n jQuery('#newCallingIncomingCallModal').modal('hide');\n });\n\n twilioDevice.on('offline', () =&gt; {\n console.log('Twilio device is offline');\n jQuery('#newCallingIncomingCallModal').modal('hide');\n });\n\n // Listen for the 'tokenWillExpire' event there is 1 hr time limit but even for fallback\n twilioDevice.on('tokenWillExpire', async () =&gt; {\n refreshTwilioToken(agentId, conductedFrom);\n });\n\n\n // Check if registration is successful, and if not, try to explicitly call register()\n await new Promise(resolve =&gt; {\n twilioDevice.on('registered', resolve);\n setTimeout(() =&gt; {\n console.log(&quot;Device didn't register automatically, trying explicit register...&quot;);\n twilioDevice.register();\n }, 3000); // If not registered within 5 seconds, try explicit register()\n });\n } catch (error) {\n console.error(&quot;Error initializing Twilio Device:&quot;, error);\n }\n }\n\n async function updateParentCallStatus(callSid = null, directionFrom = &quot;outgoing&quot;) {\n if (callSid == null) {\n console.error('CallSid Needed');\n return;\n }\n\n try {\n const response = await fetch(`${crm_url}/twilio-current-call-status-callback.php`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n body: &quot;firstCallUpdateUpdateSid=&quot; + callSid + &quot;&amp;directionFrom=&quot; + directionFrom\n });\n\n const data = await response.text();\n console.log('Parent call status updated:', data);\n } catch (error) {\n console.error('Error updating parent call status:', error);\n }\n }\n\n // Initialize Twilio when the page loads\n initializeTwilio(agentId, conductedFrom);\n\n // Make an outgoing call\n jQuery(document).on('click', '.phone_dialpad_call_btn', async function () {\n const thisElement = jQuery(this);\n const dialpadParent = thisElement.closest(&quot;div.phone_dialpad_parent&quot;);\n const countryCode = dialpadParent.find('select.phone_dialpad_countrycode_select_val').val();\n const phoneNumber = dialpadParent.find('input.phone_dialpad_number_val').val();\n\n if (!countryCode) {\n alert('Select country code');\n return;\n }\n if (!phoneNumber || !phoneNumber.match(/^\\+?[1-9]\\d{1,14}$/)) {\n alert('Please enter a valid phone number');\n return;\n }\n\n let dialingNumberString = countryCode + phoneNumber;\n const token = await fetchToken(agentId, conductedFrom);\n if (!token) {\n console.log('Failed to fetch token');\n return;\n }\n\n // Ensure Twilio Device is initialized\n if (!twilioDevice) {\n await initializeTwilio(agentId, conductedFrom);\n if (!twilioDevice) {\n console.error('Twilio Device initialization failed');\n return;\n }\n }\n \n try {\n // Initiate the call\n activeConnection = await twilioDevice.connect({ \n params: { To: dialingNumberString }\n });\n\n updateCallStatus('Calling...');\n jQuery('#newCallingStatusModal').modal('show');\n jQuery(&quot;#newCallingDialerModal&quot;).modal('hide');\n\n // Timer starts only when the call is accepted\n activeConnection.on('accept', () =&gt; {\n console.log('Call connected');\n updateCallStatus('Call in progress...');\n startTimer(); // Start timer only when the call is accepted\n // console.log(&quot;Full Call Parameters:&quot;, JSON.stringify(activeConnection.parameters, null, 2));\n if (activeConnection.parameters.CallSid) {\n updateParentCallStatus(activeConnection.parameters.CallSid);\n }\n });\n\n // Handle call disconnection\n activeConnection.on('disconnect', () =&gt; {\n console.log('Call disconnected');\n updateCallStatus('Call ended');\n stopTimer(); // Stop timer immediately\n // console.log(&quot;Full Call Parameters:&quot;, JSON.stringify(activeConnection.parameters, null, 2));\n if (activeConnection.parameters.CallSid) {\n updateParentCallStatus(activeConnection.parameters.CallSid);\n }\n activeConnection = null; // Reset the active connection\n jQuery('#newCallingStatusModal').modal('hide'); // Close the modal immediately\n\n });\n\n } catch (error) {\n console.error('Twilio Call Error:', error);\n updateCallStatus('Call failed: ' + error.message);\n stopTimer();\n }\n });\n\n async function refreshTwilioToken(agentId, conductedFrom) {\n console.log('Manually refreshing Twilio token...');\n const newToken = await fetchToken(agentId, conductedFrom);\n if (newToken &amp;&amp; twilioDevice) {\n twilioDevice.updateToken(newToken);\n console.log('Token refreshed successfully');\n } else {\n console.error('Failed to refresh Twilio token');\n }\n }\n\n // Hang up the call\n document.getElementById('hangupButton').addEventListener('click', () =&gt; {\n if (activeConnection) {\n activeConnection.disconnect(); // Disconnect the call immediately\n activeConnection = null;\n }\n updateCallStatus('Call ended');\n stopTimer();\n jQuery('#newCallingStatusModal').modal('hide'); // Close the modal immediately\n jQuery('#newCallingIncomingCallModal').modal('hide');\n });\n\n // Incoming call modal handling\n function showIncomingCallModal(connection) {\n activeConnection = connection; // Set active connection\n\n // Show the incoming call modal\n jQuery('#newCallingIncomingCallModal').modal('show');\n document.getElementById('incomingCallNumber').textContent = activeConnection.parameters.From;\n\n // Accept the call\n document.getElementById('acceptCallButton').onclick = () =&gt; {\n activeConnection.accept();\n updateCallStatus('Call in progress...');\n jQuery('#newCallingStatusModal').modal('show');\n jQuery('#newCallingIncomingCallModal').modal('hide');\n startTimer(); // Start timer only when the call is accepted\n // console.log(&quot;Full Call Parameters:&quot;, JSON.stringify(activeConnection.parameters, null, 2));\n if (activeConnection.parameters.CallSid) {\n updateParentCallStatus(activeConnection.parameters.CallSid, &quot;incoming&quot;);\n }\n };\n\n // Reject the call\n document.getElementById('rejectCallButton').onclick = () =&gt; {\n activeConnection.reject();\n jQuery('#newCallingIncomingCallModal').modal('hide');\n updateCallStatus('Call rejected');\n jQuery('#newCallingStatusModal').modal('hide');\n // console.log(&quot;Full Call Parameters:&quot;, JSON.stringify(activeConnection.parameters, null, 2));\n if (activeConnection.parameters.CallSid) {\n updateParentCallStatus(activeConnection.parameters.CallSid, &quot;incoming&quot;);\n }\n activeConnection = null; // Reset active connection after rejection\n };\n \n // Listen for disconnect on the active connection\n activeConnection.on('disconnect', () =&gt; {\n console.log('Call disconnected');\n updateCallStatus('Call ended');\n stopTimer();\n // console.log(&quot;Full Call Parameters:&quot;, JSON.stringify(activeConnection.parameters, null, 2));\n if (activeConnection.parameters.CallSid) {\n updateParentCallStatus(activeConnection.parameters.CallSid, &quot;incoming&quot;);\n }\n activeConnection = null; // Reset active connection\n jQuery('#newCallingStatusModal').modal('hide'); // Close call status modal\n jQuery('#newCallingIncomingCallModal').modal('hide'); // Close incoming call modal\n });\n }\n\n\n // Update call status in the modal\n function updateCallStatus(status) {\n document.getElementById('callStatus').textContent = status;\n }\n\n // Start the call timer\n function startTimer() {\n callStartTime = Date.now();\n timerInterval = setInterval(updateTimer, 1000);\n }\n\n // Stop the call timer\n function stopTimer() {\n clearInterval(timerInterval);\n document.getElementById('callTimer').textContent = '00:00';\n }\n\n // Update the timer display\n function updateTimer() {\n const elapsedTime = Math.floor((Date.now() - callStartTime) / 1000);\n const minutes = Math.floor(elapsedTime / 60).toString().padStart(2, '0');\n const seconds = (elapsedTime % 60).toString().padStart(2, '0');\n document.getElementById('callTimer').textContent = `${minutes}:${seconds}`;\n }\n</code></pre>\n<p>Following is outgoing call handler which is handled by twiml</p>\n<pre><code>// Caller input details from twilio\n $toph = $_REQUEST['To']; // 917797809829\n $fromph = $_REQUEST['From']; // client:2x13612\n $callsid = $_REQUEST['CallSid']; // CAfef253c1b7c1d15bcb1cd7240ce6556c\n $callstat = $_REQUEST['CallStatus']; // ringing\n $twilioMasterNo = getTwilioMasterInfo($con);\n\n // Twilio call status callback url handling hook file\n $statusCallbackUrl = $site_URL . &quot;twilio-current-call-status-callback.php&quot;;\n\n $qp = $_REQUEST;\n $calldesc = &quot;&quot;;\n foreach($qp as $key =&gt; $val){\n $out = $key.' == '.$val;\n if ($calldesc == &quot;&quot;) {\n $calldesc = $out;\n } else {\n $calldesc = $calldesc . ' &amp;&amp; ' . $out;\n }\n }\nif ($twilioMasterNo != &quot;&quot; &amp;&amp; $leadid != &quot;&quot;) {\n \n ?&gt;\n &lt;Response&gt;\n &lt;Dial callerId=&quot;&lt;?= htmlspecialchars($twilioMasterNo) ?&gt;&quot; record=&quot;true&quot;&gt;\n &lt;Number statusCallback=&quot;&lt;?=htmlspecialchars($statusCallbackUrl)?&gt;&quot; statusCallbackEvent=&quot;initiated ringing answered completed&quot;&gt;&lt;?= htmlspecialchars($toph) ?&gt;&lt;/Number&gt;\n &lt;/Dial&gt;\n &lt;/Response&gt;\n &lt;?php\n }\n</code></pre>\n<p>Following is my incoming file ml handler</p>\n<pre><code>// Caller input details from twilio\n $toph = $_REQUEST['To'];\n $fromph = $_REQUEST['From'];\n $callsid = $_REQUEST['CallSid'];\n $callstat = $_REQUEST['CallStatus'];\n\n // Twilio call status callback url handling hook file\n $statusCallbackUrl = $site_URL . &quot;twilio-current-call-status-callback.php&quot;;\n \n $qp = $_REQUEST;\n $calldesc = &quot;&quot;;\n foreach($qp as $key =&gt; $val){\n $out = $key.' == '.$val;\n if ($calldesc == &quot;&quot;) {\n $calldesc = $out;\n } else {\n $calldesc = $calldesc . ' &amp;&amp; ' . $out;\n }\n }\nif ($selectedAgent != &quot;&quot; &amp;&amp; $leadid!= &quot;&quot;) {\n // Create an inbound call record\n $op = create_vtigercallrecord($vclient, $leadid, $agentid, $userid, $leadph, $agentph, $callsid, $calldesc, $callstat, $conduct, $con);\n ?&gt;\n &lt;Response&gt;\n &lt;Dial record=&quot;true&quot;&gt; &lt;!-- Enable call recording --&gt;\n &lt;Client statusCallback=&quot;&lt;?=htmlspecialchars($statusCallbackUrl)?&gt;&quot; statusCallbackEvent=&quot;initiated ringing answered completed&quot;&gt;&lt;?=htmlspecialchars($selectedAgent)?&gt;&lt;/Client&gt; &lt;!-- Replace with your identity --&gt;\n &lt;/Dial&gt;\n &lt;/Response&gt;\n &lt;?php\n }\n</code></pre>\n"^^ . + "1"^^ . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + "0"^^ . + "request"^^ . + . + "1"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + "2"^^ . + "0"^^ . + "As you haven't shared any code so far, it's impossible to tell you how to resolve this"^^ . + . + "The problem when wanna counting of that records (the datatype field is double in SQL Server). When count the value that double datatype in Laravel. It comes not same value.\n\nSQL Server Record A Value = 0.2 (Double datatype)\n\nWhen get in Laravel Query Builder of A Value = 0.19999999 (Float in migration)\n\nSo that, i wanna change my datatype from double to money Maybe that has other configuration in Laravel to handle my case?"^^ . + "Laravel only get models where all relationships have a specific value"^^ . + . + "LinkedIn oauth authorization always returns invalid_client"^^ . + "0"^^ . + . + . + "preg-match"^^ . + . + . + "<p>I took note of this question <a href="https://stackoverflow.com/questions/54321717/how-to-generate-a-specific-nested-json-using-python">Nested JSON using Python</a>, but I was not quite satisfied with the answers provided because I thought that</p>\n<ol>\n<li>it could be <em>better</em> to do this with results of a database, and let json encoding do the work for you rather than try to code the [ { : } ] symbols yourself,</li>\n<li>do it in such a way that it is independent of the language or database you use, as long as you can read data, you don't have to know how specific database or language handle json,</li>\n<li>Use queries/views, thus avoid the complications of applying lambda, groupings and joins that I have seen applied in some of the answers provided to similar questions.</li>\n</ol>\n<p>So, I made a go at it as per the attached code below:</p>\n<pre><code>&lt;?php\n\nheader(&quot;Access-Control-Allow-Origin: *&quot;);\nheader(&quot;Content-Type: application/json; charset=UTF-8&quot;);\n\ninclude_once '../../config/database.php';\n\n$database = new Database();\n$con = $database-&gt;getConnection();\n$sql = 'SELECT * FROM PlanetQ ORDER BY PlanetID, ContinentID, CountryID';\n$stmt = $con-&gt;prepare($sql); \n$stmt-&gt;execute();\n$data = $stmt-&gt;fetchAll(PDO::FETCH_ASSOC);\n\n// show the data\n$PlanetQ[&quot;PlanetQ&quot;] = array();\n\nif ($data) {\n\n $oPlanetID = 0;\n $oContinentID = 0;\n $oCountryID = 0;\n\n foreach ($data as $row) {\n\n //echo $row['Planet'] . '&lt;/br&gt;';\n\n if ($oPlanetID !== $row['PlanetID']) { // new PlanetID, pick all continents &amp; countries\n \n $oPlanetID = $row['PlanetID'];\n\n $e = array(\n &quot;PlanetID&quot; =&gt; $row['PlanetID'],\n &quot;Planet&quot; =&gt; $row['Planet'],\n );\n\n $e['Continent'] = array(\n &quot;ContinentID&quot; =&gt; $row['ContinentID'],\n &quot;Continent&quot; =&gt; $row['Continent'],\n );\n \n $e['Continent']['Country'] = array(\n &quot;CountryID&quot; =&gt; $row['CountryID'],\n &quot;Country&quot; =&gt; $row['Country'],\n &quot;Code&quot; =&gt; $row['Code'],\n &quot;SqKm&quot; =&gt; $row['SqKm'],\n );\n \n } else { // same Planet, now pick only new continents\n\n if($oContinentID !== $row['ContinentID']) { //new Continent, pick all countries\n\n $oContinentID = $row['ContinentID'];\n\n $e = array(\n &quot;ContinentID&quot; =&gt; $row['ContinentID'],\n &quot;Continent&quot; =&gt; $row['Continent'],\n );\n\n $e['Country'] = array(\n &quot;CountryID&quot; =&gt; $row['CountryID'],\n &quot;Country&quot; =&gt; $row['Country'],\n &quot;Code&quot; =&gt; $row['Code'],\n &quot;SqKm&quot; =&gt; $row['SqKm'],\n );\n \n } else { //same Continent, now pick only new countries\n\n if($oCountryID !== $row['CountryID']) {\n\n $oCountryID = $row['CountryID'];\n\n $e = array(\n &quot;CountryID&quot; =&gt; $row['CountryID'],\n &quot;Country&quot; =&gt; $row['Country'],\n &quot;Code&quot; =&gt; $row['Code'],\n &quot;SqKm&quot; =&gt; $row['SqKm'],\n );\n\n }\n\n }\n\n }\n\n array_push($PlanetQ[&quot;PlanetQ&quot;], $e);\n\n }\n\n echo json_encode($PlanetQ, JSON_PRETTY_PRINT);\n\n} else {\n\n echo 'no data\\n';\n\n}\n\n?&gt;\n</code></pre>\n<p>Despite my valiant efforts, though, I still go stuck in the final parts of it. This is my result:</p>\n<pre><code>{\n &quot;PlanetQ&quot;: [\n {\n &quot;PlanetID&quot;: &quot;1&quot;,\n &quot;Planet&quot;: &quot;Earth&quot;,\n &quot;Continent&quot;: {\n &quot;ContinentID&quot;: &quot;1&quot;,\n &quot;Continent&quot;: &quot;Africa&quot;,\n &quot;Country&quot;: {\n &quot;CountryID&quot;: &quot;1&quot;,\n &quot;Country&quot;: &quot;Kenya&quot;,\n &quot;Code&quot;: &quot;254&quot;,\n &quot;SqKm&quot;: &quot;561000.00&quot;\n }\n }\n },\n {\n &quot;CountryID&quot;: &quot;6&quot;,\n &quot;Country&quot;: &quot;Egypt&quot;,\n &quot;Code&quot;: &quot;143&quot;,\n &quot;SqKm&quot;: &quot;287789.00&quot;\n },\n {\n &quot;ContinentID&quot;: &quot;2&quot;,\n &quot;Continent&quot;: &quot;Asia&quot;,\n &quot;Country&quot;: {\n &quot;CountryID&quot;: &quot;2&quot;,\n &quot;Country&quot;: &quot;China&quot;,\n &quot;Code&quot;: &quot;42&quot;,\n &quot;SqKm&quot;: &quot;289000.00&quot;\n }\n },\n {\n &quot;CountryID&quot;: &quot;5&quot;,\n &quot;Country&quot;: &quot;India'na&quot;,\n &quot;Code&quot;: &quot;14\\\\2&quot;,\n &quot;SqKm&quot;: &quot;289000.00&quot;\n }\n ]\n}\n</code></pre>\n<p>As you can see, the Planet Earth has 2 continents, Africa and Asia. Each of the continents has 2 countries each (Africa &gt; Kenya &amp; Egypt; Asia &gt; China &amp; Indian'a). The result, however, seems to be closing the continent before the second country is added, and subsequently, the planet is being closed before the second Continent is added, etc. Thus I am ending up with more curly braces than I should have in between the dataset.</p>\n<p>I would like to end up with list of Planet objects (properties), list of continent objects (properties), and list of counties objects (properties). Thus achieve something like this:</p>\n<pre><code>{\n &quot;PlanetQ&quot;: [\n {\n &quot;PlanetID&quot;: &quot;1&quot;,\n &quot;Planet&quot;: &quot;Earth&quot;,\n &quot;Continent&quot;: [\n {\n &quot;ContinentID&quot;: &quot;1&quot;,\n &quot;Continent&quot;: &quot;Africa&quot;,\n &quot;Country&quot;: [ \n {\n &quot;CountryID&quot;: &quot;1&quot;,\n &quot;Country&quot;: &quot;Kenya&quot;\n },\n {\n &quot;CountryID&quot;: &quot;6&quot;,\n &quot;Country&quot;: &quot;Egypt&quot;\n }\n ],\n {\n &quot;ContinentID&quot;: &quot;2&quot;,\n &quot;Continent&quot;: &quot;Asia&quot;,\n &quot;Country&quot;: [\n {\n &quot;CountryID&quot;: &quot;2&quot;,\n &quot;Country&quot;: &quot;China&quot;\n },\n {\n &quot;CountryID&quot;: &quot;5&quot;,\n &quot;Country&quot;: &quot;India'na&quot;\n }\n ], //close Asia countries\n } //close Asia\n ] //close Earth continents\n } //close Earth\n ] //close planes\n } //close results\n</code></pre>\n"^^ . + . + . + "Symfony 7/API Platform 4: Hydrate array of objects without Doctrine ORM"^^ . + . + . + . + . + . + "1"^^ . + . + "1"^^ . + . + . + ""*In your twig your input isnt closed*" - Unsure how this is relevant and would have anything to do with this problem? Do you have any references for this solution your are proposing? The [documentation](https://symfony.com/bundles/ux-live-component/current/index.html) clearly uses `#[LiveProp(writable: true)]` and `data-model="query"`"^^ . + . + . + . + "<p>This is for a Wordpress site with historical data. Custom post types exist, one of historical figures ('<code>people</code>') and events ('<code>events</code>').</p>\n<p>When an internal link placed in a regular post's content, I would like for the link to automatically change colour depending on which post type it links to. For example:</p>\n<blockquote>\n<p>&quot;History is filled with many people and events. [Henry VIII] was once [born].&quot;</p>\n</blockquote>\n<p>The link &quot;Henry VIII&quot; should be red as it links to a post in '<code>people</code>', and &quot;born&quot; would be green as it links to a post in '<code>events</code>'.</p>\n<p>Is this possible?</p>\n<p>Unable to set css for specific links; it's all or nothing. Conducted a web search for any solution. None found.</p>\n"^^ . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + "4"^^ . + "1"^^ . + . + . + "1"^^ . + "0"^^ . + . + "<p>I would like to create a Unique index on a MYSQL table to prevent some duplicate entries. I am trying to do this in PHP MyAdmin though I guess I could also PHP or a SQL query in the PHP MyAdmin.</p>\n<p>After clicking on Structure and launching the dialog to enter the columns for the Unique index, after you select the columns it asks you to provide &quot;Size&quot;.</p>\n<p>Following Brave's Leo I used 255 for a text column and 10 for Int(11) columns. I also tried a lot of other combinations of numbers. However, whatever I have tried it has given an error message.</p>\n<p><a href="https://i.sstatic.net/rEJoTV5k.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/rEJoTV5k.png" alt="enter image description here" /></a>\n<a href="https://i.sstatic.net/yqkikv0w.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/yqkikv0w.png" alt="enter image description here" /></a></p>\n<p>What numbers can I use, or is there another approach?</p>\n"^^ . + "According to the [nginx: client_max_body_size inheritance](https://www.getpagespeed.com/server-setup/nginx/nginx-client_max_body_size-inheritance) article, your first configuration won't work. According to the same article, your second configuration should work if you add the `client_max_body_size 50M;` directive to your `location ~ \\.php$ { ... }` block."^^ . + . + . + . + "1"^^ . + "1"^^ . + . + "1"^^ . + . + . + . + . + "CodeLite waiting for XDebug"^^ . + . + . + . + . + . + . + . + "php-mongodb"^^ . + "Incidentally, I had the original problem with PHP 8.1.31 and with PHP 8.2.27 ."^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "How to retrieve the root directory from a Filesystem object in Flysystem 3.x?"^^ . + "0"^^ . + . + ""It has something to with Opcache and SSL" - so disabling SSL or OpCache would resolve the problem?"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + "I appreciate all your comments. I thought I had supplied code that demonstrated the issue. \nHowever, I have solved the problem. Bit of a bodge up but it works although I still don't understand why. I'll continue to play with it.\nI simply cleared the field in the DB before I wrote the modified text in.\n$sql = "UPDATE users SET password= 'sometext' WHERE id = '$id'";\nExecute it and then\n$sql = "UPDATE users SET password= '$passwordhash' WHERE id = '$id'";\nand then execute that and it works fine.\nAbsolutely crazy but it works.\nI'll do some tracing and I'll be back.\nThanks again."^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + "MAKEing PHP ld: error: relocation R_X86_64_32 cannot be used against local symbol"^^ . + . + "2"^^ . + . + "0"^^ . + . + . + "1"^^ . + "Is there a way SWIG C++ to PHP could force 'static' in front of a function?"^^ . + . + . + "<p>in my laravel 12 project, I use 2 tables for authentication, i.e. the users table and the admin_users table which are both extended Authenticatable in the model.\nWhen a logged-in user navigates to a url <a href="http://127.0.0.1:8000/login_jemaat" rel="nofollow noreferrer">http://127.0.0.1:8000/login_jemaat</a> laravel redirects it to the <a href="http://127.0.0.1:8000/admin/login" rel="nofollow noreferrer">http://127.0.0.1:8000/admin/login</a> page, which I shouldn't want. How do I fix this problem, so when a logged-in user navigates to a url <a href="http://127.0.0.1:8000/login_jemaat" rel="nofollow noreferrer">http://127.0.0.1:8000/login_jemaat</a> laravel will redirects it to <a href="http://127.0.0.1:8000/" rel="nofollow noreferrer">http://127.0.0.1:8000/</a></p>\n<p>Users</p>\n<pre><code>class User extends Authenticatable\n{\n}\n</code></pre>\n<p>AdminUser</p>\n<pre><code>class AdminUser extends Authenticatable\n{\n}\n</code></pre>\n<p>config/auth.php:</p>\n<pre><code>&lt;?php\n\nreturn [\n\n 'defaults' =&gt; [\n 'guard' =&gt; env('AUTH_GUARD', 'users'),\n 'passwords' =&gt; env('AUTH_PASSWORD_BROKER', 'users'),\n ],\n\n 'guards' =&gt; [\n 'users' =&gt; [\n 'driver' =&gt; 'session',\n 'provider' =&gt; 'users',\n ],\n\n 'admin_users' =&gt; [\n 'driver' =&gt; 'session',\n 'provider' =&gt; 'admin_users',\n ],\n ],\n\n 'providers' =&gt; [\n 'users' =&gt; [\n 'driver' =&gt; 'eloquent',\n 'model' =&gt; App\\Models\\User::class,\n ],\n\n 'admin_users' =&gt; [\n 'driver' =&gt; 'eloquent',\n 'model' =&gt; App\\Models\\AdminUser::class,\n ],\n ],\n\n\n 'passwords' =&gt; [\n 'users' =&gt; [\n 'provider' =&gt; 'users',\n 'table' =&gt; env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),\n 'expire' =&gt; 60,\n 'throttle' =&gt; 60,\n ],\n\n 'admin_users' =&gt; [\n 'provider' =&gt; 'admin_users',\n 'table' =&gt; env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),\n 'expire' =&gt; 60,\n 'throttle' =&gt; 60,\n ],\n ],\n\n 'password_timeout' =&gt; env('AUTH_PASSWORD_TIMEOUT', 10800),\n];\n</code></pre>\n<p>bootstrap/app.php:</p>\n<pre><code>-&gt;withMiddleware(function (Middleware $middleware) {\n $middleware-&gt;redirectGuestsTo(function (Request $request) {\n // Jika URL mengarah ke dashboard (atau sub-path-nya), arahkan ke halaman admin login\n if ($request-&gt;is('dashboard') || $request-&gt;is('dashboard/*')) {\n return route('admin.login');\n }\n // Defaultnya untuk pengguna jemaat\n return route('pages.login');\n });\n })\n</code></pre>\n<p>route/web.php:</p>\n<pre><code>Route::middleware('guest:users')-&gt;group(function () {\n Route::get('/login_jemaat', function () {\n return view('pages.login');\n })-&gt;name('pages.login');\n\n Route::get('/register_jemaat', function () {\n return view('pages.register');\n })-&gt;name('pages.register');\nRoute::post('/register_jemaat', [PageController::class, 'register'])-&gt;name('register_jemaat');\n Route::post('/login_jemaat', [PageController::class, 'login'])-&gt;name('login_jemaat');\n});\n\nRoute::middleware('guest:admin_users')-&gt;group(function () {\n Route::get('/admin/login', [AdminAuthController::class, 'index'])-&gt;name('admin.login');\n Route::post('/admin/login', [AdminAuthController::class, 'login'])-&gt;name('admin.login.submit');\n});\n</code></pre>\n<p>Thank you everyone</p>\n"^^ . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + . + . + "1"^^ . + . + . + . + "<p>So, I think I found the cause of my problem.<br />\nEverything is in the ApiPlatform\\JsonLd\\Serializer\\ItemNormalizer.<br />\nIndeed, since v2.7 (or 3.0) the @id parameter is generated thanks to the iriConverter with the context operation passed to the method.<br />\nThe operation is a Patch operation and the iriConverter take the input iri as @id.</p>\n<p>To fix this, I made a custom normalizer which decorates the JsonLd one. Like this :</p>\n<pre><code>&lt;?php\n\nnamespace App\\Normalizer;\n\nuse ApiPlatform\\Api\\IriConverterInterface;\nuse ApiPlatform\\Metadata\\Operation;\nuse Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface;\n\nclass CustomNormalizer implements NormalizerInterface\n{\n private NormalizerInterface $decorated;\n\n public function __construct(private IriConverterInterface $iriConverter, private NormalizerInterface $decorated)\n {\n }\n\n public function normalize($object, ?string $format = null, array $context = []): null|array|\\ArrayObject|bool|float|int|string\n {\n $normalizedData = $this-&gt;decorated-&gt;normalize($object, $format, $context);\n\n if (self::isCustomOperation($normalizedData, $context)) {\n $normalizedData = $this-&gt;regenerateIdWithIriFromGetOperation($object, $context, $normalizedData);\n }\n\n return $normalizedData;\n }\n\n public function supportsNormalization($data, ?string $format = null): bool\n {\n return $this-&gt;decorated-&gt;supportsNormalization($data, $format);\n }\n\n private function regenerateIdWithIriFromGetOperation($object, array $context, array $normalizedData): array\n {\n // We force the converter to use the GET operation instead of the called operation to generate the iri\n $iri = $this-&gt;iriConverter-&gt;getIriFromResource($object, context: $context);\n $normalizedData['@id'] = $iri;\n\n return $normalizedData;\n }\n\n private static function isCustomOperation($normalizedData, array $context): bool\n {\n if (!is_array($normalizedData) || !array_key_exists('@id', $normalizedData)) {\n return false;\n }\n if (!($context['operation'] ?? null) instanceof Operation) {\n return false;\n }\n $extraProps = $context['operation']-&gt;getExtraProperties();\n\n return $extraProps['custom_operation'] ?? false;\n }\n}\n\n</code></pre>\n<p>Then, I added the custom normalizer in the YAML configuration (config/services.yaml) :</p>\n<pre><code> App\\Normalizer\\CustomNormalizer:\n decorates: &quot;api_platform.jsonld.normalizer.item&quot;\n</code></pre>\n<p>And for the given operations, I added an extra property to only activate the custom normalizer on specific operations:</p>\n<pre><code>#[Patch(\n uriTemplate: '/o_ts/{id}/reactivated',\n uriVariables: ['id' =&gt; new Link(fromClass: self::class, identifiers: ['id'])],\n controller: OTReactivated::class,\n openapiContext: ['summary' =&gt; 'Work Order reactivated'],\n securityPostDenormalize: 'is_granted(&quot;OT&quot;, object)',\n securityPostDenormalizeMessage: &quot;Vous n'avez pas l'accès à cette ressource.&quot;,\n name: 'api_o_ts_reactivated',\n extraProperties: ['custom_operation' =&gt; true],\n)]\n</code></pre>\n<p>With that, the @id returned is the correct one!</p>\n"^^ . + "You need to serialize the parallel requests with a queue"^^ . + . + . + "Running Windows exe to access MySQL database fails with error code: 1073741515"^^ . + "0"^^ . + "I suggest amending the title and opening of your question to relate to your specific issue, rather than the extremely broad and vague scope it currently has. See also [ask]."^^ . + . + "0"^^ . + . + "@Aquaholic. Just to be sure. You are looking for a method to save answers periodically (avoiding JavaScript) and ensure they are saved when the time is up, regardless of the page the user is on?"^^ . + . + . + "slim-4"^^ . + . + . + . + . + "0"^^ . + . + . + "basically it's connected to a database that fetches their unique id and uses it as a session identifier. I'm planning on changing this to add more security though."^^ . + . + . + "<p>Use a regular expression to find the lines that begin with <code>Location:</code> and extract the rest of the line using a capture group.</p>\n<pre><code>foreach ($pile as $p) {\n if (preg_match('/^\\s*location:\\s*(.*)/im', $p, $match)) {\n $linksonly[] = $match[1];\n }\n}\n</code></pre>\n<p>If you need other values you can extract them similarly.</p>\n"^^ . + . + "0"^^ . + . + . + "Berlin to UTC is 1 hour. Can you see what the timestamps are being passed as to yajira?"^^ . + "<p>I have this PHP code:</p>\n<pre class="lang-php prettyprint-override"><code>class Test {\n public string $Foo { set =&gt; strtoupper($value); }\n public string $Bar { set {} }\n}\n\n$test = new Test;\n$test-&gt;Foo = 'foo';\n$test-&gt;Bar = 'bar';\n\necho $test-&gt;Foo;\necho $test-&gt;Bar; // Error: Property Test::$Bar is write-only\n</code></pre>\n<p>Both of them has only a setter, not a getter. But they still have different logic, since one of them is possible to read, and the other is write-only. Is there a way to detect the difference using reflection?</p>\n"^^ . + . + "How can I change the color of the grid in this chart using Chart.js"^^ . + . + . + . + . + "1"^^ . + . + "sudo dnf list --installed | grep php returns 8.3.19-1.fc41.remi among others while php -v returns 8:4 and /usr/bin/php -v return 8.3 . The #PATH is /home/jaaf/.config/herd-lite/bin:/home/jaaf/android-platform-tools:/home/jaaf/.config/herd-lite/bin:/home/jaaf/android-platform-tools:/home/jaaf/.local/bin:/home/jaaf/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/lib/snapd/snap/bin. How on earth, to get rid of this herd-lite version ?"^^ . + . + . + "1"^^ . + . + . + . + "<p>Assuming a 2d array as input, how can each first level key be copied as a new element in its second level row?</p>\n<p>Sample input:</p>\n<pre class="lang-php prettyprint-override"><code>$members = [\n 'myname' =&gt; ['userid' =&gt; 52, 'age' =&gt; 46],\n 'isname' =&gt; ['userid' =&gt; 22, 'age' =&gt; 47],\n 'yourname' =&gt; ['userid' =&gt; 47, 'age' =&gt; 85]\n];\n</code></pre>\n<p>Desired result:</p>\n<pre class="lang-php prettyprint-override"><code>[\n 'myname' =&gt; ['userid' =&gt; 52, 'age' =&gt; 46, 0 =&gt; 'myname'],\n 'isname' =&gt; ['userid' =&gt; 22, 'age' =&gt; 47, 0 =&gt; 'isname'],\n 'yourname' =&gt; ['userid' =&gt; 47, 'age' =&gt; 85, 0 =&gt; 'yourname'],\n]\n</code></pre>\n<p>After fixing some typos, <a href="https://3v4l.org/EPnY8" rel="nofollow noreferrer">the following script works</a>, but how else can this be achieved?</p>\n<pre class="lang-php prettyprint-override"><code>foreach ($members as $key =&gt; $item) {\n array_push($members[$key], $key);\n}\n</code></pre>\n<p><sub>This question was stimulated by <a href="https://stackoverflow.com/q/23803496/2943403">array_push not working in foreach loop</a> which suffered from multiple typos and was closed accordingly.</sub></p>\n"^^ . + "How can I add a bcc recipient to $mailto in my webform"^^ . + . + "My mistake, it was in the third array but thanks to you guys I added in a count($column) if statement and now it shows up as the first line. I added in some of the CSV code that you requested. Thanks"^^ . + "0"^^ . + "ups-api"^^ . + "1"^^ . + . + . + . + "<p>You should first verify the include/require path in your index.php is correct. Adding <code>__DIR__</code> might help:</p>\n<pre><code>require_once __DIR__ . '/vendor/autoload.php';\n</code></pre>\n"^^ . + . + "configuration"^^ . + "If you're on PHP 8.1 or above (which you should be, nothing else is supported) where mysqli exceptions are already enabled by default, you don't need to clutter your script with code to check for database connection errors - PHP will do this automatically for you, and route the error either to the output or to your error log file, depending on your PHP settings. And you should never be echoing error data deliberately anyway - it can easily reveal sensitive info to attackers by accident. More information: https://phpdelusions.net/mysqli#error_handling"^^ . + . + "https://github.com/bmewburn/intelephense-docs/blob/master/installation.md, please see the section with Run\nintelephense {transport}\nWhere {transport} is one of:\n\n--node-ipc\n--stdio\n--socket={number}\n--pipe={string}"^^ . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + "<p>I am using <strong>Norton Antivirus</strong>, and I disabled the &quot;HTTPS Scanning&quot; option within the &quot;Safe Web&quot; feature as outlined in <a href="https://stackoverflow.com/questions/78812467/all-https-connections-outside-of-browser-fail-with-ssl-certificate-problem-una/79322895#79322895">All HTTPS connections outside of browser fail with &quot;SSL certificate problem: unable to get local issuer certificate&quot;</a></p>\n<p>This prevented the curl error 60 in composer.</p>\n<p>For reference: <a href="https://curl.se/libcurl/c/libcurl-errors.html#CURLEPEERFAILEDVERIFICATION" rel="nofollow noreferrer">https://curl.se/libcurl/c/libcurl-errors.html#CURLEPEERFAILEDVERIFICATION</a></p>\n<blockquote>\n<p>CURLE_PEER_FAILED_VERIFICATION (60)</p>\n<p>The remote server's SSL certificate or SSH fingerprint was deemed not OK.</p>\n</blockquote>\n"^^ . + . + . + . + . + . + . + . + . + . + "If you are consuming api routes then no need to handle csrf ? ---------------------------------------------------- can you please clarify your question , Thanks"^^ . + . + . + . + . + "<p>If the page is just reloading, is probably some error with the form validation (caused by the StoreAppointmentRequest).</p>\n<p>To confirm (<em>fastly</em>), add:\n<code>&lt;?php dump($errors); ?&gt;</code> on the .blade file with the form.\nand submit the form again.</p>\n<p>If this is indeed the case, then:\n<a href="https://laravel.com/docs/11.x/validation#quick-displaying-the-validation-errors" rel="nofollow noreferrer">https://laravel.com/docs/11.x/validation#quick-displaying-the-validation-errors</a></p>\n"^^ . + . + "0"^^ . + "3"^^ . + . + . + . + "Examining variables in Sublime Text 3 with Xdebug"^^ . + . + . + . + "when I clear my table using `migrate:fresh` and register, I receive a 204 response code. However, when I try to register again, I get a 200 response, even though I haven't logged in yet."^^ . + . + "Reversing the lookup and searching through the longest area codes first – as suggested in my first comment to this answer – speeds up the lookup. It then takes 4 ns on average."^^ . + . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + "2"^^ . + "bash"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + . + "1"^^ . + . + . + "2"^^ . + "How to Define a money Data Type in Laravel Migrations for SQL Server?"^^ . + . + "0"^^ . + "<p>Note that WordPress <code>post_class</code> filter hook doesn't work when <a href="https://woocommerce.com/document/high-performance-order-storage/#how-to-enable-high-performance-order-storage" rel="nofollow noreferrer">WooCommerce High Performance Order Storage (HPOS) is enabled</a>, which seems to be the case on one of your websites, as HPOS is now enabled by default in WooCommerce.</p>\n<p>For Admin Orders hooks compatibility, see: <a href="https://stackoverflow.com/questions/77366037/filtering-orders-list-in-woocommerce-with-hpos/77366541#77366541">Filtering orders list in WooCommerce with HPOS</a></p>\n<p>Here is the list of threads related to <a href="https://stackoverflow.com/search?q=%5Bwoocommerce%5D+HPOS">WooCommerce High Performance Order Storage on stack overflow</a>.</p>\n<h5>Alternative for HPOS:</h5>\n<p>You could <a href="https://stackoverflow.com/questions/78185098/custom-columns-in-admin-orders-list-disapeared-with-woocommerce-8-6-1/78185329#78185329">add a column to admin orders (HPOS enabled) with the shipping method used</a> and highlight <strong>Local pickup</strong> directly in the code, adding some html tag with a <code>style</code> attribute with the desired styles to be applied <em>(depending on the shipping method)</em>.</p>\n"^^ . + . + . + . + "1"^^ . + . + "this is PHP! there is no maven/gradle task! there's no "build" to be done! if the last task is "publish artifacts" I can deploy on the server and have it running fine!"^^ . + . + "1"^^ . + "1"^^ . + . + . + . + . + "1"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + . + "laravel-dusk"^^ . + "0"^^ . + "1"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + "3"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + "Please can you share the actual var_dump output?"^^ . + . + . + "2"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + . + "1"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + "1"^^ . + . + . + . + "laravel-permission"^^ . + "1"^^ . + . + . + "<p>According to <a href="https://developer.shopware.com/docs/guides/plugins/plugins/framework/data-handling/entities-via-attributes.html" rel="nofollow noreferrer">this page</a> it is now possible and recommended to define entities without the use of getters and setters for the fields.</p>\n<p>But when I define my Entity like this in &quot;shopware/core&quot;: &quot;~v6.6.9.0&quot;,</p>\n<pre><code>use Shopware\\Core\\Content\\Product\\ProductEntity;\nuse Shopware\\Core\\Framework\\DataAbstractionLayer\\Entity;\n\nuse Shopware\\Core\\Framework\\DataAbstractionLayer\\Attribute\\Field;\nuse Shopware\\Core\\Framework\\DataAbstractionLayer\\Attribute\\FieldType;\nuse Shopware\\Core\\Framework\\DataAbstractionLayer\\Attribute\\PrimaryKey;\nuse Shopware\\Core\\Framework\\DataAbstractionLayer\\Attribute\\ManyToMany;\n\nclass ProductBundleEntity extends Entity\n{\n #[PrimaryKey]\n #[Field(type: FieldType::UUID)]\n public string $id;\n\n #[Field(type: FieldType::FLOAT)]\n public ?float $discount;\n\n #[Field(type: FieldType::STRING)]\n public ?string $discountType;\n\n #[Field(type: FieldType::BOOL)]\n public bool $active;\n\n #[Field(type: FieldType::DATETIME)]\n public ?\\DateTimeInterface $validFrom;\n\n #[Field(type: FieldType::DATETIME)]\n public ?\\DateTimeInterface $validTo;\n\n /**\n * @var array&lt;string, ProductEntity&gt;|null\n */\n #[ManyToMany(\n entity: 'product',\n )]\n public ?array $products = null;\n}\n</code></pre>\n<p>and try to validate using <code>bin/console dal:validate</code>, I get a bunch of errors:</p>\n<pre><code>* No getter function for property id \n* No setter function for property id \n* No getter function for property discount \n* No setter function for property discount \n* No getter function for property discountType \n* No setter function for property discountType \n* No getter function for property active \n* No setter function for property active \n* No getter function for property validFrom \n* No setter function for property validFrom \n* No getter function for property validTo \n* No setter function for property validTo \n* No getter function for property products \n* No setter function for property products \n</code></pre>\n<p>Is that just not implemented yet or am I doing something wrong?</p>\n"^^ . + . + . + "@MagnieMozios i got this error \nWarning: POST Content-Length of 12265205 bytes exceeds the limit of 8388608 bytes in Unknown on line 0"^^ . + . + . + "1"^^ . + . + . + "2"^^ . + . + . + "<p>In your action, flexform-settings are available via <code>$this-&gt;settings</code>. Just pass your limit to the called method of your repository: <code>ItemRepository-&gt;findAllFilteredByXy($xy, $this-&gt;settings['limit'])</code></p>\n"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + "2"^^ . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + . + . + . + "Problems getting array items out of a JSON decode in PHP"^^ . + "0"^^ . + . + . + . + "0"^^ . + "While loop in PHP. How to stop it?"^^ . + . + . + "0"^^ . + "Why is there no heartbeat on RabbitMQ / PHP connection"^^ . + "0"^^ . + "0"^^ . + "<p>I'm building a simple system to allow a handful of signers to sign documents via a web portal. Written using PHP, jQuery using a mySQL database.</p>\n<p>There are a few elements to the system:</p>\n<p><strong>Creating signers</strong>\nDocument signers create a login to the system. When they create their account, they draw a visual representation of their signature, stored in the database as JSON. When they create their signature, they also set a password, so that later in the system, when applying their signature, we can check that they know the password for the stored signature.</p>\n<p><strong>Creating documents</strong> The system allows logged in users to create a document which they will go on to sign. The document is encrypted using a private key stored on the server. The encrypted document content is written to the database, with a checksum to ensure that the document data hasn't been tampered with when it's later decrypted for plain-text viewing.</p>\n<p><strong>Signing documents</strong> Currently, when a signer signs a document, it takes the document ID and their signature ID (verified ownership by password) and creates a relational table (i.e. document 1 was signed by signer 1). This works well, as I can prove that the document hasn't been altered since generating, and it also proves that the signer intended to sign the document, as they wouldn't be able to proceed without knowing the password for their signature.</p>\n<p>The issue I face is the security issue with the relational table. Currently, a DB admin could go into the table, and change the signer for 'document 1' from 'signer 1' to 'signer 2'. This means that when the signed document is reviewed, it would have the incorrect/the wrong signers signature on it.</p>\n<p>I would appreciate any recommendations of how I can circumvent this issue, so that we can prove the link between the document and signer ID.</p>\n"^^ . + . + "0"^^ . + "0"^^ . + . + "aws-php-sdk"^^ . + "1"^^ . + . + "@ADyson So, I tried copying what they already do, it doesn't save anything and just doesn't work. In addition, I don't want to use external packages because I don't want to put any code that isn't mine in my project. My project is 4.5 years old and it literally does everything it needs to do without any plugins, except for sending push notifications. I wish someone would be able to solve this and I end up shrinking a project that weighed 90 MB at launch to a weight of 1 MB."^^ . + . + "1"^^ . + . + . + . + "It's being set automatically in the working example by Symfony, and also in the last example by the preparedheaders"^^ . + "amphp"^^ . + . + . + . + . + . + . + "php 8 pdo invalid string data with utf8mb4 and utf8mb4_0900_ai_ci collation"^^ . + . + . + "1"^^ . + . + . + "Why is it timed? Is it a test?"^^ . + . + "numeric(19,2) is probably good for you, it's more precise than float."^^ . + "0"^^ . + "Have a look into `aria2`, it does work well called by PHP `popen()` https://github.com/aria2/aria2"^^ . + . + "0"^^ . + . + . + "No. Another post said definitively that you shouldn't convert a special character to an html entity because the special character is preferable. Nowhere in that post did anyone write anything remotely like "it's up to you"."^^ . + . + . + . + . + "2"^^ . + . + . + "-3"^^ . + . + "1"^^ . + . + "<p>I am trying to install PHP8.3 using <code>brew install php@8.3</code> . But I'm getting the following</p>\n<pre><code>==&gt; Downloading https://libzip.org/download/libzip-1.11.3.tar.xz\ncurl: (35) error:14004410:SSL routines:CONNECT_CR_SRVR_HELLO:sslv3 alert handshake failure \n\nError: php@8.3: Failed to download resource &quot;libzip&quot;\nDownload failed: https://libzip.org/download/libzip-1.11.3.tar.xz\n</code></pre>\n"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + "2"^^ . + . + "@zockchin: That's not a quote from the manual but generated text. Therefore the author can't provide any references to the source of it. You can simulate it e.g. with Deepseek, just copy & paste your question into it."^^ . + . + . + "For safety, is it enough to check whether user input conforms to an expected value? Or do I need to escape it before output anyway?"^^ . + "0"^^ . + "1"^^ . + "<p>It's a very old PHP problem, but I'm working with an old SQL database for a private project. The SQL databsae is latin encoded and has for example &quot;Andr\\xc3\\xa9&quot; representing André.</p>\n<p>The database rows themself have the &quot;Andr\\xc3\\xa9&quot;</p>\n<p>I've read all the documentation about UTF8_decode(), mb_convert_encoding() and all of the rest of the modern functions, none of them convert my database string.</p>\n<p>And yet... If I just declare raw hard-coded string with the \\xc3\\xa9 bit in the the é, it converts no problem.</p>\n<pre><code>$iso_string_from_raw = &quot;Andr\\xc3\\xa9&quot;;\n$iso_string_from_db = $a-&gt;u_firstnames; //same as $iso_string_from_raw on copy/paste\n$iso_string_raw = mb_convert_encoding($iso_string_from_raw, &quot;ISO-8859-1&quot;, &quot;UTF-8&quot;);\n$iso_string_from_db = mb_convert_encoding($iso_string_from_db, &quot;ISO-8859-1&quot;, &quot;UTF-8&quot;);\n\nVar_dump(): \n$iso_string_from_raw -&gt; &quot;André&quot;\n$iso_string_from_db -&gt; &quot;Andr\\xc3\\xa9&quot;\n$iso_string_raw -&gt; &quot;André&quot; (as it should be)\n$iso_string_from_db -&gt; &quot;Andr\\xc3\\xa9&quot;\n\nstring(6) &quot;André&quot;\nstring(12) &quot;Andr\\xc3\\xa9&quot;\nstring(5) &quot;André&quot;\nstring(12) &quot;Andr\\xc3\\xa9&quot;\n</code></pre>\n<p>Appreciating that the database having these escaped characters in the rows, any help with a solution for converting that would be appreciated.</p>\n"^^ . + . + . + "The order of the addition matters how inaccuracies due to precision limitations creep into the sum."^^ . + "3"^^ . + . + "The distortion takes the most time in this particular script, I'd purposely used a more complex distortion function as an example in the test. \n\nBut I get similar results using a variety of different imagick functions in tests using the two different PHP versions. Running in 7.2 is giving the quicker results."^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "The referer is not where the traffic is coming from. When you follow a link, it's the URL of the page containing the link, but the traffic comes from your PC's IP."^^ . + . + . + . + "2"^^ . + . + . + "Thank you, I was definitely missing that, yet it is only part of the solution for me, as I have a module version mismatch. Runkit does exist in folder `20230831`, yet the other modules are in `20200930`; hence at first I got a not found error for `runkit7.so`, and when providing the full path via `extension=/usr/lib/php/20230831/runkit7.so` I get an `These options need to match` / `Unable to initialize module` warning."^^ . + . + "runkit"^^ . + . + . + . + . + "2"^^ . + . + . + "Laravel Install issue: Your requirements could not be resolved to an installable set of packages"^^ . + "1"^^ . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + "elementor"^^ . + . + "0"^^ . + . + . + . + . + ""since EntiesProject is now separated to 2 projects, each need to have their own composer.json, composer.lock and vendor." - that's not how Composer works. There is only ever **one** `vendor` directory in your application, it contains a copy of each library you use. Maybe you're picturing NPM, and its notoriously giant `node_packages` directory; that's caused by the way JS modules are scoped so that you can have multiple different versions of the same module installed at the same time - PHP doesn't work like that, so Composer couldn't do that even if it wanted to."^^ . + . + "4"^^ . + "Yeah, I just answered my question. Please read the answer, and thanks for taking the time to read it."^^ . + "0"^^ . + . + . + "3"^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + "<p>You have to know for yourself whether you need it in the end or not, that can't be answered.</p>\n<p>However what you technically ask about is pretty clear:</p>\n<p>Right now you try to look into the future when initializing the static class member in the <em>static::setDefault()</em> method.</p>\n<p>As you have demonstrated, you are using reflection and it requires the closure to have a return type.</p>\n<p>If it doesn't, you can not check it at that place.</p>\n<p>However, there is the <em>static::getDefault()</em> method where the closure is actually invoked. Therefore under these circumstances you can defer the check until that method is called and throw an exception if the return value of the closure invocation does not match your requirements.</p>\n<p>To turn this now lazy check into an eager check, you just call getDefault() already in setDefault() if there is no return type to check.</p>\n<p>Or decide for yourself which runtime behaviour you want. Always a lazy check is technically possible, too.</p>\n<hr />\n<blockquote>\n<p>But how I could extend anonymous class...</p>\n</blockquote>\n<p>As usual, with a pinch of salt:</p>\n<pre><code>&lt;?php\n\n$parent = new class () extends stdClass {};\n\nclass_alias(get_class($parent), 'parentClass');\n\n$child = new class() extends parentClass {};\n\nvar_dump(get_parent_class($child));\nvar_dump(get_parent_class(get_parent_class($child)));\n</code></pre>\n<pre><code>string(42) &quot;class@anonymous /path/to/script.php:4$0&quot;\nstring(8) &quot;stdClass&quot;\n</code></pre>\n"^^ . + . + "1"^^ . + . + "<pre><code>public function up(): void\n {\n Schema::create('books', function (Blueprint $table) {\n $table-&gt;id();\n $table-&gt;string('book_name');\n $table-&gt;string('author');\n $table-&gt;integer('page_count');\n $table-&gt;foreignId('category_id')-&gt;constrained()-&gt;onDelete('cascade');\n $table-&gt;string('isbn');\n $table-&gt;string('publisher');\n $table-&gt;string('publish_year');\n $table-&gt;string('status');\n $table-&gt;timestamps();\n });\n }\n</code></pre>\n<blockquote>\n<p>SQLSTATE[22007]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. (Connection: sqlsrv, SQL: insert into [books] ([book_name], [author], [page_count], [category_id], [isbn], [publisher], [publish_year], [status], [updated_at], [created_at]) values (1984, George Orwell, 328, 4, 9780451524935, Penguin Books, 1949, available, 2025-03-17 14:01:33.722, 2025-03-17 14:01:33.722))</p>\n</blockquote>\n<p>I am working on a website but I always get the same error when trying to add data with seeder. I tried using datetime instead of timestamps and although I made it nullable, it continues to give the same error. I use SQL Server Management Studio.</p>\n"^^ . + "octane"^^ . + . + "rabbitmq"^^ . + . + . + . + . + "split"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + "there is nothing to check, you delete everything"^^ . + . + . + "0"^^ . + . + "1"^^ . + "_"I believe"_ is not a good basis to operate on here. I would suggest that you go and create a new API key for a.com, and see if the problem persists."^^ . + . + . + "2"^^ . + "<p>I'm in the process of rolling out a feature to all clients, but some clients already have existing data, and I cannot override the content present in their <code>meal_moment</code> table.</p>\n<p>I need to create a default meal_moment with ID 0 for all clients who don't have any <code>meal_moment</code> data, while also updating all orders to <code>mealmoment_id</code> 0, as I need to override that.</p>\n<p>Clients where the feature is already deployed have a <code>meal_moment</code> with ID 0.</p>\n<p>Here is my migration code:</p>\n<pre><code>public function up(Schema $schema): void\n{\n // if no mealmoment with the id 0 exists, create it\n $this-&gt;addSql(&quot;\n INSERT INTO `meal_moment` (`id`, `name`, `code`, `ordre`, `customer_id`)\n VALUES (0, 'None', 'None', 0, 0);\n UPDATE `order` SET mealmoment_id = 0 WHERE mealmoment_id IS NULL\n &quot;);\n}\n\npublic function down(Schema $schema): void\n{\n $this-&gt;addSql('UPDATE `order` SET mealmoment_id = NULL WHERE mealmoment_id = 0');\n $this-&gt;addSql('DELETE FROM meal_moment WHERE id = 0');\n}\n</code></pre>\n<p>This craches approch craches for some clients but works in our dev envs where there is no mealmoment. Also, for a reason I can't find, the <code>id = 0</code> in the insert always gets replaced by <code>id = 1</code></p>\n<p>Thanks for your help and suggestions !</p>\n"^^ . + "-3"^^ . + . + . + . + . + "1"^^ . + . + . + . + . + "0"^^ . + "3"^^ . + . + "@C3roe from what i see "$mailTemplate->getContentHtml()" is responsible for binding the value of the html data field on the template."^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + "Is there a reason you want to do it in the application rather than at the more standard database level? https://stackoverflow.com/questions/9497869/export-and-import-all-mysql-databases-at-once"^^ . + "0"^^ . + . + . + . + . + . + . + "2"^^ . + "0"^^ . + . + "0"^^ . + "1"^^ . + "1"^^ . + . + "1"^^ . + . + . + . + "2"^^ . + . + . + . + . + . + "1"^^ . + "2"^^ . + . + "0"^^ . + . + "+ i'm just trying to open my index.php"^^ . + . + "2"^^ . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + "3"^^ . + . + "0"^^ . + . + "@NicoHaase If I understand this directly, SSL is compiled into homebrew's PHP. At least there is no module which is explicitly loaded. So not enabling it is not trivial."^^ . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + "0"^^ . + "3"^^ . + . + . + "1"^^ . + "0"^^ . + . + . + "Can you provide this APIRequest ?"^^ . + "0"^^ . + . + . + "1"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + "The [documentation](https://www.php.net/manual/en/function.header.php#example-4638) for `header` shows setting a cookie in example 3. As to how to use `partitioned`, it might be useful to look at the [`__toString`](https://github.com/symfony/http-foundation/blob/ee1b504b8926198be89d05e5b6fc4c3810c090f0/Cookie.php#L253) method of Symfony's cookie implementation."^^ . + . + . + . + . + . + "`$this->subject ?? ''` What about this?"^^ . + . + . + . + . + . + . + "Sincerely, I wouldn't know how to do it properly. FilamentPHP is an entire new enviroment for me. Sure I could do a trick somehow to listen to the event and force the image replacement, but it would be a total mess, dirty and honestly, a complete trash. I'd like to stay as close to the PHP, Laravel and Filament fundamentals as I can."^^ . + "3"^^ . + "stream-socket-client"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + "The second argument to `fprintf()` should be a format string like `'%s'`. The string to be printed should be next, it will replace `%s` in the format."^^ . + "1"^^ . + "0"^^ . + . + "1"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + "1"^^ . + "@Olivier Yes. (Some more characters to satisfy SO requirements.)"^^ . + . + "1"^^ . + "1"^^ . + . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + "How to authenticate using SimpleWebAuthnBrowser?"^^ . + "0"^^ . + . + . + . + "`everything must be as easy as possible, as fast as possible, as secure as possible, and as up-to-date as possible`...most people would have those goals for their applications,whether it's about news or anything else"^^ . + . + . + . + . + "-1"^^ . + "1"^^ . + . + . + . + "0"^^ . + "Insufficient Property Type in StdClass"^^ . + . + . + . + "0"^^ . + . + . + . + "Also, that very first bit of php code you've shown...is that code in the login.php file? Or is it somewhere else? It's not clear. Please label your code with the file each part comes from, then it's clear. This can be relevant to your problem, potentially. Thanks"^^ . + . + . + "1"^^ . + "It's already closed for a long time as a duplicate, that you refuse to accept whilst failing to provide an evidence that it "isn't the case". A "working example" is not an example that works as you want. A working example means an example that **proves your point.** A code that **everyone can run and see that "I run the update. No update."** You fail to provide this one. But well it seems like a communication problem: you just cannot accept a reasonable explanation. So be it."^^ . + . + "1"^^ . + "1) I just thought it may give interesting info to help in answer. 2) i saw something called transaction in laravel but all docs i found didn't get me anything in my case."^^ . + "1"^^ . + "How create anonymous classes that aren't the same class"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "cakephp"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + . + "1"^^ . + . + . + . + . + . + . + . + "2"^^ . + "0"^^ . + . + "I believe you, however I can't _see_ about which annotation you're commenting as the code in question does not contain it. Btw. it's fine if you [edit] the question and show next to your original code fragment what you have tried, _especially_ if it is not working the way you love it so far. These things can clarify a lot."^^ . + "google-cloud-firestore"^^ . + "0"^^ . + "Please add all clarification **to your question** by editing it. If this is not related to MySQL or "journal", please also remove these tags"^^ . + . + "What would be the best way to display database data into a select form type and then display it after input using php"^^ . + "1"^^ . + "0"^^ . + . + "`var_dump` invokes `__debugInfo` or the internal equivalent, and is used as the name implies, for debugging, and I would not rely on it for normal daily code. You'll also find problems with namespaces, too. As noted in what I linked to, as well as an [internals thread](https://externals.io/message/120895), your best best is to walk the data and create the structure that you think makes the most sense. Alternatively, I wouldn't be surprised if someone has made a library to do this, too."^^ . + "Once the markup is generated and sent to the browser, PHP itself is no longer involved. Is there any reason to **not** use JS, while this is exactly the technique used to run in the browser?"^^ . + . + . + . + . + "0"^^ . + . + "Error when using a Custom PHP CodeSniffer Sniff"^^ . + . + "0"^^ . + . + "<p>I would appreciate it if someone could share a similar experience and/or solution to this problem.</p>\n<p>I have this setup for the php dev environment</p>\n<ul>\n<li>Mac running apache2.4/php7.4/freetds1.4.26/php-pdo-dblib</li>\n<li>Parallel Desktop 20.2.2 running guest OS Windows 11 + dev db Sybase ASE 16</li>\n<li>Production db Sybase ASE 16 on a remote server</li>\n<li>test script <strong>db.php</strong></li>\n</ul>\n<pre><code>&lt;?php\ntry {\n $db=empty($argv[1])?$_REQUEST['db']:$argv[1];\n $dbh = new PDO('dblib:host='.$db, 'sa', 'password');\n echo &quot;Connected!&quot;;\n} catch (PDOException $e) { \n echo &quot;Failed: &quot; . $e-&gt;getMessage(); \n}\n</code></pre>\n<p>FreeTDS definition as</p>\n<ol>\n<li><strong>TESTDB</strong> (connect to guest on Parallel Desktop)</li>\n<li><strong>PRODDB</strong> (connect to live db on a remote server)</li>\n</ol>\n<pre><code>[TESTDB] # local parallel desktop\n host = 10.211.55.2\n port = 5000\n tds version = 5.0\n\n[PRODDB] # remote production db\n host = 10.10.1.3\n port = 5000\n tds version = 5.0\n</code></pre>\n<p>Tests that I have done:</p>\n<ol>\n<li>php-cli using <strong>TESTDB</strong>: <code>php db.php TESTDB</code> =&gt; Connected!</li>\n<li>php-cli using <strong>PRODDB</strong>: <code>php db.php PRODDB</code> =&gt; Connected!</li>\n<li>browser using <strong>TESTDB</strong>: <code>HTTP://localhost/db.php?db=TESTDB</code> =&gt; <em><code>Failed: SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (TESTDB) (severity 9)</code></em></li>\n<li>browser using <strong>PRODDB</strong>: <code>HTTP://localhost/db.php?db=PRODDB</code> =&gt; Connected!</li>\n</ol>\n"^^ . + . + . + "@RoboRobok Yeah, certainly a design flaw in my opinion."^^ . + . + . + "How to Build Web Push Notifications from Scratch Without Minishlink\\WebPush?"^^ . + "`was under the impression that AJAX (or jQuery, or other JS's) can POST a variable in the same way that a form's method = POST`...it can, and does. What differs is how the browser deals with the response to that POST"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + . + "<p>Your code is obsolete, can be simplified and has some mistakes like:</p>\n<ul>\n<li>You can get the WC_Order object directly as 2nd argument from the function,</li>\n<li>Since WooCommerce 3, you need to use methods on the WC_Order object, instead of properties,</li>\n<li>You should check orders with processing and completed status...</li>\n</ul>\n<p>Try the following:</p>\n<pre class="lang-php prettyprint-override"><code>add_action( 'woocommerce_order_status_processing', 'change_role_on_purchase', 10, 2 );\nadd_action( 'woocommerce_order_status_completed', 'change_role_on_purchase', 10, 2 );\nfunction change_role_on_purchase( $order_id, $order ) {\n $user = $order-&gt;get_user(); // Get the WP_User Object\n\n // Loop through order line items\n foreach ( $order-&gt;get_items() as $item ) {\n $product_id = $item-&gt;get_product_id();\n $variation_id = $item-&gt;get_variation_id();\n\n if ( $user &amp;&amp; in_array('13874904', [$product_id , $variation_id]) ) {\n // Set user as paying customer if not set yet\n wc_paying_customer( $order_id );\n // Check for &quot;subscriber&quot; user role and replace it\n if ( wc_user_has_role( $user, 'subscriber' ) ) {\n $user-&gt;set_role( 'special_subscriber' );\n }\n break; // Stop the loop\n }\n }\n}\n</code></pre>\n<p>It should better work.</p>\n<p><strong>Related:</strong></p>\n<ul>\n<li><a href="https://stackoverflow.com/questions/39401393/how-to-get-woocommerce-order-details/44708344#44708344">How to get WooCommerce order details</a></li>\n<li><a href="https://stackoverflow.com/questions/45706007/get-order-items-and-wc-order-item-product-in-woocommerce-3/45706318#45706318">Get Order items and WC_Order_Item_Product in WooCommerce 3</a></li>\n<li><a href="https://stackoverflow.com/questions/22843504/how-can-i-get-customer-details-from-an-order-in-woocommerce/57562904#57562904">How can I get customer details from an order in WooCommerce?</a></li>\n</ul>\n"^^ . + "0"^^ . + . + "How to get data from Guzzle and API response in Laravel"^^ . + . + "<p>I am using wordpress on hostinger. I have registered new custom post types. I am using the twentytwentyfive theme and gutenburg editor. I get this error when I add a style property to a element:<br />\n<code>Updating failed. The response is not a valid JSON response.</code></p>\n<p>NOTE: THIS ERROR ONLY HAPPENS ON CUSTOM POST TYPES. ON normal WP PAGES AND POSTS, IT'S FINE</p>\n<p>This happens when any block has a style property</p>\n<p>e.g.</p>\n<p>when I have</p>\n<pre><code>&lt;!-- wp:paragraph --&gt;\n &lt;p style=&quot;background-color: #000000&quot;&gt;Prepare for 2025&lt;/p&gt;\n&lt;!-- /wp:paragraph --&gt;\n</code></pre>\n<p>It throws the error but when I have</p>\n<pre><code>&lt;!-- wp:paragraph --&gt;\n &lt;p&gt;Prepare for 2025&lt;/p&gt;\n&lt;!-- /wp:paragraph --&gt;\n</code></pre>\n<p>It's fine.</p>\n<p>In the network tab I see:<br />\n<code>https://{website}.com/wp-json/wp/v2/myupdates/60?_locale=user</code> getting a 403 after I post<br />\n{&quot;id&quot;:60,&quot;content&quot;:&quot;&lt;!-- wp:paragraph --&gt;\\n&lt;p style=&quot;background-color: #000000&quot;&gt;Prepare for 2025&lt;/p&gt;\\n&lt;!-- /wp:paragraph --&gt;&quot;}</p>\n<p>My custom post types are defined in a post-types.php file in mu-plugins folder</p>\n<p>This is the file</p>\n<pre><code>&lt;?php\nfunction include_myupdates_in_category_archives($query)\n{\n if (!is_admin() &amp;&amp; $query-&gt;is_main_query() &amp;&amp; (is_category() || is_tag())) {\n $query-&gt;set('post_type', array('post', 'myupdates', 'myfundraisers', 'mycampaigns'));\n }\n}\nadd_action('pre_get_posts', 'include_myupdates_in_category_archives');\n\nfunction custom_post_types()\n{\n // Event post type\n // wordpress register_post_type function\n register_post_type('myupdates', array(\n 'supports' =&gt; array('title', 'thumbnail', 'editor', 'excerpt', 'custom-fields'),\n 'has_archive' =&gt; true,\n 'rewrite' =&gt; array('slug' =&gt; 'updates'),\n 'taxonomies' =&gt; array('category'),\n 'description' =&gt; 'Council Updates',\n 'public' =&gt; true,\n 'show_in_rest' =&gt; true,\n 'label' =&gt; 'Updates',\n 'labels' =&gt; array(\n 'name' =&gt; 'Updates',\n 'add_new_item' =&gt; 'Add New Update',\n 'edit_item' =&gt; 'Edit Update',\n 'all_items' =&gt; 'All Updates',\n 'singular_name' =&gt; 'Update'\n ),\n 'menu_icon' =&gt; 'dashicons-info-outline' // https://developer.wordpress.org/resource/dashicons/\n ));\n\n register_post_type('myfundraisers', array(\n 'supports' =&gt; array('title', 'thumbnail', 'editor', 'excerpt'),\n 'has_archive' =&gt; true,\n 'rewrite' =&gt; array('slug' =&gt; 'fundraisers'),\n 'taxonomies' =&gt; array('category'),\n 'description' =&gt; 'Council Fundraisers',\n 'public' =&gt; true,\n 'show_in_rest' =&gt; true,\n 'label' =&gt; 'Fundraisers',\n 'labels' =&gt; array(\n 'name' =&gt; 'Fundraisers',\n 'add_new_item' =&gt; 'Add New Fundraiser',\n 'edit_item' =&gt; 'Edit Fundraiser',\n 'all_items' =&gt; 'All Fundraisers',\n 'singular_name' =&gt; 'Fundraiser'\n ),\n 'menu_icon' =&gt; 'dashicons-awards' // https://developer.wordpress.org/resource/dashicons/\n ));\n\n register_post_type('mycampaigns', array(\n 'supports' =&gt; array('title', 'thumbnail', 'editor', 'excerpt'),\n 'has_archive' =&gt; true,\n 'rewrite' =&gt; array('slug' =&gt; 'campaigns'),\n 'taxonomies' =&gt; array('category'),\n 'description' =&gt; 'Council Campaigns',\n 'public' =&gt; true,\n 'show_in_rest' =&gt; true,\n 'label' =&gt; 'Campaigns',\n 'labels' =&gt; array(\n 'name' =&gt; 'Campaigns',\n 'add_new_item' =&gt; 'Add New Campaign',\n 'edit_item' =&gt; 'Edit Campaign',\n 'all_items' =&gt; 'All Campaigns',\n 'singular_name' =&gt; 'Campaign'\n ),\n 'menu_icon' =&gt; 'dashicons-groups' // https://developer.wordpress.org/resource/dashicons/\n ));\n}\n\nadd_action('init', 'custom_post_types')\n\n\n\n ?&gt;\n</code></pre>\n"^^ . + . + . + "Track the connection status from the backend?"^^ . + "<p>You may use this regex in PHP with a non-capturing optional group:</p>\n<pre class="lang-bash prettyprint-override"><code>^Saint\\h+(\\w+)\\h+eats(?:\\h+(\\w+)\\h+of)?\\h+those\\h+(\\w+)\n</code></pre>\n<p><a href="https://regex101.com/r/QL7CDt/3" rel="nofollow noreferrer">RegEx Demo</a></p>\n<p><strong>RegEx Details:</strong></p>\n<ul>\n<li><p><code>^Saint</code>: Match <code>Saint</code> at the start</p>\n</li>\n<li><p><code>\\h+</code>: Match 1+ horizontal whitespace</p>\n</li>\n<li><p><code>(\\w+)</code>: 1st capture group to match 1+ word characters</p>\n</li>\n<li><p><code>\\h+</code>: Match 1+ horizontal whitespace</p>\n</li>\n<li><p><code>eats</code>: Match <code>eats</code></p>\n</li>\n<li><p><code>(?:</code>: Start non-capture group</p>\n<ul>\n<li><code>\\h+</code>: Match 1+ horizontal whitespace</li>\n<li><code>(\\w+)</code>: 2nd capture group to match 1+ word characters</li>\n<li><code>\\h+</code>: Match 1+ horizontal whitespace</li>\n<li><code>of</code>: Match <code>of</code></li>\n<li><code>)?</code>: End non-capture group.<code>?</code> makes this group <em>optional</em></li>\n</ul>\n</li>\n<li><p><code>\\h+</code>: Match 1+ horizontal whitespace</p>\n</li>\n<li><p><code>those</code>: Match <code>those</code></p>\n</li>\n<li><p><code>\\h+</code>: Match 1+ horizontal whitespace</p>\n</li>\n<li><p><code>(\\w+)</code>: 3rd capture group to match 1+ word characters</p>\n</li>\n</ul>\n<p><a href="https://onlinephp.io/c/c978a" rel="nofollow noreferrer">PHP Code Demo</a> (Thanks to @sin)</p>\n<p>---</p>\n<p>Here is another regex solution using branch reset feature supported by PCRE (php, perl etc) or by using <code>regex</code> module in python:</p>\n<pre><code>^Saint\\h+(\\w+)\\h+eats(?|\\h+(\\w+)\\h+of|())\\h+those\\h+(\\w+)\n</code></pre>\n<p><a href="https://regex101.com/r/QL7CDt/2" rel="nofollow noreferrer">RegEx Demo 2</a></p>\n"^^ . + "0"^^ . + "0"^^ . + . + . + . + "<p>How add <code>darkMode: class</code> in <code>tailwind.config.js</code>, it is missing in Laravel 12.</p>\n"^^ . + . + "0"^^ . + . + . + . + . + "since I put the delete in the protected $deletedField = 'deletion'; I don't need to put them in the authorizedFields, if that's the answer, also the SQL first() and findAll() work in my code but not in some functions"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + "2"^^ . + . + . + . + . + . + ""dnf repolist" (and read man dnf)"^^ . + . + . + . + "0"^^ . + . + . + . + "i think the issue might be in the request itself its showing pendingbroadcast could your configuration need to be revised and thats all ?"^^ . + . + "0"^^ . + "0"^^ . + "Can you put this `dd( $request->tags );` in the first line of the update method and modify your question to show the dump in the case of a deletion and in the case of an addition."^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + "<p>A website using payment gateway requires Samesite as None to continue session for users returning from payment gateway to website. In other pages of website Samesite should be Lax or strict to protect from CSRF attack.</p>\n<p>Let's say the website has following payment pages.</p>\n<ol>\n<li><em>checkout_pay.php</em>: it shows order confirmation before user is proceeding for payment</li>\n<li><em>checkout_response.php</em>: it shows if payment transaction was successful</li>\n<li><em>checkout_fail.php</em>: it shows if transaction failed</li>\n<li><em>checkout_cancel.php</em>: it shows if transaction was cancelled</li>\n</ol>\n<p>These are some queries that I have in this regard.</p>\n<ol>\n<li><p>Is it possible to set different values for Samesite in different pages?</p>\n</li>\n<li><p>Can Samesite be set None for above four payment pages and set Lax for other pages, admin section by using <code>session_set_cookie_params()</code>?</p>\n</li>\n<li><p>Whether Samesite cookie life-time be set separately for different pages? (The <code>session.cookie_lifetime</code> already set to two days)</p>\n</li>\n</ol>\n"^^ . + "Perhaps take a look at [creating a DMZ](https://www.google.com/search?q=creating+a+dmz+to+host+webserver) to find articles that might be of use. Be aware that you are exposing computers behind the router gateway to all manner of nefarious people"^^ . + "0"^^ . + . + "0"^^ . + . + "Symfony UX/DynamicForms: Can you fill/override dependent form fields with selected data when they are added"^^ . + "twilio-php"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + "`Neither moodle nor the OS do recognize the changes i made.`...what actual issue is occurring then? Can you provide a [mre] of the issue, and any error messages etc? Please [edit] your question. See also [ask]"^^ . + "0"^^ . + . + . + . + . + "<p>I'm using Royal Audio Player as a plugin for a website I'm creating, and I want to have something similar to what this guy created for his Voiceover website.</p>\n<p>Essentially, I want text above the audio player with the different categories available to click on, and when one is clicked on by the user then it will change the player to the respective playlist depending on which one was clicked on.</p>\n<p>So far, I've got 2 shortcodes for the audio player:</p>\n<pre class="lang-none prettyprint-override"><code>[fwdrap preset_id=&quot;VOICEOVER&quot; playlist_id=&quot;VoiceOvers&quot; start_playlist_id=&quot;Audiobooks&quot; start_track_id=&quot;preset&quot;]\n[fwdrap preset_id=&quot;VOICEOVER&quot; playlist_id=&quot;VoiceOvers&quot; start_playlist_id=&quot;Narration&quot; start_track_id=&quot;preset&quot;]\n</code></pre>\n<p>The audio player does have a drop-down that the user can use, which when clicked on will show the other categories and they can choose from there.</p>\n<p>But I want the user to be able to see all of the categories at a given time with a single player. To my knowledge, changing the short-code using AJAX is the only way I can really achieve my goal.</p>\n<p>I tried following this stack overflow post: <a href="https://stackoverflow.com/q/54442781/29746210"><em>Change wordpress shortcode with Javascript</em></a>.</p>\n<p>So I got code like this:</p>\n<pre><code>add_action(\n 'wp_ajax_switch_audio_playlist', \n 'switch_audio_playlist'\n);\nadd_action(\n 'wp_ajax_nopriv_switch_audio_playlist',\n 'switch_audio_playlist'\n);\n\nfunction switch_audio_playlist() \n{\n if (isset($_POST['playlist'])) \n {\n $playlist = sanitize_text_field($_POST['playlist']);\n\n echo do_shortcode('[fwdrap preset_id=&quot;VOICEOVER&quot; playlist_id=&quot;VoiceOvers&quot; start_playlist_id=&quot;' . $playlist . '&quot; start_track_id=&quot;preset&quot;]');\n $html = ob_get_clean();\n\n wp_send_json_success($html);\n } \n else \n {\n wp_send_json_error('No playlist provided.');\n }\n}\n</code></pre>\n<pre><code>function enqueue_custom_ajax_script() \n{\n wp_enqueue_script(\n 'custom-ajax-script',\n get_template_directory_uri() . '/js/custom-ajax.js',\n array('jquery'),\n null,\n true\n );\n \n wp_localize_script(\n 'custom-ajax-script',\n 'ajax_object',\n array('ajax_url' =&gt; admin_url('admin-ajax.php'),\n );\n}\n\nadd_action('wp_enqueue_scripts', 'enqueue_custom_ajax_script');\n</code></pre>\n<p>HTML/JS + Shortcode:</p>\n<pre><code>&lt;div class=&quot;playlist-container&quot;&gt;\n &lt;a class=&quot;switch-playlist&quot; data-playlist=&quot;Audiobooks&quot;&gt;Audiobooks&lt;/a&gt;\n | &lt;a class=&quot;switch-playlist&quot; data-playlist=&quot;Narration&quot;&gt;Narration&lt;/a&gt;\n&lt;/div&gt;\n&lt;div id=&quot;audio-player-container&quot;&gt;\n [fwdrap preset_id=&quot;VOICEOVER&quot; playlist_id=&quot;VoiceOvers&quot; start_playlist_id=&quot;Audiobooks&quot; start_track_id=&quot;preset&quot;]\n&lt;/div&gt;\n\n&lt;script src=&quot;https://code.jquery.com/jquery-3.6.0.min.js&quot;&gt;&lt;/script&gt;\n&lt;script&gt;\njQuery(document).ready(function($) {\n $('.switch-playlist').on('click', function() {\n let playlist = $(this).data('playlist');\n console.log('Switching to playlist:', playlist);\n\n $.ajax({\n url: ajax_object.ajax_url, // This comes from wp_localize_script\n method: &quot;POST&quot;,\n data: {\n action: 'fetch_shortcode',\n playlist: playlist\n },\n success: function(response) {\n console.log('AJAX response:', response);\n $('#audio-player-container').html(response.data);\n }\n });\n });\n});\n&lt;/script&gt;\n</code></pre>\n<p>After fixing a localization issue, I've come to this error:</p>\n<p>When I load the page, the audio player is loading as intended: <a href="https://i.sstatic.net/pBsYh2Gf.png" rel="nofollow noreferrer">My inspector before I click on the Narration Button (Screenshot)</a>.</p>\n<p>But when I press on the narration button the page shows nothing and the inspector looks like this:\n<a href="https://i.sstatic.net/4ad4DnBL.png" rel="nofollow noreferrer">Inspector after I click on the narration button (Screenshot)</a>.</p>\n"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + "And I'd recommend next to your question to als try on https://phpstan.org/try and link your [mre]."^^ . + . + . + . + . + . + . + "<p>I'm new to php and css, and am trying to see if certain things are possible using them.\nIn this case, I'm trying to customize my Woocommerce single product page (WP free Astra theme).\nI was able to change the &quot;out of stock message&quot; to something different, but I would love to add a link within the new message.</p>\n<p>This is what I just added:</p>\n<pre class="lang-php prettyprint-override"><code>/**\n * Change Out Of Stock Text On Product Page\n */\nadd_filter('woocommerce_get_availability', 'availability_filter_func');\nfunction availability_filter_func($availability)\n{\n $availability['availability'] = str_ireplace('Out of stock', 'Sold! Style available for customization using the bespoke code below', $availability['availability']);\n return $availability;\n}\n</code></pre>\n<p>And I'd like the word &quot;customization&quot; to link to a different page.\nIs that possible?</p>\n"^^ . + . + "1"^^ . + . + . + "<p>laravel upgraded 9 to 11, I'm getting <code>$request-&gt;user()</code> and <code>Auth::user()</code> null value in web route. I'm using <a href="https://github.com/PHP-Open-Source-Saver/jwt-auth" rel="nofollow noreferrer">php-open-source-saver/jwt-auth</a></p>\n<h3>routes/web.php</h3>\n<pre><code>Route::get('customer/{id}', [FrontendController::class, 'home']);\n</code></pre>\n<h3>app/Http/Controllers/FrontendController.php</h3>\n<pre><code>use Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Auth;\n\npublic function home(Request $request)\n{\n dd($request-&gt;user(), Auth::user());\n}\n</code></pre>\n<h3>bootstrap/app.php</h3>\n<pre><code>-&gt;withRouting(\n web: __DIR__ . '/../routes/web.php',\n api: [\n __DIR__ . '/../routes/api/core.php',\n __DIR__ . '/../routes/api/user.php'\n ],\n commands: __DIR__ . '/../routes/console.php',\n health: '/up'\n)\n-&gt;withMiddleware(function (Middleware $middleware) {\n //dd($middleware-&gt;getMiddlewareGroups());\n})\n-&gt;withExceptions(function (Exceptions $exceptions) {\n //\n})-&gt;create();\n</code></pre>\n<h3>Middleware groups showing when <code>dd($middleware-&gt;getMiddlewareGroups())</code></h3>\n<pre><code>&quot;web&quot; =&gt; [\n 0 =&gt; &quot;Illuminate\\Cookie\\Middleware\\EncryptCookies&quot;,\n 1 =&gt; &quot;Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse&quot;,\n 2 =&gt; &quot;Illuminate\\Session\\Middleware\\StartSession&quot;,\n 3 =&gt; &quot;Illuminate\\View\\Middleware\\ShareErrorsFromSession&quot;,\n 4 =&gt; &quot;Illuminate\\Foundation\\Http\\Middleware\\ValidateCsrfToken&quot;,\n 5 =&gt; &quot;Illuminate\\Routing\\Middleware\\SubstituteBindings&quot;,\n],\n&quot;api&quot; =&gt; [\n 0 =&gt; &quot;Illuminate\\Routing\\Middleware\\SubstituteBindings&quot;\n]\n</code></pre>\n<h3>Config file</h3>\n<h4>config/auth.php</h4>\n<pre><code>'defaults' =&gt; [\n 'guard' =&gt; 'api',\n 'passwords' =&gt; 'users',\n],\n\n'guards' =&gt; [\n 'web' =&gt; [\n 'driver' =&gt; 'session',\n 'provider' =&gt; 'users',\n ],\n\n 'api' =&gt; [\n 'driver' =&gt; 'jwt',\n 'provider' =&gt; 'users',\n ],\n],\n</code></pre>\n<h4>config/session.php</h4>\n<pre><code>'driver' =&gt; 'file'\n</code></pre>\n<h3>Environment</h3>\n<div class="s-table-container"><table class="s-table">\n<thead>\n<tr>\n<th>Q</th>\n<th>A</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Framework</td>\n<td>Laravel</td>\n</tr>\n<tr>\n<td>Framework version</td>\n<td>11.x</td>\n</tr>\n<tr>\n<td>PHP-Open-Source-Saver/jwt-auth</td>\n<td>2.7</td>\n</tr>\n<tr>\n<td>PHP version</td>\n<td>8.2</td>\n</tr>\n</tbody>\n</table></div>\n<h3>Expected behaviour</h3>\n<p><code>$request-&gt;user()</code> or <code>Auth::user()</code> should be a logged-in user in the controller.</p>\n<h3>Actual behaviour</h3>\n<p><code>$request-&gt;user()</code> and <code>Auth::user()</code> both are getting null</p>\n"^^ . + . + . + . + . + . + "How to show more columns in laravel backpack?"^^ . + . + "Which samples are you referring to specifically, and what bit(s) are you confused about? Your question could really be a lot clearer about where you're stuck. The place to start for documentation would obviously https://github.com/microsoftgraph/msgraph-sdk-php, which has samples using GraphServiceClient"^^ . + "0"^^ . + . + "0"^^ . + . + "Dependent dropdown list using Laminas framework and doctrine-orm - The input was not found in the haystack"^^ . + . + "@ZaidMalek we're creating an application by which we'll save the email deliverability in table. So by this process we're getting the exact data of email deliverability. Suppose some email is not exist in real world but from this code we're getting it is deliverable and suppose some email does exist in real world but if send mail from gmail or own company email id we're getting bounce mail"^^ . + . + . + . + . + . + "Security aware email providers don't reveal this information because its typical usage is to curate email lists for spam purposes. Determining whether an address exists is pretty much pointless for everything else, because what you really want to know for legit use cases is whether the mail actually belongs to the person that supplied it, and for that you just send a message with a random code."^^ . + "Before you can use a database, it has to be created. That _normally_ happens during provisioning, _not_ deployment. I'd therefore would guess that expecting it for deployment may be at the fault, however I might be wrong. As you ask about it, from my perspective I'd expect at least that you explain why _you_ expect the database to be created during deployment (and not provisioning). This should make it more clear what you are asking about (e.g. a quick guess that was not fulfilled, a dedicated feature not at play etc.) Please [edit] and additionally provide references if possible."^^ . + . + . + . + . + . + . + "<p>I added the shared directory to the <code>intelephense.environment.includePaths</code> , removed the repository from composer.json and required its autoload file directly. I moved these settings to a workspace file, I open that file with VSCode instead of the folder.</p>\n<p>My files look like this:</p>\n<p>app/application.code-workspace</p>\n<pre><code>{\n &quot;folders&quot;: [\n {\n &quot;path&quot;: &quot;.&quot;\n }\n ],\n &quot;settings&quot;: {\n &quot;intelephense.environment.includePaths&quot;: [\n &quot;../shared&quot;\n ]\n }\n}\n</code></pre>\n<p>app/composer.json</p>\n<pre><code>{\n &quot;name&quot;: &quot;my/app&quot;,\n &quot;autoload&quot;: {\n &quot;psr-4&quot;: {\n &quot;Application\\\\&quot;: &quot;Application&quot;\n }\n }\n}\n</code></pre>\n<p>app/index.php</p>\n<pre><code>&lt;?php\n\nrequire_once __DIR__.'/../shared/vendor/autoload.php';\nrequire_once __DIR__.'/vendor/autoload.php';\n\nuse Application\\Runner;\n\n$runner = new Runner();\n$runner-&gt;run();\n</code></pre>\n<p>app/Application/Runner.php</p>\n<pre><code>&lt;?php\n\nnamespace Application;\n\nuse Shared\\Test;\n\nclass Runner {\n \n public function run(){\n $test = new Test();\n $test-&gt;run();\n }\n}\n</code></pre>\n<p>shared/composer.json</p>\n<pre><code>{\n &quot;name&quot;: &quot;my/shared&quot;,\n &quot;autoload&quot;: {\n &quot;psr-4&quot;: {\n &quot;Shared\\\\&quot;: &quot;Shared&quot;\n }\n }\n}\n</code></pre>\n<p>shared/Test.php</p>\n<pre><code>&lt;?php\n\nnamespace Shared;\n\nclass Test {\n \n public function run(){\n echo 'Hello Shared!';\n }\n}\n</code></pre>\n"^^ . + . + . + . + "1"^^ . + . + . + . + "This question is similar to: [Laravel 5.2 How To redirect All 404 Errors to Homepage](https://stackoverflow.com/questions/35717751/laravel-5-2-how-to-redirect-all-404-errors-to-homepage). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem."^^ . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + . + "fpdf"^^ . + . + . + . + . + "<p>I'm working on a custom post type in WordPress for &quot;Projects&quot; that includes three custom meta boxes: one for a project title, one for a project description, and one for an image gallery. The gallery meta box allows me to add images using the WordPress media uploader. The images display correctly in the meta box immediately after being added, but once I update the project and refresh the page, the gallery images vanish.</p>\n<p>Here’s a summary of my setup:</p>\n<p>Custom Post Type: &quot;progetti&quot; (Projects) with support for featured images.\nMeta Boxes:\nProject Title: Uses wp_editor and saves its value as a meta field (_progetto_titolo).\nProject Description: Also uses wp_editor (saved as _progetto_descrizione).\nGallery: Stores a comma-separated list of attachment IDs in a meta field (_progetto_gallery). It includes JavaScript that adds and removes images from the gallery.\nI initially updated the actual post title by calling wp_update_post() inside my save_post hook after saving the custom title. I suspected this was triggering a second save cycle that might be wiping out other meta values (like the gallery). So I tried a couple of approaches:</p>\n<p>Temporarily removing the save_post hook before calling wp_update_post(), then re-adding it.\nUsing the wp_insert_post_data filter to update the title before the post is saved.\nI even consolidated my nonce usage into a single nonce field to avoid potential conflicts. Despite these attempts, the gallery meta field still ends up empty after the post is updated and reloaded.</p>\n<p>Snippet below:</p>\n<pre><code>// Registra il Custom Post Type &quot;Progetti&quot;\nfunction create_custom_post_type_progetti() {\n $labels = array(\n 'name' =&gt; _x( 'Progetti', 'Post Type General Name', 'textdomain' ),\n 'singular_name' =&gt; _x( 'Progetto', 'Post Type Singular Name', 'textdomain' ),\n 'menu_name' =&gt; __( 'Progetti', 'textdomain' ),\n 'name_admin_bar' =&gt; __( 'Progetto', 'textdomain' ),\n 'archives' =&gt; __( 'Archivio Progetti', 'textdomain' ),\n 'attributes' =&gt; __( 'Attributi Progetto', 'textdomain' ),\n 'parent_item_colon' =&gt; __( 'Progetto Genitore:', 'textdomain' ),\n 'all_items' =&gt; __( 'Tutti i Progetti', 'textdomain' ),\n 'add_new_item' =&gt; __( 'Aggiungi Nuovo Progetto', 'textdomain' ),\n 'add_new' =&gt; __( 'Aggiungi Nuovo', 'textdomain' ),\n 'new_item' =&gt; __( 'Nuovo Progetto', 'textdomain' ),\n 'edit_item' =&gt; __( 'Modifica Progetto', 'textdomain' ),\n 'update_item' =&gt; __( 'Aggiorna Progetto', 'textdomain' ),\n 'view_item' =&gt; __( 'Visualizza Progetto', 'textdomain' ),\n 'view_items' =&gt; __( 'Visualizza Progetti', 'textdomain' ),\n 'search_items' =&gt; __( 'Cerca Progetto', 'textdomain' ),\n 'not_found' =&gt; __( 'Non trovato', 'textdomain' ),\n 'not_found_in_trash' =&gt; __( 'Non trovato nel cestino', 'textdomain' ),\n 'featured_image' =&gt; __( 'Immagine di copertina', 'textdomain' ),\n 'set_featured_image' =&gt; __( 'Imposta immagine di copertina', 'textdomain' ),\n 'remove_featured_image' =&gt; __( 'Rimuovi immagine di copertina', 'textdomain' ),\n 'use_featured_image' =&gt; __( 'Usa come immagine di copertina', 'textdomain' ),\n 'insert_into_item' =&gt; __( 'Inserisci nel progetto', 'textdomain' ),\n 'uploaded_to_this_item' =&gt; __( 'Caricato in questo progetto', 'textdomain' ),\n 'items_list' =&gt; __( 'Lista progetti', 'textdomain' ),\n 'items_list_navigation' =&gt; __( 'Navigazione lista progetti', 'textdomain' ),\n 'filter_items_list' =&gt; __( 'Filtra lista progetti', 'textdomain' ),\n );\n $args = array(\n 'label' =&gt; __( 'Progetto', 'textdomain' ),\n 'description' =&gt; __( 'Custom post type per progetti', 'textdomain' ),\n 'labels' =&gt; $labels,\n // Supporta l'immagine in evidenza; per titolo e contenuto usiamo metabox personalizzati\n 'supports' =&gt; array( 'thumbnail' ),\n 'hierarchical' =&gt; false,\n 'public' =&gt; true,\n 'show_ui' =&gt; true,\n 'show_in_menu' =&gt; true,\n 'menu_position' =&gt; 5,\n 'menu_icon' =&gt; 'dashicons-portfolio',\n 'show_in_admin_bar' =&gt; true,\n 'show_in_nav_menus' =&gt; true,\n 'can_export' =&gt; true,\n 'has_archive' =&gt; true, \n 'exclude_from_search' =&gt; false,\n 'publicly_queryable' =&gt; true,\n 'capability_type' =&gt; 'post',\n 'show_in_rest' =&gt; true,\n );\n register_post_type( 'progetti', $args );\n}\nadd_action( 'init', 'create_custom_post_type_progetti', 0 );\n\n\n// Enqueue delle funzioni necessarie per il media uploader in admin\nfunction progetti_enqueue_admin_scripts( $hook ) {\n global $post;\n if ( ( $hook == 'post-new.php' || $hook == 'post.php' ) &amp;&amp; isset( $post ) &amp;&amp; $post-&gt;post_type === 'progetti' ) {\n wp_enqueue_media();\n }\n}\nadd_action( 'admin_enqueue_scripts', 'progetti_enqueue_admin_scripts' );\n\n\n// Aggiunge le Meta Box per i campi personalizzati\nfunction progetti_add_meta_boxes() {\n add_meta_box( 'progetti_titolo', 'Titolo Progetto', 'progetti_titolo_meta_box_callback', 'progetti', 'normal', 'high' );\n add_meta_box( 'progetti_descrizione', 'Descrizione Progetto', 'progetti_descrizione_meta_box_callback', 'progetti', 'normal', 'high' );\n add_meta_box( 'progetti_gallery', 'Gallery Immagini', 'progetti_gallery_meta_box_callback', 'progetti', 'normal', 'high' );\n}\nadd_action( 'add_meta_boxes', 'progetti_add_meta_boxes' );\n\n\n// Meta box per il Titolo: include il nonce\nfunction progetti_titolo_meta_box_callback( $post ) {\n wp_nonce_field( 'progetti_save_meta_box_data', 'progetti_meta_box_nonce' );\n $value = get_post_meta( $post-&gt;ID, '_progetto_titolo', true );\n wp_editor( $value, 'progetto_titolo', array(\n 'textarea_name' =&gt; 'progetto_titolo',\n 'media_buttons' =&gt; false,\n 'textarea_rows' =&gt; 5,\n ) );\n}\n\n// Meta box per la Descrizione: non include il nonce\nfunction progetti_descrizione_meta_box_callback( $post ) {\n $value = get_post_meta( $post-&gt;ID, '_progetto_descrizione', true );\n wp_editor( $value, 'progetto_descrizione', array(\n 'textarea_name' =&gt; 'progetto_descrizione',\n 'media_buttons' =&gt; false,\n 'textarea_rows' =&gt; 10,\n ) );\n}\n\n// Meta box per la Gallery: non include il nonce\nfunction progetti_gallery_meta_box_callback( $post ) {\n $gallery = get_post_meta( $post-&gt;ID, '_progetto_gallery', true );\n ?&gt;\n &lt;div id=&quot;progetti-gallery-container&quot;&gt;\n &lt;ul id=&quot;progetti-gallery-list&quot;&gt;\n &lt;?php\n if ( ! empty( $gallery ) ) {\n $gallery_ids = explode( ',', $gallery );\n foreach ( $gallery_ids as $attachment_id ) {\n $img_url = wp_get_attachment_thumb_url( $attachment_id );\n if ( $img_url ) {\n echo '&lt;li data-attachment_id=&quot;' . esc_attr( $attachment_id ) . '&quot;&gt;\n &lt;img src=&quot;' . esc_url( $img_url ) . '&quot; style=&quot;max-width:100px; margin:0 10px 10px 0;&quot;/&gt;\n &lt;a href=&quot;#&quot; class=&quot;progetti-remove-image&quot;&gt;Rimuovi&lt;/a&gt;\n &lt;/li&gt;';\n }\n }\n }\n ?&gt;\n &lt;/ul&gt;\n &lt;input type=&quot;hidden&quot; id=&quot;progetti_gallery&quot; name=&quot;progetti_gallery&quot; value=&quot;&lt;?php echo esc_attr( $gallery ); ?&gt;&quot; /&gt;\n &lt;/div&gt;\n &lt;p&gt;\n &lt;a href=&quot;#&quot; id=&quot;progetti-add-gallery-images&quot; class=&quot;button&quot;&gt;Aggiungi Immagini&lt;/a&gt;\n &lt;/p&gt;\n &lt;script&gt;\n jQuery(document).ready(function($){\n var frame;\n $('#progetti-add-gallery-images').on('click', function(e){\n e.preventDefault();\n if ( frame ) {\n frame.open();\n return;\n }\n frame = wp.media({\n title: 'Seleziona Immagini per la Gallery',\n button: {\n text: 'Aggiungi alla gallery'\n },\n multiple: true\n });\n frame.on( 'select', function() {\n var attachments = frame.state().get('selection').toArray();\n var gallery_ids = $('#progetti_gallery').val();\n var ids = gallery_ids ? gallery_ids.split(',') : [];\n attachments.forEach(function(attachment){\n attachment = attachment.toJSON();\n if ( ids.indexOf(attachment.id.toString()) === -1 ) {\n ids.push(attachment.id);\n var img_url = attachment.sizes.thumbnail ? attachment.sizes.thumbnail.url : attachment.url;\n $('#progetti-gallery-list').append('&lt;li data-attachment_id=&quot;'+attachment.id+'&quot;&gt;&lt;img src=&quot;'+img_url+'&quot; style=&quot;max-width:100px; margin:0 10px 10px 0;&quot;/&gt;&lt;a href=&quot;#&quot; class=&quot;progetti-remove-image&quot;&gt;Rimuovi&lt;/a&gt;&lt;/li&gt;');\n }\n });\n $('#progetti_gallery').val(ids.join(','));\n });\n frame.open();\n });\n // Rimuove l'immagine dalla gallery\n $('#progetti-gallery-list').on('click', '.progetti-remove-image', function(e){\n e.preventDefault();\n $(this).closest('li').remove();\n var ids = [];\n $('#progetti-gallery-list li').each(function(){\n ids.push($(this).data('attachment_id'));\n });\n $('#progetti_gallery').val(ids.join(','));\n });\n });\n &lt;/script&gt;\n &lt;?php\n}\n\nadd_filter( 'wp_insert_post_data', 'progetti_set_custom_title', 10, 2 );\nfunction progetti_set_custom_title( $data, $postarr ) {\n if ( isset( $postarr['post_type'] ) &amp;&amp; $postarr['post_type'] === 'progetti' ) {\n if ( isset( $_POST['progetto_titolo'] ) ) {\n $custom_title = wp_strip_all_tags( $_POST['progetto_titolo'] );\n $data['post_title'] = $custom_title;\n }\n }\n return $data;\n}\n\nfunction progetti_save_meta_box_data( $post_id ) {\n // Verifica il nonce (presente solo nel meta box del Titolo)\n if ( ! isset( $_POST['progetti_meta_box_nonce'] ) ) {\n return;\n }\n if ( ! wp_verify_nonce( $_POST['progetti_meta_box_nonce'], 'progetti_save_meta_box_data' ) ) {\n return;\n }\n // Evita autosave e revisioni\n if ( defined( 'DOING_AUTOSAVE' ) &amp;&amp; DOING_AUTOSAVE ) {\n return;\n }\n if ( isset( $_POST['post_type'] ) &amp;&amp; 'progetti' == $_POST['post_type'] ) {\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n }\n // Salva il titolo e il contenuto personalizzato\n if ( isset( $_POST['progetto_titolo'] ) ) {\n $custom_title = wp_kses_post( $_POST['progetto_titolo'] );\n update_post_meta( $post_id, '_progetto_titolo', $custom_title );\n }\n if ( isset( $_POST['progetto_descrizione'] ) ) {\n update_post_meta( $post_id, '_progetto_descrizione', wp_kses_post( $_POST['progetto_descrizione'] ) );\n }\n // Salva la gallery, se presente\n if ( isset( $_POST['progetti_gallery'] ) ) {\n update_post_meta( $post_id, '_progetto_gallery', sanitize_text_field( $_POST['progetti_gallery'] ) );\n }\n}\nadd_action( 'save_post', 'progetti_save_meta_box_data' );\n</code></pre>\n<p>I attempted several approaches to fix the issue. First, I updated the post title within the save_post hook using wp_update_post and temporarily removed the hook to avoid recursion. Next, I tried using the wp_insert_post_data filter to update the title before the post was saved. I also consolidated nonce usage across my meta boxes to prevent any conflicts. I expected that the gallery meta field—holding a comma-separated list of image attachment IDs—would be saved correctly and persist after the post update. However, after saving and refreshing the page, the gallery meta field is empty, causing the images to disappear.</p>\n"^^ . + . + . + . + . + "1"^^ . + "<p>I'm encountering an issue with PHP and Nginx when handling large file return via an API.</p>\n<p>Issue:</p>\n<p>Small files (under 2GB) are processed correctly.\nLarge files result in an empty response with a 200 status code.</p>\n<p><strong>Configuration:</strong></p>\n<ul>\n<li>php.ini:\n<ul>\n<li>post_max_size = 800 -&gt; 4000</li>\n<li>upload_max_filesize = 2000 -&gt; 4000</li>\n</ul>\n</li>\n<li>nginx.conf:\n<ul>\n<li>client_max_body_size = 300 -&gt; 4000</li>\n<li>memory_limit = -1</li>\n</ul>\n</li>\n</ul>\n<p>Restart procedure:</p>\n<pre class="lang-none prettyprint-override"><code>sudo php-fpm8.3 -t \nsudo service php8.3-fpm \nsudo systemctl reload nginx\n</code></pre>\n<p>Verified the configuration was applied (php -i).</p>\n<p>Error logs:</p>\n<p>Checked logs (/var/log/nginx/error.log), but found no errors.</p>\n<p>What could be causing the issue?</p>\n<ul>\n<li>Adjusted php.ini settings (post_max_size, upload_max_filesize, memory_limit).</li>\n<li>Modified nginx.conf (client_max_body_size).</li>\n<li>Restarted PHP-FPM and Nginx.</li>\n<li>Checked logs (/var/log/nginx/error.log).</li>\n</ul>\n<p>What I Expected:</p>\n<p>Large files (over 2GB) should be processed and returned correctly.</p>\n"^^ . + "Javascript to PHP upload multiple files from a html table"^^ . + . + "2"^^ . + . + "0"^^ . + . + . + . + . + . + . + "do you mean run it like ./php-heic-to-jpg-linux-arm64 ?"^^ . + "1"^^ . + . + "<p>I'm trying to save the state of the private property in a parent class when exporting and importing without allowing access to the property anywhere else. I'm storing the state by exporting to a file.</p>\n<p>Take a class with private properties, export it with <code>var_export()</code> and initialize it with <code>__set_state()</code> too easy.</p>\n<p>Now subclass it and try the same thing. You can't set the private property of the parent class in <code>__set_state()</code>. Can you?</p>\n<p>Maybe I should be using serialize instead but is there a way to get this to work?</p>\n<p>I tried:</p>\n<ul>\n<li><p>Creation of dynamic property B::$priA3 is deprecated\n<code>$obj-&gt;priA3 = $an_array['priB3'];</code></p>\n</li>\n<li><p>Cannot access private property A::$priA3\n<code>parent::$priA3 = $an_array['priA3'];</code></p>\n</li>\n</ul>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\n$br = &quot;----\\n&quot;;\n\nclass A\n {\n private $priA3;\n\n public function __construct()\n {\n $this-&gt;priA3 = 'priA3';\n }\n\n public static function __set_state($an_array)\n {\n $obj = new A;\n $obj-&gt;priA3 = $an_array['priA3'];\n return $obj;\n }\n }\n\n$a = new A;\n\n$b = var_export($a, true);\neval('$c = ' . $b . ';');\nprint_r($c);\necho $br;\n\nclass B extends A\n {\n public function __construct()\n {\n parent::__construct();\n }\n\n public static function __set_state($an_array)\n {\n $obj = new B;\n\n // \\|/ Creation of dynamic property B::$priA3 is deprecated\n // $obj-&gt;priA3 = $an_array['priB3'];\n\n // \\|/ Cannot access private property A::$priA3\n // parent::$priA3 = $an_array['priA3'];\n\n return $obj;\n }\n }\n\n$a = new B;\n$b = var_export($a, true);\neval('$c = ' . $b . ';');\nprint_r($c);\n</code></pre>\n<p>Workaround I found was to either use optional parameters in the constructor for initialization of the properties, use <code>__set()</code> to access the overloaded property, or a protected method to set it. I don't think these are good options.</p>\n<p>The parent class would create the private property so adding an optional parameter in the constructor or allowing it to be set any other way would not work, it shouldn't be visible to anything but the parent class.</p>\n<p>Otherwise maybe i should be using serialize instead for this?</p>\n"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + "_"For me, it looks like PHP ignores my condition, and takes always the first define()"_ - no, it definitively doesn't - https://3v4l.org/r89Jj _"HOWEVER, the debug mode is enabled on production too !"_ - debug mode can also be enabled via the backend - could it be that's the case?"^^ . + "3"^^ . + . + "0"^^ . + "I recommend implementing the logic of a chunk-wise encryption in such a way that the resulting ciphertext is identical to an encryption performed in one step. This has the advantage that the chunk size of the decryption is decoupled from that of the encryption."^^ . + "@matiaslauriti Please explain further or share your idea with us"^^ . + "0"^^ . + . + . + . + . + . + "<p>I am trying to do a POST request to my classless personal-api.php file located at http:ip.address:port\\public\\api\\personal\\personal-api.php but it returns a cURL error(28)</p>\n<p>I am using Http facade to send the POST request by</p>\n<pre><code>$params = [params];\n$url = url('public/api/personal/personal-api.php');\nHttp::post($url, $params);\n</code></pre>\n<p>I tried using Http::get and I still get the cURL error(28)</p>\n"^^ . + . + . + . + "0"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + "Moving result within PHP while loop up one line?"^^ . + . + . + . + . + "<p>We don't want to run composer update on our production server we would rather version control the vendor folder. We have shared files between our webapplications and we have a git repository called &quot;shared&quot; for this. What we do is currently uploading the files to the server cloning the shared repository into a shared sibling directory and use composer to load its content.</p>\n<pre><code>{\n &quot;repositories&quot;: [\n {\n &quot;type&quot;: &quot;path&quot;,\n &quot;url&quot;: &quot;../shared&quot;\n }\n ],\n &quot;require&quot;: {\n &quot;my/shared&quot;: &quot;*&quot;\n }\n}\n</code></pre>\n<p>My current problem with this, that composer uses absolute path instead of relative path in its autoloader files when we use path type of repository. We could get rid of the composer repository and require the autoload file from the shared directory directly.</p>\n<pre><code>require_once __DIR__.'/../shared/vendor/autoload.php'\n</code></pre>\n<p>This would work, but it would break the code completion for VSCode.</p>\n<p>I think you can see the problem.\nWe need to:</p>\n<ul>\n<li>use composer</li>\n<li>version control the vendor directories (I understand this is not recommended)</li>\n<li>load files from the shared sibling directory</li>\n<li>autocomplete with VSCode for the shared directory</li>\n</ul>\n<p>Can this be solved somehow?</p>\n"^^ . + "2"^^ . + "enums"^^ . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + "1"^^ . + . + . + . + . + . + "You don't have to install Composer on the machine if you don't want to. As long as you have PHP installed, Composer can be downloaded and run as a PHAR file."^^ . + . + "What I want to do is change the registration method instead of just registering via email\nI want to register via email or phone number, but what is stopping me is how will I change the verification method instead of just verifying email. I want to verify email or phone number, that is if the user enters a phone number to register it will be verified based on it being a phone number, or if he enters an email it will be verified based on it being an email in the loginRequest.php file of Laravel 11."^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + "Use require_once and concrete files instead of conditional class definitions (if (!class_exists(...)) { class ... {...} })."^^ . + . + . + . + . + "1"^^ . + "That worked great for plain text, and with the XML"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "@C3roe I read the page you mentioned, and I know that PHP is server side, the fact that I can echo the php variables `$STR_phpwidth` and `$STR_phpheight` correctly, but not manipulate them is the confusing part."^^ . + . + . + "2"^^ . + "0"^^ . + . + "Ah, unable to edit and clarify the existing question ... well, do that first: https://stackoverflow.com/q/79434917/367456"^^ . + . + . + . + . + "raspberry-pi"^^ . + "1"^^ . + "0"^^ . + "2"^^ . + . + "<p>I was able to do what I wanted and wanted to share it with you so that everyone can benefit from it. What I did was simply filter the value that comes from the request and check if it is an email or not.</p>\n<p>First, a variable named identify was created to take the value of email or mobile on behalf of the verification and filtering of the value that comes from the request. If the value that comes from the request is an email, the value of the variable identify that was created will be equal to email.</p>\n<p>If the value coming from the request is not an email, a value named mobile will be stored inside the same variable named identify.</p>\n<p>And the value that is inside the identify variable is used, i.e. if the value is email or mobile</p>\n<p>It is placed inside validation to check if the value that comes from the request is present in the users table in the database or not\nLike this:</p>\n<pre><code>public function rules(): array\n {\n $this-&gt;identify = filter_var(request()-&gt;input('identify') , FILTER_VALIDATE_EMAIL ) ? &quot;email&quot; : 'mobile';\n return [\n 'identify' =&gt; ['required', 'string',&quot;exists:users,$this-&gt;identify&quot;],\n 'password' =&gt; ['required', 'string'],\n ];\n }\n public function messages(): array\n {\n return [\n 'identify.exists' =&gt; 'unavailable',\n ];\n }\n</code></pre>\n<p>Then change the authentication method inside the authenticate function inside the if condition to change my authentication method Auth::attempt and make it look like this:</p>\n<pre><code>if (!Auth::attempt([$this-&gt;identify =&gt; request()-&gt;input('identify'), 'password' =&gt; request()-&gt;input('password')], $this-&gt;boolean('remember'))) {\n RateLimiter::hit($this-&gt;throttleKey());\n\n throw ValidationException::withMessages([\n 'identify' =&gt; trans('auth.failed'), \n ]);\n }\n</code></pre>\n<p>What was done here is to take the value inside the identify variable and put it inside Auth::attempt and make its value the value that comes from request and also the same thing with the password it will be as it is nothing changed in it I just added it inside the list so that there are no problems or objections or errors in the code and made its value equal to the value that comes from request</p>\n<p>This way I solved the problem I was facing and did what I wanted to do.</p>\n<p>If there is any query or if there is a better way in mind please feel free to share it for everyone to benefit from. Thank you.</p>\n"^^ . + . + . + . + "<p>Wordpress styles not loading. Used docker-compose to start nginx, mariadb &amp; wordpress. Here is the configuration I'm using.</p>\n<pre class="lang-yaml prettyprint-override"><code>services:\n mysql:\n image: mariadb:latest\n container_name: wordpress-sql\n volumes:\n - maria-db-wp:/var/lib/mysql\n environment:\n MYSQL_ROOT_PASSWORD: root\n MYSQL_DATABASE: wordpress\n MYSQL_USER: wpadmin\n MYSQL_PASSWORD: wpadminpass\n restart: unless-stopped\n networks:\n - wordpress-vpc\n wordpress:\n image: wordpress:beta-php8.3-fpm-alpine\n container_name: wordpress-main\n volumes:\n - wp-vol-1:/var/www/html\n depends_on:\n - mysql\n environment:\n WORDPRESS_DB_HOST: mysql\n MYSQL_ROOT_PASSWORD: root\n WORDPRESS_DB_NAME: wordpress\n WORDPRESS_DB_USER: wpadmin\n WORDPRESS_DB_PASSWORD: wpadminpass\n WORDPRESS_TABLE_PREFIX: wp_\n restart: unless-stopped\n networks:\n - wordpress-vpc\n nginx:\n image: nginx:stable-alpine-perl\n container_name: nginx-wp\n volumes:\n - ./nginx.conf:/etc/nginx/nginx.conf:ro\n - wp-vol-1:/var/www/html\n ports:\n - &quot;80:80&quot;\n networks:\n - wordpress-vpc\n restart: unless-stopped\n depends_on:\n - wordpress\n \nnetworks:\n wordpress-vpc:\n driver: bridge\nvolumes:\n maria-db-wp:\n wp-vol-1:\n\n</code></pre>\n<p>Here are some screenshots\n<a href="https://i.sstatic.net/pBmFskzf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pBmFskzf.png" alt="" /></a>\n<a href="https://i.sstatic.net/f5PLjUE6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/f5PLjUE6.png" alt="enter image description here" /></a></p>\n<p>Here is the page source\n<a href="https://i.sstatic.net/M6rDLjyp.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/M6rDLjyp.png" alt="enter image description here" /></a></p>\n<p>I tried searching for these css stylesheets inside of my installation directory both in my local installation (which work correctly) &amp; my docker volume directory, both have the same CSS sheets inside <code>/wp-admin/css</code> so doesnt seem like an installation issue?</p>\n<p>This entire thing is fresh &amp; the volumes defined in the dockerfile were created just before this docker compose.</p>\n<p>network tab screenshots\n<a href="https://i.sstatic.net/DdkGZ524.png" rel="nofollow noreferrer">network tab</a>\n<a href="https://i.sstatic.net/WpRs71wX.png" rel="nofollow noreferrer">network tab css response</a></p>\n<p>console says\n<code>JQMIGRATE: Migrate is installed, version 3.4.1</code></p>\n<h3>Even in the sources the css/ css-files do come so ...</h3>\n"^^ . + "0"^^ . + "You're probably thinking of trailing commas on the arguments themselves, like `foo(1,2,3,);` -- this is what became allowed in 7.3."^^ . + . + . + . + "orocrm"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + "http-status-code-403"^^ . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "How do I properly connect my sveltekit front end and PHP backend with Apache?"^^ . + "<p>this is my code and i would like to import the images from database into my html code. This should import images from phpmyadmin, but for some reason, it doesnt really work. I would be really happy if someone helped me.</p>\n<pre><code>&lt;?php\n$servername = &quot;localhost&quot;;\n$username = &quot;root&quot;;\n$password = &quot;&quot;;\n$dbname = &quot;database_name&quot;;\n\n$conn = new mysqli($servername, $username, $password, $dbname);\n\nif ($conn-&gt;connect_error) {\n die(&quot;Connection failed: &quot; . $conn-&gt;connect_error);\n}\n\nfunction load_images($reference_id) {\n $mysqli = new mysqli(&quot;localhost&quot;, &quot;root&quot;, &quot;&quot;, &quot;database_name&quot;);\n\n $result_images = $mysqli-&gt;query(&quot;SELECT `img_root(img.png,picture.jpeg` FROM `table_name` WHERE `id_reference` = '$reference_id'&quot;);\n\n $index = 1;\n while ($row_image = $result_images-&gt;fetch_assoc()) {\n $obrazek = $row_image['image_row'];\n echo &quot;&lt;div class='image-container' &gt;&quot;;\n echo &quot;&lt;img class='demo' src='images/$image' alt='Image $index' height='350' width='350' onclick='openModal(); currentSlide($index)' data-index='$index'&gt;&quot;;\n echo &quot;&lt;/div&gt;&quot;;\n $index++; \n }\n\n mysqli_close($mysqli);\n}\n\n?&gt;\n\n\n&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n&lt;head&gt;\n &lt;meta charset=&quot;UTF-8&quot;&gt;\n &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n &lt;title&gt;Document&lt;/title&gt;\n&lt;/head&gt;\n&lt;body&gt;\n\n &lt;?php\n for ($i = 1; $i &lt;= 3; $i++) {\n\n\n echo &quot;&lt;div class='photos1'&gt;&quot;;\n load_images($i);\n echo &quot;&lt;/div&gt;&quot;;\n }\n ?&gt;\n\n \n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n"^^ . + . + . + "0"^^ . + "php-7.4"^^ . + . + . + . + "0"^^ . + . + "Can you show the code where you are making the api request?"^^ . + . + . + "<p>In PHP 7.1.33, I'm running the following function <code>zen_cfg_uspsr_showservices</code>. On each execution, I'm getting an error of</p>\n<blockquote>\n<p>[17-Feb-2025 20:58:50 UTC] PHP Parse error: syntax error, unexpected ']', expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in E:\\xampp\\htdocs\\zencart157\\includes\\modules\\shipping\\uspsr.php on line 2460</p>\n</blockquote>\n<p>Line 2460 references this:</p>\n<pre class="lang-none prettyprint-override"><code>$methods_intl[] = preg_replace(\n</code></pre>\n<p>The error doesn't make sense as all braces are matched. I'm not sure why this error is continuing to insist. I tried with both version of array declaration (<code>array()</code> and <code>[]</code>). And both versions yield the same error message.</p>\n<p>Here is the source code:</p>\n<pre class="lang-php prettyprint-override"><code>function zen_cfg_uspsr_showservices($key_value)\n{\n // Split up Key Value into an array, then go through that array and find the non-numeric values. That should be the name of a method.\n $key_values = array_filter(explode(', ', $key_value));\n\n $methods_dom = [];\n $methods_intl = [];\n\n $output_domestic = '';\n $output_intl = '';\n\n foreach ($key_values as $methods) {\n if (!is_numeric($methods)) {\n // This is a string, not a number. Check to see if the value contains the word International, otherwise, it's a domestic\n\n if (preg_match('/International/', $methods)) {\n $methods_intl[] = preg_replace(\n [\n '/International/',\n '/Envelope/',\n '/ Mail/',\n '/Large/',\n '/Medium/',\n '/Small/',\n '/First/',\n '/Legal/',\n '/Padded/',\n '/Flat Rate/',\n '/Express Guaranteed /',\n '/Package\\hService\\h-\\hRetail/',\n '/Package Service/',\n '/ISC/',\n '/Machinable DDU/',\n '/Machinable\\s+/',\n '/(Basic|Single-Piece)/i',\n '/USPS\\s+/',\n '/Non-Soft Pack Tier 1/',\n '/\\s{2,}/'\n ],\n [\n 'Intl',\n 'Env',\n '',\n 'Lg.',\n 'Md.',\n 'Sm.',\n '1st',\n 'Leg.',\n 'Pad.',\n 'F/R',\n 'Exp Guar',\n 'Pkgs - Retail',\n 'Pkgs - Comm',\n '',\n '',\n '',\n ' ',\n '',\n '',\n ' '\n ],\n $methods\n );\n }\n else {\n $methods_dom[] = preg_replace(\n [\n '/International/',\n '/Envelope/',\n '/ Mail/',\n '/Large/',\n '/Medium/',\n '/Small/',\n '/First/',\n '/Legal/',\n '/Padded/',\n '/Flat Rate/',\n '/Express Guaranteed /',\n '/Package\\hService\\h-\\hRetail/',\n '/Package Service/',\n '/ISC/',\n '/Machinable DDU\\s+/',\n '/Machinable\\s+/',\n '/(Basic|Single-Piece)/i',\n '/USPS\\s+/',\n '/Non-Soft Pack Tier 1/',\n ],\n [\n 'Intl',\n 'Env',\n '',\n 'Lg.',\n 'Md.',\n 'Sm.',\n '1st',\n 'Leg.',\n 'Pad.',\n 'F/R',\n 'Exp Guar',\n 'Pkgs - Retail',\n 'Pkgs - Comm',\n '',\n '',\n '',\n '',\n '',\n ''\n ],\n $methods\n );\n }\n }\n }\n\n foreach ($methods_dom as $method) {\n $output_domestic .= trim($method) . ($method == end($methods_dom) ? '' : ', ');\n }\n\n foreach ($methods_intl as $method) {\n $output_intl .= trim($method) . ($method == end($methods_intl) ? '' : ', ');\n }\n\n $output = &quot;&lt;b&gt;Domestic Methods:&lt;/b&gt;&lt;br&gt; &quot; . (zen_not_null($output_domestic) ? $output_domestic : '&lt;em&gt;- None -&lt;/em&gt;') . &quot;&lt;br&gt;&lt;br&gt;\\n&quot; . &quot;&lt;b&gt;International Methods&lt;/b&gt;: &lt;br&gt;&quot; . (zen_not_null($output_intl) ? $output_intl : '&lt;em&gt;- None -&lt;/em&gt;');\n\n return $output . &quot;\\n&quot;;\n}\n\n</code></pre>\n"^^ . + . + "If you're using mysql or mariadb, you need to create the database first. If you're working on local machine, change your database driver to sqlite to solve the issue temporarily and the deal with creating the database."^^ . + . + "0"^^ . + . + "mcrypt"^^ . + "<p>Using the Pods Framework, I am trying to get the underlying type of field for a custom pod. I need to determine:</p>\n<ol>\n<li>if it is a relationship field</li>\n<li>if it is a single or multiple relationship field</li>\n</ol>\n<p>I have tried <code>['type']</code> using <code>$type = $field['type'];</code> but don't get any results</p>\n<pre class="lang-php prettyprint-override"><code>function get_relationship( $atts ) {\n global $post;\n \n $defaults = array(\n 'post_id' =&gt; $post-&gt;ID, // default to the current Post ID.\n 'pod' =&gt; '',\n 'field' =&gt; '',\n 'classes' =&gt; ''\n );\n \n $args = wp_parse_args( $atts, $defaults );\n\n // get the pod\n $pod = pods( $args['pod'], $args['post_id'] );\n \n // get the relevant field\n $related = $pod-&gt;field( $args['field'] );\n $type = $related.type; //['type']; // ?\n</code></pre>\n"^^ . + . + "php"^^ . + . + . + "How to handle the design pattern of nested arrays of DTO's in Yii2/barebones PHP?"^^ . + "To change the title in an Angular application you use the service Title and you define in routes the title (see the [docs](https://angular.dev/guide/routing/common-router-tasks#setting-the-page-title). Remember that an Angular app is a SPA, that is: you load the whole App only one time (well, you can use loadLazy to not load the whole app, but to change the title use the especific Angular way to change this)"^^ . + "0"^^ . + . + . + . + . + "1"^^ . + "It seems you already have a search form on your page with GET method. But instead of adding this select control to that form, you added it to completely different form with POST method. Then obviously this separate form never gets submitted. Add this select to the main search form."^^ . + . + . + "<p>I have a Wordpress loop where I want to load the right template based on the value in a variable called 'is_neighborhood'. In the code below, my echo statement prints &quot;Yes&quot; on the screen. However, it gets to the if and else statements and writes &quot;Booooooo&quot; when it should be writing &quot;Whoo Hoo&quot; based on the value of 'is_neighborhood'</p>\n<p>Why is this not evaluating properly?</p>\n<pre><code> while ( have_posts() ) :\n the_post();\n\n echo the_field('is_neighborhood');\n\n if (the_field('is_neighborhood') == 'Yes')\n {\n echo 'WHOO HOO!';\n die();\n }\n\n else\n {\n echo 'Booooooo';\n die();\n }\n\n get_template_part( 'template-parts/content/content', 'single' );\n\n // End the loop.\n endwhile;\n</code></pre>\n"^^ . + "I'm quite surprised that gmail is answering at all on port 25."^^ . + . + . + . + "Calculating Distance Between Colours Using PHP"^^ . + . + . + . + . + . + "-4"^^ . + "0"^^ . + . + "1"^^ . + . + "0"^^ . + . + "2"^^ . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + "Routing issue with FastRoute in PHP app: 404 page not found when accessing a specific debate"^^ . + . + . + "PHP-HTML Redirect based on Remaining Time in minutes"^^ . + "2"^^ . + . + "CarbonPeriod returns duplicate week month"^^ . + "<p>In your <code>$group</code> stage, you have</p>\n<pre class="lang-php prettyprint-override"><code>'_id' =&gt; [\n 'tipoDocumentoIdentificacion' =&gt; '$tipoDocumentoIdentificacion',\n 'numDocumentoIdentificacion' =&gt; '$numDocumentoIdentificacion'\n]\n</code></pre>\n<p>Those fields <strong>don't exist at the top-level</strong> so the group <code>_id</code> is null and it becomes just a count of all documents. So your result look like this: <a href="https://mongoplayground.net/p/06UBpXV4YhG" rel="nofollow noreferrer">Mongo Playground with Incorrect result</a>. Use the stage dropdown to see the result after the <code>$unwind</code> stage.</p>\n<p>The <code>$unwind</code> stage still keeps the <em>parent field</em> in the document when the arrays are de-constructed. See <a href="https://www.mongodb.com/docs/manual/reference/operator/aggregation/unwind/#unwind-embedded-arrays" rel="nofollow noreferrer">this example in the docs</a>.</p>\n<p>Those fields are still under the <code>usuarios</code>. So the code should be:</p>\n<pre class="lang-php prettyprint-override"><code>'_id' =&gt; [\n 'tipoDocumentoIdentificacion' =&gt; '$usuarios.tipoDocumentoIdentificacion',\n 'numDocumentoIdentificacion' =&gt; '$usuarios.numDocumentoIdentificacion'\n]\n</code></pre>\n<p>Then your result would be:</p>\n<pre class="lang-json prettyprint-override"><code>[\n {\n &quot;_id&quot;: {\n &quot;numDocumentoIdentificacion&quot;: &quot;1085902666&quot;,\n &quot;tipoDocumentoIdentificacion&quot;: &quot;CC&quot;\n },\n &quot;count&quot;: 2\n }\n]\n</code></pre>\n<p><a href="https://mongoplayground.net/p/Wv6jHudEOom" rel="nofollow noreferrer">Mongo Playground with Correct result</a></p>\n"^^ . + . + "2"^^ . + "0"^^ . + "2"^^ . + . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + "Google Wallet: How to create generic pass object"^^ . + . + . + . + . + "0"^^ . + . + . + "Did you reload apache2 configuration ?"^^ . + "symfonyux"^^ . + "0"^^ . + . + "3"^^ . + . + "0"^^ . + . + "<p>When making a request to api.x.com with php-curl, a “Could not resolve” error may occur.\nIn occurs once every 5 or 6 times.</p>\n<p>The endpoints used are /2/user/me, /2/tweets, and /2/media/upload.</p>\n<p>Operating environment is</p>\n<ul>\n<li>CentOS 6.10</li>\n<li>PHP 5.3.3\n<ul>\n<li>php-curl: 7.48.0</li>\n<li>OpenSSL 1.0.1e</li>\n<li>libSSH2/1.4.2</li>\n</ul>\n</li>\n</ul>\n<p>some source.</p>\n<pre class="lang-php prettyprint-override"><code>$curl = curl_init();\ncurl_setopt($curl, CURLOPT_URL, 'https://api.x.com/2/users/me');\ncurl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');\ncurl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\ncurl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);\ncurl_setopt($curl, CURLOPT_TIMEOUT, 30);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\ncurl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);\ncurl_setopt($curl, CURLOPT_HEADER, false);\ncurl_setopt($curl, CURLINFO_HEADER_OUT, true);\ncurl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);\ncurl_setopt($curl, CURLOPT_HTTPHEADER, /* Content-Type: multipart/form-data */);\ncurl_setopt($curl, CURLOPT_DNS_SERVERS, '8.8.8.8,1.1.1.1');\ncurl_exec($curl);\n</code></pre>\n<p>Can't update the operating system or PHP because it's a production environment with composite content.</p>\n<p>I tried specifying Google's and Cloudflare's DNS with &quot;CURLOPT_DNS_SERVERS&quot; using &quot;curl_setopt&quot;, but it didn't solve the issue.</p>\n<p>Since the lookup for api.x.com is failing, I suspect it's a DNS-related issue.</p>\n<p>Is the problem on my end? How can I get this resolved?</p>\n"^^ . + . + . + . + . + . + . + . + . + "Just run this command and everything will be working fine.\n`php artisan livewire:publish --assets`"^^ . + . + . + . + . + . + . + . + "0"^^ . + "@YourCommonSense [I'm sorry if my ignorance offends you.](https://meta.stackexchange.com/a/407046/1709517) I guess you were born knowing what you know today and never experienced not knowing something."^^ . + . + . + . + . + . + . + "Woocommerce Rest API - Get Order Items With Float Quantity"^^ . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + "2"^^ . + . + "0"^^ . + . + . + . + "2"^^ . + "1"^^ . + . + "0"^^ . + "roles"^^ . + . + "google-cloud-platform"^^ . + . + "0"^^ . + . + . + "1"^^ . + "<p>I cloned your Brave-2.0 CMS and tried it out locally.</p>\n<p>The problem:</p>\n<p>The <code>&lt;select name=&quot;tags[]&quot; id=&quot;tags&quot; class=&quot;form-control tag-select&quot; multiple&gt;</code> is not maintaining its previous select value when accessing the edit article page.</p>\n<p>If you resubmit without changing anything, your code will not detect data coming from <code>tags</code> array (the <code>$request-&gt;has('tags')</code> is always <code>false</code>), thus deleting ALL of your previously input tag.</p>\n<p>The solution:</p>\n<p>I can't give you a specific code yet but the easiest fix I can think of is to do the following:</p>\n<ul>\n<li>Prepare a variable that stores your #tags select value. When the user access the edit article page, make sure the backend values are stored into the javascript variables. (through API or through element embedding)</li>\n<li>Before submitting the form, force the javascript to prevent the form submission, add the <code>tags[]</code> array data, then submit the form.</li>\n</ul>\n<p>Alternatively, you can try using Vue script just for the multi-select of your tags.</p>\n<p>Hope this helps.</p>\n<p>Regards,</p>\n"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + "<p>I am using Sage to connect via odbc using PHP. This was working fine until a recent upgrade to version 31 but stopped working from there.</p>\n<p>The issue is the DSN works fine through Excel and therefore Sage support can't take it any further.</p>\n<p>I have installed PHP 8.4.4 (and also 8.1.3) and am running the code directly from the command line but using <code>$db = new PDO('odbc:MyName');</code> and nothing else <code>The driver doesn't support the version of ODBC behaviour that the application requested.</code>.</p>\n<p>If I try <code>$db = odbc_connect('MyName');</code> I get the error <code>The driver returned invalid (or failed to return).</code></p>\n<p>After a lot of research <em>I am well aware</em> that the standard options seem to be mismatches between 32-bit and 64-bit systems, however Sage, PHP and the ODBC System DSN are all 32-bit, so I don't believe this is the issue.</p>\n<p>In the PDO instance the password and username are omitted and the error doesn't reference this so it clearly can't even connect to the DSN yet Excel can.</p>\n<p>Interestingly the Sage guy created a test DSN to the local Demo company - that fails too via PHP (same driver), so I'm wondering if it's a driver update issue. The OS is 64-bit.</p>\n<p>I've also created a UDL file and tested the 64-bit version and that (as well as the 32-bit through Excel) works fine. I've also tried PHP 8.1 64bit -&gt; 64bit driver and that fails too.</p>\n"^^ . + "0"^^ . + "3"^^ . + . + . + . + . + . + . + . + . + "Image resize / fit gives poor quality results"^^ . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + "0"^^ . + . + "You're adding the the fetched content to citiesContainer, which already exists. So you can use that as the parent, I expect"^^ . + . + . + "1"^^ . + . + . + . + . + "sage-erp"^^ . + "@MatthewBradley\nThe question and answers are outdated and not for the current version of Laravel\nMany changes have occurred in the current version of Laravel and the previous question and the answers in the previous question are not compatible with the current version of Laravel"^^ . + . + "What you are describing sounds like a memory leak somewhere but it would be impossible to tell if that's the case or where the leak might be originating from unless you use some sort of a monitoring tool to figure out if there's anything out of the ordinary happening on your server's resource use"^^ . + . + "IIS Authentication Windows seems not working"^^ . + . + . + "Warning! Your code is likely to be vulnerable to SQL Injection, because you are mixing query and data. See https://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php"^^ . + "2"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + "-2"^^ . + "0"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + "websocket"^^ . + . + "3"^^ . + "@maiorano84 Thanks, I had tried pconnect before twemproxy, and that did help, but with twemproxy, it does not seem to make any difference."^^ . + . + "0"^^ . + . + "2"^^ . + . + "0"^^ . + "FPDF's SetProtection script password protecting since Amazon Linux 2023"^^ . + . + . + "1"^^ . + . + "@hschmauder: Yes `->value` (or `->name`) is by design of enums. It is also a safeguard: The next HTTP request might be with a different (e.g. new cases) enum definition and then your code continues to be compatible (as the string value can be turned back into an enum case) but that requires to operate with the cases from that point on forward. HTTP method might be a good example: You application starts to support GET only, later on you add POST introducing forms. While you could introduce string constants for the supported methods, you certainly don't want to refer to them by string only."^^ . + "2"^^ . + . + . + . + "But I do wonder, why would the user need to be able to do that? Can't you just set them up with all the roles they need to do the tasks you want them to be allowed to do, at the time when their account is created? Why do they need to be able to switch around?"^^ . + . + . + "0"^^ . + "0"^^ . + . + "Follow this link https://stackoverflow.com/questions/5669905/sqlite-with-encryption-password-protection"^^ . + . + "Okta integration for php 8 symfony"^^ . + "-1"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + "Thank you for your Answers. The \\b is not the correct solution. Therefor this Question is not an duplicate! (?i)(?<!\\w)SEARCH_TERM(?!\\w) - Lookaround is the right solution."^^ . + . + "Tried 3 different browsers to be sure, has in file is the same (See Question), but the other 2 are different"^^ . + . + "0"^^ . + . + "Also you mentioned "another domain". If users from two domains are supposed to access your app using integrated authentication thar will rely on a trust relationship between the two domains, which is way outside the scope of your php app"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + "Sorry @C3roe, I do actually get the following message returned: 'Not on a course or lesson page (Detected post type: lesson)'. I'm not sure if that helps??"^^ . + . + . + . + . + "1"^^ . + . + . + . + "Herd routes to php files by default. You might need to create a custom driver for your application https://herd.laravel.com/docs/macos/extending-herd/custom-drivers"^^ . + "Or this one? https://stackoverflow.com/q/48241939"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + "<p>You can use the <code>date</code> validation rule for that (<a href="https://laravel.com/docs/7.x/validation#rule-date" rel="nofollow noreferrer">Docs</a>).</p>\n<p>Tried <a href="https://laravelplayground.com/" rel="nofollow noreferrer">this laravel playground</a> and the following code worked:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\n$date = '2025-02-31';\n\n$rules = [\n 'date' =&gt; 'date',\n];\n$validator = \\Validator::make(['date' =&gt; $date], $rules);\n\nif ($validator-&gt;fails()) {\n dump('Invalid date');\n // Throw exception / log error / store faulty line...\n}\n\n$date = '2025-02-25';\n\n$rules = [\n 'date' =&gt; 'date',\n];\n$validator = \\Validator::make(['date' =&gt; $date], $rules);\n\nif ($validator-&gt;fails()) {\n dump('Invalid date 2');\n // Throw exception / log error / store faulty line...\n}\n</code></pre>\n<p>You can basically use the <code>Validator</code> facade wherever you want, with a given set of rules, just like you would do it in a Request.</p>\n"^^ . + "0"^^ . + . + . + . + . + . + "php - request for https://apis.roblox.com/challenge/v1/continue, LOGIN ROBLOX"^^ . + "1"^^ . + "I'm trying to populate 2 drop down menus. The first with the categories of photos(folder name) and the 2nd with sub categories of the 1st"^^ . + . + "0"^^ . + "1"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + "1"^^ . + "0"^^ . + . + . + "How do I fix this curl deepl code is not working"^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + "I haven't tried this myself, but you could read the headers with a normal get request, and don't read the body. See, for instance: https://chriswhite.blog/coding/inspecting-http-response-headers-without-downloading-body-with-guzzle/ You still need to work out what headers you get in which situation."^^ . + . + "Psalm does not detect SQL Injection"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + "1"^^ . + . + "Have you tried `\\Namespace\\Path\\Module\\Class::method` in your routes file? Another possibility - as the route destination"^^ . + . + "0"^^ . + . + . + "0"^^ . + "<p>To access it directly from virutal host. You can either run <code>npm run dev</code> or <code>npm run build</code> accordingly. You can find the difference for the both <a href="https://stackoverflow.com/questions/63133245/difference-between-npm-run-dev-and-npm-run-production">here</a>.</p>\n"^^ . + . + . + . + "0"^^ . + "ElasticSearch+Laravel 11"^^ . + . + "0"^^ . + . + "1"^^ . + . + "<p>You can try to define a name for each of your routes, in this way:</p>\n<pre><code>Route::post('/register', [UserController::class, 'register'])-&gt;name('register');\n</code></pre>\n<p>Then you the route name on your form, in this way:</p>\n<pre><code>&lt;form action=&quot;{{ route('register') }}&quot; method=&quot;POST&quot;&gt;\n</code></pre>\n<p>You can also try to define the type of that button with:</p>\n<pre><code>&lt;button type=&quot;submit&quot;&gt;submit&lt;/button&gt;\n</code></pre>\n<p>I also suggest you check the route list with artisan with <code>php artisan route:list</code>, if your 'register' route is not in the list or if it's not a POST route try to refresh the cache with <code>php artisan route:clear</code></p>\n"^^ . + . + . + "Although it is completely valid to do so, is there a specific reason that you are using PHP to invoke another PHP process (using a different SAPI), instead of just running the PHP code?"^^ . + . + . + "<p>Try to disable as say in <a href="https://backpackforlaravel.com/docs/6.x/crud-cheat-sheet#responsive-table" rel="nofollow noreferrer">our docs</a></p>\n<p><code>CRUD::disableResponsiveTable();</code></p>\n<p>Try to not use <code>CRUD::setFromDb();</code> and set your own columns and fields.</p>\n<p>Cheers.</p>\n"^^ . + . + . + "0"^^ . + . + . + "1"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "I think, if you know that area code can be minimum `x` and maximum `y` digits long, then you can loop in the range from `x` to `y` (both inclusive) and then select that much characters from the telephone number and search in the `area_codes` list. Without any loop I think it would be more difficult. Also, if the `area_codes` is properly sorted, then use can use binary search also to make it more efficient."^^ . + "<p>Simply generate a unique unsubscribe token for each user. For example, this way:</p>\n<pre><code>\n$token = md5($email . 'secret_key'); // Add a secret key here\n$unsubscribe_link = &quot;https://example.com/unsubscribe/MyCode.php?param=$token&quot;;\n</code></pre>\n<p>Adopting this simple solution, you don't even need to store the token in the database:</p>\n<pre><code>$query = &quot;SELECT email FROM subscribers WHERE md5(email . 'secret_key') = '$token'&quot;;\n</code></pre>\n"^^ . + . + "In Laravel, how can I keep the selected options of a multiselect on an invalid form?"^^ . + "<p><strong>I installed the JustFans script from CodeCanyon on Hostinger hosting, but when trying to upload images, they do not appear on the website, even though they exist in the public/uploads folder.</strong></p>\n<p><strong>I also found the following error message in the admin panel:</strong></p>\n<pre><code>Missing storage symlink\nWe could not find a storage symlink. This could cause problems with loading media files from the browser.\n\n</code></pre>\n<p><strong>When I tried running:</strong></p>\n<pre><code>php artisan storage:link\n\n</code></pre>\n<p><strong>I got this error:</strong></p>\n<pre><code>Call to undefined function Illuminate\\Filesystem\\symlink()\n\n</code></pre>\n<p><strong>I tried this manual fix, and it worked, but I need it to run automatically:</strong></p>\n<pre><code>mkdir -p public/storage\ncp -r storage/app/public/* public/storage/\n</code></pre>\n<p><strong>I attempted to set up a Cron Job in Hostinger with the following command:</strong></p>\n<pre><code>* * * * * cp -r /home/your-username/storage/app/public/* /home/your-username/public_html/storage/\n\n</code></pre>\n<p><strong>However, it did not run automatically.</strong></p>\n<ol>\n<li><strong>Running php artisan storage:link</strong></li>\n</ol>\n<ul>\n<li>Expected: It should create a symbolic link from storage/app/public to public/storage.</li>\n<li>Result: Got the error:</li>\n</ul>\n<pre><code>Call to undefined function Illuminate\\Filesystem\\symlink()\n\n</code></pre>\n<p><strong>This means the symlink() function is disabled on my Hostinger server.</strong>\n2. Manually Copying Files</p>\n<ul>\n<li>Command Used:</li>\n</ul>\n<pre><code>mkdir -p public/storage\ncp -r storage/app/public/* public/storage/\n</code></pre>\n<p><strong>- Expected: The images should be accessible in the browser.</strong>\n<strong>- Result: This worked, but I had to run the command manually every time new media was uploaded.</strong></p>\n<ol start="3">\n<li>Setting Up a Cron Job on Hostinger</li>\n</ol>\n<ul>\n<li>Command Used:</li>\n</ul>\n<pre><code>* * * * * cp -r /home/your-username/storage/app/public/* /home/your-username/public_html/storage/\n\n</code></pre>\n<p><strong>- Expected: The cron job should automatically copy new media every minute.</strong>\n<strong>- Result: It did not execute as expected.</strong></p>\n<p><strong>Next Steps:</strong>\nI need a fully automated solution where media files are always accessible without having to manually copy them. Looking for alternatives to symlink() that work on Hostinger.</p>\n<p><strong>Any advice or alternative approaches? </strong></p>\n"^^ . + "<p>i just purchased Ultimate addons for beaver builder (U A B B), but when i install, error message say &quot;there is serious error in website&quot; i cant longer login why?</p>\n<p>I Tried to uninstall and install but nothing works, any help</p>\n"^^ . + . + "Thank you for the answer. I had a feeling what I looked for cannot be done and it made sense not to be possible. I will go with looping, like you've said, and in a future iteration of the menu builder, I'll just ajax/js in a user interface to generate what I wanted before I write it in an array - a menu builder just through code editing is really not the most efficient way for me to handle this (considering my issue was human input error). I appreciate your time!"^^ . + "0"^^ . + . + "Your database admins should not be able to just go into a production database, particularly not if is so sensitive as yours is. Privileged user accounts should be protected by security software, that enables authorised users to check out passwords for a certain period of time only (after which it changes the password automatically), checkout is tied to a valid incident or change request ticket. All activities of the privileged accounts must be logged and the logs reviewed after the session is over by an independent colleague."^^ . + . + "emoticons"^^ . + "@ADyson My point is, maybe they'd seen backslash escapes used elsewhere, and didn't know that quoting was an option. I see this a lot, where someone asks "how do I do X?" and an experienced dev comments "why didn't you use Y?" rather than _answering_ "you can solve this with Y". [We shouldn't be surprised that people don't know all the things we know.](https://xkcd.com/1053/)"^^ . + "0"^^ . + . + "See [ask] and how to make a [mre] of your issue"^^ . + . + . + . + "0"^^ . + "nfs"^^ . + "So it's just a type declaration, without retur. the rest is same. Submit a pull request, problem solved"^^ . + . + "0"^^ . + . + . + "1"^^ . + "<p>I want to disable the select component on my Filament form based on user login, I tried all the tutorials on Google but none of them work.</p>\n<p>This is my Filament resource code</p>\n<pre class="lang-php prettyprint-override"><code> public static function form(Form $form): Form\n {\n return $form\n -&gt;schema([\n //\n Forms\\Components\\Section::make()\n -&gt;schema([\n Forms\\Components\\Select::make('jnskendaraan_id')\n -&gt;label('Pilih Jenis Kendaraan')\n -&gt;options(Jnskendaraan::pluck('jns_kendaraan', 'id'))\n -&gt;required()\n -&gt;reactive(),\n Forms\\Components\\Select::make('kendaraan_id')\n -&gt;label('Pilih Kendaraan')\n -&gt;disabled(fn (Get $get) : bool =&gt; ! filled($get('jnskendaraan_id')))\n -&gt;options(fn(Get $get) =&gt; Kendaraan::where('jnskendaraan_id', (int) $get('jnskendaraan_id'))- &gt;pluck('nm_kendaraan', 'id'))\n -&gt;required(),\n Forms\\Components\\DatePicker::make('tgl_booking')\n -&gt;required()\n -&gt;columnSpanFull(),\n Forms\\Components\\TimePicker::make('jam_booking')\n -&gt;required()\n -&gt;columnSpanFull(),\n Forms\\Components\\Textarea::make('keperluan')\n -&gt;required()\n -&gt;columnSpanFull(),\n Forms\\Components\\Select::make('status')\n -&gt;options([\n 'pending' =&gt; 'Pending',\n 'approve' =&gt; 'Approve',\n 'canceled' =&gt; 'Canceled',\n ])\n -&gt;default('pending')\n -&gt;selectablePlaceholder(false)\n ])\n ]);\n }\n</code></pre>\n"^^ . + . + . + "twilio-api"^^ . + "okta"^^ . + "1"^^ . + . + . + "If there's a link to some documentation about this plugin you're using, that would also be helpful."^^ . + "0"^^ . + "Extract the necessary prefix from the current URL; or make it dependent on the content of the `lang` attribute of the `html` element."^^ . + "I added additional configuration to my YAML and verified that it’s not a ParseFunc issue. The problem occurs when saving my content element, as it is being saved incorrectly in the database. Could this be caused by a DataProcessor from the Bootstrap package?"^^ . + "why not just send a verification link to your users email?"^^ . + . + "<p>Hello i create datatables serverside with PHP, but filtering result is wrong.\ni want to show only 1 data, when i filter &quot;epic 5&quot; but the result show 5 data.\nYou can check my screenshot here : <a href="https://i.ibb.co.com/4RnRcwLg/Screenshot-1.png" rel="nofollow noreferrer">https://i.ibb.co.com/4RnRcwLg/Screenshot-1.png</a></p>\n<p>When i debug SQL code show like this. <strong>Why datatables split my filtering?</strong></p>\n<pre><code>SELECT\n `rank_star`.*,\n `rk`.`rank_name`,\n `usr`.`employee_username` \nFROM\n `rank_star`\n LEFT JOIN `rank` AS `rk` ON `rk`.`id_rank` = `rank_star`.`id_rank`\n LEFT JOIN `employee` AS `usr` ON `usr`.`employee_id` = `rank_star`.`created_by`\n LEFT JOIN `employee` AS `usr_up` ON `usr_up`.`employee_id` = `rank_star`.`updated_by` \nWHERE\n (\n LOWER( `rk`.`rank_name` ) LIKE % epic % \n OR LOWER( `rank_star`.`rank_name_star` ) LIKE % epic % \n OR LOWER( `rank_star`.`rank_star_order` ) LIKE % epic % \n OR LOWER( `rank_star`.`created_at` ) LIKE % epic % \n OR LOWER( `rank_star`.`updated_at` ) LIKE % epic % \n OR LOWER( `usr`.`employee_username` ) LIKE % epic % \n OR LOWER( `usr_up`.`employee_username` ) LIKE % epic %) \n AND (\n LOWER( `rk`.`rank_name` ) LIKE % 5 % \n OR LOWER( `rank_star`.`rank_name_star` ) LIKE % 5 % \n OR LOWER( `rank_star`.`rank_star_order` ) LIKE % 5 % \n OR LOWER( `rank_star`.`created_at` ) LIKE % 5 % \n OR LOWER( `rank_star`.`updated_at` ) LIKE % 5 % \n OR LOWER( `usr`.`employee_username` ) LIKE % 5 % \n OR LOWER( `usr_up`.`employee_username` ) LIKE % 5 %) \nORDER BY\n `rank_star`.`rank_star_order` ASC \n LIMIT 100 OFFSET 0\n</code></pre>\n<p><strong>This is my javasript code</strong></p>\n<pre><code>$(document).ready(function(){\n $(&quot;#example&quot;).DataTable({\n search: { &quot;bSmart&quot;: false, &quot;bRegex&quot;: true },\n serverSide : true,\n processing : true,\n ajax : {\n url : &quot;rank_star/res&quot;,\n type : 'POST',\n dataType : 'JSON',\n data : {_token : '{{csrf_token()}}'}\n },\n columns : [\n {data : 'act', name : 'act'},\n {data : 'rank_name', name : 'rk.rank_name'},\n {data : 'rank_name_star', name : 'rank_star.rank_name_star'},\n {data : 'rank_min_star', name : 'rank_min_star',className: &quot;text-center&quot;},\n {data : 'rank_max_star', name : 'rank_max_star',className: &quot;text-center&quot;},\n {data : 'rank_star_order', name : 'rank_star.rank_star_order',className: &quot;text-center&quot;},\n {data : 'created_date', name : 'created_at'},\n {data : 'updated_date', name : 'updated_at'},\n {data : 'employee_add', name : 'usr.employee_username'},\n {data : 'employee_update', name : 'usr_up.employee_username'},\n ],\n pageLength: 100,\n order: [[5, 'asc']],\n });\n});\n</code></pre>\n<p><strong>And this is my PHP Code</strong></p>\n<pre><code>$data = RankStar::query()-&gt;select(\n [\n 'rank_star.*',\n 'rk.rank_name',\n 'usr.employee_username',\n ]\n )\n -&gt;leftJoin('rank as rk', 'rk.id_rank', '=', 'rank_star.id_rank')\n -&gt;leftJoin('employee as usr', 'usr.employee_id', '=', 'rank_star.created_by')\n -&gt;leftJoin('employee as usr_up', 'usr_up.employee_id', '=', 'rank_star.updated_by');\n return datatables()-&gt;eloquent($data)\n -&gt;addColumn(&quot;act&quot;, function($row){\n\n $func_action =&quot;&quot;;\n $btn_edit = &quot;&lt;button type='button' title='Update' class='btn btn-primary btn-sm' onclick='do_edit(\\&quot;&quot;.$row-&gt;id_rank_star.&quot;\\&quot;)' data-toggle='modal' data-target='#update_modal'&gt;&lt;i class='fa fa-pencil'&gt;&lt;/i&gt;&lt;/button&gt;&amp;nbsp;&quot;;\n $btn_delete = &quot;&lt;button type='button' title='Delete' class='btn btn-danger btn-sm' onclick='do_delete(\\&quot;&quot;.$row-&gt;id_rank_star.&quot;\\&quot;)'&gt;&lt;i class='fa fa-trash'&gt;&lt;/i&gt;&lt;/button&gt;&quot;;\n \n if(acc_update(Session::get('ses_level'),$this-&gt;data['id_menu']) == '1'){\n $func_action .= $btn_edit;\n }\n\n if(acc_delete(Session::get('ses_level'),$this-&gt;data['id_menu']) == '1'){\n $func_action .= $btn_delete;\n }\n\n return &quot;&lt;center&gt;&quot;.$func_action.&quot;&lt;/center&gt;&quot;; \n })\n -&gt;addColumn(&quot;rank_name&quot;, function($row){\n return @$row-&gt;rank_name;\n })\n -&gt;addColumn(&quot;rank_name_star&quot;, function($row){\n return @$row-&gt;rank_name_star;\n })\n -&gt;addColumn(&quot;rank_min_star&quot;, function($row){\n return @$row-&gt;rank_min_star;\n })\n -&gt;addColumn(&quot;rank_max_star&quot;, function($row){\n return @$row-&gt;rank_max_star;\n })\n -&gt;addColumn(&quot;rank_star_order&quot;, function($row){\n return @$row-&gt;rank_star_order;\n })\n -&gt;addColumn(&quot;employee_add&quot;, function($row){\n return @$row-&gt;creator-&gt;employee_username;\n })\n -&gt;addColumn(&quot;employee_update&quot;, function($row){\n return @$row-&gt;updater-&gt;employee_username;\n })\n -&gt;addColumn(&quot;created_date&quot;, function($row){\n return get_date_indonesia($row-&gt;created_at).&quot; &quot;.substr($row-&gt;created_at, 10, 9);\n })\n -&gt;addColumn(&quot;updated_date&quot;, function($row){\n return get_date_indonesia($row-&gt;updated_at).&quot; &quot;.substr($row-&gt;updated_at, 10, 9);\n })\n -&gt;rawColumns(['act'])\n -&gt;make(true);\n</code></pre>\n<p>Help me sir, thanks.</p>\n"^^ . + . + . + "0"^^ . + "0"^^ . + "wp-graphql"^^ . + . + . + . + . + . + . + . + "<p>Your provided code is a bit incomplete and you missed saving the field value. Try the following:</p>\n<pre class="lang-php prettyprint-override"><code>// Add a custom checkout field (checkout blocks)\nadd_action(\n 'woocommerce_init',\n function() {\n woocommerce_register_additional_checkout_field( array(\n 'id' =&gt; 'namespace/newsletter-opt-in',\n 'label' =&gt; 'Subscribe to newsletter?',\n 'location' =&gt; 'order',\n 'type' =&gt; 'checkbox',\n ) );\n }\n);\n\n// Save the custom checkout field value (when the checkbox ix checked)\nadd_action(\n 'woocommerce_set_additional_field_value',\n function ( $key, $value, $group, $wc_object ) {\n if ( 'namespace/newsletter-opt-in' === $key ) {\n $wc_object-&gt;update_meta_data( 'newsletter_opt_in', $value );\n }\n },\n 10,\n 4\n);\n</code></pre>\n<p>Now the field value is saved as custom order meta data when submitting an order and you can retreive the &quot;newsletter opt-in&quot; value from the <code>WC_Order</code> object like:</p>\n<pre><code>$order = wc_get_order($order_id);\n$subscribe = $order-&gt;get_meta('newsletter_opt_in');\n</code></pre>\n<p>The value will equal to <code>'1'</code> if the customer has subscribed. If the customer didn't subscribed there is no value <em>(an empty string)</em>.</p>\n"^^ . + . + . + . + . + . + . + . + "Why doesn't limesurvey register plugins defined in child classes?"^^ . + "<p>Try to install a minor version of PHP (for e.g. 8.0) as migrating from 7.4 to 8.4 you most probably would come up with code deprecated functions and features. <a href="https://www.php.net/releases/8.4/en.php" rel="nofollow noreferrer">https://www.php.net/releases/8.4/en.php</a></p>\n<p>Maybe you can try with this Wordpress repositorywith PHP 8.3: <a href="https://github.com/pabloripoll/docker-wordpress-6.4-php-8" rel="nofollow noreferrer">https://github.com/pabloripoll/docker-wordpress-6.4-php-8</a></p>\n"^^ . + . + "fopen"^^ . + "1"^^ . + . + . + "0"^^ . + "pdo"^^ . + . + "3"^^ . + "1"^^ . + . + . + "Here one more regex idea: [`trim(preg_replace('~...$|..~', '$0 ', $s))`](https://tio.run/##K8go@P/fxj7AI4CLKy2/KDUxOUMjWt1QXUfd0AhMGENIEyhlCqPNgAwTI0sjA2OQYktLS2NjS/VYBcdgBZViTa5qLgWF1OSMfIWSosxcjYKi1PT4otSCnMTkVA31Oj09PZUaPb06dR0FdRUDBSAF1KKppxSTp2TNVcvF9f8/AA) but that's using an additional `trim()` which might be unwanted."^^ . + . + . + "2"^^ . + "Yes, everything is in order; it correctly matches the en_GB condition and then the gift voucher condition. If I do a dump at the end, after adding the different data and retrieving my template, everything is in order in my Fpdi object. \nBut here, in the dashboard, downloading the PDF does not work as soon as there is /en/ in the address. I have [21-Feb-2025 21:26:22 UTC] PHP Notice: iconv(): Detected an illegal character in input string in /home/lifestylkq/radici/wp-content/plugins/translatepress-multilingual/assets/lib/simplehtmldom/simple_html_dom.php on line 1079\nin the log file"^^ . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + "Sounds like a problem with routing to me as well. Wasn't there a command to list all the routes? That output would certainly be useful with the question. Probably you can find it and [edit] the question."^^ . + . + . + "0"^^ . + . + "web-development-server"^^ . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + "Yeah using it in this case, removed for space but yes I am."^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "get"^^ . + "0"^^ . + . + . + . + . + "As written, the cleaning part depends on your requirements. If you feel overwhelmed by it, just add something in cron and experiment with it. Keep the magic out. As you can see, the code in the answer is even less complex compared to what you have in the question. Just think about a real stupid way on how to handle this and give it a try. Don't give up too early."^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + "3"^^ . + "facebook-graph-api"^^ . + . + . + "1"^^ . + . + "I'd use `file_put_contents` with the `FILE_APPEND` flag set, instead of that fopen/fwrite/fclose sermon. But - depending on what you actually want to do with this data later on, you should really think about maybe using a different data format, something like JSON. Because with how you are currently doing it, later on you won't be able to differentiate between two messages "Foo" and "Bar" written over two lines in your file - and _one_ message "Foo[line break]Bar" entered directly like that by the user ..."^^ . + . + "0"^^ . + . + . + . + "How to sync laravel with email services"^^ . + . + . + "How to access backend from a different domain"^^ . + . + "1"^^ . + . + "1"^^ . + . + . + "<p>I am following the Laravel 12 documentation for <a href="https://laravel.com/docs/12.x/blade#rendering-json" rel="nofollow noreferrer">rendering JSON</a> but the provided example is not working. If I replace <code>{{ Js::from($map) }}</code> with the copy-and-pasted output of <code>console.log(hexes)</code>, it works perfectly. So the correct information is being passed from the backend, but it is not encoded(?) in the way Blade(?) expects it to be.</p>\n<pre><code>&lt;script&gt;\nconst hexes = {{ Js::from($map) }};\nconsole.log(hexes);\nvar hex = new OI.hexmap(document.getElementById('hexmap'),\n{\n 'grid': {'show':true},\n 'label': {\n 'show': true, \n 'clip': true, \n 'format': function(txt,attr) {\n return attr.hex.q + &quot;, &quot; + attr.hex.r;\n }\n },\n 'hexjson':{\n &quot;layout&quot;:&quot;odd-r&quot;,\n &quot;hexes&quot;: hexes,\n }\n}\n);\n&lt;/script&gt;\n</code></pre>\n<p>I am trying to build a <a href="https://open-innovations.org/projects/hexmaps/hexjson.html" rel="nofollow noreferrer">HexJSON</a> object for use by Open Innovations' <a href="https://open-innovations.github.io/oi.hexmap.js/" rel="nofollow noreferrer">Hexmap Library</a>. When I run the code in the example the library throws errors like <code>Unexpected value translate(NaN NaN) parsing transform attribute.</code> and <code>Unexpected value NaN NaN NaN NaN parsing viewBox attribute.</code> However, when I hardcode the HexJSON, the library works as advertised.</p>\n<p>This is the PHP backend. Adding a <code>value</code> with the <code>key</code> &quot;origin&quot; forces <code>json_encode</code> to treat the array as a dictionary, as expected by HexJSON.</p>\n<pre><code>$hexes = Hexagon::orderBy('id', 'asc')-&gt;get()-&gt;toArray();\n$hexes[&quot;origin&quot;] = array(&quot;q&quot;=&gt;0, &quot;r&quot;=&gt;0);\nreturn view('game', [&quot;map&quot; =&gt; json_encode($hexes)]);\n</code></pre>\n"^^ . + "0"^^ . + . + . + . + . + "1"^^ . + . + "-1"^^ . + . + . + . + . + "1"^^ . + "This is what I explain Bellow."^^ . + . + "<p>if your component class is in this path: <code>The livewire class (app/Livewire/Productos.php)</code><br />\nThe problem might be in the namespace declaration inside of the Products.php file.<br />\nYou have it declared wrong with: <code>App\\Http\\Livewire</code>. It should be: <code>App\\Livewire</code></p>\n"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + "IDP create in laravel using Simple SAML php"^^ . + "colors"^^ . + . + "6"^^ . + . + "-1"^^ . + . + . + "same error ......"^^ . + "0"^^ . + "0"^^ . + "<p>This is doable in a simple way with a bit of PHP and JavaScript.</p>\n<p>First, you need to set up The &quot;ebook&quot; and &quot;audiobook&quot; variations as virtual products:</p>\n<p><a href="https://i.sstatic.net/EDlDyCkZ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/EDlDyCkZ.png" alt="Admin-variable product" /></a></p>\n<p>Then the following code will (for virtual variations):</p>\n<ul>\n<li>Set the max quantity to 1 (in product page),</li>\n<li>Hide the quantity button (in product page),</li>\n<li>Hide the quantity button (in cart page).</li>\n</ul>\n<p>The code:</p>\n<pre class="lang-php prettyprint-override"><code>// Product page: Set max quantity for virtual product variation\nadd_filter( 'woocommerce_available_variation', 'wc_available_variation_max_qty', 10, 3 );\nfunction wc_available_variation_max_qty( $data_variation, $product, $variation ) {\n if ( $data_variation['is_virtual'] ) {\n $data_variation['max_qty'] = 1;\n }\n return $data_variation;\n}\n\n// Product page: Hide quantity field for virtual product variation\nadd_action('woocommerce_single_variation', 'variable_product_jquery_script', 5);\nfunction variable_product_jquery_script() {\n // Enqueued JavaScript\n wc_enqueue_js( &quot;$('form.variations_form').on('show_variation', function(event, data){ \n if( data.is_virtual ) {\n $('div.quantity').hide();\n } else {\n $('div.quantity').show();\n }\n });&quot; );\n}\n\n// Cart page: Hide quantity field for virtual product variation\nadd_filter( 'woocommerce_quantity_input_args', 'filter_wc_quantity_input_args', 10, 2 );\nfunction filter_wc_quantity_input_args( $args, $product ) {\n if ( $product-&gt;is_virtual() ) {\n $args['min_value'] = $args['max_value'] = 1;\n }\n return $args;\n}\n</code></pre>\n<p>Code goes in functions.php file of your child theme (or in a plugin).</p>\n<p><strong>In single variable product page <em>(physical product variation)</em>:</strong></p>\n<p><a href="https://i.sstatic.net/Z4G5OWzm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Z4G5OWzm.png" alt="physical product variation" /></a></p>\n<p><strong>In single variable product page <em>(virtual product variation)</em>:</strong></p>\n<p><a href="https://i.sstatic.net/rUcYG5ik.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/rUcYG5ik.png" alt="virtual product variation" /></a></p>\n<p><strong>In cart page:</strong></p>\n<p><a href="https://i.sstatic.net/fz1bE4q6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/fz1bE4q6.png" alt="enter image description here" /></a></p>\n<p><strong>Based on:</strong></p>\n<ul>\n<li><a href="https://stackoverflow.com/questions/62437758/woocomerce-update-max-quantity-for-product-variation/62438954#62438954">Woocomerce - Update max quantity for product variation</a></li>\n<li><a href="https://stackoverflow.com/questions/78056378/woocommerce-show-custom-stock-message-when-a-size-variant-is-selected/78071534#78071534">WooCommerce show custom stock message when a size variant is selected</a></li>\n<li><a href="https://stackoverflow.com/questions/62943477/set-quantity-minimum-maximum-and-step-at-product-level-in-woocommerce/62946194#62946194">Set quantity minimum, maximum and step at product level in Woocommerce</a></li>\n</ul>\n"^^ . + . + . + . + . + "2"^^ . + . + . + . + . + . + "2"^^ . + "2"^^ . + . + . + "It's not a firewall issue.\n\nThe web server is on the Mac side, and connection to the db using php-pdo-dblib is via port 5000\n\nOn the Mac side: `tsql -S TESTDB -p 5000 -U sa` worked fine\nOn the Mac side : `php db.php TESTDB` worked fine"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + "What you get with this `dd(Auth::user()->can('view_permission_categories'));`?\nIf it is true then it quite weird. Try using `@if` with `auth()->user()->can('view_permission_categories')`"^^ . + "Do I still need getters and setters when using Entities via Attributes?"^^ . + . + . + "1"^^ . + . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + "Regexp for PHP preg_replace - avoid word in word inclusion + exact match"^^ . + "How do I solve Symfony v7 JWT/ Bundle Error "Unable to find the controller for path /api/login_check The route is wrongly configured (404 Not Found)""^^ . + "0"^^ . + "Laravel complex Has One of Many Realationship"^^ . + "It's up to you how you store the data really, according to what best suits your use case and requirements. Our opinions on that aren't really relevant."^^ . + "0"^^ . + "0"^^ . + "1"^^ . + "Small correction: bcrypt truncates the *password* to 72 characters, before hashing it. That happens consistently on both hash and verify, so would never cause a login attempt to *fail*, it would cause multiple long passwords to all succeed if they are different only after the 72nd byte."^^ . + . + "<p>I read some data from the database with the following command:</p>\n<pre><code>$klassenstufe = $DB-&gt;get_records_sql( &quot;SELECT c.id, c.name, c.idnumber, c.description, cm.cohortid, cm.userid\nFROM {cohort} AS c\nINNER JOIN {cohort_members} AS cm\nON c.id = cm.cohortid\nWHERE cm.userid = {$get_userid}\n&quot; );\n</code></pre>\n<p>As an example, with</p>\n<pre><code>$klassenstufe-&gt;name\n</code></pre>\n<p>I get two entries from the database.</p>\n<ol>\n<li>AK2030</li>\n<li>AK2030b</li>\n</ol>\n<p>I want to count the character set and only get the one that has 7 characters (AK2030b).</p>\n<p>If I have the right data set, I want to have the number once (2030) and the last letter (b) in 2 different variables.</p>\n<p>The number and letter can vary.</p>\n<p>What approach can I take?</p>\n"^^ . + . + "0"^^ . + "1"^^ . + . + "It is quite hard to help you without seeing the code. Do you have this code in your login controller? protected $redirectTo = '/home';"^^ . + . + "<p>I am facing a problem with routing and authentication.</p>\n<p>I referred to this document:<br />\n<a href="https://simplesamlphp.org/docs/stable/simplesamlphp-idp.html" rel="nofollow noreferrer">https://simplesamlphp.org/docs/stable/simplesamlphp-idp.html</a></p>\n<p>I copied <code>simplesamlphp</code> inside my <code>public</code> folder. I also configured the <code>public\\simplesamlphp\\config\\config.php</code> file</p>\n<p>When I try this login URL it gives me a <code>404</code>:</p>\n<pre><code>public/simplesamlphp/module.php/saml/idp/sso.php\n</code></pre>\n<p>I set this route for accessing the login page:</p>\n<pre><code>Route::get('/saml/login1', function () {\n // echo &quot;SDf&quot;;\n return Redirect::to('/public/simplesamlphp/module.php/core/authenticate.php?as=laravel');\n});\n\nRoute::get('/saml/logout', function () {\n return Redirect::to('/public/simplesamlphp/module.php/core/logout.php');\n});\n</code></pre>\n<p>I am unable to find clear documentation for simplesamlphp and laravel, can anyone help?</p>\n"^^ . + "Did this answer your question? Btw. with the latest PHP version 8.4 you may omit the parenthesis. `new A->test();`"^^ . + . + . + . + . + . + "@aynber would this mess up herds internal URL mapping?"^^ . + . + . + . + . + . + "0"^^ . + . + . + "503 error after 3 minutes of execution time"^^ . + "OK. So have you done any debugging? When you test it, what was in `$geo_data` as a whole when it's returned from the remote service? Did it contain what you expect? Have you tried connecting from a few different IP addressed to see if it makes any difference? Bear in mind that most of these free IP location services are just big databases, often with member-contributed content. They often aren't complete, so some IP ranges might not return a result, or might be inaccurate."^^ . + . + . + . + "2"^^ . + . + "The code where you do first or first-all is missing. It might be obvious to you, but it would help your question to have it more visible so it becomes clear which line of code provokes which error."^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "1"^^ . + "-2"^^ . + "0"^^ . + . + "<p>I'm stuck on this screen with laravel spark / paddle\nWebhooks work and I am successfully creating a subscription and paying for it in the sandbox, however I am unabel to see cancel / change plans views on my end.</p>\n<p>Their support is super slow. They mentioned it's partially received data, however when I purchase the subscription paddle webhooks successfully send notifications into my local environment (to ngrok). Meaning my auth keys and everything else is correct.</p>\n<p>my SparkServiceProvider.php is</p>\n<pre><code>&lt;?php\n\nnamespace App\\Providers;\n\nuse App\\Models\\User;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\ServiceProvider;\nuse Illuminate\\Validation\\ValidationException;\nuse Spark\\Plan;\nuse Spark\\Spark;\n\n\nclass SparkServiceProvider extends ServiceProvider\n{\n /**\n * Bootstrap any application services.\n */\n public function boot(): void\n {\n Spark::billable(User::class)-&gt;resolve(function (Request $request) {\n return $request-&gt;user();\n });\n\n Spark::billable(User::class)-&gt;authorize(function (User $billable, Request $request) {\n return $request-&gt;user() &amp;&amp;\n $request-&gt;user()-&gt;id == $billable-&gt;id;\n });\n\n Spark::billable(User::class)-&gt;checkPlanEligibility(function (User $billable, Plan $plan) {\n // if ($billable-&gt;projects &gt; 5 &amp;&amp; $plan-&gt;name == 'Basic') {\n // throw ValidationException::withMessages([\n // 'plan' =&gt; 'You have too many projects for the selected plan.'\n // ]);\n // }\n });\n }\n}\n</code></pre>\n<p>and User model:</p>\n<pre><code>&lt;?php\n\nnamespace App\\Models;\n\n// use Illuminate\\Contracts\\Auth\\MustVerifyEmail;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Foundation\\Auth\\User as Authenticatable;\nuse Illuminate\\Notifications\\Notifiable;\nuse LaraZeus\\Bolt\\Models\\Concerns\\BelongToBolt;\nuse Spark\\Billable;\n\n\nclass User extends Authenticatable\n{\n /** @use HasFactory&lt;\\Database\\Factories\\UserFactory&gt; */\n use Billable, HasFactory, Notifiable;\n\n /**\n * The attributes that are mass assignable.\n *\n * @var list&lt;string&gt;\n */\n protected $fillable = [\n 'name',\n 'email',\n 'password',\n ];\n\n /**\n * The attributes that should be hidden for serialization.\n *\n * @var list&lt;string&gt;\n */\n protected $hidden = [\n 'password',\n 'remember_token',\n ];\n\n /**\n * Get the attributes that should be cast.\n *\n * @return array&lt;string, string&gt;\n */\n protected function casts(): array\n {\n return [\n 'email_verified_at' =&gt; 'datetime',\n 'password' =&gt; 'hashed',\n ];\n }\n}\n</code></pre>\n<p>Thank you!</p>\n<p><a href="https://i.sstatic.net/oIcv90A4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/oIcv90A4.png" alt="Laravel Spark Subscription page" /></a></p>\n"^^ . + "I'm sorry. I have edited question."^^ . + . + . + "I tried creating a $vehicle_id = $_GET['vehicle_id']; but then my calendar stops showing on page reload"^^ . + . + . + "2"^^ . + "0"^^ . + . + "@C3roe Of course, that was it. Can you turn that into an answer so that I can accept it?"^^ . + . + "nginx-reverse-proxy"^^ . + . + "i already check all the params and settings and they are all fine but when I add the actual operator "add,set,snapshot" it still gives the error."^^ . + . + "@PaulT. My laptop is running on Windows 11, yes it had something to do with the port. I tried changing the MySQL port of XAMPP from 3306 to 3307, but with no avail. I no longer have the error logs, because I uninstalled XAMPP.\nPrior to this there was a warning popping up during the first step of of installing the software saying: "Important! Because an activated User Account Control (UAC) on your system some functions of XAMPP are possibly restricted. With UAC please avoid to install XAMPP to C:\\Program Files (missing write permissions). Or deactivate UAC with msconfig after this setup."."^^ . + . + . + "[What do you mean "It doesn't work"?](https://meta.stackexchange.com/questions/147616/what-do-you-mean-it-doesnt-work)"^^ . + "Well, that's strange, I just tested it with PHP 8.2 on Windows 10 and it worked..."^^ . + "Since the issue appears to be with wkhtmltopdf itself, an easy workaround should be to use a "safe" file name - and then simply rename that resulting file to the desired name using PHP afterwards."^^ . + . + . + . + . + . + "tailwind-css"^^ . + "4"^^ . + . + . + . + . + "@hakre, the answer that you provided below fixed my issue! thanks a lot, cheers!"^^ . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + "1"^^ . + . + . + "i manage to add records on Authentication but somehow on Firestore still returning the same error on set function."^^ . + . + "1"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + "http-status-code-503"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + "wordpress-theme-astra"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + "@AlwaysLearning this isn't a SQL Server issue. There shouldn't be any conversion, that's 10000% a Laravel bug. Date types are binary. Date parameters are binary, they have no format. It's *Laravel* that converts dates to strings instead of using proper parameters. PHP was notorious for such bugs over a decade ago, that allowed widespread SQL injection hacks, as the first data libraries didn't allow (server-bound) parameters. *Maybe, maybe* the bug would be justified if Laravel used an old FreeTDS version that didn't support parameters, but ODBC *always* supported them"^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + "2"^^ . + "2"^^ . + . + . + . + "-1"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + . + "2"^^ . + "If you're selling your software, 1) it makes no commercial sense whatsoever to take the burden of this sort of thing onto yourself, when someone else has already solved the problem. All you need to do is check the license of 3rd party libraries is compatible with your intended distribution model. 2) if I was a customer scrutinising your process I'd quite frankly be horrified to learn that you've ditched proven software in favour of a DIY solution in which - with all due respect and I'd be the same - you have a fraction of the knowledge of the experts who created the well-known library."^^ . + . + . + "0"^^ . + "1"^^ . + . + "<p>Working on a dwh frontend I'm looking at an option to sensibly compare certain time periods with previous years.</p>\n<p>My customer wants to be able to</p>\n<ol>\n<li>select a certain time period (which are two dates principly)</li>\n<li>compare this with the same period in last year and the year before that.</li>\n</ol>\n<p>I'm not looking for sql suggestions how to select and aggregate numbers for a certain period, I can handle that. Only how to select dates in certain circumstances.</p>\n<p>Currently frontend allows to select a time period by selecting a startdate and an enddate with presets for current month, current quarter, ytd, last year and so on. Works but where it gets messy is dear old Februar.</p>\n<p>Its March so when selecting previous month frontend does a: <code>1.2.2025 to 28.2.2025</code>. Fine. Backend should adjust this to <code>1.2.2024 to 29.2.2024</code> and <code>1.2.2023 to 28.2.2023</code> for last years comparison.</p>\n<p>Is there generic way to do this? Or do I end up with calculating if either year <a href="https://www.php.net/manual/en/intlgregoriancalendar.isleapyear.php" rel="nofollow noreferrer">is a leap year</a> and adjust?</p>\n"^^ . + . + . + "0"^^ . + . + . + "PHP - Download the list of files (or metadata?) of a torrent from a magnet URI / URL / Link?"^^ . + . + . + "@TUPKAP Thanks, I removed json_encode and now everything seems to work perfectly."^^ . + . + "<p>I made a code for woocommerce product listings with ajax load more by scroll and ajax filters by category - all works great, but there is one case, when it didn't. Only on the main shop page when I select two or more categories in filter after I get first set of products and try to scroll down to start loading I get nothing more - it send ajax request and get no result - the same action on category listing works great. Filtering by single category works great on both pages. Below is the php code called by ajax load more request, maybe you can help me with this, after two days I have no more idea how to fix that.</p>\n<pre><code>function mev_load_more_products() {\n $args = json_decode(stripslashes($_POST['query']), true);\n $args['paged'] = $_POST['page'] + 1;\n $args['post_status'] = 'publish';\n $query = new WP_Query($args);\n if ($query-&gt;have_posts()) {\n while ($query-&gt;have_posts()) {\n $query-&gt;the_post();\n get_template_part('woocommerce/content', 'product');\n }\n }\n die();\n}\nadd_action('wp_ajax_load_more_products', 'mev_load_more_products');\nadd_action('wp_ajax_nopriv_load_more_products', 'mev_load_more_products');\n</code></pre>\n<p>And this is JS code sending request to this action:</p>\n<pre><code>let currentPage = catalog_params.current_page;\nlet queryVars = catalog_params.query_vars;\nconst productList = $('.catalog-page-list');\n$(window).scroll(function () {\n if ($(document).scrollTop() &gt; ($(document).height() - 2000)) {\n let data = {\n 'action' : 'load_more_products',\n 'query' : queryVars,\n 'page' : currentPage\n };\n $.ajax({\n url: woocommerce_params.ajax_url,\n data: data,\n method: 'POST',\n success: function(data) {\n if (data) {\n productList.find('.product-card:last-of-type').after(data);\n currentPage++;\n }\n }\n });\n }\n});\n</code></pre>\n<p>This is JS code filtering products list using data from form:</p>\n<pre><code>const defaultQueryVars = catalog_params.query_vars;\nlet formData = $('#catalog-filters').serializeArray();\nlet filterData = {\n 'action' : 'filter_products',\n 'filters' : {},\n 'query' : defaultQueryVars\n};\nformData.forEach(item =&gt; {\n if (item.name.endsWith('[]')) {\n if (!filterData.filters[item.name]) {\n filterData.filters[item.name] = [];\n }\n filterData.filters[item.name].push(item.value);\n } else {\n filterData.filters[item.name] = item.value;\n }\n});\n\n$.ajax({\n url: woocommerce_params.ajax_url,\n data: filterData,\n method: 'POST',\n success: function(data) {\n productList.html(data.html);\n currentPage = 1;\n queryVars = data.query_vars;\n }\n});\n</code></pre>\n<p>And action for filtering:</p>\n<pre><code>function mev_filter_products() {\n $args = json_decode(stripslashes($_POST['query']), true);\n $args['paged'] = 1;\n if (isset($_POST['filters'])) {\n $filters = $_POST['filters'];\n if (!isset($args['tax_query'])) {\n $args['tax_query'] = [];\n }\n if (isset($filters['category'])) {\n $args['tax_query'][] = [\n 'taxonomy' =&gt; 'product_cat',\n 'field' =&gt; 'slug',\n 'terms' =&gt; $filters['category'],\n 'operator' =&gt; 'IN',\n ];\n }\n }\n $query = new WP_Query($args);\n ob_start();\n if ($query-&gt;have_posts()) {\n while ($query-&gt;have_posts()) {\n $query-&gt;the_post();\n get_template_part('woocommerce/content', 'product');\n }\n }\n $html = ob_get_clean();\n ob_end_clean();\n wp_send_json([\n 'query_vars' =&gt; json_encode($query-&gt;query_vars),\n 'html' =&gt; $html,\n ]);\n die();\n}\nadd_action('wp_ajax_filter_products', 'mev_filter_products');\nadd_action('wp_ajax_nopriv_filter_products', 'mev_filter_products');\n</code></pre>\n<p>As I mentioned it all works great if I open product category page, but for main shop page works only if I do not choose two categories in filters.</p>\n<p>For complete this is how I load JS file with params:</p>\n<pre><code>wp_register_script('kp-product-catalog', get_template_directory_uri() . '/js/product-catalog.js', ['jquery', 'woocommerce'], time(), true );\nif (is_shop() || is_product_category() || is_product_tag() || is_tax('seria') || is_tax('product_brand')) {\n global $wp_query;\n wp_localize_script( 'kp-product-catalog', 'catalog_params', array(\n 'query_vars' =&gt; json_encode($wp_query-&gt;query_vars),\n 'current_page' =&gt; get_query_var('paged') ? get_query_var('paged') : 1,\n ));\n wp_enqueue_script('kp-product-catalog');\n}\n</code></pre>\n"^^ . + . + "<h3>TailwindCSS v4</h3>\n<p><code>blocklist</code> avaliable from <strong>v4.0.0</strong> or higher.</p>\n<p>The <code>blocklist</code> setting added to the legacy JavaScript-based configuration in PR #14556, but it did not receive retroactive support in v3.</p>\n<ul>\n<li><a href="https://github.com/tailwindlabs/tailwindcss/compare/v4.0.0-alpha.25...v4.0.0-alpha.26" rel="nofollow noreferrer">Changelog: What's change in release v4.0.0-alpha.26</a></li>\n<li><a href="https://github.com/tailwindlabs/tailwindcss/pull/14556" rel="nofollow noreferrer"><code>tailwindlabs/tailwindcss</code> PR #14556: Add blocklist support from v3 config files</a></li>\n</ul>\n<h3>TailwindCSS v3</h3>\n<p><code>blocklist</code> avaliable from v3.2.4 or higher and fixed from <strong>v3.2.5</strong> or higher.</p>\n<p>The blocklist itself was introduced in v3 in PR #9812. It was released in v3.2.4 on November 11, 2022. So you need at least version v3.2.4.</p>\n<ul>\n<li><a href="https://github.com/tailwindlabs/tailwindcss/compare/v3.2.3...v3.2.4" rel="nofollow noreferrer">Changelog: What's change in release v3.2.4</a></li>\n<li><a href="https://github.com/tailwindlabs/tailwindcss/pull/9812" rel="nofollow noreferrer"><code>tailwindlabs/tailwindcss</code> PR #9812: Allow users to block generation of certain utilities</a></li>\n</ul>\n<p>However, its type was omitted from the TypeScript Config type, which was later added in PR #10239 in the v3.2.5 release.</p>\n<ul>\n<li><a href="https://github.com/tailwindlabs/tailwindcss/compare/v3.2.4...v3.2.5" rel="nofollow noreferrer">Changelog: What's change in release v3.2.5</a></li>\n<li><a href="https://github.com/tailwindlabs/tailwindcss/pull/10239" rel="nofollow noreferrer"><code>tailwindlabs/tailwindcss</code> PR #10239: Fix missing blocklist type</a></li>\n</ul>\n<h3>Conclusion</h3>\n<p>I believe your installed Tailwind CSS version might be 3.2.4 (or lower), where the blocklist type was still incorrect.</p>\n<p>Although <a href="https://stackoverflow.com/questions/79520965/tailwindcss-postcss-build-error-cannot-read-properties-of-undefined-reading-b#comment140239455_79520966">you mentioned in a comment that you think you're using v4.0.14</a>, that's impossible. From your configuration file, it's clear that the installed version is v3.</p>\n<blockquote>\n<pre class="lang-js prettyprint-override"><code>const tailwindcss = require('tailwindcss');\n</code></pre>\n</blockquote>\n<p>The <a href="https://stackoverflow.com/q/79520965/15167500">quoted code snippet</a> is a typical v3 installation. Starting from v4, a separate PostCSS package was released under the name <code>@tailwindcss/postcss</code>. From v4 onwards, you should install Tailwind CSS into the mix using this package, so it's likely that you're mistaken in thinking you're using v4.</p>\n<p>To install the latest v3 version of Tailwind CSS, but at least v3.2.5, use the following command:</p>\n<pre class="lang-none prettyprint-override"><code>npm install tailwindcss@^3.2.5\n</code></pre>\n<p>If the command fails, npm will likely provide information about which dependency is preventing the installation of this version of TailwindCSS. It's likely that some dependency is restricting you to a lower version instead of the latest v3.</p>\n<p>Installing the stable v4 would require a full migration, for which you can follow the migration guide. But again, that solving the problem does not require a v4 migration, as installing v3.2.5 is sufficient to resolve the issue.</p>\n<ul>\n<li><a href="https://tailwindcss.com/docs/upgrade-guide" rel="nofollow noreferrer">Upgrade guide</a> - TailwindCSS v3 to v4 Docs</li>\n<li><a href="https://stackoverflow.com/a/79383884/15167500">What changed from v4 onwards?</a> - StackOverflow</li>\n</ul>\n"^^ . + . + "2"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + "1"^^ . + . + "2"^^ . + "@hakre The inheritance tree is not as straightforward as my *contrived* example. There are cases of `ServiceA extends ExteneralAnother extends ExternalDependency` and `ServiceB extends ExternalYetAnother extends ExternalDependency`. I don't want to create base classes for `ExteneralAnother ` and `ExternalYetAnother`."^^ . + . + . + . + "0"^^ . + . + "1"^^ . + . + "<p>How can I set a default banner image in the file uploader?</p>\n<p>I'm using Laravel's Filament <code>FileUpload</code> component, and I want to display a default banner image when the page loads. If the user uploads a new image, it should replace the default. However, if no image is uploaded, the default banner image should remain.</p>\n<p>I've tried using the <code>default()</code> method and the <code>formatStateUsing()</code> function, but neither seems to work:</p>\n<pre class="lang-php prettyprint-override"><code>Forms\\Components\\FileUpload::make('banner')\n -&gt;disk('banner')\n -&gt;directory('banner')\n -&gt;image()\n -&gt;imageEditor()\n -&gt;maxSize(3072) // 3MB limit\n -&gt;acceptedFileTypes(['image/jpeg', 'image/png', 'image/webp'])\n -&gt;formatStateUsing(fn($state) =&gt; $state ?? ['banner/banner.png']) // Default banner image\n -&gt;validationMessages([\n 'banner.dimensions' =&gt; __('validationBannerDimensions'),\n 'banner.max' =&gt; __('validationBannerMax'),\n ])\n -&gt;rules([\n 'dimensions:min_width=500,min_height=500,max_width=1000,max_height=1000'\n ])\n -&gt;helperText(__('validationBannerHelperMsg')),\n</code></pre>\n<p>How to set the default image so that it appears when the form loads?</p>\n"^^ . + . + . + "0"^^ . + . + . + "<p>I am trying to insert data into a mysql table (named manufacturers) with the following configuration settings:</p>\n<blockquote>\n<p><code>mysql:host=localhost;dbname=administration;charset=utf8mb4;collation=utf8mb4_0900_ai_ci;port=3306</code></p>\n</blockquote>\n<p>I get:</p>\n<blockquote>\n<p>SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\\xE9 Panh...' for column 'CEO' at row 1</p>\n</blockquote>\n<p>The field value for CEO is shown below</p>\n<p>Ren� Panhard, �mile Levassor, and Belgian lawyer Edouard Sarazin</p>\n<p>If I remove the accented characters and replace them with an &quot;e&quot;, everything works fine.</p>\n<p>Everything I've read says its a problem with the collation. However, all the variables appear to be set identically. I've tried SET NAMES, modifying the connect dsn, rebuilding the table, but it just doesn't work. I am using PHP 8 and MySQL 8. All the fixes in the &quot;similar&quot; list are for old outdated versions of PHP and MySql.</p>\n<p>At the point of insertion, the following settings are in place.</p>\n<p>Outputting schema collation:</p>\n<pre><code>administration utf8mb4 utf8mb4_0900_ai_ci\n</code></pre>\n<p>Outputting session variables</p>\n<pre><code>character_set_client utf8mb4\ncharacter_set_connection utf8mb4\ncharacter_set_results utf8mb4\ncollation_connection utf8mb4_0900_ai_ci\n</code></pre>\n<p>session collation variables:</p>\n<pre><code>collation_connection utf8mb4_0900_ai_ci\ncollation_database utf8mb4_0900_ai_ci\ncollation_server utf8mb4_0900_ai_ci\n</code></pre>\n<p>session character_set:</p>\n<pre><code>character_set_client utf8mb4\ncharacter_set_connection utf8mb4\ncharacter_set_database utf8mb4\ncharacter_set_filesystem binary\ncharacter_set_results utf8mb4\ncharacter_set_server utf8mb4\ncharacter_set_system utf8mb3\ncharacter_sets_dir C:\\Program Files\\MySQL\\MySQL Server 8.0\\share\\charsets\\\n</code></pre>\n<p>manufacturer table info</p>\n<p>Table info:</p>\n<pre><code>manufacturer utf8mb4_0900_ai_ci\n</code></pre>\n<p>outputting table column info</p>\n<p>Table info:</p>\n<pre><code>manufacturer address1 utf8mb4_0900_ai_ci\nmanufacturer address2 utf8mb4_0900_ai_ci\nmanufacturer CEO utf8mb4_0900_ai_ci\nmanufacturer city utf8mb4_0900_ai_ci\nmanufacturer country utf8mb4_0900_ai_ci\nmanufacturer dateadded \nmanufacturer emailaddress utf8mb4_0900_ai_ci\nmanufacturer endyear utf8mb4_0900_ai_ci\nmanufacturer lastupdated \nmanufacturer Lastupdatedby utf8mb4_0900_ai_ci\nmanufacturer mfrid \nmanufacturer modelyr utf8mb4_0900_ai_ci\nmanufacturer name utf8mb4_0900_ai_ci\nmanufacturer phone utf8mb4_0900_ai_ci\nmanufacturer postalcd utf8mb4_0900_ai_ci\nmanufacturer stateorprovince utf8mb4_0900_ai_ci\nmanufacturer wwwaddress utf8mb4_0900_ai_ci\n</code></pre>\n"^^ . + . + . + "Ok thanks I’ll do that"^^ . + . + "@CarloC: Yes, this is the mental model that worked well for me. I've stumbled a bit in my archives and dug up this piece from 2010: [_References to the Max_ (hakre on wordpress)](https://hakre.wordpress.com/2010/02/18/references-to-the-max/ "References to the Max - It’s somehow hard to understand. PHP Variables and how they do References to the according data."). May have some link rot but archive.org may help, have not checked it in and out, but if you're in for a read, it may give you some more infos and resources. I think the phpinternals book referenced in comments above is a good ref."^^ . + . + "@Your Common Sense: I understand, and is where I need some help to get too, just apply what is available to me"^^ . + . + . + "<p><a href="https://laravel.com/docs/11.x/collections#method-collapse" rel="nofollow noreferrer">Collapse</a> before group:</p>\n<pre><code>$groupingline = collect($linedata)-&gt;collapse()-&gt;groupBy('id')-&gt;values()-&gt;all();\n</code></pre>\n"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + "Divide a multi-language string into its two parts (Korean and English)"^^ . + . + "1"^^ . + "google-drive-api"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + "I think reinstalling php will be a good approach then."^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + "1"^^ . + . + "0"^^ . + . + . + "Have added an edit as am getting data returned now although its not restricting to lines where it has HP: 0"^^ . + . + . + . + . + . + . + . + . + "then you have two option, upload the image in the background process meaning via process and queue or you can also you use a jquery image cropper which will reduce the image size before uploading it.\n\nthanks"^^ . + . + "<p>I have a way of doing an Excel export from mysql which works well and effectively, however, one of the tables contain decoded/encoded rich text with emojis. When I run the export, it shows the encoded data just like that from the database.</p>\n<p>I can get it to show correctly when displaying in HTML using <code>htmlspecialchars_decode()</code> and <code>html_entity_decode()</code>. I don't mind the emojis being encoded in the export but all the other special characters like (<code>' 'n ë ê - ! &quot;</code>) must export as it displays in HTML.</p>\n<p>How can I go about decoding the rich text for the excel?</p>\n<p>I also tried writing a query that takes the rich text data, encodes it and insert it into a temporary table with how it should look in the export and then run the export query from the temporary table. But I can't get it to show without the encoding even in the temporary table.</p>\n<p>The export works fine its just that the content in column2 is rich text and looks like this in the database:</p>\n<pre><code>&amp;amp;lt;p&amp;amp;gt;LET us try this &amp;amp;amp;#39;n export&amp;amp;lt;/p&amp;amp;gt;\n</code></pre>\n<p>It should look like this:</p>\n<pre><code>LET us try this 'n export \n</code></pre>\n<p>This is how the export query looks:</p>\n<pre><code>$sql10 = &quot;SELECT column1, column2, column3\nFROM table_x \nWHERE column1 LIKE 'test' AND column4 = '1'&quot;; \n\n\n$result = $conn-&gt;query($sql10);\n\nif(mysqli_num_rows($result) &gt; 0)\n{\n while($row = mysqli_fetch_assoc($result))\n {\n $data[] = $row; \n }\n\n $response = [];\n $response['data'] = $data;\n}\n\n$hd1 = [['column1', 'column2', 'column3' ]];\n$arm = array_merge($hd1, $data);\n \n$xlsx = Shuchkin\\SimpleXLSXGen::fromArray( $arm );\n$xlsx-&gt;saveAs(Export_test.xlsx');\n</code></pre>\n"^^ . + "middleware"^^ . + "1"^^ . + "1"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + "Youre most likely doing something wrong? have you tried deleting the template layout? `php artisan livewire:layout`. Also I will suggest updating the question above will more of your codes including the routing codes\n`"^^ . + . + . + . + . + . + . + "3"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + "product"^^ . + . + . + "<p>Im trying with this code:</p>\n<pre><code>$playlistId = &quot;YOUR_PLAYLIST_ID&quot;; // Replace with your actual Playlist ID\n$playlistItem = new Google\\Service\\YouTube\\PlaylistItem();\n$playlistItemSnippet = new Google\\Service\\YouTube\\PlaylistItemSnippet();\n$playlistItemSnippet-&gt;setPlaylistId($playlistId);\n$playlistItemSnippet-&gt;setResourceId(new Google\\Service\\YouTube\\ResourceId([\n 'kind' =&gt; 'youtube#video',\n 'videoId' =&gt; $videoId\n]));\n\n$playlistItem-&gt;setSnippet($playlistItemSnippet);\n$response = $youtube-&gt;playlistItems-&gt;insert('snippet', $playlistItem);\n</code></pre>\n<p>but the video doesnt get the playlist, there is not error nor exception, and response is a Guzzle typed.</p>\n"^^ . + "when I call the /test route, the entire connection breaks, and even routes that were working before stop responding. The terminal does not indicate any shutdown, but the browser gives ERR_CONNECTION_REFUSED. I have to restart the server to restore functionality. @hakre"^^ . + . + . + . + . + . + . + . + . + . + . + "<p>I am testing the Pi Network API and have initiated an app_to_user payment. It has successfully passed the first stage.</p>\n<p>Here is the response from the Pi server:</p>\n<pre><code>{\n &quot;identifier&quot;: &quot;Emk9m2XYquidn4aETMhRfGqQPeGi&quot;,\n &quot;user_uid&quot;: &quot;user uuid&quot;,\n &quot;amount&quot;: 1.0,\n &quot;memo&quot;: &quot;A2U Payment&quot;,\n &quot;metadata&quot;: {\n &quot;test&quot;: 1234\n },\n &quot;from_address&quot;: &quot;APP WALLET ADDRESS&quot;,\n &quot;to_address&quot;: &quot;USER WALLET ADDRESS&quot;,\n &quot;direction&quot;: &quot;app_to_user&quot;,\n &quot;status&quot;: {\n &quot;developer_approved&quot;: true,\n &quot;transaction_verified&quot;: false,\n &quot;developer_completed&quot;: false,\n &quot;cancelled&quot;: false,\n &quot;user_cancelled&quot;: false\n },\n &quot;transaction&quot;: {\n &quot;txid&quot;: &quot;ec7106f1bc5ec78994f0fb2a68eef2129e47cee76a0c1ab321be8c49df1bda16&quot;,\n &quot;verified&quot;: false,\n &quot;_link&quot;: &quot;https://api.testnet.minepi.com/transactions/ec7106f1bc5ec78994f0fb2a68eef2129e47cee76a0c1ab321be8c49df1bda16&quot;\n },\n &quot;created_at&quot;: &quot;2025-03-01T05:34:40.772Z&quot;,\n &quot;network&quot;: &quot;Pi Testnet&quot;\n}\n</code></pre>\n<p>According to the API logic, after creating a payment (<code>app_to_user</code> or <code>user_to_app</code>), it must be <code>completed</code> to finalize the transaction on the server.</p>\n<p>The API documentation provides the following endpoint to complete the payment from the server using an API key:</p>\n<pre><code>POST api.minepi.com/v2/payments/{payment_id}/complete\n</code></pre>\n<p>However, when I send this request, the server returns the following response:</p>\n<pre><code>{\n &quot;error&quot;: &quot;verification_failed&quot;,\n &quot;verification_error&quot;: &quot;payment_already_linked_with_a_tx&quot;\n}\n</code></pre>\n<p>Additionally, I checked my Pi Browser wallet, and there is no pending payment to accept. The balance remains unchanged, and I still have an unfinished payment, as the system does not allow me to create a new one.</p>\n<p>Meanwhile, <code>user_to_app</code> payments work correctly.</p>\n<ol>\n<li>Tried completing the payment from the server using <code>POST</code> <code>/payments/{payment_id}/complete</code>, but got the error <code>payment_already_linked_with_a_tx</code>.</li>\n<li>Checked Pi Browser wallet—there was no transaction to accept, and my balance was unchanged.</li>\n<li>Tried creating a new payment, but the system says I still have an unfinished transaction.</li>\n<li>Considered completing the payment from the client side using the Pi JS SDK, but found no such functionality in the documentation.</li>\n</ol>\n<p>Has anyone encountered this issue? Maybe someone else has tested this API?</p>\n<p>Here is the official <a href="https://pi-apps.github.io/community-developer-guide/docs/gettingStarted/quickStart/" rel="nofollow noreferrer">documentation</a>:</p>\n"^^ . + . + . + "2"^^ . + "<p>I found a good-enough solution to fix my particular problem but I'll change the accepted answer if someone provides a workable phpdoc for the given code structure, which I still feel should be possible and preferred.</p>\n<p>In the meantime my fix is to simply remove the <code>State</code> type-hint.</p>\n<pre><code> return State::all()\n -&gt;map(fn ($state) =&gt; (object) [\n 'value' =&gt; $state-&gt;id,\n 'label' =&gt; $state-&gt;name,\n ])\n -&gt;sortBy('label')\n -&gt;prepend((object) [\n 'value' =&gt; null,\n 'label' =&gt; '',\n ])\n ;\n</code></pre>\n<p>The assumption that <code>id</code> is an integer and only an integer seems to stem from a deeper assumption about Laravel Models. Our <code>State</code> class does <strong>not</strong> declare <code>id</code> in code or PHPDoc in any way, but type-hinting it still has PHPStan assuming <code>int</code>.</p>\n<p>This is a frustrating fix since I like to type-hint, but I've spent enough time trying to find the better solve.</p>\n"^^ . + "0"^^ . + "0"^^ . + . + "2"^^ . + "@Crunchip this is exactly what I already suggested in the first comment"^^ . + "Why do you need to use `->value` with enum?"^^ . + . + "https://3v4l.org/B5ONX perhaps serves to illustrate the point a little bit."^^ . + . + . + . + "<p>I'm facing a problem that someone already faced but he did not receive an answer here : <a href="https://stackoverflow.com/questions/78854769/elementor-loop-grid-widget-post-taxonomy-get-queried-object-of-the-taxonom">Elementor Loop Grid widget &gt; post taxonomy | get_queried_object() of the taxonomy iteration</a></p>\n<p><strong>To be clear, I try to filter posts with a server filtering to show only posts included in a chosen taxonomy in a loop grid list of taxonomies.</strong></p>\n<p>Indeed, in a loop grid that displays the sub taxonomies of the current archive taxonomy, using this code :</p>\n<pre><code>function get_taxonomy_children( $args, $settings, $display_settings ) {\n if ( isset( $settings['term_taxonomy_id'] ) &amp;&amp; $settings['term_taxonomy_id'] === 'taxonomy_children' ) {\n $args['term_taxonomy_id'] = '';\n\n $current_term = get_queried_object();\n\n if ( isset( $current_term-&gt;term_id ) ) {\n $args['parent'] = $current_term-&gt;term_id;\n }\n }\n return $args;\n}\nadd_filter( 'elementor/loop_taxonomy/args', 'get_taxonomy_children', 20, 3 );\n</code></pre>\n<p>I then want to show in each element of the category the list of posts associated to this taxonomy.</p>\n<p>For example, I have a page which is the archive of the Africa element in my &quot;places&quot; custom taxonomy. Thanks to the previous function, it iterates and gives the ned elements in the loop grid : the direct children of Africa, being Senegal, Ivory Coast, Kenya etc. Then, the goal is to show all the posts in each of these elements. For this, I created a loop grid/post list in elementor, directly nested in the loop grid element of my first sub taxonomy loop grid, and wanted to filter it in server with a function like the one I used before.</p>\n<p>However, it seems that the term id of the looped items cannot be accessed, even after multiple tries :</p>\n<ul>\n<li>If I use the function <code>get_queried_object</code>, the queried object is always Africa for each element of the loop, instead of being Senegal, Ivory Coast etc.</li>\n<li>And if I try things like <code>get_the_terms(get_the_ID(), 'places')</code> or things like that, it instead gets all the taxonomies of the first post of the list, which is always the first element of a sorted post list on Africa, so again it fails.</li>\n<li>Then I tried to pass it with Elementor dynamic content to a shortcode to render then my second loop grid directly with code, but I can't find term ID in the dynamic variables and I don't know if there is a way to properly pass it natively with things like this <code>{{term_id}}</code> or other.</li>\n</ul>\n<p>Then, how to properly get the term ID of the loop object?</p>\n<p>I haven't found any solution yet.</p>\n"^^ . + "Adding page number to shortcodes in wordpress?"^^ . + "caddyfile"^^ . + . + "@bricas30, it sounds like a compatibility issue - each SQL Server database has it's own `COMPATIBILITY_LEVEL` which affects how that database can work. What does `SELECT NAME, COMPATIBILITY_LEVEL FROM sys.databases` return for your database? This example is tested with SQL Server 2017, PHP 7.1 and Microsoft PHP Driver for SQL Server 4.3."^^ . + . + "0"^^ . + "1"^^ . + "2"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + "I don't got it sorry, let take an example : \n\nIs a user is navigating to https://malicious.com. That website try to send a request to my laravel server to delete the account of the authenticated user. It won't work because that request will be treats by laravel as a stateless request, so the auth:sanctum middleware would send an "unauthenticated" message.\n\nBy the way, Laravel verify the CSRF token only for the domain that are listed in SANCTUM_STATEFUL_DOMAINS, it it not the case of malicious.com."^^ . + "sublimetext3"^^ . + . + . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + "When you convert PHP `null` to a string, it becomes an empty string, not a SQL `NULL` literal. You should be using prepared statements, not concatenating strings."^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + "2"^^ . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + "Docker, PHP and stream_socket_client: connection timeout"^^ . + . + "<p>The intelephense tells me that I have an undefined method which is 'userCoolPosts' from routes/web.php, but as you can see below, the method exists in the User.php from app/Models folder. Upon testing my project, the method is working fine but the error in the console persists.</p>\n<p><strong>web.php</strong></p>\n<pre><code>Route::get('/', function () {\n $posts = [];\n if (Auth::check()) {\n $posts = Auth::user()-&gt;usersCoolPosts()-&gt;latest()-&gt;get();\n }\n return view('home', ['posts' =&gt; $posts]);\n});\n</code></pre>\n<p><strong>User.php from app/Models folder</strong></p>\n<pre><code> protected function casts(): array\n {\n return [\n 'email_verified_at' =&gt; 'datetime',\n 'password' =&gt; 'hashed',\n ];\n }\n\n public function usersCoolPosts()\n {\n return $this-&gt;hasMany(Post::class, 'user_id');\n }\n}\n</code></pre>\n<p>I did reindex Intelephense (index workspace), and still the error persists.</p>\n"^^ . + . + "@AlwaysLearning i see, but that still means laravel sends strings into db that are converted to datetime(2)? It seems that this is a bit brittle, since it still has dependency on date format?"^^ . + . + "So `stackoverflow.com` will see only `Google.com` . it can't see my website?"^^ . + "0"^^ . + . + . + "1"^^ . + "Symfony 7 ERR_TOO_MANY_REDIRECTS error on login"^^ . + "0"^^ . + . + . + "Cryptographically relating database records"^^ . + . + . + . + . + "Thank for help.Just check epel is installed already"^^ . + . + . + "1"^^ . + . + . + "@Ammar what answer were you planning to provide? The rest of us feel that the question isn't clear enough to provide a sufficiently specific answer."^^ . + "2"^^ . + . + . + "@KevInSol: I thought that /usr/local/lib/pkgconfig would be searched by default\nbut what if you do `PKG_CONFIG_PATH=/usr/local/lib/pkgconfig\npkg-config --modversion libjpeg`?"^^ . + . + . + "1"^^ . + "1"^^ . + . + . + . + . + "I suppose it's a documentation problem and you can just submit a pull request calling them not types but return type declarations"^^ . + . + . + "I use Windows WSL. I have a distro dedicated exclusively to PHP and web development. There, I can easily switch between Node and PHP versions without depending on my operating system. Since the WSL distro can be easily backed up and moved to a new Windows machine without any installation, I no longer need to configure my development software - database manager, PHP manager, Node manager - ever again."^^ . + . + . + "0"^^ . + . + "PHPMYADMIN I can't log in. Constant PhpMyAdmin\\E_STRICT is deprecated"^^ . + . + . + "0"^^ . + . + . + . + "Invalid backend response. Error occurred on the server side. HTTP error 500"^^ . + "I would recommend reading through this: https://wordpress.stackexchange.com/a/350596/12496"^^ . + "<p>I am using Laravel Breeze to handle profile updates, and I have added functionality to allow users to update their avatar. Everything works fine, but the issue is that when a user uploads a new avatar, the old one isn't deleted from the filesystem.</p>\n<p>I store avatars in storage/app/public/avatars/ and use php artisan storage:link to make them accessible. Here is my update method:</p>\n<pre><code>public function update(ProfileUpdateRequest $request): RedirectResponse\n{\n $request-&gt;user()-&gt;fill($request-&gt;validated());\n\n if ($request-&gt;user()-&gt;isDirty('email')) {\n $request-&gt;user()-&gt;email_verified_at = null;\n }\n\n if ($request-&gt;hasFile('avatar')) {\n // Attempt to delete the old avatar\n Storage::disk('public')-&gt;delete('avatars/' . $request-&gt;user()-&gt;avatar);\n \n $file = $request-&gt;file('avatar');\n $fileName = Str::uuid() . '.' . $file-&gt;getClientOriginalExtension();\n $file-&gt;storeAs('avatars', $fileName, 'public');\n\n $request-&gt;user()-&gt;avatar = $fileName;\n }\n\n $request-&gt;user()-&gt;save();\n\n return Redirect::route('profile.edit');\n}\n\n</code></pre>\n<p>However, after uploading a new avatar, the old avatar remains in the storage/app/public/avatars/ directory instead of being deleted.</p>\n<p>What I’ve tried:</p>\n<blockquote>\n<p>Checked that <code>Storage::disk('public')-&gt;delete('avatars/' . $request-&gt;user()-&gt;avatar);</code> runs before the new file is stored.\nVerified that the file exists in storage/app/public/avatars/ before deleting.\nDebugged with <code>dd(Storage::disk('public')-&gt;exists('avatars/' . $request-&gt;user()-&gt;avatar));</code> before the delete call.\nConfirmed that <code>$request-&gt;hasFile('avatar') returns true</code>, so the condition is being met.\nRemoved everything from the function and tested only deletion:</p>\n</blockquote>\n<pre><code>dd(Storage::disk('public')-&gt;delete('avatars/' . $request-&gt;user()-&gt;avatar));\n</code></pre>\n<p>In this case, the avatar was successfully deleted, which makes this issue even stranger.</p>\n<p>Questions:\nWhy isn't the old avatar getting deleted in the full function?\nCould there be a reason why Storage::delete() works in isolation but not when used before storing a new file?\nHow can I ensure that the old avatar is properly removed before saving the new one?\nAny insights would be greatly appreciated!</p>\n"^^ . + . + "i make all u mention and still have same problem"^^ . + "Exclude products from specific category for free shipping min amount in WooCommerce"^^ . + "@AlexHowansky You were right. Somehow a Heredoc went awry."^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + "The direct answer is that you need to make the php interpreter process the xml file. Then all the *<? ?>* tags will be processed by the corresponding *<?php ?>* interpreter."^^ . + . + "1. [Validate your HTML](https://validator.w3.org/) 2. You seem to want a cascading dropdown but do not have code to support it. 3. You do not echo the $directory in the option `<option id='photo_collection' name='photo_collection' value='$directory' onclick= showDropdownGallery()></option>` and they all have the same ID which is not permitted, and the onclick will not trigger on an option, instead use the select's change event"^^ . + . + . + "@Honk der Hase Yes I read that on different sites, but where ?"^^ . + . + "<p>A discounted item could be:</p>\n<ul>\n<li>an &quot;on sale&quot; item (a product which price is on sale),</li>\n<li>an item discounted by a coupon applied to cart.</li>\n</ul>\n<p>In the code below I have implemented both, so if a coupon is applied or if there is an &quot;on sale&quot; item, Your custom progressive discount based on cart subtotal will not be applied.</p>\n<p>Try:</p>\n<pre class="lang-php prettyprint-override"><code>// Conditional function that check if there are cart items &quot;on sale&quot;\nfunction has_items_on_sale( $cart ) {\n // Loop through cart items\n foreach ( $cart-&gt;get_cart() as $item ) {\n if ( $item['data']-&gt;is_on_sale() ) {\n return true;\n }\n }\n return false;\n}\n\n// Progressive discount based on cart subtotal\nadd_action( 'woocommerce_cart_calculate_fees', 'subtotal_based_progressive_discount' );\nfunction subtotal_based_progressive_discount( $cart ) {\n if( is_admin() &amp;&amp; !defined('DOING_AJAX') ) {\n return;\n }\n // Exit if a cart item is on sale\n if( has_items_on_sale( $cart ) ) {\n return;\n }\n // Exit if a coupon has been applied to cart\n if( $cart-&gt;get_applied_coupons() ) {\n return;\n }\n\n $subtotal = $cart-&gt;subtotal;\n $percent = 0;\n\n if( $subtotal &gt;= 3000 &amp;&amp; $subtotal &lt; 10000 ) {\n $percent = 2; // 2 %\n } elseif( $subtotal &gt;= 10000 ) {\n $percent = 5; // 5 %\n }\n\n if( $percent &gt; 0 ) {\n $cart-&gt;add_fee( __('Sale') . &quot; {$percent}%&quot;, -($subtotal * $percent / 100) );\n }\n}\n</code></pre>\n<p>It should work.</p>\n<hr />\n<h4>Addition:</h4>\n<h5>Progressive discount based on cart item subtotal excluding &quot;on sale&quot; items.</h5>\n<p>Alternatively, you can use the following to apply a progressive discount on the subtotal excluding &quot;on sale&quot; items <em>(if there is no applied coupons)</em>:</p>\n<pre class="lang-php prettyprint-override"><code>// Utility function: Get cart subtotal excluding on sale items\nfunction get_subtotal_excluding_on_sale_items( $cart, $subtotal = 0 ) {\n // Loop through cart items\n foreach ( $cart-&gt;get_cart() as $item ) {\n if ( ! $item['data']-&gt;is_on_sale() ) {\n $subtotal = $item['line_subtotal'] + $item['line_subtotal_tax'];\n }\n }\n return $subtotal;\n}\n\n// Progressive discount based on cart subtotal\nadd_action( 'woocommerce_cart_calculate_fees', 'subtotal_based_progressive_discount' );\nfunction subtotal_based_progressive_discount( $cart ) {\n if( is_admin() &amp;&amp; !defined('DOING_AJAX') ) {\n return;\n }\n \n // Exit if a coupon has been applied to cart (optional)\n if( $cart-&gt;get_applied_coupons() ) {\n return;\n }\n\n $subtotal = get_subtotal_excluding_on_sale_items( $cart );\n $percent = 0;\n\n if( $subtotal &gt;= 3000 &amp;&amp; $subtotal &lt; 10000 ) {\n $percent = 2; // 2 %\n } elseif( $subtotal &gt;= 10000 ) {\n $percent = 5; // 5 %\n }\n\n if( $percent &gt; 0 ) {\n $cart-&gt;add_fee( __('Sale') . &quot; {$percent}%&quot;, -($subtotal * $percent / 100) );\n }\n}\n</code></pre>\n<p>It should work.</p>\n"^^ . + . + "While I understand the frustration of regulars caused by poorly-worded questions and not well-expressed problems, I see no harm in trying to help despite that"^^ . + . + "<p>I see that your project is located in the htdocs folder by default. In this case, without any modifications, you can access the public folder on port 80 using:</p>\n<pre class="lang-none prettyprint-override"><code>http://localhost/AppName/public/index.php\n</code></pre>\n<p>If the goal is to make your application secure locally and prevent direct access to files belonging to other projects (e.g., <code>http://localhost/AppName/.env</code>), then it is necessary to change the <code>htdocs</code> folder so that it points to your project's <code>public</code> folder. This is a huge security vulnerability, as the database password, for example, is stored in the <code>.env</code> file.</p>\n<p>This way, you can access the public folder via <code>http://localhost</code>, and there will be no possibility to load content outside of the <code>public</code> folder. (Yes, in this case <code>http://localhost/../.env</code> will invalid request.)</p>\n<p><strong>Note</strong>: <em>In my answer, I am not using the exact paths you provided, as I am trying to generalize the instructions. However, <code>C:\\path\\to\\laravelproject</code> refers to your <code>D:\\xampp\\htdocs\\AppName</code> directory.</em></p>\n<h3>Requirements</h3>\n<p>To host a website from your own machine on an internal network, you need a web server. XAMPP can be a great option for this, especially if you configure it to start automatically when Windows boots up.</p>\n<ul>\n<li>Set your <code>xampp.exe</code> to start automatically on Windows startup.</li>\n<li>In XAMPP, configure it to automatically start the web server and MySQL when the app launches (so you don't have to start them manually).</li>\n</ul>\n<p>After that, you just need to manipulate the default root directory of the <code>localhost:80</code> web address started by XAMPP - which is set to <code>.\\xampp\\htdocs</code> by default -; so that it points to the Laravel's <code>public</code> folder.</p>\n<h3>Set public directory with XAMPP</h3>\n<h5>Solution #1: Change XAMPP default <code>htdocs</code> folder path (recommended)</h5>\n<p>Find and open the <code>C:\\path\\to\\xampp\\apache\\conf\\httpd.conf</code> file.</p>\n<p>Look for a line where the <code>DocumentRoot</code> is set to <code>C:\\path\\to\\xampp\\htdocs</code>. Change it to:</p>\n<pre class="lang-none prettyprint-override"><code>DocumentRoot C:\\path\\to\\laravelproject\\public\n</code></pre>\n<p>If you want to continue using PHPMyAdmin, you will need an additional alias as well.</p>\n<p>Find and open the <code>C:\\path\\to\\xampp\\apache\\conf\\extra\\httpd-xampp.conf</code> file.</p>\n<p>Look or create a new line where the <code>Alias /phpmyadmin</code> is set to <code>C:\\path\\to\\xampp\\htdocs\\phpMyAdmin</code>. If not exists create this new line:</p>\n<pre class="lang-none prettyprint-override"><code>Alias /phpmyadmin &quot;C:\\path\\to\\xampp\\htdocs\\phpMyAdmin&quot;\n</code></pre>\n<p>After that should restart XAMPP webserver.</p>\n<h5>Solution #2: Copy project's public folder to <code>htdocs</code></h5>\n<p>By default, it will host the <code>C:\\path\\to\\xampp\\htdocs</code> folder. You should place the contents of your Laravel project's public folder inside the <code>C:\\path\\to\\xampp\\htdocs</code> folder.</p>\n<p>If you choose to copy, you will need to make edits in the copied <code>index.php</code> file. You will find some relative paths that look for files in a parent directory. These need to be rewritten to point to your Laravel project.</p>\n<h5>Solution #3: Create a symlink from htdocs to project's public</h5>\n<p>On Windows, creating a symlink could also work, like <code>C:\\path\\to\\xampp\\htdocs --&gt; C:\\path\\to\\laravelproject\\public</code>).</p>\n<pre class="lang-bash prettyprint-override"><code># By default htdocs existed, remove it by rename\nren &quot;C:\\path\\to\\xampp\\htdocs&quot; &quot;C:\\path\\to\\xampp\\htdocs.bak&quot;\n\n# Run as administrator from cmd\nmklink /D &quot;C:\\path\\to\\xampp\\htdocs&quot; &quot;C:\\path\\to\\laravelproject\\public&quot;\n</code></pre>\n<p><strong>Note</strong>: <em>I would not apply the descriptions of Solution #2 and #3 directly to the <code>htdocs</code> folder, but rather to the <code>.\\htdocs\\myproject</code> folder. In this case, however, the URL for your web application would not be <code>http://localhost</code>, but rather <code>http://localhost/myproject</code>.</em></p>\n<h3>Call project from browser</h3>\n<p>After this, you can load your Laravel project in the browser via the <code>http://localhost</code> port. (If there is no port specified, it refers to port <code>80</code>, meaning by default, XAMPP is accessible via <code>localhost:80</code>.)</p>\n<p>In your Laravel project's <code>.env</code> file, change the default paths from <code>http://localhost:8000</code> to <code>http://localhost</code>. If you're not using this machine directly, I recommend using your computer's internal network IP address instead of localhost: <code>http://192.168.0.100</code>.</p>\n<p><strong>Note</strong>: If the machine from which you want to access the locally hosted website is not on the same network as the &quot;server&quot; machine, you can set up a virtual LAN network, for example, using RadminVPN or similar services. But in this case, you would need to set your VPN address in the <code>.env</code> file.</p>\n<h3>Installation as production</h3>\n<p>If you do not intend to develop or modify this application, it is advisable to set it up as a &quot;production&quot; version.</p>\n<ul>\n<li><a href="https://stackoverflow.com/a/59664416/15167500">Laravel - What steps should one take to make a Laravel app ready for production mode</a></li>\n</ul>\n"^^ . + . + . + . + . + . + "<p>i am trying to deploy my laravel app which uses laravel reverb on railway but i keep getting an error related to pusher</p>\n<pre class="lang-none prettyprint-override"><code> \n Pusher\\Pusher::__construct(): Argument #1 ($auth_key) must be of type strin \n g, null given, called in /var/www/html/vendor/laravel/framework/src/Illumin \n ate/Broadcasting/BroadcastManager.php on line 341 \n \n\nScript @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1\n</code></pre>\n"^^ . + . + . + . + "Oh.. minor changes done to make it work. \n headers: {\n "Content-Type": "application/x-www-form-urlencoded",\n },\n body: new URLSearchParams(attrObj) Thank you for your help. Cheers!!!"^^ . + . + "2"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + "1"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + "1"^^ . + "And you should use [`http_build_query()`](https://www.php.net/manual/en/function.http-build-query.php) to properly build `$data`."^^ . + "Assume I were to request `.com/CPT/foo-bar` - can you tell me, without checking your database, whether this would be case #2 or case #3? No? Then how do you expect WP to?"^^ . + . + . + . + . + . + "How to get compressed and uncompressed size for each file in zip archive with php?"^^ . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + "IIS + PHP -> Sometimes wrong response"^^ . + . + . + . + "0"^^ . + . + . + . + . + "1"^^ . + "<p>I am not able to set a PHP alias in the git bash installed in windows (I'm using Herd).</p>\n<p>Context:</p>\n<ul>\n<li>If I open Git Bash from windows menu, I can see the alias working (<code>php -v</code> returns correct info)</li>\n<li>In my PHP project, I set a pre-commit hook to run some tests using <code>php</code> command</li>\n</ul>\n<p>I added this aliases in both <code>.bashrc</code> and <code>.bash_profile</code> files:</p>\n<pre><code>export PATH=$PATH:&quot;/c/Users/MyUser/.config/herd/bin/&quot;\n\n# Laravel Herd Aliases - please do not remove these lines\nalias php=&quot;php.bat&quot;\nalias herd=&quot;herd.bat&quot;\nalias laravel=&quot;laravel.bat&quot;\nalias composer=&quot;composer.bat&quot;\n</code></pre>\n<p>Now, when I execute <code>git commit something</code>, I get this error:</p>\n<blockquote>\n<p>which: no php in\n(/mingw64/libexec/git-core:/mingw64/libexec/git-core:/mingw64/bin:/usr/bin:\n...etc other paths)<br />\n/c/ProgramData/ComposerSetup/bin/composer: line\n14: php: command not found</p>\n</blockquote>\n<p>What I do not understand is that the alias seems to work If I use in git bash, but it's not working in normal git flow.</p>\n"^^ . + "[This is how this primitive snippet could look](https://3v4l.org/UfCt5#v8.4.5) according to current standards. The business logic is separated from presentation logic and errors are informative but don't leak outside (which is likely opposite to what does your "handling" do)."^^ . + . + . + "<p>I have a string of words, here broken into lines to better visualize the repeating pattern:</p>\n<pre><code>Saint John eats less of those apples.\nSaint Paul eats more of those berries.\nSaint Luke eats those oranges.\n</code></pre>\n<p>From this string I need to extract all names, all fruits, and all the quantifiers. The result should be:</p>\n<pre><code>Array\n(\n [0] =&gt; Array\n (\n [0] =&gt; Saint John eats less of those apples.\n [1] =&gt; John\n [2] =&gt; less\n [3] =&gt; apples\n )\n [1] =&gt; Array\n (\n [0] =&gt; Saint Paul eats more of those berries.\n [1] =&gt; Paul\n [2] =&gt; more\n [3] =&gt; berries\n )\n [2] =&gt; Array\n (\n [0] =&gt; Saint Luke eats those oranges.\n [1] =&gt; Luke\n [2] =&gt; \n [3] =&gt; oranges\n )\n)\n</code></pre>\n<p>I have gotten as far as:</p>\n<pre><code>preg_match_all(&quot;|Saint (.+?) eats (.+?) of those (.+?).|&quot;, $string, $matches);\n</code></pre>\n<p>But this of course doesn't find the last (partial) match. How can I rephrase my regular expression to find it?</p>\n<hr />\n<p><em>Notes</em></p>\n<p>In the real string, there is more non-repeating text before, between, and after the repeating pattern. E.g.:</p>\n<blockquote>\n<p>The apples have worms. That is why Saint John eats less of those apples. Unfortunately Saint John dislikes berries. Unlike Saint Paul. Saint Paul eats more of those berries. When John and Paul are gone, Saint Luke eats those oranges. Afterward, he is still hungry.</p>\n</blockquote>\n<p>Unlike <a href="https://stackoverflow.com/questions/66398620/optionally-match-part-of-a-regular-expression">this related question</a>, I don't want to optionally match <em>all</em> of the missing part, but only <em>part of</em> the missing part!</p>\n"^^ . + . + . + . + . + . + . + "1"^^ . + "1"^^ . + "This is my final edit. Please read the code comments. You must not use `array_combine` to merge columns with values, because that function does not map data by keys/indexes, it maps purely by position and this is definitely not reliable for your task. https://3v4l.org/8Jfcp"^^ . + . + . + . + "1"^^ . + . + "0"^^ . + . + . + . + "So, one of the things it comes to my mind to propose is to add created_at and updated_at manually, every time. in the case of an update updated_at. Another solution and this might be more appropriate because it doesn't give the impression you need timestamps you can avoid using them by either setting them to the migration alter table: $table->timestamps(false); or directly to the model: class Book extends Model\n{\n public $timestamps = false;\n\n // Other model properties and methods\n}. Also lastly the data received from the UI input field should be a text type, not an integer"^^ . + "Thank you for calling that out. I've rewritten my answer (which closely aligns with your answer's approach)."^^ . + . + . + "0"^^ . + "0"^^ . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + "@deceze Thank you for actually answering my question."^^ . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + "1"^^ . + "@user2531657 the `if (empty($fields) || in_array($field, $fields, true)) {\n $result[$field] = $definition;\n }` clearly suggests that if the `$fields` is an empty array or the field is inside of it, then we add it to the result. And `$fields` is empty by default. I did not debug it, but I encourage you to debug it yourself instead of relying on some AI chatbot. Also, it could be the case that the version I looked at might differ from the version you have."^^ . + . + . + . + . + . + . + . + "0"^^ . + "`create_function` was removed in PHP 8 - see https://www.php.net/manual/en/function.create-function.php . Why don't you rewrite it as an anonymous function, like in the example in the documentation?"^^ . + . + . + . + "0"^^ . + . + . + . + . + "1"^^ . + "https://askubuntu.com/questions/491629/how-to-install-php-mbstring-extension-in-ubuntu May help"^^ . + . + . + . + . + "4"^^ . + . + . + . + "Actually you pointed me in the right direction and I managed to write different code to make it work. I would post it but not sure if I can without creating a new question? Thanks so much :D"^^ . + . + "If you want indexed arrays in each row, just change `$row[$col]` to `$row[]`."^^ . + . + . + . + "1"^^ . + . + . + "0"^^ . + "Yes please. I can't work out what to change"^^ . + . + "2"^^ . + . + . + "-1"^^ . + . + . + . + . + "<p>I wonder if there is a possibility to use the SOLR export request handler with the PHP Solarium library: <a href="https://solr.apache.org/guide/6_6/exporting-result-sets.html" rel="nofollow noreferrer">https://solr.apache.org/guide/6_6/exporting-result-sets.html</a></p>\n<p>I can access the results applying the example &quot;http://localhost:8983/solr/core_name/export?q=my-query&amp;sort=severity+desc,timestamp+desc&amp;fl=severity,timestamp,msg&quot; through the browser or curl, but not through the Solarium library as there seem to be no such thing as $client-&gt;createExport</p>\n<p>Am I missing something?</p>\n<p>I also tried <code>$request-&gt;setHandler('export')</code>, following the example from <a href="https://stackoverflow.com/questions/40836226/how-to-use-a-custom-request-handler-in-solarium">How to use a custom request handler in Solarium</a>, but it is still using the select handler.</p>\n"^^ . + "0"^^ . + "1"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + "One clearer approach would be to have an isFinished scope in the Job model and then use that scope in the User model. \nThe idea is that the User model shouldn't be keeping tabs of jjob statuses; it should be handled within the Job model itself."^^ . + . + . + . + . + . + "How to deal with returned JSON data"^^ . + . + . + . + "Way too much code to dig through. As above, narrow it down to what's needed just to reproduce your specific issue. This may require a little bit of thought and effort on your part, to form a useful example which reproduces the problem but is still consistent with how your app works. See also [ask]."^^ . + . + "1"^^ . + . + "2"^^ . + "0"^^ . + . + "<p>I am using PHP with the MailChimp API. I am not using the MC library, but making calls direct.</p>\n<p>I am trying to send a newsletter to a subset of Subscribers in an Audience. This subset is defined by a Tag. I am expecting this group to be in the 1,000s (in the future) so I do not want to get the subscribers email and then send to them. Instead I want to leverage MC's segments, define that, and send it to them.</p>\n<p>I define my segment like this:</p>\n<pre><code>$segmentData = [\n 'name' =&gt; $segmentName,\n 'options' =&gt; [\n 'match' =&gt; 'any',\n 'conditions' =&gt; [\n [\n 'condition_type' =&gt; 'Tags',\n 'field' =&gt; 'tags',\n 'op' =&gt; 'contains',\n 'value' =&gt; [$tagName]\n ],\n ],\n ],\n];\n</code></pre>\n<p>But I keep getting an error:</p>\n<pre><code>&quot;errors&quot;:[{\n &quot;field&quot;:&quot;options.conditions.item:0&quot;,\n &quot;message&quot;:&quot;Data did not match any of the schemas described in anyOf.&quot;\n}]\n</code></pre>\n<p>I have a test Audience of about 20 subscribers. One of these is tagged &quot;notify_region&quot;.</p>\n<p>I've tried a few different variations but it doesn't help.</p>\n<p>Is this possible, or am I missing something?</p>\n<p>This is my test code:</p>\n<pre><code>&lt;?php\n\n$apiKey = 'YOUR_MAILCHIMP_API_KEY';\n$listId = 'YOUR_LIST_ID';\n$templateId = 'YOUR_TEMPLATE_ID';\n$tagName = 'notify_region';\n$segmentName = 'Example Segment 1';\n\nfunction callMailchimp($method, $endpoint, $data = []) {\n global $apiKey;\n $apiUrl = &quot;https://us10.api.mailchimp.com/3.0&quot;;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $apiUrl . $endpoint);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);\n curl_setopt($ch, CURLOPT_USERPWD, &quot;user:$apiKey&quot;);\n if (!empty($data)) {\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));\n curl_setopt($ch, CURLOPT_HTTPHEADER, [\n 'Content-Type: application/json'\n ]);\n }\n $response = curl_exec($ch);\n curl_close($ch);\n return json_decode($response, true);\n}\n\n$segmentData = [\n 'name' =&gt; $segmentName,\n 'options' =&gt; [\n 'match' =&gt; 'any',\n // 'match' =&gt; 'all',\n 'conditions' =&gt; [\n [\n 'condition_type' =&gt; 'Tags',\n 'field' =&gt; 'tags',\n 'op' =&gt; 'contains',\n 'value' =&gt; [$tagName]\n // 'value' =&gt; [ $tagName ],\n ],\n ],\n ],\n];\n\n$segmentResponse = callMailchimp('POST', &quot;/lists/$listId/segments&quot;, $segmentData);\n\nif (isset($segmentResponse['id'])) {\n $segmentId = $segmentResponse['id'];\n\n $campaignData = [\n 'type' =&gt; 'regular',\n 'recipients' =&gt; [\n 'list_id' =&gt; $listId,\n 'segment_opts' =&gt; [\n 'saved_segment_id' =&gt; $segmentId,\n ],\n ],\n 'settings' =&gt; [\n 'subject_line' =&gt; 'Notification for Region',\n 'from_name' =&gt; 'Company',\n 'from_email' =&gt; 'hello@example.com',\n 'template_id' =&gt; $templateId,\n ],\n ];\n\n $campaignResponse = callMailchimp('POST', '/campaigns', $campaignData);\n\n if (isset($campaignResponse['id'])) {\n $campaignId = $campaignResponse['id'];\n\n // $sendResponse = callMailchimp('POST', &quot;/campaigns/$campaignId/actions/send&quot;);\n // if(isset($sendResponse['message']) &amp;&amp; $sendResponse['message'] === 'Campaign send started'){\n // echo &quot;Campaign sent successfully!&quot;;\n // } else {\n // echo &quot;Failed to send campaign: &quot; . json_encode($sendResponse);\n // }\n\n echo &quot;FIN.&quot;;\n\n } else {\n echo &quot;Failed to create campaign: &quot; . json_encode($campaignResponse);\n }\n} else {\n echo &quot;Failed to create segment: &quot; . json_encode($segmentResponse);\n}\n</code></pre>\n"^^ . + "<p>Create a custom rule and check any array with the desired constraints. <a href="https://codeigniter4.github.io/userguide/libraries/validation.html#creating-a-rule-class" rel="nofollow noreferrer">https://codeigniter4.github.io/userguide/libraries/validation.html#creating-a-rule-class</a></p>\n<p>Sample class:</p>\n<pre class="lang-php prettyprint-override"><code>class IdRules\n{\n /**\n * Use as 'required|valid_ids[100,intval,string]'\n */\n public function valid_ids($value = null, string $params, array $data = [], ?string $error = null): bool\n {\n $rules = explode(',', $params);\n\n if (! is_array($value)) {\n $error = 'Not array';\n\n return false;\n }\n\n if (count($value) &gt; $rules[0]) {\n $error = 'The array is too large';\n\n return false;\n }\n\n foreach ($value as $k =&gt; $v) {\n // validation `ids` and return `bool`\n if (gettype($k) === $rules[1]) {}\n if (gettype($v) === $rules[2]) {}\n }\n\n return true;\n }\n}\n</code></pre>\n"^^ . + . + "2"^^ . + . + "Also note you're creating `$delivery_postcode` and then never using it. And avoid the `@` silencer whenever possible. Instead prefer the null coalesce operator like `$_SESSION["stored_postcode"] ?? null`."^^ . + . + "Anyway if you want to add a newline character in the file, what is stopping you from doing that? Do you understand how to concatenate 2 strings together in PHP using `.`?"^^ . + . + . + . + . + . + "use ScyllaDB with PHP- Swoole"^^ . + . + "0"^^ . + "0"^^ . + . + "stripe-payments"^^ . + "You can send it to the server using AJAX"^^ . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + "You have to use [Facade testing](https://laravel.com/docs/11.x/mocking#facade-spies), not mock but spy, you want to know if those initial calls are done, not what to return. You should be doing `DB::shouldHaveReceived('prohibitDestructiveCommands')` (that is a spy) and that's it, you don't care what you have to return, you just care that it is being called"^^ . + . + . + "4"^^ . + . + "0"^^ . + "1"^^ . + "upload-max-filesize"^^ . + . + . + "i see a picture of a lipstick, i don't get a 403, did you fix it?"^^ . + . + . + . + . + . + . + . + . + "@TimLewis I did mention I was using php artisan cache:clear\nphp artisan config:clear\nphp artisan optimize:clear to clear the cached config. Besides I manually deleted the config files too."^^ . + . + . + . + . + "0"^^ . + . + . + . + "Based on the link you've provided, it sounds like those things should match. That might be a good update to your question then for clarity."^^ . + "2"^^ . + "0"^^ . + . + . + "<p>When I access signup.php directly by entering the URL in the browser (localhost/camping_project/signup.php), it works fine.</p>\n<p>But when I click the &quot;Get Started&quot; button in home.html, it shows the raw PHP code instead of executing it.</p>\n<p>If I use an absolute path (e.g., http://localhost/camping_project/signup.php), it works, but I want to use relative paths.</p>\n<p>this is the structure of my project:</p>\n<pre><code>camping_project/\n├── index.php\n├── signup.php\n└── home_page/\n └── home.html\n</code></pre>\n<p>In home.html, I have navigation links like this:</p>\n<pre><code>&lt;a href=&quot;../signup.php&quot; class=&quot;nav__button-ghost&quot;&gt;Get Started&lt;/a&gt;\n&lt;a href=&quot;../index.php&quot; class=&quot;nav__button-link&quot;&gt;Login&lt;/a&gt;\n</code></pre>\n"^^ . + . + "0"^^ . + . + . + . + "phpmyadmin"^^ . + . + "0"^^ . + "Can I check it through dusk ?"^^ . + . + "Not going to argue with you at all. I'm after your help as I am not a MYSQL expert, just a basic user I see the above being clear but you do not. I am saying that the valid statement above does not work due to the contents of the password field. That is my problem and it looks like I have been too long winded to explain that correctly.\n\nI've had a look at the site you provide a link to. At first I thought I could use it but I have no idea how to set up the database with my values. I can insert my code easy enough but with no valid DB it doesn't like it which is not unexpected."^^ . + . + . + . + . + . + . + . + "1"^^ . + . + "1"^^ . + "<p>Python doesn't use PCRE, so that's not it.</p>\n<p><code>(.{4,5})+</code></p>\n<p>first matches &quot;12341&quot;, tben extends to include &quot;23412&quot;, then extends to include &quot;34123&quot;. It can't do more, so the first 15 characters are replaced by &quot;-&quot;. It can't match the trailing &quot;4&quot;, so that's left alone.</p>\n<p><code>(.{4,5})*</code></p>\n<p>matches the first 15 characters the same way. But then it's left with a trailing &quot;4&quot;. And the empty string <em>does</em> match, because <code>*</code> means 0 or more matches, and 0 counts. So you get a second &quot;-&quot;. The trailing &quot;4&quot; itself doesn't match, so it's left alone. Then the empty string after the trailing &quot;4&quot; matches (0 times again), so you get a final &quot;-&quot;.</p>\n"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + "<p>It is likely that some other plugin or your custom code may be overwriting the from email address. To resolve this try these options:</p>\n<ol>\n<li><p>Look for the plugins or custom code which is hooking to the filter <code>wp_mail_from</code> and check if they are altering your from email address. If yes try to disable them.</p>\n</li>\n<li><p>Add this filter callback to enable filtering the from email address in FluentSMTP plugin. (This is enabled by default, but just making sure if you have not disabled it in some other place)</p>\n<p><code>add_filter( 'fluentsmtp_disable_from_name_email', '__return_false', 100 );</code></p>\n</li>\n<li><p>Instead of <code>woocommerce_email_from_address</code> filter, use <code>wp_mail_from</code> filter. But the catch here is you will only get the current from email address in the call back. Since you only need to alter the from email address for <code>customer_new_account</code> emails, you need to <code>add_filter</code> before the new customer account email is sent and remove it using <code>remove_filter</code> after the email is sent.</p>\n</li>\n</ol>\n<p>Example:</p>\n<pre class="lang-php prettyprint-override"><code>function custom_send_from_address () {\n return'welcome@mywebsite.org';\n}\n\nfunction attach_filter () {\n // Hook to filter with low priority\n add_filter( 'wp_mail_from', 'custom_send_from_address', 1000 );\n}\nadd_action( 'woocommerce_created_customer_notification', `attach_filter` );\n\nfunction detach_filter () {\n remove_filter( 'wp_mail_from', 'custom_send_from_address' );\n}\nadd_action( `woocommerce_email_sent`, 'detach_filter' );\n</code></pre>\n"^^ . + . + . + "0"^^ . + "0"^^ . + . + "2"^^ . + "0"^^ . + "Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer)."^^ . + "<p>I’ve already set up my Telegram bot webhook in a WordPress site. When I check it using getWebhookInfo, I get this response:</p>\n<pre><code>{&quot;ok&quot;:true,&quot;result&quot;:{&quot;url&quot;:&quot;https://example.com/webhook-.php&quot;,&quot;has_custom_certificate&quot;:false,&quot;pending_update_count&quot;:0,&quot;max_connections&quot;:40,&quot;ip_address&quot;:&quot;address&quot;}}\n</code></pre>\n<p>The webhook works perfectly on my local WordPress environment, but when I test it on the live server, I don’t receive any updates or responses from Telegram.</p>\n<p>I’m fetching data from Telegram like this:</p>\n<pre><code>$update = json_decode(file_get_contents('php://input'), true);\n</code></pre>\n<p>Also, my webhook file is in the same directory as the wp-content folder.</p>\n<p>A few things I’ve already checked:</p>\n<ul>\n<li>allow_url_fopen is ON</li>\n<li>I have a valid SSL certificate</li>\n<li>The webhook URL is set correctly</li>\n</ul>\n<p>Despite this, I’m still not getting any updates from Telegram on the live server. What could be causing this issue?</p>\n"^^ . + . + "1"^^ . + . + . + . + . + . + "<p><strong>Note</strong>: The auth code can be used only once and if you try to reuse the auth code then you will get error.</p>\n<ul>\n<li>It is one-time use code used to exchange for an access token.</li>\n<li>Authorization codes expire after about 10 minutes.</li>\n</ul>\n<p>Hence you will get an <strong>invalid grant error</strong> when you try to reuse the auth code:</p>\n<p>For <em><strong>sample</strong></em>, I used below parameters:</p>\n<p><img src="https://i.imgur.com/D99iE5o.png" alt="enter image description here" /></p>\n<p>Hence you need to generate auth-code again if you want to reuse it. And you can make use of refresh token to generate access token whenever the old access token expires.</p>\n<ul>\n<li>The Authorization Code is primarily used during the initial authorization process, so it’s not necessary to pass it every time once you have obtained the access and refresh tokens.</li>\n<li>After obtaining these tokens, you can use them to make requests for resources without needing to re-authenticate the user like below:</li>\n</ul>\n<p>Generated <strong>access and refresh tokens</strong>:</p>\n<pre class="lang-json prettyprint-override"><code>https://login.microsoftonline.com/TenantID/oauth2/v2.0/token\n\nclient_id: ClientID\ngrant_type: authorization_code\nscope: offline_access user.read mail.read mail.send mail.readbasic mail.readwrite imap.accessasuser.all smtp.send\nredirect_uri: RedirectURL\ncode: code\nclient_secret: xxx\n</code></pre>\n<p><img src="https://i.imgur.com/GAo5QB8.png" alt="enter image description here" /></p>\n<p>Now use the <strong>refresh token to generate new access token:</strong></p>\n<pre class="lang-json prettyprint-override"><code>https://login.microsoftonline.com/TenantID/oauth2/v2.0/token\n\nclient_id: CLientID\ngrant_type: refresh_token\nrefresh_token: RefreshTokenFromAbove\nclient_secret: Secret\n</code></pre>\n<p><img src="https://i.imgur.com/72jA2Hj.png" alt="enter image description here" /></p>\n<p><em><strong>Sample code:</strong></em></p>\n<pre class="lang-php prettyprint-override"><code>// Example of exchanging the refresh token for a new access token\n$tokenUrl = &quot;https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token&quot;;\n$data = [\n &quot;client_id&quot; =&gt; &quot;clientId&quot;,\n &quot;client_secret&quot; =&gt; &quot;clientSecret&quot;,\n &quot;grant_type&quot; =&gt; &quot;refresh_token&quot;,\n &quot;refresh_token&quot; =&gt; $token-&gt;refresh_token,\n &quot;scope&quot; =&gt; &quot;offline_access user.read mail.read mail.send&quot;\n];\n\n$options = [\n 'http' =&gt; [\n 'header' =&gt; &quot;Content-type: application/x-www-form-urlencoded&quot;,\n 'method' =&gt; 'POST',\n 'content' =&gt; http_build_query($data),\n ],\n];\n$context = stream_context_create($options);\n$response = file_get_contents($tokenUrl, false, $context);\n$tokenData = json_decode($response, true);\n\n// The new token data should contain a new access_token and refresh_token\n$newAccessToken = $tokenData['access_token'];\n$newRefreshToken = $tokenData['refresh_token'];\n</code></pre>\n<p>To avoid the need for repeated re-authentication, you should properly cache the access token and refresh token and refresh the access token when it expires.</p>\n<ul>\n<li><strong>Token Cache</strong>: Save the tokens either in memory or a persistent storage (like a database) to avoid re-authenticating with each request.</li>\n<li><strong>Token Expiry</strong>: Before making any request, verify if the access token has expired and refresh it when necessary.</li>\n</ul>\n"^^ . + . + . + . + . + . + "-5"^^ . + . + . + . + . + "This is an educated guess, but are you having trouble with displaying the select correctly in the modal? That's a known issue. You can try setting the `dropdownParent` property, as explained here: https://select2.org/dropdown#dropdown-placement"^^ . + . + . + "It doesn't seem to be possible. Do you see "https" with any of these requests in the address bar though?"^^ . + . + . + . + . + . + . + "<p>In laravel 10 / nova 4 app using spatie/laravel-permission ^5.11 in app/Models/User.php added <code>isAdmin</code> method:</p>\n<pre><code>&lt;?php\n\nnamespace App\\Models;\n\n...\nuse Illuminate\\Foundation\\Auth\\User as Authenticatable;\nuse Illuminate\\Notifications\\Notifiable;\nuse Spatie\\Permission\\Traits\\HasPermissions;\nuse Cog\\Contracts\\Ban\\Bannable as BannableContract;\nuse Stephenjude\\Wallet\\Interfaces\\Wallet;\nuse Stephenjude\\Wallet\\Traits\\HasWallet;\n\nclass User extends Authenticatable implements BannableContract, Wallet\n{\n protected $table = 'users';\n protected $primaryKey = 'id';\n public $timestamps = true;\n\n use HasApiTokens, HasFactory, Notifiable;\n use HasPermissions;\n use Bannable, HasWallet;\n\n\n\n public function isAdmin(): bool\n {\n \\Log::info( '-1 $this-&gt;permissions(permissions)::' . print_r( json_encode($this-&gt;permissions), true ) );\n \\Log::info( '-1 $this-&gt;can(ACCESS_PERMISSION_ADMIN)::' . print_r( $this-&gt;can(ACCESS_PERMISSION_ADMIN), true ) );\n\n return $this-&gt;can(ACCESS_PERMISSION_ADMIN);\n }\n</code></pre>\n<p>Bur it always returns <code>false</code> (I have checked data in model_has_permissions table ) and in the code above I see that <code>$this-&gt;permissions</code> has row <code>[{&quot;id&quot;:1,&quot;name&quot;:&quot;Admin&quot;...</code>,\nbut why</p>\n<pre><code>$this-&gt;can(ACCESS_PERMISSION_ADMIN);\n</code></pre>\n<p>returns false ?</p>\n"^^ . + . + "1"^^ . + . + "0"^^ . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + "Taking a look further down to the [changelog](https://www.php.net/manual/en/changelog.mysqli.php) it does not say it is deprecated, but some methods and properties are. How do you receive the error? Via error log or tools like phpstan? Can you give more details, please?"^^ . + "3"^^ . + "1"^^ . + . + "progressive-web-apps"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + "1"^^ . + . + . + . + "1"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + "@AdamAllen please add all clarification **to your question** by editing it."^^ . + . + "1"^^ . + . + "0"^^ . + "1"^^ . + "@DarioPP, based on your edits you understand the deprecation itself I think. As such, we can completely ignore the specific package and boil the question down to "Why is a deprecation being sent to stdout when my PHP configuration is XYZ". Is that fair? The specific library is a red-herring that is just distracting from the conversation, you could easily just put little bit of code such as https://3v4l.org/rNBts#v8.4.3 and that would represent the problem."^^ . + . + . + "0"^^ . + "2"^^ . + . + . + "0"^^ . + "How does this solve the problem of the second script waiting for unzip to finish?"^^ . + . + . + "<p>In your case, when you create deployment here</p>\n<pre><code> $tenant = Deployment::create([\n 'slug' =&gt; $request-&gt;slug,\n 'database_name' =&gt; 'tenant_' . $request-&gt;slug,\n 'tenant_name' =&gt; $request-&gt;tenant_name,\n 'address' =&gt; $request-&gt;address,\n 'contact_email' =&gt; $request-&gt;contact_email,\n 'contact_number' =&gt; $request-&gt;contact_number,\n 'country' =&gt; $request-&gt;country,\n 'language' =&gt; $request-&gt;language,\n 'subscription_start_date' =&gt; $request-&gt;subscription_start_date,\n 'subscription_end_date' =&gt; $request-&gt;subscription_end_date,\n 'status' =&gt; 'active',\n ]);\n</code></pre>\n<ol>\n<li><p><code>Events\\TenantCreated</code> event get triggered.</p>\n</li>\n<li><p>Now go <code>app/Providers/TenancyServiceProvider</code> find the <code>Events\\TenantCreated</code></p>\n<pre><code> Events\\TenantCreated::class =&gt; [\n JobPipeline::make([\n Jobs\\CreateDatabase::class,\n Jobs\\MigrateDatabase::class,\n Jobs\\SeedDatabase::class,\n\n // Your own jobs to prepare the tenant.\n // Provision API keys, create S3 buckets, anything you want!\n\n ])-&gt;send(function (Events\\TenantCreated $event) {\n return $event-&gt;tenant;\n })-&gt;shouldBeQueued(false), // `false` by default, but you probably want to make this `true` for production.\n ],\n</code></pre>\n</li>\n<li><p>You can see <code>CreateDatabase</code>, <code>MigrateDatabase</code> and <code>SeedDatabase</code>. These three actions executed immediately.</p>\n</li>\n<li><p>So when you are trying to execute migration manually, you are trying to migrate tables second time.</p>\n<pre><code> Log::info(&quot;Running migrations for tenant database: &quot; . $tenant-&gt;database_name);\n Artisan::call('tenants:migrate', ['--tenants' =&gt; [$tenant-&gt;id]]);\n Log::info(&quot;Migrations completed for tenant: &quot; . $tenant-&gt;database_name);\n</code></pre>\n</li>\n<li><p>So what you should do either don't call migration manually or remove/comment <code>Jobs\\MigrateDatabase::class</code> from job pipeline in <code>TenancyServiceProvider</code>.</p>\n</li>\n</ol>\n<p>Hope it will help.</p>\n<p>Read Doc: <a href="https://tenancyforlaravel.com/docs/v3/multi-database-tenancy" rel="nofollow noreferrer">https://tenancyforlaravel.com/docs/v3/multi-database-tenancy</a></p>\n"^^ . + . + "0"^^ . + "0"^^ . + "<p>i have routes,and nested groups of routes.some routes have metadata contain required permissions or rolles ,which are checked against user session variables.\ni handled the check in controller constructor by using\nservice('router')-&gt;getMatchedRouteOptions() and check with helper function which throw exception 404 if session()-&gt;get('user_role') not in allowed array</p>\n<p>but the problem is in some nested views and components, which have list of links to these routes ,which should be also conditionally listed according to the given permissions in routes metadata</p>\n<p>1- how can i access the metadata by route name in any part of the application using a function like:\nisAllowed($route_name) which check if route has metadata allowed-&gt;roles , intersecting with with user permissions or roles?</p>\n<p>2- how can i get routes under specific group by group name givin also in metdata alias 'as'?</p>\n<p>i want the permissions in metadata to be centralized , without creating another soulution which need duplicating routes</p>\n<p>below is a sample of the route</p>\n<pre><code>$routes-&gt;group('users', ['as' =&gt; 'admin_users'], static function ($routes) {\n // Route for the users main page\n $routes-&gt;get('', 'AdminControllers\\ViewController::users_main_page', [\n 'as' =&gt; 'admin_master_page',\n 'allowed' =&gt; [\n 'role' =&gt; ['admin', 'super_admin', 'owner'],\n ]\n ]);\n\n // Route for the users search page\n $routes-&gt;get('search', 'AdminControllers\\ViewController::users_search', [\n 'as' =&gt; 'user_search',\n 'allowed' =&gt; [\n 'role' =&gt; ['super_admin', 'owner'],\n ]\n ]);\n $routes-&gt;get('add', 'AdminControllers\\ViewController::add_user', [\n 'as' =&gt; 'add_user',\n 'allowed' =&gt; [\n 'role' =&gt; ['super_admin', 'owner'],\n ]\n ]);\n\n});\n</code></pre>\n"^^ . + "@ADyson This is my code that I sell, and not something public, and I also built a simple and short class that can send SMTP messages and also regular emails directly from the server and everything works great, nowadays any artificial intelligence can build something like this for you, I recommend you try it. In any case, for now I continue to wait for someone serious to try to help me solve what I'm looking to solve instead of arguing with me about what I'm saying."^^ . + "0"^^ . + . + . + . + "Neither of those sounds like "critical" errors. On the frontend, is there any further content after this message, or does the page just appear to "end" there?"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + "laravel"^^ . + . + . + . + . + "1"^^ . + . + "0"^^ . + . + . + . + . + "Are you using non-root permission to logging to `/proc/1/fd/1`?"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "I was also under the impression that `toArray()` should return all fields, but that does not seem to be the case. I am using the standard Yii2 MongoDB extension for ActiveRecord without any modifications to the `toArray()` or `fields()` methods.\n\nStrangely, ChatGPT also states that "In Yii2's ActiveRecord, the toArray() method returns only the attributes that have been set (including those that are set to a null value).” Though I know that ChatGPT is not the most reliable source, it must still be getting this information from somewhere!?"^^ . + . + "url"^^ . + . + . + "0"^^ . + "magento2.4"^^ . + "0"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + "I don't think Laravel is the best tool for that. I would just find a way to export the database from production and import it locally."^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + "1"^^ . + "Problem refreshing Jquery grid upon update"^^ . + . + . + . + "@NicoHaase I did this test in a brand new installation of symfony 7.2. It seems that "symfony/ux-turbo" is installed by default (webapp). I didn't mention it because at that time, I didn't know about it. It was while looking for why the redirection wasn't working that I found this clue."^^ . + "<p>The following worked for me:</p>\n<pre><code>define('RSA_PRIV_KEY', &quot;&lt;base64 encoded key&gt;&quot;);\n$privkey = openssl_pkey_get_private(RSA_PRIV_KEY);\n\n$encrypted = &quot;&quot;; \nopenssl_private_encrypt(&quot;my fancy string&quot;, $encrypted, $privkey);\n\n$this-&gt;log-&gt;info(&quot;&gt;&gt;&gt;&quot; . base64_encode($encrypted)); \n</code></pre>\n"^^ . + "Yes, I tried defining the host to '0.0.0.0' on the vite.config.js but none changes when restart the deployment. What did you mean with 'building the project in vite?'. Using npm run build? I tried these also but only generates my compiled css and javascript and delete my index, robots, favicon... I guess I am missing something"^^ . + . + . + "2"^^ . + "1"^^ . + . + . + . + . + "0"^^ . + "3"^^ . + "0"^^ . + "`preg_replace()` can take arrays. Without changing anything of your current functionality, e.g. like this: [`$que=preg_replace(["/([^0-9,. ])([0-9,.])/","/([0-9,.])([^0-9,. ])/"],"$1 $2",$que);`](https://tio.run/##K8go@P/fxj7AI4CLS6WwNFXBVkEpMVEhKcnYODlZwVSvIF/JGiZRUJSaHl@UWpCTmJyqEa2krxEdZ6BrqaOnEKupEQ1mxWrqK@kogGSgXCQl@kqxQCkVQwUVI6AakJGa1lypyRn5YLY11///AA)"^^ . + "`implicitly promting a reader to think that there is such a thinkg like a "global scope" and such a thin like "all scopes"`...yes, those things exist. So it should definitely prompt the reader about them. I'm not clear what you mean by this remark."^^ . + "gmail-imap"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + "Thank you Chris! I was going to do so, however I faced the same problem with the paths. WP uses different relative paths on the template for the index page and for the rest of the pages! If I make another page to be used as index, its images disappear. I'm totally confused with the image paths."^^ . + "<p>In a project I have, I use this approach, taking advantage of the <a href="https://www.php.net/manual/en/wrappers.data.php" rel="nofollow noreferrer">&quot;data&quot; wrapper</a>:</p>\n<pre class="lang-php prettyprint-override"><code>\n$fileName = 'some_random_file.mp3';\n\n$fileContents = file_get_contents($fileName);\n\n$fileHandle = fopen('data://text/plain;base64,' . base64_encode($fileContents), 'rb+');\nstream_context_set_option($fileHandle, 'http', 'filename', $fileName);\nstream_context_set_option($fileHandle, 'http', 'content_type', 'audio/mpeg');\n\n$response = $this-&gt;httpClient\n -&gt;request('POST', 'http://localhost:8000/upload/file', \n [\n 'headers' =&gt; [\n 'Content-Type' =&gt; 'multipart/form-data'\n ],\n 'body' =&gt; [\n 'file' =&gt; $fileHandle,\n ],\n]);\n</code></pre>\n<p><a href="https://symfony.com/doc/current/http_client.html#uploading-data" rel="nofollow noreferrer">The docs mention how to set the name for a case like this</a>.</p>\n"^^ . + "Is there any good reason to set `0` as an ID (see [this](https://stackoverflow.com/questions/53681688/i-need-to-put-in-a-script-an-id-with-zero-value) question) ? Also, how does the migration *"crashes for some clients"* ?"^^ . + "0"^^ . + "0"^^ . + "dom"^^ . + . + "webdav"^^ . + "1"^^ . + "custom-post-type"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + "joomla"^^ . + "Is this code already SQL injection proof or should I use prepared statements?"^^ . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "Yes you are right, but even if i **setProtocol('file://')** it doesn't work.\nAnd even if i replace **chroot** with **asset('')** and `$newPath = str_replace('\\\\', '/', $newPath);` with `$newPath = str_replace('\\\\', '/', asset($newPath));` as suggested by Switi it doesn't work"^^ . + "enable multiFile on grid in processmaker3.2"^^ . + . + . + . + . + "<p>I developed a simple php project with some simple framework and now I want to host it on server, the server is shared server and I do not have SSH access, so I have uploaded all the files via cPanel. For some reason the project isn't opening up on web browser correctly, can someone advise what should I do in this case?</p>\n<p>On local machine the project displays correctly and all the pages can be navigated normally, but on web server I'm getting few errors, one related to autoloader. other error indicates platform incompatibility. I think this is related to Composer, but since this is shared hosting without SSH access how to I run <code>composer update</code> or <code>composer dump-autoload</code>.</p>\n<p>On local machine:</p>\n<p>I install the project using composer:</p>\n<p><code>composer create-project quantum/project oraks</code></p>\n<p>then installed the demo skeleton:</p>\n<p><code>php qt install:demo</code></p>\n<p>this was generated controllers, models, view files and other resources.</p>\n<p>I can run the local server via:</p>\n<p><code>php qt serve</code></p>\n<p>all the pages are fully functional (posts, login, manage posts, etc.)</p>\n<p>Now I have zipped all this stuff and uploaded to server (shared hosting) via cPanel, extracted it there, trying to access via browser to the domain and instead of displaying the web page I'm getting error:</p>\n<pre><code>Fatal error: Uncaught Error: Failed opening required '/vendor/autoload.php' in ../index.php on line 3\n</code></pre>\n<p>Environments:</p>\n<ul>\n<li>The framework I use is called: <a href="https://github.com/softberg/quantum-php-core" rel="nofollow noreferrer">quantumphp</a></li>\n<li>My local environment is php 7.4</li>\n<li>The local server is php dev server (not Apache)</li>\n<li>The Server php is also 7.4</li>\n<li>But the web server on hosting is Apache</li>\n</ul>\n<p>The <code>.htaccess</code> file (inside the public directory):</p>\n<pre><code>&lt;IfModule mod_rewrite.c&gt;\n RewriteEngine On\n\n # Removing trailing slash\n RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]\n\n # Handle Front Controller...\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteRule ^(.*)$ /index.php/$1 [L]\n\n&lt;/IfModule&gt;\n</code></pre>\n<p>Please advise</p>\n"^^ . + . + . + . + "the answer is app specific see https://stackoverflow.com/a/79443872/10802527 and https://stackoverflow.com/a/72615104/10802527 https://stackoverflow.com/a/74971954/10802527 but a better app may be PyMuPDF HOWEVER simplest would be any pdf2HTML app that writes with colours for text (ONE COMMAND LINE) then parse that line of HTML. THUS PDF.js usually is no use."^^ . + "1"^^ . + . + "When doing that the ca file is valid (Checked CA file C:\\Program Files\\Common Files\\SSL\\cert.pem: valid)"^^ . + "Agreed, it's very unclear what specific problem you're trying to ask about. "cannot be saved perfectly" is quite a vague statement. Can you clarify the exact situation please? You can [edit] your question. Thanks."^^ . + . + . + "[RENAME the submit button!!!](https://stackoverflow.com/questions/22982741/form-submit-jquery-does-not-work/22982900#22982900) Never call anything submit when you try to handle submit with JS"^^ . + . + . + "1"^^ . + . + "As for the path mappings issue -- not using CodeLite so cannot really help on this."^^ . + . + . + "<p>when using <code>(new mysqli_driver())</code> I see this message in vscode:</p>\n<blockquote>\n<p>Type 'mysqli_driver' is deprecated since PHP 8.1PHP(PHP6403)</p>\n<p>class mysqli_driver The mysqli_driver class is an instance of the monostate\npattern, i.e. there is only one driver which can be accessed though an\narbitrary amount of mysqli_driver instances.</p>\n<p><a href="https://www.php.net/manual/class.mysqli-driver.php" rel="nofollow noreferrer">https://www.php.net/manual/class.mysqli-driver.php</a></p>\n<p>@deprecated</p>\n</blockquote>\n<p>However on the <a href="https://www.php.net/manual/en/class.mysqli-driver.php" rel="nofollow noreferrer">php.net page</a> I see no mention of the whole class being deprecated only a couple of methods. Is my vscode PHP extension in error?</p>\n<p>the php docs are inconclusive.</p>\n"^^ . + . + . + . + "0"^^ . + . + "I don't understand what you're doing here. On DBFIDDLE the output is always the same. The order of the names should be different every time the page is called. But since I don't understand your code, I might be missing something. Could you explain how this does what I ask (**shuffle a list**)?"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "2"^^ . + "This is how the "smart" search is _supposed_ to behave - https://datatables.net/manual/search#Global-search `search: { "bSmart": false, "bRegex": true }` - what is that supposed to be? Why are both option names prefixed with `b`? And why are you trying to set the regex option to true here to begin with?"^^ . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + ""*implicitly promting a reader to think that there is such a thinkg like a "global scope" and such a thin like "all scopes" and if something is available in global scope its' not necessarily should be available in other scopes*" - **yes, [exactly this](https://www.php.net/manual/en/language.variables.scope.php)**. And what makes you at odds with this sentence?"^^ . + "0"^^ . + "Those error reporting calls have no effect on parse errors, since the script is parsed before they can be executed."^^ . + . + . + . + . + . + "0"^^ . + "<p>I'm facing an issue with toast notifications in my CodeIgniter app. After a failed login attempt, the error message is displayed correctly using Toastr. However, this message keeps appearing on every page after the login attempt, even after navigating or refreshing the page.</p>\n<p>I've tried using flashdata to show the error message, but the toast notification keeps appearing on all pages until the session expires or I manually clear the session.</p>\n<p><strong>Here's my login function:</strong></p>\n<pre><code>$login_status = $this-&gt;validate_login($email, $password);`\nif ($login_status == 'success') {`\n redirect(site_url('dashboard'), 'refresh');`\n} else {\n $this-&gt;session-&gt;set_flashdata('error_message', get_phrase('login_failed'));`\n redirect(site_url('login'), 'refresh');\n}\n</code></pre>\n<p><strong>Logout Function:</strong></p>\n<pre class="lang-none prettyprint-override"><code> $this-&gt;session-&gt;sess_destroy();\n $this-&gt;session-&gt;set_flashdata('logout_notification', 'logged_out');\n redirect(site_url('login'), 'refresh');\n}\n</code></pre>\n<p><strong>In includes-bottom.php:</strong></p>\n<pre><code> &lt;script&gt;\n toastr.error('&lt;?php echo $this-&gt;session-&gt;flashdata('error_message');?&gt;');\n &lt;/script&gt;\n&lt;?php } ?&gt;\n</code></pre>\n<p><strong>Session Config:</strong></p>\n<pre><code>$config['sess_cookie_name'] = 'ci_session';\n$config['sess_expiration'] = 7200;\n$config['sess_save_path'] = 'ci_sessions';\n$config['sess_match_ip'] = FALSE;\n$config['sess_time_to_update'] = 300;\n$config['sess_regenerate_destroy'] = FALSE;\n</code></pre>\n<p>I’ve ensured the flash message is unset after use, and session regeneration is done. However, the issue persists where the toast notification keeps appearing across all pages after a failed login.</p>\n<p>Has anyone faced this issue before? What am I missing here?</p>\n<p>I tried using flashdata to display the error message for login failure and unset the session after showing the message. I also ensured the session is regenerated and cleared on logout. I expected the toast message to only appear once when the login fails and not persist across multiple pages or after a page refresh. However, the issue persists, and the toast message keeps showing on every page even after navigating or refreshing the page.</p>\n"^^ . + "1"^^ . + . + . + . + . + . + "0"^^ . + "2"^^ . + . + "Oauth permission each login, even if accepted first"^^ . + "You can also use `$response->json()` instead ([docs](https://docs.guzzlephp.org/en/5.3/quickstart.html?highlight=json#json-responses))."^^ . + . + . + . + "I've got a crappy work around using DynamoDB (which runs as a gateway endpoint rather than a service endpoint so free) that calls lambda to write the logs."^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + "Related: https://stackoverflow.com/questions/32821976/convert-errors-notices-warnings-into-exceptions ; maybe even duplicate"^^ . + . + . + "@MarkRotteveel i posted the relevant part as text"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "XAMPP is outdated software. For development, you don't need anything extra, just PHP and an SQL server. With PHP, you can then open a port to any folder: `php -S $host:$port -t public/`"^^ . + "0"^^ . + "<p>Laravel does not provide a direct money column type.<br />\nI think using decimal is the better option, but if u really need the money type then use raw SQL</p>\n"^^ . + . + . + "Are you struggling with the PHP part or with the JS part? The error you've shown does not look related to JS or Recaptcha at all"^^ . + . + . + . + "Username for Social media network"^^ . + . + "0"^^ . + . + . + . + "datatables"^^ . + "-2"^^ . + . + . + "Custom code not working on lesson pages - Tutor LMS"^^ . + . + "Improve performance of this regex"^^ . + . + . + "<p>To get the course id from the lesson id you can try the below query. LearnPress uses this query. <a href="https://github.com/LearnPress/learnpress/blob/cfc9c9a745fcf6f3a7da672450416f9dc218ce3a/inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php#L170" rel="nofollow noreferrer">Check here</a></p>\n<pre class="lang-php prettyprint-override"><code>$output = $wpdb-&gt;get_var(\n $wpdb-&gt;prepare(\n &quot;SELECT c.ID FROM {$wpdb-&gt;posts} c\n INNER JOIN {$wpdb-&gt;learnpress_sections} s ON c.ID = s.section_course_id\n INNER JOIN {$wpdb-&gt;learnpress_section_items} si ON si.section_id = s.section_id\n WHERE si.item_id = %d ORDER BY si.section_id DESC LIMIT 1\n &quot;,\n $lesson_id\n )\n);\n</code></pre>\n<p><strong>But I think a better option to programmatically mark the lesson as completed is to use the <a href="https://docs.thimpress.com/learnpress/developer-guide/rest-api/#14-finish-lesson" rel="nofollow noreferrer">Rest API</a>.</strong> You just need to call the <code>/wp-json/learnpress/v1/lessons/finish</code> end point and pass the lesson <code>id</code>.</p>\n"^^ . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + . + "1"^^ . + . + . + "delphi"^^ . + "@М.Б. It would be weird that it's an server issue because I have countless of components that have almost the same actions. Anyway, I'm running XAMPP on my PC and MAMPP on my laptop so it's different, I tested it on both devices."^^ . + "Examples such as https://stackoverflow.com/a/66314463/5947043 may help with how to send the file"^^ . + . + "0"^^ . + . + . + "0"^^ . + "<p>I want to add a feature to my Laravel app that allows one user to follow another user. From the research that I've done I should be able to do this without a followings model. So what I do have is a follow_users pivot table with following schema</p>\n<pre><code>Schema::create('follow_users', function (Blueprint $table) {\n $table-&gt;id();\n $table-&gt;foreignId('user_id')-&gt;constrained()-&gt;onUpdate('cascade')-&gt;onDelete('cascade');\n $table-&gt;foreignId('follow_id')-&gt;constrained('users', 'id')-&gt;onUpdate('cascade')-&gt;onDelete('cascade');\n $table-&gt;timestamps();\n });\n</code></pre>\n<p>I understand I don't need the id or the timestamps but I would prefer to have them.</p>\n<p>My routes are as follows:</p>\n<pre><code>Route::middleware('auth:sanctum')-&gt;prefix('v2')-&gt;group(function () {\n Route::apiResource('/follows', FollowController::class);\n});\n</code></pre>\n<p>I have many more routes than this but only showing this for brevity. All my other routes work as expected.</p>\n<p>For my Users model I have the following:</p>\n<pre><code>public function followings(): BelongsToMany\n {\n return $this-&gt;belongsToMany(User::class, 'follow_users', 'follow_id', 'user_id')-&gt;withTimestamps();\n }\n</code></pre>\n<p>I did create a FollowController in which I plan to hold my methods for index, store, show, update, delete. Where I'm getting lost is in the controller. For all of my other controllers I have something like</p>\n<pre><code>public function store(StoreCommentRequest $request)\n {\n $suggestion = Comment::create($request-&gt;validated());\n\n return CommentResource::make($suggestion);\n }\n</code></pre>\n<p>to store my data. But because I don't have a Follow model nor a FollowResource I can't do it the same way.</p>\n<p>How do I code this using the User model to save the data to the pivot table?</p>\n"^^ . + . + "sqlanywhere"^^ . + . + . + . + . + . + . + "I am trying to fetch data from database using php to display it on html but I am to get the following"^^ . + . + . + "That sounds like they are making use of some [HTTP State Management Mechanism](https://datatracker.ietf.org/doc/html/rfc6265), but I don't have access to their configuration, so this is only a broad guess."^^ . + . + "0"^^ . + "1"^^ . + "wkhtmltopdf"^^ . + . + . + "Put another way, you're asking: *can I skip security critical steps under certain conditions?* — Well… yeah. __At your own peril.__ If you understand what those security critical steps do, and they provably don't do anything in your case, then technically you don't need them. But again, can you guarantee those circumstances won't change in the future? Up to you to make that decision to… *checks notes* save 12 to 15 key strokes."^^ . + . + "0"^^ . + . + "strpos"^^ . + . + . + . + "Sending PHP application logs to AWS App Runner container application log (stdout, stderr)"^^ . + . + "0"^^ . + . + . + "How to get count from associative array in MariaDB table?"^^ . + . + . + . + "1"^^ . + "1"^^ . + . + . + . + "Is there anything that prevents you following the recommendation given in the message?"^^ . + "1"^^ . + . + "in my function, there is $object->libraries()-><!< What am I writing here? > to search and delete duplicate items in my database by object"^^ . + . + . + "<p>I have these entries in a MariaDB Wordpress postmeta table:</p>\n<pre><code>meta_key ------------- meta_value\nprofile_star_rating ----------------a:1:{s:25:&quot;skills&quot;;s:1:&quot;4&quot;;}\nprofile_star_rating ----------------a:1:{s:25:&quot;skills&quot;;s:1:&quot;3&quot;;}\n</code></pre>\n<p>and so on...</p>\n<p>I need to count all rows which have the meta_key &quot;profile_star_rating&quot; plus sum up the value from meta_value field. The meta_value is written as an associative array.</p>\n<p>How to handle associative arrays in a SQL statement? My programming knowledge is very basic.</p>\n<p>EDIT: To make it more clear:\n<a href="https://i.sstatic.net/XnzTTqcg.jpg" rel="nofollow noreferrer">Screenshot DB</a></p>\n<p>In this case I need to get 2 for the occurence of the same meta key &quot;profile_star_rating&quot; and 7 for the total count of values 3 and 4.</p>\n<p>I can get the value from one cell like this, but how to wrap that up in an SQL statement?</p>\n<pre><code>add_action('wp_trash_post', 'my_deleted_post');\nfunction my_deleted_post($post_id) {\nglobal $post;\n$author_id=$post-&gt;post_author;\n$rating=$post-&gt;profile_star_rating;\n$value=$rating['profile_star_rating']\n</code></pre>\n"^^ . + "0"^^ . + "Welcome to SO. Please try searching before posting a new question - there is so much knowledge here already. A simple search for the keywords in your title, eg "*php pass data between pages*" turns up many answers https://stackoverflow.com/questions/871858/php-pass-variable-to-next-page, https://stackoverflow.com/questions/5678567/how-to-pass-variables-between-php-scripts, https://stackoverflow.com/questions/16778425/pass-variables-between-two-php-pages-without-using-a-form-or-the-url-of-page, https://stackoverflow.com/q/20294915/6089612, ..."^^ . + . + . + . + . + . + "0"^^ . + "The task script takes a long time to complete and causes the browser to timeout, so i I call it via exec() instead. Yes, the error log file is flooded with "**simple.php called.**" - about 10 per second. Also, only when I append ` >/dev/null &` to the command does the browser complete, otherwise it is continually waiting."^^ . + "0"^^ . + . + . + "<p>From what I could see, the function <code>pll_the_languages</code> echoes the output directly instead of returning it. That's why, as you stated, it also appears at the top of the page.</p>\n<p>If you don't want that to happen again, what you should do is use output buffering.</p>\n<p>Example:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\nfunction switcher() {\n ob_start(); // Start output buffering\n pll_the_languages( array( 'hide_current' =&gt; 1 ) ); // This prints the switcher\n return ob_get_clean(); // Capture the output and return it\n}\nadd_shortcode( 'switcher_shortcode', 'switcher' );\n?&gt;\n</code></pre>\n<p>Explanations:</p>\n<ul>\n<li><code>ob_start</code>: starts buffering the output.</li>\n<li><code>pll_the_languages</code>: prints the language switcher, but doesn't return it.</li>\n<li><code>ob_get_clean</code>: captures the printed output and returns it as a string, preventing it from being displayed twice.</li>\n</ul>\n"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + "<p>You are always overwriting the meta-data entry.</p>\n<blockquote>\n<p>How to solve this confusing problem?</p>\n</blockquote>\n<p>Do not overwrite. The meta-data can contain the same key multiple times. That is what the <code>$single</code> parameter is for. You have it set to <code>true</code>, that signals you want to operate on a single value. As you could demonstrate, this leads to the last-man-standing resolution, that is the last AJAX call (write) wins.</p>\n<p>The default for the <code>$single</code> parameter is <code>false</code>. It will return an array then:</p>\n<pre class="lang-php prettyprint-override"><code>assert( is_scalar($post_id) );\n\n$user_id = get_current_user_id( );\n$key = 'saved';\n$saved = get_user_meta( $user_id, $key );\n</code></pre>\n<p>And only if it was not yet added (to not have too many duplicate meta values), add it:</p>\n<pre class="lang-php prettyprint-override"><code>if ( false === in_array( $post_id, $saved ) )\n{\n add_user_meta( $user_id, $key, $post_id );\n}\n</code></pre>\n<p>Now the procedure is appending. That is you need to add a bit more data-handling, e.g. cleaning up the list every night or so. This depends on your requirements.</p>\n"^^ . + "0"^^ . + . + "cross-domain"^^ . + "I told you two times, and will repeat again: when update query "runs successfully but does no update" it means you just provided **same value that's already in that row**. This is **expected** behavior, which is also explained in the linked answer. When you change the data then indeed it "does" update because the data is changed. Entire behavior you explained is perfectly valid and well documented. I still have no idea why you're at odds with it."^^ . + . + "0"^^ . + "0"^^ . + . + "_"I tried to pass the environment"_ - in the code, this second parameter is named `$indexHost` - is that what you are referring to, when you say "environment"? What actual value did you use for `my-index`(I don't assume this was meant literal)? cURL apparently can't resolve the host name, so I'm guessing that your `my-index` is either wrong, or needs to be registered with Pinecone first or something ...?"^^ . + "<p>As stated in the title i'm currently using Laravel DOMPDF that extends from DOMPDF library to generate PDF from HTML.</p>\n<p><strong>Issue</strong> : Images are displayed in the PDF as a black square with a cross inside</p>\n<p><strong>Context</strong> :</p>\n<p>I'm retrieving from my DB an HTML file that was created using a text editor.</p>\n<pre><code>$template = Template::where('Title', $request-&gt;templateTitle)-&gt;firstOrFail();\n</code></pre>\n<p>This HTML contains placeholders (in the code dynamic-values) for words and images.\nStill from my DB i'm retrieving data to replace these placeholders</p>\n<pre><code>// Retrieve trainer &amp; company data for dynamic replacements.\n$trainer = Trainer::findOrFail($request-&gt;trainerId);\n$company = Company::findOrFail($trainer-&gt;companies_id);\n\n// Define the dynamic values. (Keep these keys in sync with your template)\n$dynamicValues = [\n 'company_name' =&gt; $company-&gt;company_name,\n 'street_number' =&gt; $company-&gt;street_number,\n 'street_type' =&gt; $company-&gt;street_type,\n 'street_name' =&gt; $company-&gt;street_name,\n 'postal_code' =&gt; $company-&gt;postal_code,\n 'city' =&gt; $company-&gt;city,\n 'activity_declaration_number' =&gt; $company-&gt;activity_declaration_number,\n 'acquisition_region' =&gt; $company-&gt;acquisition_region,\n 'registration_number' =&gt; $company-&gt;registration_number,\n 'contact_first_name' =&gt; $company-&gt;contact_first_name,\n 'contact_last_name' =&gt; $company-&gt;contact_last_name,\n 'trainer_first_name' =&gt; $trainer-&gt;first_name,\n 'trainer_last_name' =&gt; $trainer-&gt;last_name,\n 'trainer_address' =&gt; $trainer-&gt;address,\n 'trainer_zip_code' =&gt; $trainer-&gt;zip_code,\n 'logo_path' =&gt; $company-&gt;logo_path, \n];\n\n// Get the initial content from the template.\n$content = $template-&gt;Content;\n// Replace all dynamic text placeholders.\nforeach ($dynamicValues as $key =&gt; $value) {\n $placeholder = '&lt;span class=&quot;dynamic-value&quot;&gt;' . $key . '&lt;/span&gt;';\n $content = str_replace($placeholder, $value, $content);\n}\n</code></pre>\n<p>Then to replace placeholder images for a PDF i call :</p>\n<pre><code>$content = $this-&gt;processDynamicImages($content, $dynamicValues, 'pdf');\n</code></pre>\n<p>Which is just a function that remove images with empty src, retrieve the images marked as 'dynamic-image', replace the placeholder src by it's value and returns the full html:</p>\n<pre><code>private function processDynamicImages($html, array $dynamicValues, $format)\n {\n libxml_use_internal_errors(true);\n $dom = new \\DOMDocument();\n $dom-&gt;loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));\n $images = $dom-&gt;getElementsByTagName('img');\n foreach ($images as $img) {\n if (!($img instanceof \\DOMElement)) {\n continue;\n }\n if (empty($img-&gt;getAttribute('src'))) {\n $img-&gt;parentNode-&gt;removeChild($img);\n continue;\n }\n $class = $img-&gt;getAttribute('class');\n if (strpos($class, 'dynamic-image') !== false) {\n $src = $img-&gt;getAttribute('src');\n foreach ($dynamicValues as $key =&gt; $value) {\n if (stripos($src, $key) !== false) {\n $newPath = ltrim($value, '/'); // e.g. &quot;storage/companies/logos/...&quot;\n // Ensure forward slashes (they work with chroot)\n $newPath = str_replace('\\\\', '/', $newPath);\n $img-&gt;setAttribute('src', $newPath);\n break;\n }\n }\n }\n }\n $result = $dom-&gt;saveHTML();\n libxml_clear_errors();\n return $result;\n }\n</code></pre>\n<p>Then we finish the pdf Creation by defining the chroot (the folder in which DOMPDF will be authorized to look for images)</p>\n<pre><code>$chroot = public_path();\n$pdf = \\Barryvdh\\DomPDF\\Facade\\Pdf::loadHTML($content)-&gt;setOptions(['chroot' =&gt; $chroot, 'isRemoteEnabled'=&gt;true]);\n</code></pre>\n<p>And defining the filename, filepath for storage and create the pdf :</p>\n<pre><code>$filename = $pdfFilename;\n$filePath = storage_path('app/public/Trainers/contracts/' . $filename);\n$pdf-&gt;save($filePath);\n</code></pre>\n<p><strong>What i've found</strong> :</p>\n<p>There is a file called <strong>Cache.php</strong> in a folder called <strong>Image</strong> in the <strong>vendor/dompdf/src</strong> library</p>\n<p>In this file there is a function called <strong>resolve_url</strong> which, as stated at the top of the function is used to <strong>Resolve and fetch an image for use</strong></p>\n<p>After several tests with this function, i found the issue was coming from this foreach :</p>\n<pre><code>foreach ($allowed_protocols[$protocol][&quot;rules&quot;] as $rule) {\n [$result, $message] = $rule($full_url);\n if (!$result) {\n throw new ImageException(&quot;Error loading $url: $message&quot;, E_WARNING);\n }\n }\n</code></pre>\n<p>Where <strong>$allowed_protocols = $options-&gt;getAllowedProtocols()</strong> and <strong>getAllowedProtocols()</strong> returns</p>\n<pre><code>private $allowedProtocols = [\n &quot;data://&quot; =&gt; [&quot;rules&quot; =&gt; []],\n &quot;file://&quot; =&gt; [&quot;rules&quot; =&gt; []],\n &quot;http://&quot; =&gt; [&quot;rules&quot; =&gt; []],\n &quot;https://&quot; =&gt; [&quot;rules&quot; =&gt; []]\n ];\n</code></pre>\n<p>and <strong>[$result,$message]</strong> would return :</p>\n<pre><code>array:2 [▼ // vendor\\dompdf\\dompdf\\src\\Image\\Cache.php:86\n 0 =&gt; false\n 1 =&gt; &quot;Permission denied. The file could not be found under the paths specified by Options::chroot.&quot;\n]\n</code></pre>\n<p>So i removed the foreach, just to find that i had to enable the extension <strong>php_gd</strong> in my <strong>php_ini</strong> and restart my computer and it worked.</p>\n<p><strong>Question</strong>:</p>\n<p>Why does this foreach triggers an error ?</p>\n<p><strong>EDIT ON SWITI ANSWER</strong></p>\n<p>Thank you for your answer Switi</p>\n<p>But as i stated in the body of my question, i've already installed <strong>php_gd</strong> by exactly doing what you are telling in your answer</p>\n<p>Something caught my attention though, i didn't try the asset() for the src.\nSo following up on your advice i replaced in my controller method <strong>processDynamicImages()</strong> , in <strong>if($format === 'pdf'</strong>) this :</p>\n<pre><code>$newPath = str_replace('\\\\', '/', $newPath);\n</code></pre>\n<p>by that :</p>\n<pre><code>$newPath = str_replace('\\\\', '/', asset($newPath));\n</code></pre>\n<p>Now, two things changed.</p>\n<ul>\n<li>First the loading time for the answer coming from the server is way longer, i even had to add <strong>ini_set('max_execution_time', 90);</strong> to the beginning of my Controller to avoid a <strong>Maximum Execution Time</strong> error</li>\n<li>Second, in the <strong>Image/Cache.php</strong> in <strong>DOMPDF</strong> library, the foreach that checks if the image follows security rules is now returning :</li>\n</ul>\n<p><strong>array (0 =&gt; true,1 =&gt; NULL)</strong> instead of <strong>false</strong> and <strong>Permission denied</strong> before returning :</p>\n<pre><code>Dompdf\\Exception\\ImageException {#4598 ▼ // vendor\\dompdf\\dompdf\\src\\Image\\Cache.php:191\n #message: &quot;Image not found&quot;\n #code: 2\n #file: &quot;\nD:\\Graphy Scope\\CRM MASTERFORMA\\Code\\masterforma\\vendor\n\\dompdf\\dompdf\\\nsrc\\Image\\Cache.php\n&quot;\n #line: 117\n trace: {▶}\n}\n</code></pre>\n<p>We're getting somewhere !</p>\n<p>If i <strong>dd($full_url);</strong> i get <strong>http://localhost:8000/storage/companies/logos/QYMcuLqYwlhqZIXst1j13w79iI41wctYNenXVuf6.png</strong> which is the right path to the image, so i don't understand the <strong>image not found</strong></p>\n"^^ . + . + . + "0"^^ . + "0"^^ . + "Yeah, thanks a lot bro"^^ . + "What's the difference between a type and a type declaration?"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + "Hi ADyson. Basically the user enters comments in a rich textarea input field, from there the information is inserted into the database and then recalled again in html format on a different section. Where the html output is, is also an export option for them to export the relevant data. As mentioned the html display is correct but the problem comes with exporting the comments from the database. I hope this makes sense."^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "Also, why not create a fork of that project? Or use any other library to read Excel sheets, like `phpoffice/phpspreadsheet`?"^^ . + . + "2"^^ . + . + . + "2"^^ . + . + "0"^^ . + . + "2"^^ . + "<p>I have a container running in App Runner with a PHP application on it. It has no outbound internet access nor Endpoint to log directly to CloudWatch and so want to utilise the application logs provided by App Runner.</p>\n<p>Nginx logs are posted there which include the request details etc however every way I've tried to post the PHP application logs to it it fails:</p>\n<ul>\n<li>Logging to /proc/1/fd/1 fails due to permission issues</li>\n<li>Logging directly fails due to network connectivity</li>\n<li>Running a background task via <code>tail -f /var/log/file &gt; /proc/1/fd/1 &amp;</code> in the startup script works locally however doesn't work in App Runner and I have no logging information why.</li>\n</ul>\n<p><strong>EDIT</strong></p>\n<p>Also tried supervisord and tailing the log as a process:</p>\n<pre><code>[program:logging]\ncommand=/bin/tail -f /app/log/file.log\nstdout_logfile=/proc/1/fd/1\nstdout_logfile_maxbytes=0\nstderr_logfile=/proc/1/fd/1\nstderr_logfile_maxbytes=0\npriority=300\n</code></pre>\n<p>Once again this works on local containers but not in App Runner</p>\n<p>Is there a way to send the logs to the App Runner Application Logs for a PHP app?</p>\n"^^ . + . + "@IMSoP How do I do that?"^^ . + . + "0"^^ . + . + . + "<p>You can run PHP Code through server either wamp or xampp and for linux lamp server. And your extension must be .php not html.</p>\n"^^ . + . + . + "3"^^ . + . + "it nearly works for me. The blog home and the author archives still 404 but the blog category and the CPT archives work. Any ideas?"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + "accessibility"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + "Is ``img_root(img.png,picture.jpeg`` really your column name? Why did you name it this way?"^^ . + . + . + . + . + "Thanks! #2 worked for me with changes - see my edit."^^ . + . + . + . + "regex-lookarounds"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + "So do you understand the conceptual model now? in the code example in the question link I provided, you'll see this in action - the JS sends an ajax request to the server, and the server just responds with some formatted data, rather than an entire HTML page. The JS receives it back, and uses that data to make a small, targeted update to a specific part of the already-loaded page. That is, as far as I can tell, is exactly what you're aiming to do here."^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + "3"^^ . + . + "1"^^ . + . + "1"^^ . + "0"^^ . + . + "2"^^ . + . + . + . + . + . + "2"^^ . + "I think your code is correct, but the explanation is wrong. The key in messages needs to be `attribute.rule`, not just `attribute`"^^ . + . + . + "I tried changing the content-type in JS but still no luck. Any other suggestions?"^^ . + . + "1"^^ . + . + . + "floating-point"^^ . + "0"^^ . + . + . + "1"^^ . + "0"^^ . + "<p>I’m encountering build errors when using TailwindCSS in my Laravel application. The errors occur when running <code>npm run dev</code>, and I haven’t been able to find a solution online. Here are the details:</p>\n<h3><strong>Error Message</strong></h3>\n<p>The errors are consistent across multiple files, including <code>flatpickr.css</code>, <code>app.scss</code>, <code>home.scss</code>, and <code>coolecto-custom.scss</code>. The key error is:</p>\n<pre><code>TypeError: Cannot read properties of undefined (reading 'blocklist')\n at createContext (D:\\DECIZIF\\CRI\\cri-app-v3\\node_modules\\tailwindcss\\lib\\lib\\setupContextUtils.js:1209:76)\n at getContext (D:\\DECIZIF\\CRI\\cri-app-v3\\node_modules\\tailwindcss\\lib\\lib\\setupContextUtils.js:1278:19)\n ...\n</code></pre>\n<h3><strong>Configuration Files</strong></h3>\n<h4><strong><code>webpack.mix.js</code></strong></h4>\n<pre class="lang-js prettyprint-override"><code>const mix = require('laravel-mix');\nconst tailwindcss = require('tailwindcss');\n\nmix.js('resources/js/app.js', 'public/js').vue()\n .sass('resources/scss/app.scss', 'public/css')\n .options({\n processCssUrls: false,\n legacyNodePolyfills: false,\n postCss: [ tailwindcss('./tailwind.config.json') ]\n });\n\nmix.sass('resources/scss/home.scss', 'public/css');\nmix.sass('resources/scss/coolecto-custom.scss', 'public/css');\n\nmodule.exports = {\n output: {\n hashFunction: 'md5',\n },\n};\n</code></pre>\n<h4><strong><code>tailwind.config.js</code></strong></h4>\n<pre class="lang-js prettyprint-override"><code>module.exports = {\n content: [\n './resources/js/app.js',\n './resources/**/*.vue',\n './resources/views/**/*.php',\n './app/**/*.php',\n ],\n theme: {\n extend: {},\n },\n plugins: [],\n blocklist: [],\n whitelist: [],\n};\n</code></pre>\n<h3><strong>Context</strong></h3>\n<ul>\n<li>I’m using Laravel with Laravel Mix and TailwindCSS.</li>\n<li>I’ve used the Kompo framework (kompo.io) before without issues, but this project is causing problems.</li>\n<li>The errors started appearing after integrating TailwindCSS into this project.</li>\n<li>I’ve tried searching for similar issues but haven’t found anything matching this exact error.</li>\n</ul>\n<p>What I’ve Tried\nVerified that TailwindCSS and PostCSS are correctly installed and configured.</p>\n<p>Ensured that the tailwind.config.js file is correctly referenced in webpack.mix.js.</p>\n<p>Checked for version mismatches between TailwindCSS, PostCSS, and Laravel Mix.</p>\n<h3><strong>Questions</strong></h3>\n<ol>\n<li>What could be causing the <code>blocklist</code> property to be undefined in TailwindCSS?</li>\n<li>Are there any known compatibility issues between TailwindCSS, Laravel Mix, and PostCSS that could lead to this error?</li>\n<li>Are there additional debugging steps I can take to diagnose the issue further?</li>\n</ol>\n<p>Any pointers or resources to help resolve this issue would be greatly appreciated. Thank you!</p>\n"^^ . + "0"^^ . + . + . + "1"^^ . + "0"^^ . + . + "As to your question: it's difficult to guess, from only reading your code, where the problem lies. The best thing to do is to find out where the redirection happens, by debugging, and work your way back from there."^^ . + "@Ben if you name your fields on form as `var[]` - on php side you will get array and can use array_sum then"^^ . + "Why does Python regular expression give different result for the following 2 quantifiers?"^^ . + . + "1"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + "@user1934428 here says that windows does not have same function: https://stackoverflow.com/questions/13826189/shopt-not-found-in-win-bash"^^ . + "0"^^ . + "0"^^ . + . + . + "2"^^ . + . + "2"^^ . + . + . + "<p>Your approach of commenting out the <code>&lt;td&gt;</code> element is correct. Additionally, please remove the <strong><code>colspan</code></strong> attribute in <code>email_order_details.php</code> <code>tfoot</code> section.</p>\n<pre class="lang-php prettyprint-override"><code>&lt;tfoot&gt;\n &lt;?php\n $item_totals = $order-&gt;get_order_item_totals();\n \n if ( $item_totals ) {\n $i = 0;\n foreach ( $item_totals as $total ) {\n $i++;\n ?&gt;\n &lt;tr&gt;\n &lt;th class=&quot;td&quot; scope=&quot;row&quot; style=&quot;text-align:&lt;?php echo esc_attr( $text_align ); ?&gt;; &lt;?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?&gt;&quot;&gt;&lt;?php echo wp_kses_post( $total['label'] ); ?&gt;&lt;/th&gt;\n &lt;td class=&quot;td&quot; style=&quot;text-align:&lt;?php echo esc_attr( $text_align ); ?&gt;; &lt;?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?&gt;&quot;&gt;&lt;?php echo wp_kses_post( $total['value'] ); ?&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php\n }\n }\n if ( $order-&gt;get_customer_note() ) {\n ?&gt;\n &lt;tr&gt;\n &lt;th class=&quot;td&quot; scope=&quot;row&quot; style=&quot;text-align:&lt;?php echo esc_attr( $text_align ); ?&gt;;&quot;&gt;&lt;?php esc_html_e( 'Note:', 'woocommerce' ); ?&gt;&lt;/th&gt;\n &lt;td class=&quot;td&quot; style=&quot;text-align:&lt;?php echo esc_attr( $text_align ); ?&gt;;&quot;&gt;&lt;?php echo wp_kses_post( nl2br( wptexturize( $order-&gt;get_customer_note() ) ) ); ?&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php\n }\n ?&gt;\n&lt;/tfoot&gt;\n</code></pre>\n<p><a href="https://i.sstatic.net/JfHcQkw2.png" rel="nofollow noreferrer">The email should look like this</a></p>\n<p><a href="https://i.sstatic.net/JfHcQkw2.png" rel="nofollow noreferrer">Please check the output table image in this following link</a></p>\n"^^ . + . + . + . + . + "0"^^ . + . + . + "The SELECT is not needed at all, use `RETURNING user_id ` in your INSERT to get the id in return. Fetch this result an you can use the id in your PHP code."^^ . + . + . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + "1"^^ . + . + "<p>I am trying to understand how to create a multi-process inside a loop in Workerman. And is it even possible to achieve this?</p>\n<p>The goal is to have multiple processes run in parallel to iterate through an array. Can anyone help me with this?</p>\n<p>Thank you for your assistance.</p>\n<pre><code>$worker = new \\Workerman\\Worker;\n\n$worker-&gt;onWorkerStart = function () {\n foreach($array as $item) {\n $worker-&gt;count = 10;\n // DO SOME STUFF \n }\n}\n</code></pre>\n"^^ . + "0"^^ . + "<p>Opencart 2,3,0,2, Journal 3 Theme</p>\n<p>i want to do a validation for telephone in one page check out. customer can register via new customer or during onepage checkout. in Journal theme which telephone is marked as required.\nfor new customer i used the code below and works perfect, checks the telephone number is digit and contains only numbers.</p>\n<pre><code>if (\n (utf8_strlen($this-&gt;request-&gt;post['telephone']) &lt; 9) || \n (utf8_strlen($this-&gt;request-&gt;post['telephone']) &gt; 11) || \n preg_match('/[^\\d]/is', $this-&gt;request-&gt;post['telephone'])\n) {\n $this-&gt;error['telephone'] = $this-&gt;language-&gt;get('error_telephone');\n</code></pre>\n<p>in onepage checkout, it does not validate the number same code below.</p>\n<pre><code>if (\n (utf8_strlen(trim($this-&gt;request-&gt;post['telephone'])) &lt; 1) || \n (utf8_strlen(trim($this-&gt;request-&gt;post['telephone'])) &gt; 32)|| \n preg_match('/[^\\d]/is', $this-&gt;request-&gt;post['telephone'])\n) {\n $json['error']['telephone'] = $this-&gt;language-&gt;get('error_telephone');\n}\n</code></pre>\n<p>how can i do a validation with the variable above, what could be the reason? do i control tpl files?</p>\n"^^ . + . + . + "There is no actual PHP code in this, just data. Something else that reads / processes this XML _might_ chose to `eval` the content of the `phpcode` element, whether that's a good idea or not ... But this appears to be a way to instruct some plugin that provides "hooks" to modify its functionality, which PHP code it should execute in certain situations."^^ . + . + . + . + . + "Return total number of results from a TYPO3 db query?"^^ . + "1"^^ . + . + "menuitem"^^ . + . + "<p>i have more web sites, i have tried to copy a code which is working on one ( same woo version, same php version, same theme, same hosting) to another one, but it is not working.</p>\n<pre><code>// **********local pickup orders list color**********\n\nfunction filter_post_class( $classes, $class, $post_id ) {\n // Determines whether the current request is for an administrative interface page\n if ( ! is_admin() ) return $classes;\n\n // Get the current screen object\n $current_screen = get_current_screen();\n\n // Only when\n if ( $current_screen-&gt;id === 'edit-shop_order' ) {\n // Get an instance of the WC_Order object\n $order = wc_get_order( $post_id );\n\n // Is a WC_Order\n if ( is_a( $order, 'WC_Order' ) ) {\n // Get the shipping method\n // $shipping_method = $order-&gt;get_shipping_methods();\n $shipping_method = @array_shift($order-&gt;get_shipping_methods());\n $shipping_method_id = $shipping_method['method_id'];\n\n //NOT empty\n if ( ! empty( $shipping_method ) ) {\n $classes[] = $shipping_method_id;\n }\n }\n }\n\n // Return the array\n return $classes;\n}\nadd_filter( 'post_class', 'filter_post_class', 10, 3 );\n\n// Add CSS\nfunction action_admin_head() {\n // Get the current screen object\n $current_screen = get_current_screen();\n\n // Only when\n if ( $current_screen-&gt;id === 'edit-shop_order' ) {\n echo '&lt;style&gt;\n .type-shop_order.local_pickup {\n background-color: #d5d6ad !important;\n }\n\n &lt;/style&gt;';\n }\n}\nadd_action( 'admin_head', 'action_admin_head' );\n</code></pre>\n<p>i have tried also this one :</p>\n<p><a href="https://stackoverflow.com/questions/51502505/woocommerce-dashboard-highlight-orders-marked-local-pickup">WooCommerce dashboard - highlight orders marked &#39;Local pickup&#39;</a></p>\n<p>but none are working.</p>\n<p>any idea why is this happening and how to fix it?</p>\n"^^ . + . + "0"^^ . + . + . + . + "Why can't I search for tags with Dom\\HTMLDocument?"^^ . + "it is possible that on the old location php errors are suppressed"^^ . + . + "<p>This is what I am using for Github actions.</p>\n<p>Note, to compare the hashes via <a href="https://www.php.net/manual/en/function.hash-equals.php" rel="nofollow noreferrer">hash_equals</a> function!</p>\n<p>Also note, the header keys are underscored in the <a href="https://www.php.net/manual/en/reserved.variables.server.php" rel="nofollow noreferrer">$_SERVER</a> globals array. The dashes are transformed by PHP.</p>\n<blockquote>\n<p>In addition to the elements listed below, PHP will create additional elements with values from request headers. These entries will be named HTTP_ followed by the header name, capitalized and with underscores instead of hyphens. For example, the Accept-Language header would be available as $_SERVER['HTTP_ACCEPT_LANGUAGE'].</p>\n</blockquote>\n<pre><code>$body = file_get_contents(filename: 'php://input');\n$signature = $_SERVER['HTTP_X_HUB_SIGNATURE_256'] ?? '';\n\n$expected = 'sha256=' . hash_hmac(algo: 'sha256', data: $body, key: $secret);\nif (hash_equals($signature, $expected)) {\n return true;\n}\n</code></pre>\n"^^ . + "If we're talking about Azure App Services, theres usually a "Deployment Center" area of the menu on the left where you can see recent CI/CD runs, deployment attempts etc. you should be able to go there and see the Oryx (App Service Build system) logs for the failed deployment. can you share what you find there? hopefully that will provide some more info. but yea maybe you can look at using Flask, Django etc. instead of php here too lol"^^ . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "<p>DataProviders are called before Setup. I see two possibilities if the state variable is to be set dynamically. One has to store the values outside the test class.</p>\n<ol>\n<li>Use <a href="https://github.com/zf1s/zend-registry" rel="nofollow noreferrer">Zend_Registry</a>. Of course, you can also write your own object (singleton) for storing values.</li>\n</ol>\n<pre class="lang-php prettyprint-override"><code>use PHPUnit\\Framework\\TestCase;\n\nclass DataProviderSetupTest extends TestCase\n{\n protected function setUp(): void\n {\n \\Zend_Registry::set('state', 'Thank you for the fish!');\n }\n\n /**\n * @dataProvider statefulDataProvider\n */\n public function testDataProviderWithStateDependency(\\Zend_Registry $expected): void\n {\n $actual = 'Thank you for the fish!'; // generated by some service under test\n $this-&gt;assertSame($expected::get('state'), $actual);\n }\n\n public function statefulDataProvider(): \\Generator\n {\n yield 'member not initialized' =&gt; [\\Zend_Registry::getInstance()];\n }\n}\n</code></pre>\n<ol start="2">\n<li>The dirty workaround is to use global variables. You have to consider whether you can live with it in tests. With an object, you can simply transport several variables.</li>\n</ol>\n<pre class="lang-php prettyprint-override"><code>use PHPUnit\\Framework\\TestCase;\n\n$transportObject = new class {\n public string $state;\n};\n\nclass DataProviderSetupTest extends TestCase\n{\n protected function setUp(): void\n {\n global $transportObject;\n $transportObject-&gt;state = 'Thank you for the fish!';\n }\n\n /**\n * @dataProvider statefulDataProvider\n */\n public function testDataProviderWithStateDependency(object $expected): void\n {\n $actual = 'Thank you for the fish!'; // generated by some service under test\n $this-&gt;assertSame($expected-&gt;state, $actual);\n }\n\n public function statefulDataProvider(): \\Generator\n {\n global $transportObject;\n yield 'member not initialized' =&gt; [$transportObject];\n }\n}\n</code></pre>\n"^^ . + "My account Custom PDF export in multiple languages"^^ . + "@CheeseFlavored Check the updated answer. I've added the full code with PHP cURL. You can search only your items by passing your seller id to the filter parameter."^^ . + . + . + "Symfony Doctrine - How to pass data into a foreign key using fixture?"^^ . + . + "All variables point to a memory location. Just what is stored in this memory location is different."^^ . + . + "What is the message for `error.action.required.data`?"^^ . + . + "2"^^ . + . + . + "CPanel and WordPress Not Working – API 500 Error & No Website Access"^^ . + . + "Thanks for the consideration to all those who helped re-open it. I have provided the answer. Please go through it, and if possible try to help with the other case of "Recording inputs in case the user decides to close the browser tab/window". Together, things work better with thought-pooling. @ADyson"^^ . + . + . + "<p>Since you override the method already, you can add a new parameter with a default value:</p>\n<pre><code>protected function module(int $x, int $y, int $M_TYPE, string $modulShape = ''): string {\n //...\n}\n</code></pre>\n"^^ . + "<p>I've written a Laravel application that generates content for documents and inserts it into existing Word templates using PHPWord. My desired approach is pretty simple:</p>\n<ol>\n<li>I generate the content that I need with Markdown formatting</li>\n<li>I write that content to named slots in Word (E.g. ${slot}) using PHPWord's <a href="https://phpword.readthedocs.io/en/latest/templates-processing.html" rel="nofollow noreferrer"><strong>Template Processing</strong></a></li>\n</ol>\n<p>The issue that I'm experiencing is finding reliable ways to write formatted content such as bulleted lists or applying styles that are pre-existing in the Word document. For example, a markdown section of content might be formatted like this:</p>\n<pre><code># Some heading\nA paragraph of text\n- Bullet 1\n- Bullet 2\nSome more text\n## A sub-heading\n- Bullet 1\n- Bullet 2\nSome text\n</code></pre>\n<p>I don't have an easy way of knowing what the format will be before the text is generated, but I need to now insert this into Word. I've seen people doing this by adding HTML to sections like <a href="https://stackoverflow.com/questions/62082848/phpword-html-to-word-design-issue">here</a>, but I don't know how to do it using named slots, as my content needs to fit into specific places in the document.</p>\n<p>I've tried using the HTML route, but to no avail (formatting not applied, issues with special characters and the Word documents not opening). I've tried plain text, but that obviously leaves out all my required formatting. My latest approach has been to write the actual HTML tags and then use Copilot in Word to format them, but that is tedious and not automated.</p>\n<p>Can someone help me with either:</p>\n<ol>\n<li>A better way of telling PHPWord to apply the in-document styles (e.g Heading 1, Heading 2 etc.) to markdown text generated and inserted into an existing template.</li>\n<li>Or, a way of programmatically telling Copilot in Word to auto-rewrite all of the content inserted with HTML tags.</li>\n</ol>\n"^^ . + . + . + . + . + "@ADyson - a time based survey"^^ . + "1"^^ . + "0"^^ . + . + . + . + . + "Joomla 5.2 / VM 4.4"^^ . + . + . + "0"^^ . + "You can display more currencies in checkout and cart, but it requires you to use other [WooCommerce Action and Filter Hooks](https://woocommerce.github.io/code-reference/hooks/hooks.html). However, the final calculations for payments are still handled in the default currency, as it is tightly integrated with WooCommerce calculations, totals, and payment processing."^^ . + . + "@TimLewis Yeah theres a few ways i've considered doing it using `whereHas`/`whereDoesntHave`, i'm just curious if theres a much nicer/cleaner way to achieve it"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + "unit-testing"^^ . + . + . + "@krisgjika we're creating an application by which we'll save the email deliverability in table"^^ . + . + . + . + . + . + . + . + "Honestly I don't see how it's not a duplicate. It literally says, "whenever you embed a piece of data within a foreign code, you must format it according to the rules of that code", without any exceptions mentioned. So you just have to follow the advise. Otherwise it will make a distinct question for every possible input value."^^ . + . + . + . + "0"^^ . + . + "tx-news"^^ . + . + . + "amazon-s3"^^ . + . + "logout"^^ . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + "So you received the email, but the URL has not been changed? Is it? Did you try checking if this method is reachable?"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + "Moodle External Web Services - Request parameters are not correctly received"^^ . + "<p>This is easy to achieve with generics. Some resources first:</p>\n<ul>\n<li><a href="https://phpstan.org/blog/generics-in-php-using-phpdocs" rel="nofollow noreferrer">Generics in PHP using PHPDocs</a></li>\n<li><a href="https://phpstan.org/blog/generics-by-examples" rel="nofollow noreferrer">Generics By Examples</a></li>\n</ul>\n<p>First you need to make your abstract base class generic with <code>@template</code> tags. And use the <code>T</code> type as <code>$props</code> parameter type:</p>\n<pre class="lang-php prettyprint-override"><code>/**\n * @template T of array&lt;string, mixed&gt;\n */\nabstract class Model {\n\n /**\n * @param T $props\n */\n public static function make(array $props): static\n {\n // ... magic\n }\n\n}\n</code></pre>\n<p>Then the child class extending <code>Model</code> has to use <code>@extends</code> PHPDoc tag from generics to specify the <code>T</code> from <code>Model</code> with the array shape you want to allow to pass to the <code>make</code> method:</p>\n<pre class="lang-php prettyprint-override"><code>/**\n * @extends Model&lt;array{\n * subModelProp: string,\n * }&gt; */\nclass SubModel extends Model {\n\n}\n</code></pre>\n<p>When calling the <code>make</code> method, PHPStan can now verify the keys and values passed as an argument:</p>\n<pre class="lang-php prettyprint-override"><code>// Error:\n// Parameter #1 $props of static method Model&lt;array&lt;string, string&gt;&gt;::make() expects array{subModelProp: string}, array{notAProp: 1} given.\n// Array does not have offset 'subModelProp'.\nSubModel::make(['notAProp' =&gt; 1]);\n\n// Error:\n// Parameter #1 $props of static method Model&lt;array&lt;string, string&gt;&gt;::make() expects array{subModelProp: string}, array{subModelProp: 1} given.\n// Offset 'subModelProp' (string) does not accept type int.\nSubModel::make(['subModelProp' =&gt; 1]);\n\n// OK - No errors\nSubModel::make(['subModelProp' =&gt; 'foo']);\n</code></pre>\n<p>Here's all the code on PHPStan's on-line playground: <a href="https://phpstan.org/r/5a02a2c7-e1a4-4a04-ae77-73788fbebb09" rel="nofollow noreferrer">https://phpstan.org/r/5a02a2c7-e1a4-4a04-ae77-73788fbebb09</a></p>\n"^^ . + . + . + "2"^^ . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "<p>The issue with your original implementation was using <code>$request-&gt;validate</code> as, by default, this will return a redirect. See <a href="https://laravel.com/docs/11.x/validation#automatic-redirection" rel="nofollow noreferrer">here</a> from the laravel docs about why this happens.</p>\n<p>There are two ways to rectify this.</p>\n<ol>\n<li>Override the <code>failedValidation</code> method on the <code>FormRequest</code> class to conditionally check what output is expected from the request. This may work for some cases but we should alternatively do:</li>\n<li>Manually create a validatior instance and check the state of the rules without redirecting.</li>\n</ol>\n<pre class="lang-php prettyprint-override"><code>$data = [...]; //This could be your request, or some other data\n\n$validator = Validator::make($data, (new CustomRequest())-&gt;rules());\n\nif ($validator-&gt;fails()) { \n // Do something\n}\n</code></pre>\n"^^ . + . + . + "1"^^ . + . + . + "1"^^ . + . + . + . + . + . + "1"^^ . + "Custom Herd/Valet Drivers for Resolving URL Paths in Vanilla PHP Projects"^^ . + "What is the error/output you get now?"^^ . + "<p>Just replace <code>:technical</code> with your query statement. Of course, you should need to bind another id such as <code>:id2</code>, otherwise the query doesn't make sense.</p>\n<pre><code>REPLACE INTO devices (id, type, labels, graphical, technical)\nVALUES (:id, :type, :label, :graphical, (SELECT technical FROM devices WHERE id = :id2))\n</code></pre>\n"^^ . + . + "0"^^ . + "0"^^ . + . + "1"^^ . + "-1"^^ . + "@TimLewis it is blowing my mind as well as i have used this type of query 1000s of times and never had this issue. I have tried `->first()` and `->get()` and same outcome. tried the `->toSQL()` as well then inputted that directly into my database and worked fine. for the output i tried `dd()` the code direct, they i assigned it to a variable and `dd()` it as well. I am baffled!"^^ . + . + "How about https://wiki.archlinux.org/title/RTorrent#Saving_magnet_links_as_torrent_files_in_watch_folder"^^ . + . + "0"^^ . + . + "virtuemart"^^ . + "Hi @ADyson, all the files with exact same structure was zipped and uploaded to the server and then extracted, so I think no files should be missing. This is a simple php framework similar to Laravel and uses same `.env` file if you are about it"^^ . + . + . + "0"^^ . + "1"^^ . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + "2"^^ . + . + "0"^^ . + "How to install runkit7?"^^ . + "The key here is the return value of `the_field()`, so please post the code so that we can see what it is doing."^^ . + "<p>I haven't used that framework, but for my composer Symfony project I uploaded the files to my home directory, outside of <code>public_html</code>.</p>\n<p>For this example, directory is <code>/home/seth</code> - my Symfony project was uploaded and unzipped into <code>/home/seth</code>.</p>\n<p>Webserver is configured to host files out of <code>/public_html</code> - I just copied the files from <code>/public</code> to <code>/public_html</code>.</p>\n<p><code>/vender, /config, /src, /bin, /var </code> are the Symfony framework files or my code (/src) - ignore the other folders as they are related to my webhosting panel</p>\n<p><a href="https://i.sstatic.net/jyTGLUqF.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/jyTGLUqF.png" alt="Example Symfony project uploaded to web hosting server" /></a></p>\n"^^ . + "How about use of [`(*SKIP)(*F)`](https://stackoverflow.com/questions/24534782/how-do-skip-or-f-work-on-regex) e.g. [`\\b(?:xx[gls]|(\\D)\\1+)\\b(*SKIP)(*F)|(\\D)\\2+`](https://regex101.com/r/2aaqiM/1) it would be more efficient if you narrow down the `\\D` further to letters `[A-Za-z]` if this would be appropriate to your functioning: [`\\b(?:xx[gls]|([A-Za-z])\\1+)\\b(*SKIP)(*F)|([A-Za-z])\\2+`](https://regex101.com/r/2aaqiM/3)"^^ . + . + "Hmmm... I was able to get better results! Thanks for helping it move forward!\n\nI still need to deal with commas and spaces.... there are times where commas and spaces occur before the english word starts...\n\nexample...\n\n나의, 내my\n\nit now splits!!! but because of the space or comma it splits to....\n\n[1] => 나의,\n[2] => 내my\n\nbut it is close... thanks for your help... if you have any ideas on how to fix above then I would greatly appreciate it!"^^ . + . + . + "2"^^ . + "I am not 100% sure, as My account orders query is made via wc_get_orders() function, but as compatibility mode keeps the data duplicated in WooCommerce and WordPress tables, it could work for your current code if you switch afterward to "WordPress posts storage (legacy)" option (so not anymore HPOS will be used by orders query)."^^ . + . + . + . + "Yes @ADyson, wasn't expecting comments to mangle things so badly. Output added to OP as suggested. Thanks"^^ . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + "So you assume that bots will not have the JavaScript run?"^^ . + "symfony7"^^ . + . + . + . + . + "<p>I happen to have had the same problem before\nThe problem was verifying the request. I don't know what are you trying to submit. However, try dump the validated object returned by this line:</p>\n<pre><code>$validated = $request-&gt;validated();\n</code></pre>\n<p>add this line directly below it:</p>\n<pre><code>dd($validated);\n</code></pre>\n<p>or use debug to see if the $validated object is successfully returned.</p>\n"^^ . + "As a piece of general advice, if you're new to PHP, I would strongly advise you to seek out a host that offers an up to date version (or configure your host to use a newer version) - PHP 7.4 is now old enough that [it no longer gets official security patches](https://www.php.net/eol.php), and newer versions have a lot of useful features. If you stay with an older version, you'll increasingly find that up to date tutorials and libraries just don't work, because they rely on those new features."^^ . + . + "firebase-realtime-database"^^ . + . + . + "Sorry, yes, it's Wordpress. What exactly do you need to narrow down the cause of the problem?"^^ . + . + . + "0"^^ . + "3"^^ . + . + . + "Add search form to WooCommerce My Account > Orders page to query specific order data"^^ . + "1"^^ . + "@PanagiotisKanavos please read what I said again. Laravel is incorrectly sending strings to SQL Server instead of proper `datetime` or `datetime2` types. It should not be doing that. I just pointed out that when receiving improper string parameters SQL Server will convert them to `datetime` and `datetime2` differently, and at least for `datetime` that's affected by the `SET DATEFORMAT` setting. See, for example, [db<>fiddle](https://dbfiddle.uk/kgh3M3CB)"^^ . + "0"^^ . + "<p>I will try to write a seeder for you, it may not exactly be what you want, but it is based on what I understood.</p>\n<p>Have in mind that seeders allows you to do anything you want, you can even run code that has nothing to do with factories. As the name implies, <code>seeder</code> is for seeding data (usually known or completely random from factories) into your database, so here you have the choice of full control (what I am going to do) versus complete randomness.</p>\n<p>I will use Laravel 12.x:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nnamespace Database\\Seeders;\n\nuse App\\Models\\OpeningHours;\nuse App\\Models\\Restaurant;\nuse Database\\Factories\\RestaurantFactory;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\Sequence;\nuse Illuminate\\Database\\Seeder;\n\nclass RestaurantSeeder extends Seeder\n{\n public function run(): void\n {\n Restaurant::factory()\n -&gt;count(10)\n -&gt;create()\n -&gt;each(function (Restaurant $restaurant) {\n /** @var Collection&lt;OpeningHours&gt; $hours */\n $hours = OpeningHours::factory()\n -&gt;count(7)\n -&gt;sequence(\n fn (Sequence $sequence) =&gt; ['day' =&gt; $sequence-&gt;index + 1]\n )\n -&gt;create();\n\n $restaurant-&gt;openingHours()-&gt;saveMany($hours);\n });\n }\n}\n</code></pre>\n<p>I do not know the relationships you have created (it should be <code>HasMany</code> for <code>Restaurant</code> to <code>OpeningHours</code>), then you can use <code>saveMany</code> for <code>openingHours</code> relationship.</p>\n<p>This is what is happening:</p>\n<ol>\n<li>We start a <code>Restaurant</code> factory, creating 10 restaurants.</li>\n<li>Because the factory will return a <code>Collection</code>, we can iterate each model, and we do something with each one (associate hours).</li>\n<li>For each <code>Restaurant</code> model, we create 7 new <code>OpeningHours</code> (the name of the model should be <code>OpeningHour</code>), and each time one is created, we set the day to be the current index (starts from <code>0</code>) + 1, so we go from <code>1</code> to <code>7</code>.</li>\n<li>After the hours are created, we associate those to the current restaurant with <code>saveMany</code> using the relationship.</li>\n</ol>\n"^^ . + . + . + . + . + . + "<p>I don't think there is a single refactoring available for this out of the box, but there are a number of tools to automate it in steps.</p>\n<hr />\n<p>Use <a href="https://www.jetbrains.com/help/phpstorm/inline.html" rel="nofollow noreferrer">&quot;Inline&quot; refactoring</a> to eliminate the direct <code>parent::</code> calls.</p>\n<p>(I hoped that Structural Search would be able to identify the relevant calls, but trying it out locally I could only get a list of classes, not the lines where the call happens. It's possible I just didn't get the right settings.)</p>\n<hr />\n<p>Move the properties and methods using the <a href="https://www.jetbrains.com/help/phpstorm/pull-members-up.html" rel="nofollow noreferrer">&quot;pull members up&quot; and &quot;push members down&quot; refactorings</a>:</p>\n<ol>\n<li>Place the cursor in class <code>B</code></li>\n<li>Choose Refactor -&gt; Push Members Down</li>\n<li>Tick all properties methods</li>\n<li>Click &quot;Refactor&quot;</li>\n</ol>\n<p>Note that if there is more than one child class of <code>B</code>, this will create copies of the methods in all of them. Alternatively, you can use &quot;Pull Members Up&quot; to move them to class <code>A</code>.</p>\n<p>Since you selected all properties and methods, class <code>B</code> will now be empty.</p>\n<hr />\n<p>Use <a href="https://www.jetbrains.com/help/phpstorm/structural-search-and-replace.html" rel="nofollow noreferrer">structural find and replace</a> to make all classes inheriting from <code>B</code> inherit from <code>A</code> instead:</p>\n<ol>\n<li>Open the &quot;Replace structurally...&quot; dialog</li>\n<li>Select the built-in template under PHP -&gt; General -&gt; Class that extends another</li>\n<li>Edit the &quot;Search template&quot; to <code>class $a$ extends \\Full\\NsName\\B {}</code></li>\n<li>Edit the &quot;Replace template&quot; to <code>class $a$ extends \\Full\\NsName\\A {}</code></li>\n<li>Click &quot;Find&quot;</li>\n<li>Review the results and click &quot;Replace Selected&quot; or &quot;Replace All&quot; if you're happy</li>\n</ol>\n<hr />\n<p>Use <a href="https://www.jetbrains.com/help/phpstorm/find-highlight-usages.html" rel="nofollow noreferrer">Find Usages</a> to find any other references to class <code>B</code>, and replace with <code>A</code> or <code>C</code> as required.</p>\n<hr />\n<p>Finally, use <a href="https://www.jetbrains.com/help/phpstorm/safe-delete.html" rel="nofollow noreferrer">Safe Delete</a> to have PhpStorm perform one last check for usages before deleting the class completely.</p>\n"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + "2"^^ . + "1"^^ . + . + . + . + . + . + "3"^^ . + . + "Okay, given there is no maven/gradle task (^^^ !!! ^^^), why did you set the scanner mode for Maven/Gradle integration? And again, regardless which build manager (or none), what prevents you from adding a build step?"^^ . + "0"^^ . + . + "<p>Consider this solution (if it matches with your constraints):</p>\n<pre><code>echo trim(preg_replace('~\\s*([0-9,.]+)\\s*~',' $1 ', $que));\n</code></pre>\n<p>The idea is to blindly catch eventual white-characters that are perhaps already around numbers and to replace them with a space. Then you use the <code>trim</code> function to remove eventual spaces at the start or the end of the string.</p>\n<p>Note that <code>[0-9,.]+</code> to describe a number may be problematic since it matches a single period (too). If a problem occurs with that, use a more descriptive subpattern like:<br><code>\\d[\\d,.]*|[,.]*+[\\d,.]+</code> (that ensures there's a least one digit).</p>\n"^^ . + "0"^^ . + . + . + . + . + . + "But I think you're expecting to write a URL inside an XML file and have the PHP interpreter automatically connect to the internet, fetch the URL and insert the response where the URL is written. Well, that isn't how PHP or XML work."^^ . + . + "<p>I created a laravel project version 12.3.0 and I can not even run the default web application. Although I modified in the .env file.</p>\n<p>Here is the displayed error:</p>\n<p>SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) (Connection: mysql, SQL: select * from <code>sessions</code> where <code>id</code> = e1ltgf5uIYLubHd9IK3OsggRw2ACQJXgw20Nf6wR limit 1)</p>\n<p>I am using MySQL Workbench</p>\n"^^ . + "amazon-app-runner"^^ . + . + "Broadly speaking, images usually bypass WordPress and are usually served directly from the server. So it should really come down to figuring out the absolute path to the image and then just removing the domain. If something else is changing the path, that's different. Is this a sub-folder install?"^^ . + "0"^^ . + . + "Not sure I understand your question. You're not allowed to send requests to the `/tweets` endpoint using Application-only authentication. So in what way would you think you could change the part which posts to that, which would have any effect? You'd still be sending the wrong type of access token to it. Obviously, if you want to post a tweet, you have to use a supported authentication method for that action. Relevant documentation: https://docs.x.com/x-api/posts/manage-tweets/introduction . Tweets are posted by/on behalf of users. Apps alone can't post tweets, because they're not users."^^ . + "<p>I've been developing a new WP theme which is aimed to be installed by the client. I'm making different HTML templates for the different site pages.</p>\n<p>I need to provide all the images used together with the theme, however I have a problem with the image paths. I ask the client to upload all the images in his <code>wp-content/uploads</code> folder, but how to get the domain name? I need the full image path to include it in the templates.</p>\n<p>As in the new WP version the templates can be only HTML, how to get the path of the theme installed? For the patterns (which are PHP files) I can use <code>&lt;img src=&quot;&lt;?php echo get_template_directory_uri()?&gt;/wp-content/uploads/myimage.png&quot;&gt;</code>. However in HTML templates I cannot use PHP! How to get the path then?</p>\n<p>Any ideas?</p>\n"^^ . + . + . + . + "2"^^ . + "multidimensional-array"^^ . + . + . + . + . + "1"^^ . + . + "I'm not familiar with F3, but normally session cookies are related to domain names. Do your apps (websites?) share a domain?"^^ . + "1"^^ . + "pg_query() or pg_insert() functions generate a query with the table name doubled? `relation does not exists`"^^ . + . + . + "1"^^ . + "1"^^ . + "I'm getting 4 seconds if I run the direct ImageMagick version from the command line of the same distort command, same values / image as the PHP script."^^ . + . + . + . + . + . + "<p>I'm working with Yii2 ActiveRecord and noticed an interesting behavior with the toArray() method.</p>\n<p>Consider the following example:</p>\n<pre><code>$model = new UserModel; \nprint_r($model-&gt;toArray());\n</code></pre>\n<p>This returns an empty array ([]), even though UserModel has defined attributes in the database schema.</p>\n<p>My usage case is something like</p>\n<pre><code>$model = new UserModel; \n$model-&gt;name = 'name'; // Only setting one attribute\n\n// somewhere later in code\n$existingModel = UserModel::findOne($id);\nif ($existingModel) {\n // overwriting explicitly set attributes\n $existingModel-&gt;setAttributes($model-&gt;toArray());\n $existingModel-&gt;save();\n}\n</code></pre>\n<p>My question is: does toArray() always return only the explicitly set attributes (e.g. <code>$model-&gt;name = '...'</code> or <code>$model-&gt;setAttribute(...)</code>)</p>\n<p>If so, is there any documentation that confirms this behavior?\nI couldn't find a clear explanation in the official Yii2 documentation.</p>\n"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + "The answer below is informative - but the question doesn’t clarify what the problem is. It would be more than helpful to reframe the question as “this code generates this query, I expect that query, what do I need to change to achieve that?”."^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + "<p>I have this livewire component that shows me information about a customer. It works fine. But, I have a few buttons with the action <code>wire:click</code>. But whenever I press those buttons, it shows a popup of my 404 page. I've tried to pinpoint the issue by commenting code, and I've found that a database query causes the issue. When I remove it, the buttons work, but the functionality gone. In short: I need the database query in order for this component to serve its purpose.</p>\n<p>My view contains this component:</p>\n<pre class="lang-html prettyprint-override"><code>&lt;livewire:klant-inzien /&gt;\n</code></pre>\n<p>And this is the frontend of my component (I removed like all the code and only kept what is needed):</p>\n<pre class="lang-html prettyprint-override"><code>&lt;div&gt;\n &lt;button type=&quot;button&quot; wire:click=&quot;test&quot;&gt;test&lt;/button&gt;\n&lt;/div&gt;\n</code></pre>\n<p>And this is my backend:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nnamespace App\\Livewire;\n\nuse App\\Mail\\InvitatieMail;\nuse Livewire\\Component;\nuse App\\Models\\NieuweKlanten;\nuse App\\Models\\Reserveringen;\nuse App\\Models\\VasteKlanten;\nuse Illuminate\\Support\\Str;\nuse Illuminate\\Mail\\Mailer;\n\nclass KlantInzien extends Component\n{\n public $bericht;\n public $bericht_type;\n\n public $email;\n public $klant = null;\n public $reserveringen;\n public $invitatie;\n\n protected $listeners = ['refresh' =&gt; '$refresh'];\n\n public function mount()\n {\n $this-&gt;email = Route::current()-&gt;parameter('email');\n }\n\n public function render()\n {\n // $this-&gt;klant = VasteKlanten::select('naam', 'straat', 'postcode', 'woonplaats', 'telefoonnummer', 'email')\n // -&gt;where('email', $this-&gt;email)\n // -&gt;first();\n\n // This code here below is causing the issue\n if (!$this-&gt;klant) {\n $this-&gt;klant = Reserveringen::select('naam', 'straat', 'postcode', 'woonplaats', 'telefoonnummer', 'email')\n -&gt;where('email', $this-&gt;email)\n -&gt;orderBy('id', 'desc')\n -&gt;first();\n }\n\n // $this-&gt;reserveringen = Reserveringen::where(function ($query) {\n // $klant_id = $this-&gt;klant ? $this-&gt;klant-&gt;id : null;\n // $query-&gt;where('email', $this-&gt;email)\n // -&gt;orWhere('id', $klant_id);\n // })-&gt;get();\n\n // $this-&gt;invitatie = NieuweKlanten::where('email', $this-&gt;klant-&gt;email)-&gt;get();\n\n return view('livewire.beheer.klant-inzien');\n }\n\n public function test()\n {\n dd('test');\n }\n}\n</code></pre>\n<p>I am not able to find a solution to this problem and why it's caused. Does anyone know a solution?</p>\n<p>I tried to add a test button with a <code>dd()</code> function to see if the code works but it returns a 404. Normally, it should just show the <code>dd()</code> result, but instead it returns a 404.</p>\n<p>The 404 returns with a</p>\n<pre><code>:8000/livewire/update:1 \nFailed to load resource: the server responded with a status of 404 (Not Found)\n</code></pre>\n<p>While using <code>php artisan route:list</code>, the update route does exist. All my other components work, even those containing buttons.</p>\n<p>EDIT:\nThese are my routes (not all of them)</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nuse Illuminate\\Support\\Facades\\Route;\nuse App\\Http\\Controllers\\BeheerderController;\nuse App\\Http\\Controllers\\DashboardController;\nuse App\\Http\\Controllers\\SessionController;\nuse App\\Http\\Controllers\\VerificatieController;\nuse App\\Http\\Middleware\\Guest;\n\nRoute::domain('beheer.' . env('APP_URL'))-&gt;group(function () {\n Route::middleware(['auth:web'])-&gt;group(function () {\n Route::get('/', [DashboardController::class, 'index'])-&gt;name('beheer.dashboard');\n\n Route::view('/klanten', 'beheer.klanten.index')-&gt;name('beheer.klanten');\n // THIS ROUTE BELOW CONTAINS MY LIVEWIRE COMPONENT \n Route::view('/klanten/{email}', 'beheer.klanten.zien')-&gt;name('beheer.klanten.zien');\n Route::view('/invitaties', 'beheer.invitaties')-&gt;name('beheer.invitaties');\n});\n</code></pre>\n<p>EDIT: When I place the alert container outside the component it does work. But i'd like to keep it within the component.</p>\n"^^ . + . + "1"^^ . + . + . + "<p>To add a link for &quot;customization&quot; substring, try the following (defining the page link below):</p>\n<pre class="lang-php prettyprint-override"><code>add_filter('woocommerce_get_availability', 'availability_filter_func');\nfunction availability_filter_func($availability)\n{\n $page_link = site_url('/customisation-page/'); // Define here the correct page link\n $linked_text = sprintf('&lt;a href=&quot;%s&quot;&gt;%s&lt;/a&gt;', $page_link, esc_html__('customization') );\n $replacement = sprintf( __('Sold! Style available for %s using the bespoke code below'), $linked_text );\n\n $availability['availability'] = str_ireplace('Out of stock', $replacement, $availability['availability']);\n \n return $availability;\n}\n</code></pre>\n<p>Tested and works.</p>\n<p><a href="https://i.sstatic.net/QSZJc7Kn.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/QSZJc7Kn.png" alt="single product out of stock" /></a></p>\n"^^ . + . + . + "0"^^ . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + "<p>WordPress does not recognize <strong>d/m/Y</strong> as a valid DATETIME format, and it sorts meta values as strings instead. You need to store and query the date in <strong>YYYY-MM-DD</strong> format.</p>\n<pre><code>update_post_meta($product_id, '_custom_date', date('Y-m-d', strtotime($input_date)));\n</code></pre>\n<p>Then, you can use:</p>\n<pre><code>'value' =&gt; date(&quot;Y-m-d&quot;),\n'type' =&gt; 'DATE',\n</code></pre>\n<p><strong>If you don't want to make this change and want to continue with your current query then :</strong></p>\n<p>your _custom_date field is stored in d/m/Y, you need to:</p>\n<ul>\n<li>Convert the current date to <strong>d/m/Y</strong> format before comparing.</li>\n<li>Use <strong>'type' =&gt; 'CHAR'</strong> instead of <strong>'DATETIME'</strong> because the stored format is not MySQL-friendly.\nSo the query will look like :</li>\n</ul>\n<pre><code>$args = array(\n 'post_type' =&gt; 'product',\n 'posts_per_page' =&gt; 500, \n 'meta_query' =&gt; array(\n array(\n 'key' =&gt; '_custom_date',\n 'value' =&gt; date(&quot;d/m/Y&quot;), // Convert current date to d/m/Y format\n 'compare' =&gt; '&gt;=',\n 'type' =&gt; 'CHAR', // Because _custom_date is stored as a string\n ),\n ),\n 'orderby' =&gt; 'meta_value',\n 'order' =&gt; 'ASC',\n);\n</code></pre>\n"^^ . + . + . + . + "Enums are final. They cannot be extended. You either need to modify the original enum or create a new enum that holds all the values of your base enum plus the ones you want.."^^ . + "1"^^ . + "2"^^ . + . + "Unfortunately, asking for recommendations for other tools would be out of scope for this site. That said, in another life I used to use iText and iTextSharp, both open source, and there is/was the ability to do it there: https://stackoverflow.com/a/9161899/231316"^^ . + "4"^^ . + . + "stop readdir adding directory name into database"^^ . + "0"^^ . + . + . + . + . + . + "2"^^ . + "<p>how you access the HTML file? using double click from finder/explorer?\nif so, that is the problem, try accessing html from browser using url:</p>\n<pre><code>http://localhost/camping_project/home_page/home.html\n</code></pre>\n"^^ . + . + "I could accept the answer as "No, it's not possible", but as a solution the problem is unacceptable.\nSplitting the package into 50 package does not solve the problem, it only makes it bigger. If there is now one vendor directory that is almost half (in terms of disk usage) of all 50 entities, then for 50 entities the size of 50x vendor directories will be even bigger than it is now."^^ . + . + . + . + . + . + . + . + . + . + . + "I posted my solution higher, I don't know how crazy is that."^^ . + . + . + "0"^^ . + . + "@shingo yes sir."^^ . + "I considered calling getDefault in setDefault, but I don't want to do that for one simple reason. I don't need the object right now, and the getDefault method is provided externally, so it can be expensive. For example if you put in that metod `sleep(5)`, setting will take at least 5 seconds."^^ . + . + "OMG, the isset solved the issue. Thank you Musa for the immediate solution."^^ . + "push"^^ . + "0"^^ . + "2"^^ . + . + "1"^^ . + "0"^^ . + "4"^^ . + . + . + "Twice use php native functions after update to php 8.2 in xhprof"^^ . + . + "0"^^ . + . + "<p>I want to send data from js to php (in the future i will change the php file for now i just want to make sure the request work ) I tried to make a post request but I get 405 error\ni also tried the put request but its still show 405 error\nwhy? and how I fix that?\ni tried <a href="https://stackoverflow.com/questions/19143971/http-status-405-method-not-allowed-error-for-rest-api">this</a>\nand this\ntnx.</p>\n<p>html + js :</p>\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;he&quot;&gt;\n&lt;head&gt;\n\n &lt;meta charset=&quot;UTF-8&quot;&gt;\n &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;\n &lt;link rel=&quot;stylesheet&quot; href=&quot;index-styles.css&quot;&gt;\n &lt;link rel=&quot;stylesheet&quot; href=&quot;charts.css-1.1.0/dist/charts.min.css&quot;&gt;\n &lt;link rel=&quot;stylesheet&quot; href=&quot;./coupon-panel.css&quot;&gt;\n &lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt;\n &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n &lt;script type=&quot;module&quot;&gt;import 'charts.css';\n&lt;/script&gt;\n \n &lt;script src=&quot;coupon-panel.js&quot;&gt;&lt;/script&gt;\n &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n &lt;title&gt;חנות אינטרנטית&lt;/title&gt;\n&lt;/head&gt;\n&lt;body onload=&quot;addeventclick()&quot;&gt;\n &lt;header&gt;\n &lt;nav onload=&quot;addeventclick()&quot;&gt;\n &lt;ul&gt;\n &lt;li&gt;&lt;a href=&quot;#&quot;&gt;דף הבית&lt;/a&gt;&lt;/li&gt;\n &lt;li&gt;&lt;a href=&quot;#deals&quot;&gt;מבצעים&lt;/a&gt;&lt;/li&gt;\n &lt;li&gt;&lt;a href=&quot;#best-sellers&quot;&gt;הנמכרים ביותר&lt;/a&gt;&lt;/li&gt;\n &lt;li&gt;&lt;a href=&quot;#about&quot;&gt;אודות החנות&lt;/a&gt;&lt;/li&gt;\n &lt;li&gt;&lt;a href=&quot;#contact&quot;&gt;צור קשר&lt;/a&gt;&lt;/li&gt;\n &lt;li class=&quot;login&quot;&gt;&lt;a href=&quot;#&quot;&gt;כניסת משתמש&lt;/a&gt;&lt;/li&gt;\n &lt;/ul&gt;\n &lt;/nav&gt;\n &lt;/header&gt;\n &lt;h1&gt;hklhkjlk&lt;/h1&gt;\n &lt;h3&gt;קופון פאנל&lt;/h3&gt;\n &lt;button onclick=&quot;newCoupon()&quot;&gt;קופון חדש&lt;/button&gt;\n &lt;button&gt;מחק קופון&lt;/button&gt;\n &lt;table style=&quot;height:200px;width:400px; margin:auto;&quot;&gt;\n &lt;tr &gt;\n &lt;th style=&quot;text-align:center;&quot;&gt;קופון:&lt;/th&gt;\n &lt;th style=&quot;text-align:center;&quot;&gt;שווי:&lt;/th&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td id=&quot;demo&quot;&gt;rtx10&lt;/td&gt;\n &lt;td&gt;10₪&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;ltx5&lt;/td&gt;\n &lt;td&gt;5%&lt;/td&gt;\n &lt;/tr&gt;\n \n &lt;/table&gt;\n &lt;h3 id=&quot;result&quot;&gt;&lt;/h3&gt;\n &lt;div id=&quot;popup&quot; style=&quot;height:200px; width:400px; margin:auto&quot;&gt;\n &lt;label class=&quot;popup-close&quot; onclick=&quot;closePopup()&quot;&gt;X&lt;/label&gt;\n &lt;table style=&quot;height:200px;width:400px;margin:auto;&quot;&gt;\n &lt;tr &gt;\n &lt;td&gt;&lt;label&gt;קוד קופון:&lt;/label&gt;&lt;/td&gt;\n &lt;td&gt;&lt;input id=&quot;code&quot;/&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;&lt;label&gt;שווי:&lt;/label&gt;&lt;/td&gt;\n &lt;td&gt;&lt;input id=&quot;value&quot;/&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;&lt;select id=&quot;typeOfValue&quot;&gt;\n &lt;option value=&quot;%&quot;&gt;% &lt;/option&gt;\n &lt;option value=&quot;₪&quot;&gt;₪&lt;/option&gt;\n &lt;/select&gt;\n &lt;/td&gt;\n &lt;td&gt;\n &lt;button id=&quot;insert&quot; onclick=&quot;submitNewCoupon()&quot;&gt;הזן&lt;/button&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;/table&gt;\n \n &lt;/div&gt;\n\n&lt;script&gt;\n function submitNewCoupon(){\n console.log(&quot;working&quot;);\n let code =$(&quot;code&quot;).val;\n let value=$(&quot;value&quot;).val;\n var e = document.getElementById(&quot;typeOfValue&quot;);\n var value2 = e.value;\n var text = e.options[e.selectedIndex].text;\n let valueOf =text;\n $.post('coupon-panel.php',{cde:code,val:value,valOf:valueOf},function(data){\n $('#result').html(data)\n })\n alert(&quot;SUCSSES&quot;);\n }\n&lt;/script&gt;\n\n\n \n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<p>and here the php file</p>\n<pre><code>&lt;?php\necho &quot;working&quot;;\nphp?&gt; \n</code></pre>\n"^^ . + . + . + . + . + . + . + "0"^^ . + "Fixed. Also added strace logs. I'm not smart enough to analyze them, even if I can see some differences :)"^^ . + "The query has no `:lastname` or `:firstname` parameters. It returns the names of everyone in the table, there's no need for those variables."^^ . + "How to bulk import entities with Doctrine?"^^ . + . + "1"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + "Connect Microsoft Fabrics Warehouse using Doctrine DBAL"^^ . + . + "2"^^ . + . + . + "2"^^ . + . + . + . + "1"^^ . + . + . + "migration"^^ . + . + . + . + "0"^^ . + . + "drupal-10"^^ . + . + . + . + ".htaccess rules for filesmatch to protect config files"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "2"^^ . + . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + "The common way would be to load the pdf in the iframe from a separate URL that just serves the PDF binary content."^^ . + . + . + . + . + "0"^^ . + "how can i get variables suggestions in php without using the $ symbol everytime"^^ . + "What is your OS, and what was the conflict with workbench? I'm guessing it was possibly with the port that workbench uses (3306, the default), but in xampp, you can set the MariaDB port to 3307 (there's a config option) to avoid conflict. Also know that xampp comes with phpMyAdmin, which is _similar_ to workbench, and is a web-based PHP application to interact with databases just like workbench does. What other error(s) were encountered causing frustration?"^^ . + . + . + . + . + . + . + "1"^^ . + "@IanTornquist: It looks like you're in a situation where you're simply assuming that the code isn't working, but only because it's unfinished and you haven't done anything to observe the result yet. You may be over-thinking it. The AJAX request is (very nearly) no different than the request to open the page in the browser. It sends an HTTP request to the server (in your case a POST request with a value) and receives whatever the server responds with (in your case that appears to be the same HTML page the user is currently on). The JavaScript code can then do what it wants with that response..."^^ . + "0"^^ . + . + . + "2"^^ . + . + . + "0"^^ . + . + . + . + . + "It could be an error in VSCode or whatever extension you are using."^^ . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + "If you've set `SESSION_DRIVER=file`, and you don't have any other code that tries to connect to a database, then there's no reason this error should be triggering... Is your error explicitly saying `Unknown database 'projectName'`? That shouldn't happen if you have `DB_DATABASE=` in your `.env`... Honestly, I have no idea what is going on with your code if all of the above is taken into consideration "^^ . + "Add `$mail->SMTPDebug = SMTP::DEBUG_CONNECTION;`, and see what that gets you."^^ . + . + . + . + . + "0"^^ . + . + "^^^ this post should have been closed a duplicate of the link shingo provided above."^^ . + . + "2"^^ . + . + "What's good practice depends on your requirements and that is an entirely different conversation. If this answers your question please accept it. If you have an additional question, ask a new question."^^ . + . + . + . + . + "0"^^ . + . + . + "Unable to setup a PHP variable "max_input_vars""^^ . + . + . + "You cannot use the "render" method if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle""^^ . + "2"^^ . + "0"^^ . + . + "I *think* that the problem is that (as ADyson points out) your hosting service doesn't support PHP, and MAMP is a tool to run a web server which supports PHP **on a computer you control** and won't help you with the hosting service you are using. The solution is to change to a hosting service with the capabilities (i.e. PHP) that you need."^^ . + . + . + "How to avoid issues with step updates in upsertGroupedSteps caused by array reindexing when using dynamic fields? Livewire 3"^^ . + . + "Do you have a reason to think this is the cause of the problem?"^^ . + . + . + "0"^^ . + "@bricas30, then you need the `FOR XML PATH` approach for string aggregation. The answer is updated."^^ . + . + "``->afterStateHydrated(function (FileUpload $component, $state, $record) {\n if ($record && $record->mainImage()) {\n $mainImage = $record->mainImage()->path;\n $component->state([asset('storage/' . $mainImage)]); // Use asset() to generate full URL\n }\n })``\n\nu can use that also \n\nI wrapped the $mainImage in an array.\n\nUsed asset() to convert the file path into a full URL because Filament needs the full URL to preview the file.\n\nThis will now correctly display the already uploaded image and let the user replace or keep it."^^ . + "Are you still get the same error? If not could you please share your for backend and frontend code?"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "2"^^ . + . + "amazon-cloudfront"^^ . + . + . + . + . + . + "0"^^ . + . + . + "@folded_bamboo it depends on environment, your business requirements, desired UX and security requirements. This deserves its own question, because of many aspects that should be considered in Authentication scenarios..."^^ . + . + . + . + . + . + . + . + . + "metadata"^^ . + "Eloquent - Factory of n elements belonging to another with count"^^ . + . + "3"^^ . + . + "2"^^ . + . + "FYI: Reg. 4.: `$state->id ?? null` suggests Phpstan that `$state->id` is nullable and if so, retains null. Therefore `...->value` is nullable, too."^^ . + . + . + . + . + . + "On this step `$this->subject` is null. Updated question with examples. I think handling this relations happen on some higher level."^^ . + . + "0"^^ . + . + "Can you share us the output for `php artisan route:list`?"^^ . + "I am trying some things with Curl and i think (almost sure) that Curl cant find the certificate (it says: schannel: disabled automatic use of client certificate and then switches to use http). But how to configure CURL that it can find the certificate is now the challange"^^ . + . + . + . + "1"^^ . + "@SimonGoater Indeed."^^ . + . + . + . + "0"^^ . + "1"^^ . + "1"^^ . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + "vaadin"^^ . + . + "issue-tracking"^^ . + . + "It's not useless as we can't see the issue you describe, without it. see my answer below."^^ . + . + . + "2"^^ . + "@Ben It depends on your data. If you have more numbers to analyze with 4-digit area codes than 6-digit, then you should check the 4-digit code first."^^ . + "Laravel V12 authentication redirects to /home instead of custom URL"^^ . + . + "@ADyson Yes, I did use very absolute wording there. What I meant was: _Packages do not offer an easy way to install the software without Composer in their documentation._"^^ . + . + "@Sitepor500.com.br So that improved efficiency quite a bit, very nice! Enough answers already, I upvoted both (will never understand some downvoters here). Actually I'm not in a mood of answering at all and was happy that richneedle metnions the (*SKIP)(*F) idea in his answer, thank you."^^ . + . + "In this solution I have to wrap also the `$main_image->path` in an array. Also I got an error saying `Argument #1 ($set) must be of type Filament\\Forms\\Get, Filament\\Forms\\Set given` . So I changed Get to Set, and made little tweaks as changing condition to `if($record?->mainImage()?->path)`, and `$set('image', ["/storage/" . $main_image->path);`. Also, I've created the logic in EditProduct.php. This way it works, but now, when I pick a new image, it won't show the new one until I save changes on the forms."^^ . + . + . + . + . + "i add `'api_middleware' => [\n \\Opcodes\\LogViewer\\Http\\Middleware\\EnsureFrontendRequestsAreStateful::class,\n \\Opcodes\\LogViewer\\Http\\Middleware\\AuthorizeLogViewer::class,\n ],` in my log-viewer.php file. i also add LOG_VIEWER_API_STATEFUL_DOMAINS=127.0.0.1:8000 (same as APP_URL) and still doesn't work"^^ . + . + . + . + "the _use backend\\models\\Invoice_ statement is not triggering the including this time, as the autoloading is missing. So _actually_ you do not include it (but at least you have the use statement)."^^ . + "1"^^ . + "0"^^ . + . + . + "1"^^ . + . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + . + "@Chimdi I've added the comment about handling this in the "PHP router" instead into by answer."^^ . + . + . + "Autoupgrade prestashop 1.7.8.8 to 8.1.7 - how to solve error with "upgradeDB" step?"^^ . + "is mysqli_driver() deprecated or not, DEVSENSE claims it is"^^ . + . + "Invalid HTML on your site aside, the contact form yields a 405 error (Method Not Allowed) ~ perhaps look at the `.htaccess` rules for that page or at any `includes` you have that are blocking POST requests to `send_email.php`"^^ . + . + "Can you try to run this directly on ImageMagick (like in the examples on https://stackoverflow.com/questions/60077318/imagemagick-v7-distortion) to check whether PHP is to blame at all?"^^ . + . + . + "@Adyson, yeah, you nailed it! The intermittent nature is because the OAuthHttpClient is not always being called—the call only triggers after the token has expired. I'll update the question accordingly."^^ . + "presumably it is due to my loop being outside of the option tag, what would be the best way to do it so that it loops for the options instead of the selects?"^^ . + "<p>I simplified all queries and went from fetching a few fields to all. Now it seems to work. Really weird.</p>\n<pre class="lang-php prettyprint-override"><code> public function render()\n {\n if (!$this-&gt;email) {\n abort(404);\n }\n\n $this-&gt;klant = VasteKlanten::where('email', $this-&gt;email)-&gt;first();\n\n if (!$this-&gt;klant) {\n $this-&gt;klant = Reserveringen::where('email', $this-&gt;email)\n -&gt;orderBy('id', 'desc')\n -&gt;first();\n\n $this-&gt;vaste_klant = false;\n }\n\n if ($this-&gt;klant) {\n $this-&gt;reserveringen = Reserveringen::where('email', $this-&gt;email)-&gt;get();\n $this-&gt;invitatie = NieuweKlanten::where('email', $this-&gt;klant-&gt;email)-&gt;get();\n }\n\n return view('livewire.beheer.klant-details');\n }\n</code></pre>\n"^^ . + "4"^^ . + . + "0"^^ . + . + . + "Laravel Dependency Injection running before Middleware"^^ . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + . + . + . + "<p><code>$department-&gt;setInstitute(rand(1,4));</code> looks strange to me - how does <code>setInstitute</code> look like?</p>\n<p>If <code>setInstitute</code> is a common setter, it should require you to use a <code>Institute</code> entity as a parameter. Something like this should work:</p>\n<pre class="lang-php prettyprint-override"><code>$instituteEntities = [];\n\nfor ($i = 0; $i &lt; count($instituteList); $i++) {\n $institute = new Institute();\n $institute-&gt;setName($instituteList[$i]);\n $manager-&gt;persist($institute);\n\n $instituteEntitites[] = $institute;\n}\n\nfor ($i = 0; $i &lt; count($departmentList); $i++) {\n $department = new Department();\n $department-&gt;setName($departmentList[$i]);\n $department-&gt;setInstitute(array_rand($instituteEntitites);\n $manager-&gt;persist($department);\n}\n</code></pre>\n"^^ . + "0"^^ . + "scylla"^^ . + . + . + "How do I make traits share conflicting methods and properties in PHP"^^ . + . + "Thanks @KIKOSoftware!\nI guess, I had the order wrong from the beginning and it now started to matter."^^ . + . + . + "1"^^ . + "1"^^ . + "2"^^ . + . + . + . + "4"^^ . + . + "0"^^ . + . + . + "@yivi ¯\\_(ツ)_/¯ Legacy code base are a mess. Yes, this solves a use case I have, no, I cannot extend from a different class."^^ . + "0"^^ . + "2"^^ . + "0"^^ . + . + . + "Undefined method 'usersCoolPosts', but both the project and method is working/running fine"^^ . + "csrf"^^ . + . + . + . + . + . + "<p>As everything I tried provided no diagnostic information about the problem I went back to basics.</p>\n<p>I assumed that Apache was the problem and did not have the correct permissions to access MySQL - even though it could run a .exe program. It has permission under the Local Systems account on my PC to access and run an .exe such as my c coded &quot;Hello World&quot; program which it did successfully.</p>\n<p>So I gave Apache Administrators rights in:</p>\n<p>Services-&gt;select Apache-&gt;select Log On-&gt;select 'This account-&gt; and provide the Administrator username and password. Click Apply and stop and restart Apache.</p>\n<p>And it worked. I can now access the MySQL data.</p>\n<p>Thank you all for your help and suggestions.</p>\n<p>Finally does anyone have any advice/concerns about giving Apache Administrator rights?</p>\n"^^ . + . + . + "0"^^ . + . + . + . + . + . + "<blockquote>\n<p>And i'm so sure \\backend\\models\\Invoice is present because i can run this code form within my project without any Error.</p>\n</blockquote>\n<p>That's good! Go to that place, and then dump all included files and inspect the list (<a href="https://www.php.net/get_included_files" rel="nofollow noreferrer"><em>get_included_files()</em></a>).</p>\n<p>From that list, pick the class autoloading related files and include them in your script.</p>\n<blockquote>\n<p><a href="https://www.yiiframework.com/doc/guide/2.0/en/concept-autoloading#using-other-autoloaders" rel="nofollow noreferrer">ex.</a></p>\n<pre class="lang-php prettyprint-override"><code>require __DIR__ . '/../vendor/autoload.php';\nrequire __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';\n</code></pre>\n</blockquote>\n<p>You know when it works when the class is found again.</p>\n"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + "2"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + "<p>I am using a plugin where users can write something about other users. Whether a user has the right to do this, can be set by the given user role in the plugin. The plugins works in the buddypress environment which means the user has to be logged in before beeing able to do anything.\nTherefore I would like to give users the possibility with a checkbox to change their role (with the same subscriber rights) on frontend.\nIs that safe? Or do I open doors for someone to give himself admin rights?</p>\n<p>Code would be something like that:</p>\n<pre><code>// ajax needed to post the checkbox state\n$id=get_current_user_id();\nu = new WP_User( $id );\n$u-&gt;remove_role( 'subscriber' );\n$u-&gt;add_role( 'special_subscriber' );\n</code></pre>\n"^^ . + . + . + "The Python script worked just fine. So, I'll go with that! :)"^^ . + . + "<p>I am trying to get some things to work with <a href="https://symfony.com/bundles/ux-live-component/current/index.html#forms" rel="nofollow noreferrer">symfony ux live component form</a> and <a href="https://github.com/SymfonyCasts/dynamic-forms" rel="nofollow noreferrer">dynamic-forms</a>.</p>\n<p>I have a <code>ChoiceType</code> and when I select a value I want to use some data from the choice to pre-fill my price field.</p>\n<p>Before option is selected:</p>\n<p><a href="https://i.sstatic.net/0k1BUWcC.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/0k1BUWcC.png" alt="Before option is selected" /></a></p>\n<p>After option is selected:</p>\n<p><a href="https://i.sstatic.net/LWgS41dr.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LWgS41dr.png" alt="After option is selected" /></a></p>\n<pre class="lang-php prettyprint-override"><code>public function buildForm(FormBuilderInterface $builder, array $options): void\n{\n $builder = new DynamicFormBuilder($builder);\n\n $builder-&gt;add('priceOption', ChoiceType::class, [\n 'choices' =&gt; $this-&gt;choices($options['locale'], $options['section']),\n 'required' =&gt; false,\n ]);\n\n $builder-&gt;addDependent('useCustomPrice', 'priceOption', function (DependentField $field, ?NewTransactionPriceOptionData $priceOption) {\n if ($priceOption) {\n $field-&gt;add(CheckboxType::class, [\n 'label' =&gt; 'Aangepaste prijs',\n 'label_html' =&gt; true,\n 'required' =&gt; false,\n ]);\n }\n });\n\n $builder-&gt;addDependent('customPrice', ['priceOption', 'useCustomPrice'], function (DependentField $field, ?NewTransactionPriceOptionData $priceOption, bool $useCustomPrice) {\n if ($useCustomPrice) {\n $field-&gt;add(PriceType::class, [\n // This does nothing (the object price value exists if I dump here)\n 'data' =&gt; $priceOption?-&gt;price ?? Price::zero(),\n ]);\n }\n });\n}\n</code></pre>\n<p>I also tried to use an event listener in the line FormType;</p>\n<pre class="lang-php prettyprint-override"><code>$builder-&gt;addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {\n $data = $event-&gt;getData();\n $data-&gt;useCustomPrice = false;\n $data-&gt;customPrice = $data-&gt;priceOption?-&gt;price ?? Price::zero();\n $event-&gt;setData($data);\n});\n</code></pre>\n<p>And a similar attempt with a getter &amp; setter and property hook;</p>\n<pre class="lang-php prettyprint-override"><code>class NewTransactionLineData\n{\n // ...\n\n public ?NewTransactionPriceOptionData $priceOption = null {\n get {\n return $this-&gt;priceOption;\n }\n\n set {\n $this-&gt;priceOption = $value;\n $this-&gt;useCustomPrice = false;\n $this-&gt;customPrice = $value?-&gt;price ?? Price::zero();\n }\n }\n\n // ...\n</code></pre>\n<p>I also tried to add the <code>LiveProp</code> to my DTO together with <code>onUpdated</code>, but that is completely ignored by my best guess because well, they are only read on the component but not the related data (component &gt; [liveProp]transactionDto &gt; lineDto). I'm using the <a href="https://symfony.com/bundles/ux-live-component/current/index.html#using-livecollectiontype" rel="nofollow noreferrer"><code>LiveCollectionType</code></a> for my <code>transaction.lines</code>.</p>\n<p>My main question at this point is, how can prefill those fields? If it's possible. If not, do you know any work arounds how you solved something like this?</p>\n<p>And as a second question which I tried to do, is it possible to also update the checkbox (i want to turn it off/hide the custom price every time I change the option).</p>\n<p>Thanks!</p>\n"^^ . + . + "0"^^ . + "postman"^^ . + . + "0"^^ . + "Laravel Blade @can Not Working, But in_array(Auth::user()->getAllPermissions()) Does"^^ . + . + "Laravel Octane - OpenSwoole taskWaitMulti error in concurrently()"^^ . + . + "0"^^ . + . + . + "<p>I am using MacOS Sonoma and when I run <code>intelephense --version</code> on the command line. I get output consisting of 10's of thousands of lines of Node errors. I have tried uninstalling and reinstalled Intelephense globally via Yarn and NPM, including various versions of Node using nvm. The truncated error begins:</p>\n<pre><code>/opt/homebrew/lib/node_modules/intelephense/lib/intelephense.js:7\n })(name =&gt; super[name], (name, value) =&gt; super[name] = value);`}}});function FS(e){return 9===e.kind}function RS(e){return 10===e.kind}function FS(e){return 9===e.kind}function RS(e){return 10===e.kind}function PS(e){return 11===e.kind}function MS(e){return 12===e.kind}function LS(\n</code></pre>\n<p>and so on and so on for very long. It ends with:</p>\n<pre><code>Error: Connection input stream is not set. Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'\n at /opt/homebrew/lib/node_modules/intelephense/lib/intelephense.js:7:3792433\n at t.createConnection (/opt/homebrew/lib/node_modules/intelephense/lib/intelephense.js:7:3793598)\n at 26997 (/opt/homebrew/lib/node_modules/intelephense/lib/intelephense.js:2:2933803)\n at __webpack_require__ (/opt/homebrew/lib/node_modules/intelephense/lib/intelephense.js:7:4115664)\n at /opt/homebrew/lib/node_modules/intelephense/lib/intelephense.js:7:4116348\n at Object.&lt;anonymous&gt; (/opt/homebrew/lib/node_modules/intelephense/lib/intelephense.js:7:4116376)\n at Module._compile (node:internal/modules/cjs/loader:1739:14)\n at Object..js (node:internal/modules/cjs/loader:1904:10)\n at Module.load (node:internal/modules/cjs/loader:1473:32)\n at Function._load (node:internal/modules/cjs/loader:1285:12)\n\nNode.js v23.6.0\n</code></pre>\n<p>It appears that the super long message is just the contents of intelephense.js? Any idea what is going on here?</p>\n"^^ . + . + "1"^^ . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + "<p>I have gathered the following code in an attempt to post to X:</p>\n<pre><code>$api_key='xx';\n$api_secret='yy';\n\n$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, 'https://api.twitter.com/oauth2/token');\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n 'Content-Type: application/x-www-form-urlencoded',\n]);\ncurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\ncurl_setopt($ch, CURLOPT_USERPWD, $api_key.':'.$api_secret);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, 'grant_type=client_credentials');\n\n$response = curl_exec($ch);\n\ncurl_close($ch);\n\n$response=json_decode($response);\n$access_token=$response-&gt;access_token;\n\n$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, 'https://api.twitter.com/2/tweets');\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n 'Authorization: Bearer '.$access_token,\n 'Content-Type: application/json',\n]);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, '{&quot;text&quot;:&quot;Hello, world!&quot;}');\n\n$response = curl_exec($ch);\n\ncurl_close($ch);\n\nprint_r($response);\n</code></pre>\n<p>I'm getting the access_token but in the end I'm presented the following error: &quot;Authenticating with OAuth 2.0 Application-Only is forbidden for this endpoint. Supported authentication types are [OAuth 1.0a User Context, OAuth 2.0 User Context].&quot;</p>\n<p>Any idea to what I'm doing wrong?</p>\n"^^ . + . + . + . + "I am not familiar with neither library, but your response for the `/user/another-challenge` seems wrong. I would try to remove the `user` attribute as in it is not needed for authentication (webauthn credentials get). Also remove the `rp` and instead add an `rpId` attribute with the value `x-y-z.ngrok-free.app`."^^ . + . + "sveltekit"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + "Access Google Drive folder files with drive.file scope"^^ . + . + "@KIKOSoftware so? Fine, they are property. However Laravel says "Undefined variable $showConfirmationModal"."^^ . + . + . + . + "2"^^ . + . + . + . + "2"^^ . + . + . + . + . + . + . + . + . + "<p>The phpseclib/v1 code encrypts with OAEP, using the private exponent for encryption and the public exponent for decryption.</p>\n<p>In phpseclib/v3, however, this is no longer possible, as the private key does not expose an <code>encrypt()</code>-function and the public key no <code>decrypt()</code>-function.<br />\nNevertheless, the functionality can be ported to v3 by swapping the public and private exponents in the keys and then encrypting with the public key and decrypting with the private key as usual.</p>\n<p>Example: Decryption of a ciphertext in v3, which was generated with the posted v1 code:</p>\n<pre class="lang-php prettyprint-override"><code>$privateKeyPem = &quot;-----BEGIN PRIVATE KEY-----\nMIIEvg...\n-----END PRIVATE KEY-----&quot;;\n\n$privateKeySwapped = null;\n$publicKeySwapped = null;\nswapKeys($privateKeyPem, $privateKeySwapped, $publicKeySwapped);\n\n$ciphertext = base64_decode('&lt;Base64 encoded ciphertext generated with the posted v1 code&gt;');\n$decrypted = $privateKeySwapped-&gt;withHash('sha1')-&gt;withMGFHash('sha1')-&gt;decrypt($ciphertext);\nprint($decrypted . PHP_EOL); // my fancy string\n</code></pre>\n<p>with:</p>\n<pre class="lang-php prettyprint-override"><code>function swapKeys($privateKeyPem, &amp;$privateKeySwapped, &amp;$publicKeySwapped) {\n $privateKey = PublicKeyLoader::load($privateKeyPem);\n $privateKeyParams = unserialize($privateKey-&gt;toString('Raw'));\n $privateKeyParamsSwapped = [\n 'e' =&gt; $privateKeyParams['d'],\n 'n' =&gt; $privateKeyParams['n'],\n 'd' =&gt; $privateKeyParams['e'],\n 'p' =&gt; $privateKeyParams['primes'][1],\n 'q' =&gt; $privateKeyParams['primes'][2]\n ];\n $privateKeySwapped = PublicKeyLoader::loadPrivateKey($privateKeyParamsSwapped);\n \n $publicKeyParamsSwapped = [\n 'e' =&gt; $privateKeyParams['d'],\n 'n' =&gt; $privateKeyParams['n']\n ];\n $publicKeySwapped = PublicKeyLoader::loadPublicKey($publicKeyParamsSwapped);\n}\n</code></pre>\n<p>Here it must be taken into account that <a href="https://phpseclib.sourceforge.net/rsa/examples.html#encrypt,pkcs1,pkcs1pub,sign1,enc1,1.0," rel="nofollow noreferrer">v1</a> uses SHA-1 by default for the OAEP- and MGF1-digest, while <a href="https://phpseclib.com/docs/rsa#rsaencryption_oaep" rel="nofollow noreferrer">v3</a> applies SHA-256 by default, so that in v3 both digests must be explicitly set to SHA-1.</p>\n<hr />\n<p>Note that the process &quot;<em>encryption with the private key</em>&quot; is, strictly speaking, not defined at all (but only (1) &quot;<em>encryption with the public key</em>&quot;/&quot;<em>decryption with the private key</em>&quot; and (2) &quot;<em>signing with the private key</em>&quot;/&quot;<em>verification with the public key</em>&quot;).</p>\n<p>Often the paraphrase &quot;<em>encryption with the private key</em>&quot; refers to signing, which may also be the case here. And accordingly, many libraries (if they support such a process at all) sign under the hood (and use the padding for signing), and do not encrypt, unlike phpseclib/v1, which, as described above, really encrypts (with OAEP and swapped exponents)!</p>\n<hr />\n<p>Also note that the PHP/OpenSSL code posted <a href="https://stackoverflow.com/a/79499293/9014097">in your answer</a> generates a signature with PKCS#1 v1.5 padding, where the (unhashed) message is signed directly (and not the DER encoding of the <em>DigestInfo</em> value as it actually should be to comply with the specification in <a href="https://datatracker.ietf.org/doc/html/rfc8017#section-9.2" rel="nofollow noreferrer">RFC 8017</a>).<br />\nIt may even be what you need, but it is not compatible with the logic implemented by the phpseclib/v1 code posted in the question.</p>\n"^^ . + . + "0"^^ . + . + "Indeed, I have to access a database with IP's in order to actually sort it out. That is why my script was going nowhere. And yes, unless I want to create one, I looked for one and found this plugin (IP2Location Redirection) that actually allows me to geo-localise domains and/or urls. Thank you for leading me to the right path, Dyson!"^^ . + . + . + . + "2"^^ . + . + . + "<pre><code>@push('scripts')\n {!! $dataTable-&gt;scripts() !!}\n@endpush\n</code></pre>\n<p>try using this.</p>\n"^^ . + . + . + "The link provided explains it in the second sentence. `In case of static method calls, this is the class explicitly named (usually the one on the left of the :: operator); in case of non static method calls, it is the class of the object.`. This is the non-static method call (because the method is not static), so it refers to the current object."^^ . + . + . + "How is your question not exactly a duplicate? Please [edit] that in. PhpUnit does not need a port, that is entirely Eclipse/PDT"^^ . + . + . + . + . + . + . + "0"^^ . + "-1"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + . + "<p>Manipulating JSON array using PHP and MONGO DB.\nI have the following nested JSON, I need to counts the Repeated Persons to depurate the collecction, in the sample are 4 records but really are 2000 records to depurate.:</p>\n<p>Version of PHP: 8.1</p>\n<pre><code>{\n &quot;numDocumentoIdObligado&quot;: &quot;8370000XX&quot;,\n &quot;numFactura&quot;: &quot;SETP990026611&quot;,\n &quot;usuarios&quot;: [\n {\n &quot;tipoDocumentoIdentificacion&quot;: &quot;CC&quot;,\n &quot;numDocumentoIdentificacion&quot;: &quot;1085902666&quot;,\n &quot;tipoUsuario&quot;: &quot;04&quot;,\n &quot;fechaNacimiento&quot;: &quot;1990-10-09&quot;,\n &quot;codSexo&quot;: &quot;F&quot;,\n &quot;codPaisResidencia&quot;: &quot;180&quot;,\n &quot;codMunicipioResidencia&quot;: &quot;52356&quot;,\n &quot;codZonaTerritorialResidencia&quot;: &quot;02&quot;,\n &quot;incapacidad&quot;: &quot;NO&quot;,\n &quot;consecutivo&quot;: 1,\n &quot;codPaisOrigen&quot;: &quot;170&quot;,\n &quot;servicios&quot;: {}\n },\n {\n &quot;tipoDocumentoIdentificacion&quot;: &quot;CC&quot;,\n &quot;numDocumentoIdentificacion&quot;: &quot;1085902666&quot;,\n &quot;tipoUsuario&quot;: &quot;04&quot;,\n &quot;fechaNacimiento&quot;: &quot;1990-10-09&quot;,\n &quot;codSexo&quot;: &quot;F&quot;,\n &quot;codPaisResidencia&quot;: &quot;180&quot;,\n &quot;codMunicipioResidencia&quot;: &quot;52356&quot;,\n &quot;codZonaTerritorialResidencia&quot;: &quot;02&quot;,\n &quot;incapacidad&quot;: &quot;NO&quot;,\n &quot;consecutivo&quot;: 1,\n &quot;codPaisOrigen&quot;: &quot;170&quot;,\n &quot;servicios&quot;: {}\n },\n {\n &quot;tipoDocumentoIdentificacion&quot;: &quot;CC&quot;,\n &quot;numDocumentoIdentificacion&quot;: &quot;1085902667&quot;,\n &quot;tipoUsuario&quot;: &quot;04&quot;,\n &quot;fechaNacimiento&quot;: &quot;1990-10-09&quot;,\n &quot;codSexo&quot;: &quot;F&quot;,\n &quot;codPaisResidencia&quot;: &quot;180&quot;,\n &quot;codMunicipioResidencia&quot;: &quot;52356&quot;,\n &quot;codZonaTerritorialResidencia&quot;: &quot;02&quot;,\n &quot;incapacidad&quot;: &quot;NO&quot;,\n &quot;consecutivo&quot;: 1,\n &quot;codPaisOrigen&quot;: &quot;170&quot;,\n &quot;servicios&quot;: {}\n },\n {\n &quot;tipoDocumentoIdentificacion&quot;: &quot;CC&quot;,\n &quot;numDocumentoIdentificacion&quot;: &quot;1085902668&quot;,\n &quot;tipoUsuario&quot;: &quot;04&quot;,\n &quot;fechaNacimiento&quot;: &quot;1990-10-09&quot;,\n &quot;codSexo&quot;: &quot;F&quot;,\n &quot;codPaisResidencia&quot;: &quot;180&quot;,\n &quot;codMunicipioResidencia&quot;: &quot;52356&quot;,\n &quot;codZonaTerritorialResidencia&quot;: &quot;02&quot;,\n &quot;incapacidad&quot;: &quot;NO&quot;,\n &quot;consecutivo&quot;: 1,\n &quot;codPaisOrigen&quot;: &quot;170&quot;,\n &quot;servicios&quot;: {}\n }\n ]\n}\n</code></pre>\n<p>What I need is to count the records grouping by &quot;tipoDocumentoIdentificacion&quot; AND &quot;numDocumentoIdentificacion&quot; to get the records with 2 or more repetions, I mean</p>\n<p><strong>Expected result</strong></p>\n<pre><code>#Documento Count \nCC1085902666 2\n</code></pre>\n<p>Here is my source code:</p>\n<pre><code>&lt;?php\n// MongoDB Connection\n$manager = new MongoDB\\Driver\\Manager(&quot;mongodb://localhost:27017&quot;);\n\n// Define database and collection\n$database = &quot;rips&quot;;\n$collection = &quot;rips2275&quot;;\n\n// Aggregation Pipeline\n$pipeline = [\n ['$unwind' =&gt; '$usuarios'], // Unwind array\n ['$group' =&gt; [\n '_id' =&gt; [\n 'tipoDocumentoIdentificacion' =&gt; '$tipoDocumentoIdentificacion',\n 'numDocumentoIdentificacion' =&gt; '$numDocumentoIdentificacion'\n ],\n 'count' =&gt; ['$sum' =&gt; 1]\n ]],\n ['$match' =&gt; [\n 'count' =&gt; ['$gte' =&gt; 2]\n ]]\n];\n\n// Execute Aggregation\n$command = new MongoDB\\Driver\\Command([\n 'aggregate' =&gt; $collection,\n 'pipeline' =&gt; $pipeline,\n 'cursor' =&gt; new stdClass()\n]);\n\ntry {\n $cursor = $manager-&gt;executeCommand($database, $command);\n $results = $cursor-&gt;toArray();\n\n if (empty($results)) {\n echo &quot;No matching records found.\\n&quot;;\n } else {\n foreach ($results as $document) {\n //print_r($document);\n $id = (array) $document-&gt;_id;\n echo &quot;Tipo Documento: &quot; . ($id['tipoDocumentoIdentificacion']).'|';\n echo &quot;Num Documento: &quot; . ($id['numDocumentoIdentificacion']).'|';\n echo &quot;Count: &quot; . $document-&gt;count . &quot;&lt;br/&gt;&quot;;\n }\n }\n} catch (MongoDB\\Driver\\Exception\\Exception $e) {\n echo &quot;Error: &quot; . $e-&gt;getMessage() . &quot;\\n&quot;;\n}\n</code></pre>\n<p>But I am getting the following:\n<a href="https://i.sstatic.net/WCBY3owX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WCBY3owX.png" alt="enter image description here" /></a></p>\n"^^ . + . + . + . + . + "What flavor of SQL are you using?"^^ . + "4"^^ . + "0"^^ . + . + "How do I split queues in Symfony Messenger?"^^ . + "3"^^ . + . + . + . + . + "String evaluation not working. Why isn't this if statement evaluating to true?"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + "@AndreyYanduganov Same error. I am not running any other thing on this Symfony installation apart from `lexik/jwt-authentication-bundle`. I created this new installation specially to solve this error."^^ . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + . + "0"^^ . + "0"^^ . + "Ok. So if you're overriding the module fucntion, what stops you from adding a new parameter to that function, as I mentioned? If you get an error saying you passed too many parameters, that will be because you didn't change the function signature. I don't see what the class's constructor has to do with that."^^ . + . + "0"^^ . + "0"^^ . + . + . + "You're going to want to use the array structure, since you have property names with dashes. It's already an array instead of an object, so that's good. The data could still be accessible as an object, but you'll have to do some extra magic to get it back out. That means you need to access it with `$xx['response']['tProd_avl']['t-prod_avl']`"^^ . + "2"^^ . + . + . + . + "0"^^ . + . + . + . + "smf-forum"^^ . + . + . + "tcpdf"^^ . + . + "<p>I am having problems getting my command line curl command to work with PHP.</p>\n<p>working command line curl below</p>\n<pre><code> curl http://localhost:11434/api/chat -d '{&quot;model&quot;:&quot;deepseek-r1:1.5b&quot;,&quot;messages&quot;:[{&quot;role&quot;:&quot;user&quot;,&quot;content&quot;:&quot;what is your name&quot;}]}'\n</code></pre>\n<p>PHP curl not working. code below</p>\n<pre><code>&lt;?php \n$url = 'http://localhost:11434/api/chat -d';\n$question = $_GET[&quot;q&quot;];\n$model = 'deepseek-r1:1.5b';\n\n$data = array(\n &quot;model&quot; =&gt; $model, \n &quot;messages&quot; =&gt; array( \n array(\n &quot;role&quot; =&gt; &quot;user&quot;,\n &quot;content&quot; =&gt; $question, \n )\n ),\n);\n\n$payload = json_encode($data);\n\n$ch = curl_init($url);\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, &quot;POST&quot;); \ncurl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n$result = curl_exec($ch);\ncurl_close($ch);\n\n$response = json_decode($result, true);\n\necho $response;\n?&gt;\n</code></pre>\n<p>Your guidance is greatly appreciated!</p>\n"^^ . + . + "0"^^ . + . + "If your application uses the dependency injection pattern, you could probably just change your configuration so that it injects MyFix instead of ExternalDependency whereever an instance of Contract needs to be instantiated. If you don't, then we're probably in the territory of doing an automated find-and-replace on your codebase to change all references to `SomeExternalDependency` to `MyFix`. Or maybe you could fork the vendor-provided code and change the implementation of SomeExternalDependency::getFoo` in your forked version."^^ . + . + "2"^^ . + ""Tested in Postman using hardcoded values." - if you already did that, what's the result? Did it work different in Postman?"^^ . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + "<p>Laravel still requires a CSRF token even when using Sanctum with <code>SANCTUM_STATEFUL_DOMAINS</code> because stateful authentication alone does not inherently prevent CSRF attacks.</p>\n<p>While <code>SANCTUM_STATEFUL_DOMAINS</code> ensures that only listed domains use session-based authentication, it does not stop a malicious site from making authenticated requests on behalf of an already logged-in user. CSRF attacks exploit the fact that browsers automatically send cookies with requests, regardless of the origin.</p>\n<p>The CSRF token serves as an additional layer of security by ensuring that every state-changing request includes a unique, verifiable token that must be explicitly set by JavaScript running on the legitimate site. This prevents unauthorized third-party websites from forging authenticated requests, even if they originate from a domain listed in <code>SANCTUM_STATEFUL_DOMAINS</code>.</p>\n"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + "Please provide enough code so others can better understand or reproduce the problem."^^ . + "methods"^^ . + "Do you have the gRPC PHP extension installed? It is required for working with Firestore."^^ . + "I'm sure you could statically analyze the code to find files that are actually needed. This is far from trivial though, because classes may be referenced by strings only available at runtime. Alternatively, you could trace which files are loaded during execution (e.g. in integration tests). In the end, it could even become part of Composer itself. This is not a regular feature I would have heard of anywhere. I guess (and you could perhaps measure it), that the results are not worth the effort."^^ . + . + . + "1"^^ . + . + . + "0"^^ . + . + "*...Some of the examples give a before and after version 7.1...* Can you provide a link to an example?"^^ . + "1"^^ . + "1"^^ . + . + "-1"^^ . + "1"^^ . + "-1"^^ . + "0"^^ . + . + . + . + . + "Google "tutorial php create html form from sql""^^ . + . + "I was just about to suggest that :memory: SQLite can be used for testing, but you've already mentioned it. By the way, this is the correct answer; the database declaration itself is already a secondary necessity."^^ . + . + . + . + "<p>When using exec() or proc_open() after posix_seteuid() or posix_setuid() I expected the resulting process to run as the UID I set inside the running script. This does not happen.</p>\n<p>is this how it's supposed to work? I've worked around this by changing the user on the executed commandline, but it just seems like a security hole to change the UID and have exec() and proc_open() run things as root anyway.</p>\n<p>Google searching has turned up nothing on this subject.</p>\n<pre><code>&lt;?php\nif (false === posix_setgid(1000)) echo &quot;Could not setgid\\n&quot;;\nif (false === posix_setuid(1000)) echo &quot;Could not setuid\\n&quot;;\necho posix_getpwuid(posix_getuid())['name'].&quot;\\n&quot;;\necho exec('echo $USER').&quot;\\n&quot;;\n</code></pre>\n<p><strong>Was expecting:</strong><br />\n# php test<br />\nron<br />\nron</p>\n<p><strong>Got instead:</strong><br />\n# php test<br />\nron<br />\nroot</p>\n"^^ . + "Just to check a few things, do other LiveComponents work or is this your first/only LiveComponent? Did you clear the cache? Does the console show any JS errors? Is Stimulus up and running (you can see a message from hello_controller.js in the console's messages) if you've just started using it. Could you also show the contents of assets/app.js as well as assets/bootstrap.js? This would all greatly help in diagnosing :)"^^ . + . + "internationalization"^^ . + "0"^^ . + . + . + "1"^^ . + "<p>I'm working on a Laravel application where I need to serve images stored in the filesystem and display them on a web page. I have defined the following route in web.php:</p>\n<pre><code>Route::post('/image/{campaign}/{folder}/{filename}', function ($campaign, $folder, $filename) {\n $path = &quot;private/campaigns-images/campaign-$campaign/$folder/$filename&quot;;\n\n if (!Storage::exists($path)) {\n abort(404);\n }\n\n $file = Storage::get($path);\n $mimeType = Storage::mimeType($path);\n \n return Response::make($file, 200)-&gt;header(&quot;Content-Type&quot;, $mimeType);\n})-&gt;name('image.show');\n</code></pre>\n<p>HTML and JavaScript\nIn my frontend, I'm trying to load and set the image as a background for a Fabric.js canvas using JavaScript:</p>\n<pre><code>&lt;div class=&quot;mySlides&quot;&gt;\n &lt;div class=&quot;numbertext&quot;&gt;1 / 3&lt;/div&gt;\n &lt;img id=&quot;background-image&quot; \n src=&quot;{{ route('image.show', ['campaign' =&gt; 1, 'folder' =&gt; 'images_17', 'filename' =&gt; 'DJI_20241105104710_0123_V.JPG']) }}&quot;\n alt=&quot;Campaign Image&quot;\n style=&quot;width: 100%; max-width: 1200px; height: auto;&quot;&gt;\n&lt;/div&gt;\n\n&lt;canvas id=&quot;canvas&quot;&gt;&lt;/canvas&gt;\n</code></pre>\n<pre><code>const canvas = new fabric.Canvas('canvas');\n\nfunction setBackgroundImage() {\n const imgElement = document.getElementById('background-image'); \n\n if (imgElement) {\n imgElement.onload = function () {\n fabric.Image.fromURL(imgElement.src, function (img) {\n canvas.setBackgroundImage(img, canvas.renderAll.bind(canvas), {\n scaleX: canvas.width / img.width,\n scaleY: canvas.height / img.height\n });\n });\n };\n\n // If the image is already loaded (from cache), trigger onload manually\n if (imgElement.complete) {\n imgElement.onload();\n }\n }\n}\nwindow.onload = function () {\n setBackgroundImage();\n};\n</code></pre>\n<h4>Issue</h4>\n<p>When I try to access an image via (GET request):\n<code>http://127.0.0.1:8000/admin/image/1/images_17/DJI_20241105104710_0123_V.JPG</code>\nI get the response &quot;No response data for this request&quot; but if I click on the same link the resource is available</p>\n<p>What I've Tried\nChecked that the file exists using Storage::exists($path), and it does.\nChanged the route method from POST to GET, but still no response.\nChecked storage/logs/laravel.log but no related errors appear.\nTried return response('Test Response'); inside the route, but nothing is displayed..</p>\n"^^ . + "Also did that (added), no extra info (i think)"^^ . + . + "Marking the return type as `mixed` is also [available as of PHP 8.0](https://www.php.net/manual/en/language.types.mixed.php), but the _syntax for return types in general_ has [existed since **7.0**](https://www.php.net/manual/en/language.types.declarations.php). If you're running a PHP version older than _that_, you _really_ need to prioritise an upgrade."^^ . + . + . + . + . + "@C3roe Okay, that makes sense. is there a way to do what I'm after?"^^ . + . + . + "I can't speak to your specific problem, but sometimes when I'm debugging things like this I put `add_header` directives into the various `location` blocks to ensure the URL I'm testing is matching the block."^^ . + "0"^^ . + "Yes I did check my edited code above please"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "i try that right now but didn't work!"^^ . + . + "You rote "Modifying the code to do a simple "Hello World" is successful." - does that mean you have successfully executed that hello world exe via PHP?"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "How do I get a user's preferred language in the pre-rendered view in laravel's maintenance mode"^^ . + . + . + "<p>Gives this error</p>\n<p><img src="https://i.sstatic.net/EDH6g8jZ.jpg" alt="Screen" /></p>\n<p>После разворачивания Duplicator показывает такие ошибки</p>\n<p><img src="https://i.sstatic.net/V0wQAjEt.jpg" alt="files" /></p>\n<p>Here is the text from the screenshots</p>\n<pre><code>SCRIPT FILE TEST: /home/g/genado6g/udv.webmolot.pro/public_html/index.php\n\nEXCEPTION Cannot access offset of type string on string\n FILE: /home/g/genado6g/udv.webmolot.pro/public_html/wp-content/themes/udv/footer.php[27]\n --- TRACE ---\n FUNCTION: require_once FILE: /home/g/genado6g/udv.webmolot.pro/public_html/wp-includes/template.php[810]\n FUNCTION: load_template FILE: /home/g/genado6g/udv.webmolot.pro/public_html/wp-includes/template.php[745]\n FUNCTION: locate_template FILE: /home/g/genado6g/udv.webmolot.pro/public_html/wp-includes/general-template.php[92]\n FUNCTION: get_footer FILE: /home/g/genado6g/udv.webmolot.pro/public_html/wp-content/themes/udv/index.php[245]\n FUNCTION: include FILE: /home/g/genado6g/udv.webmolot.pro/public_html/wp-includes/template-loader.php[106]\n FUNCTION: require_once FILE: /home/g/genado6g/udv.webmolot.pro/public_html/wp-blog-header.php[19]\n FUNCTION: require FILE: /home/g/genado6g/udv.webmolot.pro/public_html/index.php[17]\n FUNCTION: require_once FILE: /home/g/genado6g/udv.webmolot.pro/public_html/wp-content/wp_test_script_bef17e1-03023858.php[117]\n</code></pre>\n<p>How can I solve this problem?</p>\n"^^ . + . + . + "2"^^ . + "-2"^^ . + "Identifier 'VAR' has already been declared"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + "Your PHP is too old. Upgrade it."^^ . + . + . + . + . + . + "<p>You can create a dummy model that will be used for all types of data for which you do not have models, let's call it <code>DummyModel</code>.</p>\n<p>You will need to extend Laravel's <code>MorphTo</code> model with your own version of the <code>createModelByType</code> method:</p>\n<pre class="lang-php prettyprint-override"><code>public function createModelByType($type)\n{\n $class = Arr::get(Relation::morphMap() ?: [], $type, DummyClass::class);\n\n return tap(new $class, function ($instance) {\n if (! $instance-&gt;getConnectionName()) {\n $instance-&gt;setConnection($this-&gt;getConnection()-&gt;getName());\n }\n });\n}\n</code></pre>\n<p>(The Laravel original version of this method has <code>$class = Model::getActualClassNameForMorph($type);</code>, and there is no easy way to replace the static method on <code>Model</code>.)</p>\n<p>This will return your <code>DummyClass</code> any time the morph map does not have a matching class.</p>\n"^^ . + "<p>The solution was to check which processes were running</p>\n<pre><code>netstat -ano | findstr :5173\nnetstat -ano | findstr :8000\n</code></pre>\n<p><a href="https://i.sstatic.net/Btfc1Wzu.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Btfc1Wzu.png" alt="netstat" /></a></p>\n<p>and then open PowerShell and <code>taskkill</code> them</p>\n<pre><code>taskkill /PID 3676 /F\ntaskkill /PID 26668 /F\n</code></pre>\n<p><a href="https://i.sstatic.net/op9zVGA4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/op9zVGA4.png" alt="taskkill processes" /></a></p>\n<p>Now when I start the project the other port isn't being used</p>\n<p><a href="https://i.sstatic.net/TWrhIJjW.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TWrhIJjW.png" alt="the port is not being used this time" /></a></p>\n<p>and I'm able to see the proper project</p>\n<p><a href="https://i.sstatic.net/0kFOIDrC.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/0kFOIDrC.png" alt="Php 8 Laravel 11 and Filament Dashboard" /></a></p>\n"^^ . + . + "0"^^ . + "https://laravel.com/docs/11.x/deployment#nginx has the nginx config, so check against that.. You shouldn't have `location` set to the system path."^^ . + . + . + . + "sanctum"^^ . + "1"^^ . + . + "On local, the HTTP response is okay, but on the server, I didn't get a response.\n```\nserver {\n server_name baltxx.com;\n root /var/www/baltxx/public;\n index index.php index.html;\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 unix:/run/php/php8.2-fpm.sock;\n fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;\n include fastcgi_params;\n }\n location ~ /\\.ht {\n deny all;\n }\n}\n server_name baltixxx.com;\n```"^^ . + . + . + "5"^^ . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + "0"^^ . + . + . + . + . + "<p>Further to my post <a href="https://stackoverflow.com/questions/79420123/xero-api-connection">Xero api connection</a></p>\n<p>I've created a very simple test code based on <a href="https://developer.xero.com/documentation/guides/oauth2/pkce-flow/" rel="nofollow noreferrer">https://developer.xero.com/documentation/guides/oauth2/pkce-flow/</a>\nThe code opens to the xero permissions page correctly but when it returns (with a url containing all necessary parts) I just get an error response of &quot;invalid_client&quot; from the api.</p>\n<p>The client id is correct code and url string being returned so I'm not sure why it's not validating and returning my tokens ??</p>\n<p>My Code:</p>\n<pre><code> &lt;?php\nsession_start();\n\n$clientId='BFFD3*************B848C70';\n$redirectUri='http://localhost/starter/beta.php';\n$state = 'abc1';\n$codeVerifier = 'RgdEXOZqF4lUQ8KcYJps7eY0zd3OsPQQOwVDdl86e3'; \n\n// callback from xero \nif($_GET['code'] &amp;&amp; $state == $_GET['state']){\n\n\n$session_state = $_GET['session_state'];\n$state = $_GET['state'];\n$code = $_GET['code'];\n$scope = $_GET['scope'];\n \n\n// Token endpoint URL\n$tokenUrl = 'https://identity.xero.com/connect/token';\n \n\n// cURL options\n$ch = curl_init($tokenUrl);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POST, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([\n 'grant_type' =&gt; 'authorization_code',\n 'client_id' =&gt; $clientId,\n 'code' =&gt; $code,\n 'redirect_uri'=&gt;$redirectUri,\n 'code_verifier' =&gt;$codeVerifier\n]));\n\n// Execute the request\n$response = curl_exec($ch);\n\nif(curl_error($ch)) {\n var_dump(curl_error($ch));\n}\n\n\ncurl_close($ch);\n\nprint_r($response);\nexit();\n\n \n} else {\n \n // initial auth \n// opens page to authorise permission\n// workign as expected \n\n $codeChallenge = base64url_encode(hash('sha256', $codeVerifier, true)); \n\n$url = &quot;https://login.xero.com/identity/connect/authorize?response_type=code&amp;client_id=$clientId&amp;redirect_uri=$redirectUri&amp;scope=openid profile email accounting.transactions&amp;state=$state&amp;code_challenge=$codeChallenge&amp;code_challenge_method=S256&quot;;\n\nheader(&quot;Location:$url&quot;); \n\nexit(); \n\n}\n</code></pre>\n"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + "1"^^ . + . + "0"^^ . + "What errors are you getting?"^^ . + "<p>UI form code</p>\n<pre><code> &lt;form action=&quot;{{ url('/chefsUpload') }}&quot; method=&quot;POST&quot; enctype=&quot;multipart/form-data&quot;&gt;\n @csrf\n\n &lt;h3 class=&quot;text-center mb-4&quot;&gt;Chefs Information&lt;/h3&gt;\n\n &lt;!-- Name --&gt;\n &lt;div class=&quot;mb-3&quot;&gt;\n &lt;label for=&quot;name&quot; class=&quot;form-label&quot;&gt;Chef Name&lt;/label&gt;\n &lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;name&quot; name=&quot;name&quot; placeholder=&quot;Enter chef's name&quot; required&gt;\n &lt;/div&gt;\n\n &lt;!-- Speciality --&gt;\n &lt;div class=&quot;mb-3&quot;&gt;\n &lt;label for=&quot;speciality&quot; class=&quot;form-label&quot;&gt;Speciality&lt;/label&gt;\n &lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;speciality&quot; name=&quot;speciality&quot; placeholder=&quot;Enter speciality&quot; required&gt;\n &lt;/div&gt;\n\n &lt;!-- Image Upload --&gt;\n &lt;div class=&quot;mb-3&quot;&gt;\n &lt;label for=&quot;image&quot; class=&quot;form-label&quot;&gt;Image&lt;/label&gt;\n &lt;input type=&quot;file&quot; class=&quot;form-control&quot; id=&quot;image&quot; name=&quot;image&quot; accept=&quot;image/*&quot; required&gt;\n &lt;/div&gt;\n\n &lt;!-- Submit Button --&gt;\n &lt;div class=&quot;text-center&quot;&gt; \n &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary px-4 py-2&quot;&gt;\n Save Chef\n &lt;/button&gt;\n &lt;/div&gt;\n\n&lt;/form&gt;\n\n</code></pre>\n<p>UserController Code function ChefUpload</p>\n<pre><code>public function storechef(request $request)\n{\n if($request-&gt;hasFile('image'))\n {\n $image = $request-&gt;file('image');\n $imageName = time().'.'.$image-&gt;getClientOriginalExtension();\n $image-&gt;move(public_path('chefsUpload'),$imageName);\n Chefs::create([\n 'name'=&gt;$request-&gt;name,\n 'speciality'=&gt;$request-&gt;speciality,\n 'image'=&gt;$imageName\n ]);\n return redirect()-&gt;route('storechef')-&gt;with('success','Chefs Store Successfully');\n }\n}\n</code></pre>\n<p>Route Web Routes</p>\n<pre><code>use App\\Http\\Controllers\\userController;\nRoute::post('/chefsUpload', [userController::class,'storechef']);\n</code></pre>\n<p>Error I am getting\nNot Found\nThe requested resource /chefsUpload was not found on this server.\non Route\n<a href="http://127.0.0.1:8000/chefsUpload" rel="nofollow noreferrer">http://127.0.0.1:8000/chefsUpload</a></p>\n<p>Help me Solve this error</p>\n"^^ . + "You can reduce the effect to just 43.3+23.4 which in floating point isn't exactly 66.7"^^ . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + "zend-form"^^ . + . + "1"^^ . + "It still does the 'redirected too many times' thing but I noticed localhost/example.com rewrites to localhost/example.com/ and localhost/example.com/ rewrites to localhost/example.com, but the page doesn't load. I've decided to leave it as C3roe advised. I'll use the directives on live server and comment them out when working with localhost.. Thanks for the help."^^ . + . + "categories"^^ . + "<p>I'm getting this PHP error after a server move, can anyone suggest a solution?</p>\n<p><code>PHP Warning: Trying to access array offset on null in /public_html/cpd-online/wp-content/plugins/sfwd-lms/includes/course/ld-activity-functions.php on line 275</code></p>\n<p>Line 275</p>\n<p><code>if ( version_compare( $data_settings_courses['version'], '2.5', '&gt;=' ) ) {</code></p>\n<p>It's not erroring on line 268 for $data_settings_quizzes, which is odd. PHP 8.3 and not able to edit the plugin file, just trying to understand why this error on the new server vs the old location.</p>\n<p>Thanks</p>\n"^^ . + "0"^^ . + . + "2"^^ . + . + . + "0"^^ . + . + . + . + . + "https://github.com/laravel/docs/pull/10238"^^ . + . + . + "0"^^ . + . + . + . + "FYI, putting `<html>` into a loop, makes very little sense. One HTML document can only have _one_ `html` element. And form elements should be in the `body`."^^ . + . + "0"^^ . + . + . + "Hide quantity button for virtual product variations in WooCommerce"^^ . + "Thank you for pointing that out @LoicTheAztec. I was so focused on writing my answer that I didn't specify the compatibility. I’ve now added the clarification in the answer and question, and I hope this makes it clearer for everyone. Your feedback is greatly appreciated."^^ . + "1"^^ . + "0"^^ . + . + "PREG_MATCH_ALL not returning matches"^^ . + "I guess my question would be, why are you trying to do this? What problem are you trying to solve?"^^ . + "Are you accessing the page this runs in via `http://127.0.0.1:8000/` as well - or is the request for the image a cross-origin request?"^^ . + "update the post"^^ . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + "<p>Using Fedora 41 I am trying to switch from php8.4 to php8.3\nBased on <a href="https://linuxcapable.com/how-to-install-php-on-fedora-linux/" rel="nofollow noreferrer">this page</a> I did this:</p>\n<pre><code>sudo dnf upgrade --refresh\nsudo dnf install http://rpms.remirepo.net/fedora/remi-release-41.rpm -y\nsudo dnf module enable php:remi-8.3 -y\n\nsudo dnf module list php\nMise à jour et chargement des dépôts :\nDépôts chargés.\nName Stream Profiles Summary \nphp remi-7.4 common [d], devel, minimal PHP scripting language \nphp remi-8.0 common [d], devel, minimal PHP scripting language \nphp remi-8.1 common [d], devel, minimal PHP scripting language \nphp remi-8.2 common [d], devel, minimal PHP scripting language \nphp remi-8.3 [e] common [d], devel, minimal PHP scripting language \nphp remi-8.4 common [d], devel, minimal PHP scripting language \nsudo dnf install php php-cli -y\n</code></pre>\n<p>Despite this when I do</p>\n<pre><code>php -v\nPHP 8.4.1 (cli) (built: Nov 21 2024 08:58:25) (NTS)\nCopyright (c) The PHP Group\nZend Engine v4.4.1, Copyright (c) Zend Technologies\n</code></pre>\n<p>I am still using php8.4\nI would appreciate any help.</p>\n"^^ . + . + "1"^^ . + . + . + "0"^^ . + "I don't think these are hints being added accidentally, the screenshot shows valid PHP code, just not compatible with old versions of PHP."^^ . + . + . + "0"^^ . + . + "0"^^ . + "<p>I want an editable textarea after all my content in a TCPDF document.</p>\n<p>With the below command, I added this textarea, but there comes no new page. If I set the rows to a higher number, the box is getting bigger, but still no new page.</p>\n<p><code>$content .= '&lt;textarea cols=&quot;80&quot; rows=&quot;16&quot; name=&quot;text2&quot;&gt;&lt;/textarea&gt;';</code></p>\n<p><a href="https://i.sstatic.net/XWv3rYUc.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XWv3rYUc.png" alt="enter image description here" /></a></p>\n<p>Does there exists a textarea which I can make bigger or smaller like I want?</p>\n<p>my footer is this:</p>\n<pre><code>public function Footer() {\n if ($this-&gt;last_page_flag) {\n $this-&gt;SetY(-15);\n $this-&gt;SetFont('helvetica', 'N', 11);\n\n $text = &quot;Seite &quot;.$this-&gt;getAliasNumPage().'/'.$this-&gt;getAliasNbPages();\n $this-&gt;Cell(0, 5, &quot;Unterschrift: Druckdatum: &quot;.date(&quot;d.m.Y H:m:s&quot;).&quot; &quot;.$text, 0, false, 'L', 0, '', 0, false, 'T', 'M');\n } else {\n $this-&gt;SetY(-15);\n $this-&gt;SetX(-114);\n $this-&gt;SetFont('helvetica', 'N', 11);\n $text = &quot;Seite &quot;.$this-&gt;getAliasNumPage().'/'.$this-&gt;getAliasNbPages().&quot;&quot;;\n $this-&gt;Cell(115, 5, $text, 0, false, 'R', 0, '', 0, false, 'T', 'M');\n }\n}\n</code></pre>\n<p>If I only set text the page break runs fine. Only the textareas are the problems.</p>\n"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "*"Does anyone know a solution?"* - That depends on what problem you're trying to solve. So far you appear to be indicating that Microsoft Edge doesn't include the word "Mobile" in its user agent string. This isn't a problem, it's simply an observation. What's the actual problem you're trying to solve? Why do you think you need the user agent to say something different? Why do you need the user agent at all?"^^ . + . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + "<p>I am having a issue where when i write out a eloquent query using a variable it is returning NULL but if i write out that variable value in text it returns data.</p>\n<p>This is my code</p>\n<pre><code>$code = 'Test123';\n\nLiveProducts::where('code', $code)-&gt;first();\n</code></pre>\n<p>When i dump that query out i get NULL, but if i type it out like this:</p>\n<pre><code>LiveProducts::where('code', 'Test123')-&gt;first();\n</code></pre>\n<p>Then it will return data from the database.</p>\n<p>I have dumped out the variable and it is defiantly a string.</p>\n"^^ . + "1"^^ . + . + "0"^^ . + . + . + . + . + . + . + "I can't deploy the site on the hosting after localhost via Duplicator"^^ . + "0"^^ . + . + . + . + . + "2"^^ . + "1"^^ . + "Link post thumbnail image when automatically creating Woocommerce product from a Wordpress post"^^ . + "<pre><code> $count = $lastNumber-&gt;id - $lastColumn-&gt;id;\n \nlike this\n\n $count = ($lastNumber-&gt;id ?? 0) - ($lastColumn-&gt;id ?? 0);\n\nAnd the base problem was the lastNumber or the lastColumn is null.\n\nyou can use laravel sql debug mode to print the mysql query statement like this:\n\nDB::connection()-&gt;enableQueryLog();\n$lastNumber = Number::orderBy('created_at', 'desc')-&gt;first();\n$lastColumn = Number::where('column', '=', $column)-&gt;orderBy('created_at', 'desc')-&gt;first();\ndump(DB::getQueryLog());\n</code></pre>\n"^^ . + "<p>I´ve got a code and can´t explain it to me anymore..\nIt´s a working code but i can´t find the closing bracelet and the breadcrumb appears magicly on my website.\nIt´s PHP (HyperTextPREProcessor) ;)</p>\n<p>can you tell me the the no(zero) bug is which is not one ?</p>\n<p>Copilot says too there´s no bug and testing it no Bug.. :)</p>\n<p>I got the breadcrumb code from here StackOverflow and modified it that it´s not zero original anymore :)</p>\n<p>{I want to hide the breadcrumb but it´s not linked anywhere ==?}</p>\n<p>U can use this for schooling.. it´s from 2018 :)</p>\n<pre><code>function navshow(){\n global $_SERVER, $domain, $langurl, $_GET, $navcow, $SharedDomain, $issubdomain, $clearedmaindomain, $url, $page, $autourl;\n $an='Navigation: ';\n $home='https://'.$domain.'/';\n $pie=explode('/',$_SERVER['REQUEST_URI']);\n $tr=&quot; &gt;&gt; &quot;;\n $navcow=$an.'&lt;a title=&quot;ToNEKi-Media - The Web&quot; href=&quot;https://toneki-media.com&quot;&gt;ToNEKi-Media&lt;/a&gt;';\n $an2=$an.'&lt;a title=&quot;ToNEKi-Media - The Web&quot; href=&quot;https://toneki-media.com&quot;&gt;ToNEKi-Media&lt;/a&gt;';\n $b=count($pie);\n $c=0;\n $ta ='';\n if ($pie[1]!='') $langurl=$pie[1];\n if (strlen($langurl)!=2){\n $langurl='';\n }else{\n $langurl=StrToLower($langurl);\n }\n for($a=1;$a&lt;$b-1;$a++){\n $ta=$ta.$pie[$a].'/';\n if ($a!=1){\n #$navcow .=$tr.'&lt;a href=&quot;'.$home.$ta.'&quot;&gt;'.ucfirst($pie[$a]).'&lt;/a&gt;';\n }\n $c++;\n }\n $file=explode('.',ucfirst($pie[$b-1]));\n if ($_GET['edit']=='1'){\n if ($_GET['page']==''||StrToLower($_GET['page'])=='index'||$_GET['page']=='Home' ) $_GET['page']='home';\n $page=$_GET['page'];$url=$page;\n }else{\n if ($file[0]==''||StrToLower($file[0])=='index'||$file[0]=='Home' ) $file[0]='home' ;\n $page=$file[0];$url=$page;\n }\n if (stristr($domain, 'cook-maestro')||stristr($domain, 'snack-online')||stristr($domain, 'asiafood-curator')||stristr($domain, 'doener-curator')||stristr($domain, 'pizza-curator')){\n #$navcow=$an2.$tr.'&lt;a title=&quot;Cook Maestro - Where dreams of food become true&quot; href=&quot;https://cook-maestro.com&quot;&gt;Cook-Maestro&lt;/a&gt;';\n }\n $navcow .=$tr.'&lt;a href=&quot;'.$SharedDomain.'&quot; title=&quot;'.$SharedDomain.'&quot;&gt;'.ucfirst($clearedmaindomain).'&lt;/a&gt;';\n if ($issubdomain=='1') $navcow .=$tr.'&lt;a href=&quot;'.$home.'&quot; title=&quot;'.$home.'&quot;&gt;'.$domain.'&lt;/a&gt;';\n #$navcow .=$tr.'&lt;a title=&quot;'.$home.$langurl.'/&quot; href=&quot;'.$home.$langurl.'/&quot;&gt;'.ucfirst($langurl).'&lt;/a&gt;';\n $autourl=str_replace('%20', ' ', $url);\n $autourl=str_replace('-', ' ', $autourl);\n $autourl2=auto2url($autourl);\n #$navcow .=$tr.'&lt;a href=&quot;'.$home.$langurl.'/'.$autourl2.'.html&quot; title=&quot;'.ucfirst($autourl).'&quot;&gt;'.ucfirst($autourl).'&lt;/a&gt;';\n }\n</code></pre>\n<p>Explain: U can use this for schooling. it´s from 2018 :) Vs Code shows there´s no closing bracelet. I Agree but post on stackoverflow has closing. mm</p>\n"^^ . + . + . + . + . + . + "<p>I am using the OceanWP theme and Elementor Pro. I am using Elementor widgets: PRODUCTS and OceanWP widgets: WOO - PRODUCTS. These widgets do not allow you to display a SHORT PRODUCT DESCRIPTION from WooCommerce under the PRODUCT TITLE.</p>\n<p>I have created two shortcodes in PHP that allow this. The description appears either at the very top of the product field or at the very bottom. Changing priorities does nothing. I cannot place the SHORT PRODUCT DESCRIPTION exactly between the PRODUCT NAME and its PRICE. Please help.</p>\n<ol>\n<li>PHP CODE for the Elementor widget - PRODUCTS:</li>\n</ol>\n<pre><code> // SHOWING A SHORT DESCRIPTION UNDER THE PRODUCT TITLE IN THE PRODUCTS WIDGET by Elementor\n\n add_action( 'elementor/widget/render_content', function( $content, $widget ) {\n // Check if it's a Products widget in Elementor\n if ( 'woocommerce-products' === $widget-&gt;get_name() ) {\n // Get the current HTML content of the widget\n ob_start();\n add_action( 'woocommerce_after_shop_loop_item', function() {\n global $product;\n $short_description = $product-&gt;get_short_description();\n\n if ( $short_description ) {\n echo '&lt;div class=&quot;elementor-product-short-description&quot; style=&quot;margin-top: 5px; font-size: 14px; color: #666;&quot;&gt;';\n echo wp_kses_post( $short_description );\n echo '&lt;/div&gt;';\n }\n }, 15 );\n ob_end_flush();\n }\n return $content;\n }, 10, 2 );\n</code></pre>\n<ol start="2">\n<li>PHP CODE for the OceanWP widget - WOO - PRODUCTS:</li>\n</ol>\n<pre><code> // DISPLAYING A SHORT DESCRIPTION UNDER THE PRODUCT TITLE IN THE WIDGET WOO - PRODUCTS by OceanWP\n\n add_action( 'woocommerce_after_shop_loop_item_title', function() {\n global $product;\n \n if ( ! $product ) {\n return;\n }\n\n // Download a short description of the product\n $short_description = $product-&gt;get_short_description();\n\n // If the description exists, we add it ONLY under the title\n if ( $short_description ) {\n echo '&lt;div class=&quot;elementor-product-short-description&quot; style=&quot;margin-top: 5px; font-size: 14px; color: #666;&quot;&gt;';\n echo wp_kses_post( $short_description );\n echo '&lt;/div&gt;';\n }\n }, 15 ); // We changed the priority to 15 so that it is AFTER the title but before the price and button\n</code></pre>\n"^^ . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + "What WooCommerce hooks should I use to display a short product description on a page powered by Ellementor?"^^ . + . + "`$adresseFacturationSelectionner = $this->modelAdressesFacturation->getAdresse((int)$this->panier->adresses_facturation_idAdresses_facturation);` for `$this->modelAdressesFacturation` its `$this->modelAdressesFacturation = new AdressesFacturationModel();` and `private AdressesFacturationModel $modelAdressesFacturation;` Hello, I did not put the code because the error comes from the SQL and an unrecognized column so I thought that the controller had no influence, here is the code, I still risk making some mistake it is my first time that I post"^^ . + "Translate and combine a PHP string array using Smarty"^^ . + "0"^^ . + "Large File Request via API Returns Empty Response with 200 Status"^^ . + . + . + "1"^^ . + . + . + "0"^^ . + . + "When i run the index.php file in phpmyadmin folder i get the following errors: PHP Warning: Module "mbstring" is already loaded in Unknown on line 0"^^ . + . + . + . + "For reference:\nhttps://datatracker.ietf.org/doc/html/rfc8030 and https://www.w3.org/TR/push-api/"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + "Laravel request validation: input called "data""^^ . + . + . + "I've tried this on a different server with AlmaLinux 9 x_86 and I get the same error"^^ . + "subdomain"^^ . + . + "0"^^ . + "2"^^ . + "2"^^ . + "Redis streams memory leak?"^^ . + "That's the thing, even when i run /wp-json/jwt-auth/v1/token, I get an HTML page"^^ . + . + . + "If you are delivering software for a client to run on employee machines then you probably want to package it in some fashion. Docker is a good way to do this, but there are many other approaches. If you're a junior, then presumably you're not dealing with clients directly, and you have senior colleagues that you can ask about this."^^ . + . + . + . + . + . + . + . + . + "frameworks"^^ . + "<p>To achieve your goal of allowing users to select 11 players from your database and display them on the screen, you can use <a href="https://www.phpformbuilder.pro" rel="nofollow noreferrer">PHP Form Builder</a>. PHP Form Builder is a powerful tool that simplifies the process of creating forms in PHP. It uses PowerLite PDO (<a href="https://github.com/migliori/power-lite-pdo" rel="nofollow noreferrer">https://github.com/migliori/power-lite-pdo</a>) as its Database Abstraction Layer (DBAL), which makes it easy to interact with your MySQL database using PDO.</p>\n<p>Here's a simplified example inspired by the provided code:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\nuse phpformbuilder\\Form;\nuse Migliori\\PowerLitePdo\\Db;\n\nsession_start();\ninclude_once 'path/to/phpformbuilder/autoload.php';\n\n$container = require_once 'path/to/power-lite-pdo/bootstrap.php';\n$db = $container-&gt;get(Db::class);\n\n// create the players html variable\n$playersOutput = '';\n\nif ($_SERVER[&quot;REQUEST_METHOD&quot;] == &quot;POST&quot; &amp;&amp; Form::testToken('select-players-form') === true) {\n // Process form submission\n $selectedPlayers = [];\n foreach ($_POST as $position =&gt; $playerId) {\n $selectedPlayers[$position] = $playerId;\n }\n // Display selected players\n $playersOutput = '&lt;h2&gt;Selected Players&lt;/h2&gt;&lt;ul&gt;';\n foreach ($selectedPlayers as $position =&gt; $playerId) {\n $playerName = $db-&gt;selectRow('players', 'name', ['id' =&gt; $playerId])-&gt;name;\n $playersOutput .= '&lt;li&gt;' . $position . ': ' . $playerName . '&lt;/li&gt;';\n }\n $playersOutput .= '&lt;/ul&gt;';\n}\n\n// Create the form\n$form = new Form('select-players-form', 'horizontal', 'novalidate', 'bs5');\n$positions = ['ST', 'GK']; // Add other positions as needed\n\nforeach ($positions as $position) {\n $players = $db-&gt;select('players', 'id, name', ['position' =&gt; $position]);\n $options = [];\n while ($row = $db-&gt;fetch()) {\n $options[$row-&gt;id] = $row-&gt;name;\n }\n $form-&gt;addSelect($position, 'Select ' . $position, $options, 'required');\n}\n\n$form-&gt;addSubmit('submit', 'Submit');\n\n?&gt;\n&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n&lt;head&gt;\n &lt;meta charset=&quot;UTF-8&quot;&gt;\n &lt;title&gt;Select Players&lt;/title&gt;\n &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css&quot;&gt;\n &lt;?php $form-&gt;printIncludes('css'); ?&gt;\n&lt;/head&gt;\n&lt;body&gt;\n &lt;div class=&quot;container&quot;&gt;\n &lt;?php echo $playersOutput; ?&gt;\n &lt;h1&gt;Select Players&lt;/h1&gt;\n &lt;?php $form-&gt;render(); ?&gt;\n &lt;/div&gt;\n &lt;script src=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js&quot;&gt;&lt;/script&gt;\n &lt;?php $form-&gt;printIncludes('js'); $form-&gt;printJsCode(); ?&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<p>This example demonstrates how to create a form that allows users to select players by position and then display the selected players after form submission. You can expand this example to include all positions and customize it further as needed.</p>\n<p>Disclaimer: I am the author of PHP Form Builder and PowerLite PDO.</p>\n"^^ . + . + "0"^^ . + "<p>In Ubuntu Apache server laravel 5.8</p>\n<pre><code>$this-&gt;validate($request, [\n 'supplier_id' =&gt; 'required',\n 'supplier_name' =&gt; 'required']) \n \nThis is not working while the below validator function is working\n\n $validator = Validator::make($request-&gt;all(), [\n 'supplier_id' =&gt; 'required',\n 'supplier_name' =&gt; 'required'])\n\n\nOn other hand both are working on localhost xamp server.\n</code></pre>\n"^^ . + . + . + "1"^^ . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + "2"^^ . + . + . + "Also, the documentation states that the request parameters are: "merchantId", "merchantUserId", "subscriptionId", "transactionId", "amount", "autoDebit". But your payload data includes "notificationId" and does not include "autoDebit". So I think the root of the problem is that you simply haven't compared your payload data to the documentation properly. Did you not check it, field by field, before posting your question??"^^ . + . + "0"^^ . + . + "1"^^ . + . + . + "You can just write it out like this: https://3v4l.org/fHt2T . Does that help? Not _exactly_ sure what the question is - are you asking if there's specific syntax for symbolic algebra in PHP in the way you've written it out? If so, then no I'm not aware of that, unless someone else is."^^ . + . + . + . + . + . + . + . + "Call it setDeferredDefault or similar to make the first point visible. For your second point, a trait is always in use in a concrete object, therefore there is little use to mock only the trait, it will never work that way (then it would be a class). But you can however create your own mock classes that use such a trait, and you can create them on the fly anonymously, for that see the update of the answer."^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + "2"^^ . + . + "0"^^ . + . + . + "It depends on what you send, why you send it, and where you send it. I definitely wouldn't follow the given example. I would never transmit personal data in such an open manner. URLs are logged by proxy servers, internet service providers, and your own server, which means my email address would inevitably get stored on multiple machines unnecessarily. If something needs to be sent securely, use a POST request. It was designed for this purpose, and SSL authentication will ensure its encryption on the sender’s side and decryption on the receiver's side."^^ . + . + . + "@hakre what kind of debugger recommnded to use and how to install it"^^ . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + "2"^^ . + "0"^^ . + . + . + . + . + "FWIW, if it is possible I would encourage looking at a dedicated task system, and it doesn't need to be overly complex, either. If you have server access you can have a daemon running which monitors for jobs, otherwise you can have a cron that checks periodically. There is a little bit of up-front work to set these up, but I've found debugging and managing these is much easier."^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + "If you're not sure whether the code works, test it."^^ . + . + . + . + "Storing Emojis in Mysql"^^ . + "1"^^ . + "0"^^ . + "<p>I'm very new to docker and for the past week i have been trying to fix some issues. I decided to wipe it all clean and restart following a few tutorials. A lot of things worked before, except i had some database issues. The problem is that half thing i do from the tutorial, i simply don't understand so i am not really sure where i could have gone wrong. And now docker can't find my index is my assumption.. but i don't know how to fix it and all the resources online are so overwhelming and complicated to me.</p>\n<p>Also i am on Ubuntu and my index.php is inside a src directory which is in the project root directory.</p>\n<p>My docker-compose.yml:</p>\n<pre><code>services:\n apache-php:\n image: apache-pdo\n build:\n context: .\n dockerfile: Dockerfile\n volumes:\n - /home/marnix/Documents/hacklab_php/book_management_system/var/www/html\n ports:\n - &quot;80:80&quot;\n networks:\n - app-network\n mysql:\n image: mysql\n volumes:\n - /home/marnix/Documents/hacklab_php/DB:/var/lib/mysql\n environment:\n MYSQL_ROOT_PASSWORD: password\n networks:\n - app-network\n phpmyadmin:\n image: phpmyadmin\n environment:\n PMA_HOST: mysql\n ports:\n - &quot;8080:80&quot;\n depends_on:\n - mysql\n networks:\n - app-network\nnetworks:\n app-network:\n driver: bridge\n</code></pre>\n<p>my Dockerfile:</p>\n<pre><code>RUN docker-php-ext-install pdo pdo_mysql\nEXPOSE 80\n\nRUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf\nRUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf\n\nLABEL org.opencontainers.image.source=&quot;https://github.com/MilesChou/docker-xdebug&quot; \\\n repository=&quot;https://github.com/MilesChou/docker-xdebug&quot; \\\n maintainer=&quot;MilesChou &lt;jangconan@gmail.com&gt;&quot;\n\nRUN pecl install xdebug \\\n &amp;&amp; docker-php-ext-enable xdebug\n</code></pre>\n"^^ . + . + . + "<p>The issue is coming because %resource-type% as the post type slug is conflicting with other archives. Wordpress is not able to put correct query for other archives.\nTo solve this you can manually adjust the rewrite rules while ensuring that other WordPress archives remain functional.\nThe following code correctly rewrites only the required URLs while keeping blog, author, and other archives working.</p>\n<pre><code>function register_resource_post_type() {\n $args = array(\n 'public' =&gt; true,\n 'has_archive' =&gt; 'resources', // Ensures archive works\n 'rewrite' =&gt; array(\n 'slug' =&gt; '%resource-type%', // This removes 'resources/' from post URLs\n 'with_front' =&gt; false,\n ),\n 'supports' =&gt; array('title', 'editor', 'thumbnail'),\n );\n register_post_type('resource', $args);\n}\nadd_action('init', 'register_resource_post_type');\n\n/* ## Register Resource Type Taxonomy ## */\nfunction register_resource_type_taxonomy() {\n $args = array(\n 'hierarchical' =&gt; true,\n 'public' =&gt; true,\n 'rewrite' =&gt; array(\n 'slug' =&gt; 'resources', // Keeps 'resources/' in taxonomy archive URLs\n 'with_front' =&gt; false,\n ),\n );\n register_taxonomy('resource-type', array('resource'), $args);\n}\nadd_action('init', 'register_resource_type_taxonomy');\n\n/* ## Custom Post Permalink ## */\nfunction wpd_post_link($post_link, $post) {\n if ($post-&gt;post_type !== 'resource') {\n return $post_link;\n }\n\n $terms = wp_get_object_terms($post-&gt;ID, 'resource-type');\n if ($terms &amp;&amp; !is_wp_error($terms)) {\n $term_slug = $terms[0]-&gt;slug;\n } else {\n $term_slug = 'uncategorized';\n }\n\n return home_url('/' . $term_slug . '/' . $post-&gt;post_name . '/');\n}\nadd_filter('post_type_link', 'wpd_post_link', 10, 2);\n\n/* ## Custom Rewrite Rules ## */\nfunction custom_rewrite_rules() {\n $resource_types = get_terms(array(\n 'taxonomy' =&gt; 'resource-type',\n 'hide_empty' =&gt; false,\n ));\n\n if ($resource_types &amp;&amp; !is_wp_error($resource_types)) {\n foreach ($resource_types as $term) {\n // Rule for individual posts: site-url/custom-tax/post-name\n add_rewrite_rule(\n $term-&gt;slug . '/([^/]+)/?$',\n 'index.php?post_type=resource&amp;name=$matches[1]',\n 'top'\n );\n }\n }\n\n // Taxonomy archive: site-url/resources/custom-tax/\n add_rewrite_rule(\n 'resources/([^/]+)/?$',\n 'index.php?resource-type=$matches[1]',\n 'top'\n );\n\n // General archive: site-url/resources\n add_rewrite_rule(\n 'resources/?$',\n 'index.php?post_type=resource',\n 'top'\n );\n}\nadd_action('init', 'custom_rewrite_rules', 10, 0);\n\n/* ## Flush Rewrite Rules on Activation ## */\nfunction flush_rewrite_rules_on_activation() {\n register_resource_post_type();\n register_resource_type_taxonomy();\n flush_rewrite_rules();\n}\nregister_activation_hook(__FILE__, 'flush_rewrite_rules_on_activation');\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + "<p>I'm the creator of HydePHP. This is indeed possible. While there is no built-in Blade directive for this (maybe we should <a href="https://hydephp.com/contributing" rel="nofollow noreferrer">add one</a>!), you can easily accomplish this by simply using some PHP code to get a file's contents and compiling it to Markdown. HydePHP does include helpers in the <a href="https://hydephp.github.io/develop/master/api-docs/classes/Hyde-Markdown-Models-Markdown.html" rel="nofollow noreferrer"><code>Markdown</code></a> class.</p>\n<p><strong>Take this for example:</strong></p>\n<pre><code>@extends('hyde::layouts.app')\n@section('content')\n\n &lt;div class=&quot;prose&quot;&gt;\n &lt;h1&gt;{!! \\Hyde\\Markdown\\Models\\Markdown::render('**Markdown** in **Blade**!') !!}&lt;/h1&gt;\n\n {{ \\Hyde\\Markdown\\Models\\Markdown::fromFile(\\Hyde\\Hyde::path('resources/example-markdown.md')) }}\n &lt;/div&gt;\n\n@endsection\n</code></pre>\n<p>This will take the file contents of the file in the <code>resources/</code> directory (or whichever you choose) and compile the Markdown to HTML and put it in your Blade view!</p>\n<p><a href="https://i.sstatic.net/H3gozHpO.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/H3gozHpO.png" alt="screenshot of output" /></a></p>\n<p>You can of course also create your own Blade directive, or use a package. Though this is a great feature for us to include in HydePHP itself.</p>\n"^^ . + "2"^^ . + . + "Do you get the same issue when you use the default {{$slot}} instead of the livewire component"^^ . + . + "0"^^ . + . + "<p>If you wants to set null the <code>user_id</code> in the project table ,You can create an <a href="https://laravel.com/docs/12.x/events" rel="nofollow noreferrer">Event and a Listener</a> to write the set null logic in Project table.</p>\n<p>1)Create the Event class</p>\n<p>run below command ,change the Event name and set the constructor correctly .</p>\n<p><code>php artisan make:event UserSoftDeleted</code></p>\n<pre><code>namespace App\\Events;\n\nuse App\\Models\\User;\nuse Illuminate\\Foundation\\Events\\Dispatchable;\nuse Illuminate\\Queue\\SerializesModels;\n\nclass UserSoftDeleted\n{\n use Dispatchable, SerializesModels;\n\n public $user;\n\n public function __construct(User $user)\n {\n $this-&gt;user = $user;\n }\n}\n</code></pre>\n<p>2)Create the Listener for the Event.</p>\n<p><code>php artisan make:listener SetNullOnUserDelete --event=UserSoftDeleted</code></p>\n<pre><code>namespace App\\Listeners;\n\nuse App\\Events\\UserSoftDeleted;\nuse App\\Models\\Project;\n\nclass SetNullOnUserDelete\n{\n public function handle(UserSoftDeleted $event)\n {\n Project::where('user_id', $event-&gt;user-&gt;id)-&gt;update(['user_id' =&gt; null]);\n }\n}\n</code></pre>\n<p>3)Dispatch the Event in the Model class .</p>\n<pre><code>use App\\Events\\UserSoftDeleted;\nuse Illuminate\\Database\\Eloquent\\SoftDeletes;\n\nclass User extends Model\n{\n use SoftDeletes;\n\n protected static function boot()\n {\n parent::boot();\n\n static::deleting(function ($user) {\n event(new UserSoftDeleted($user)); \n });\n }\n} \n</code></pre>\n<p>4)Register the Listener against the Event inside <code>EventServiceProvider.php </code> .</p>\n<pre><code>protected $listen = [\n UserSoftDeleted::class =&gt; [\n SetNullOnUserDelete::class,\n ],\n];\n</code></pre>\n<p>Now when you soft delete a specific user the <code>user_id</code> will set to null in the project table .</p>\n"^^ . + . + "laravel-artisan"^^ . + "cart"^^ . + . + "Yes it's a typo error ! Thanks"^^ . + . + "The 0/1 ID issue is likely related to [NO_AUTO_VALUE_ON_ZERO](https://dev.mysql.com/doc/refman/8.4/en/sql-mode.html#sqlmode_no_auto_value_on_zero)"^^ . + . + "0"^^ . + . + . + . + . + . + . + "It would seem like there could be a way to use apache access control, which would having nothing to do with the PHP authentication. Some way to tell it to only serve files if the request were coming from a certain resource - like using an <if ... require, or rewriteCond for example. If there is, I just don't have an idea what the expressions would be."^^ . + "You can remedy the error with annotations or a baseline. Let me guess: That's not what you're looking for. Another tip: Show how you have tried with the object shape. It must not work, but may be more speaking to other users what would qualify as a remediation for you."^^ . + "0"^^ . + . + "So you do *assume*. Yet, unless you can come up with another realistic explanation, it looks like a firewall, swims like a firewall and quacks like a firewall"^^ . + "Drupal CMS Missing Demonstrate block region"^^ . + "0"^^ . + "1) I don't see `ob_start()` in your code. 2) You could write `$html` to the log to make sure it is correct. 3) As @C3roe said, there's no way to know how the library functions. Maybe it only runs certain code when the document is ready. Just replacing the HTML on the page will most likely not trigger the correct events to initialize a new player. Maybe they document the correct event(s) to trigger? 4) What's wrong with the built-in `select` interface? If you have 100 playlists then a pipe-separated list probably doesn't work very well, does it? Is it just about the appearance?"^^ . + . + "0"^^ . + . + . + . + . + "http-status-code-500"^^ . + "0"^^ . + "Hi there, thanks for trying. I think you can stop at Step 3 if you are installing just for the extension. If you need the memcached server, try from this one? https://github.com/jefyt/memcached-windows#memcached-for-windows\n\nOr you can try using docker to setup memcached locally. Sorry, I haven't tried it myself since I'm not on Windows."^^ . + "0"^^ . + "1"^^ . + "deployment"^^ . + . + . + "0"^^ . + . + "PHP Mailer Emails with the same sender, recipient and subject dont go into one email thread"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + . + "1"^^ . + "0"^^ . + "0"^^ . + "2"^^ . + "<p>While writing this question, I found the answer. It is a little complicated, and I believe it should be fixed in later PHP versions. But here it is.</p>\n<pre class="lang-php prettyprint-override"><code>\nfunction isWriteOnly(\\ReflectionProperty $property): bool {\n if(!$property-&gt;hasHooks()) return false;\n if($property-&gt;hasHook(\\PropertyHookType::Get)) return false;\n return $property-&gt;isVirtual(); // it has only 'set' hook, and it is virtual - it cannot be read\n}\n</code></pre>\n<p>This worked fine on both 'Foo' and 'Bar' properties.</p>\n"^^ . + "1"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + "0"^^ . + "Your solution should probably focus not on force-cleaning giant arrays, but refactoring to iterators so that you don't have giant arrays."^^ . + "0"^^ . + "What's in here: `$args = json_decode(stripslashes($_POST['query']), true);`"^^ . + . + "<p>I am encountering an issue on my Ubuntu server for my Laravel 10 web application, which runs on Ubuntu 24.04.2 LTS (GNU/Linux 6.8.0-55-generic x86_64).</p>\n<p>In my local environment, everything works fine, and I can log in without any issues.</p>\n<p>However, I cannot log in after I deployed it to the server using NGINX. The register function works fine, though.</p>\n<p>I have tried several solutions, including changing the permissions on the storage folder to 775, as suggested, but the log-in issue persists.</p>\n<p>Here is my <code>route:list</code> output:</p>\n<pre><code>GET|HEAD / .......................................................................................................................................................... \n GET|HEAD _minify/{file?} ................................................................................ minify.assets › Fahlisaputra\\Minify › HttpConnectionHandler\n GET|HEAD accounts ................................................................................................................................................... \n GET|HEAD api/user ............................................................................................................................. ApiController@showAll\n GET|HEAD api/user/{id} ........................................................................................................................... ApiController@show\n GET|HEAD app/dashboard .................................................................................................................... app › AppController@index\n POST app/deposit ................................................................................................. deposit.submit › TransactionController@deposit\n GET|HEAD app/deposit/confirm/{uuid} ..................................................................... deposit.confirm › TransactionController@updateDepositStatus\n GET|HEAD app/profile ............................................................................................................ app.profile › AppController@profile\n GET|HEAD app/settings/activity ................................................................................ app.settingsActivity › AppController@settingsActivity\n POST app/settings/bank-info .................................................................................. settings.bank.store › AppController@updateBankInfo\n POST app/settings/card-info .................................................................................. settings.card.store › AppController@updateCardInfo\n GET|HEAD app/settings/payment-method ............................................................................ app.settingsPayment › AppController@settingsPayment\n POST app/settings/personal-info ........................................................................ app.settings.personal › AppController@updatePersonalInfo\n POST app/settings/pin ..................................................................................... app.settings.pin › AppController@updateTransactionPin\n GET|HEAD app/settings/privacy ................................................................................... app.settingsPrivacy › AppController@settingsPrivacy\n GET|HEAD app/settings/profile ................................................................................................. app.settings › AppController@settings\n POST app/settings/profile/update ............................................................................... app.update.profile › AppController@updateProfile\n POST app/settings/update-auth ............................................................................... settings.update.auth › AppController@updateAuthInfo\n GET|HEAD app/signin ............................................................................................................ signin › AppController@showLoginForm\n GET|HEAD app/transactions ............................................................................................. app.transactions › AppController@transactions\n POST app/transfer ..................................................................................................... transfer › TransactionController@transfer\n GET|HEAD app/user/suspend/{uuid} .............................................................................................. user.suspend › AuthController@suspend\n GET|HEAD app/user/verify/{uuid} ................................................................................................. user.verify › AuthController@verify\n GET|HEAD app/verify-data ............................................................................................ verify.data › AuthController@showVerifyDataForm\n POST app/verify-data ....................................................................................... verify.data.submit › AuthController@submitVerifyData\n POST app/verify-pin ............................................................................... set.transaction.pin › TransactionController@setTransactionPin\n GET|HEAD app/wallet ............................................................................................................... app.wallet › AppController@wallet\n POST app/withdraw .............................................................................................. withdraw.submit › TransactionController@withdraw\n GET|HEAD app/withdraw/confirm/{uuid} ....................................................................... withdraw.confirm › TransactionController@confirmWithdraw\n POST app/withdraws/confirm/{uuid} .................................................................... withdraws.confirm › TransactionController@confirmWithdraws\n ANY apply .............................................................................................................. Illuminate\\Routing › RedirectController\n GET|HEAD contact .................................................................................................................................................... \n GET|HEAD faq ........................................................................................................................................................ \n GET|HEAD forgot-password .................................................................................................. app.forgot › AppController@forgotPassword\n GET|HEAD login ............................................................................................................ login.form › AuthController@showLoginForm\n POST login ......................................................................................................................... login › AuthController@login\n POST logout ...................................................................................................................... logout › AuthController@logout\n GET|HEAD privacy-policy ............................................................................................................................................. \n GET|HEAD register ................................................................................................... register.form › AuthController@showRegisterForm\n POST register ................................................................................................................ register › AuthController@register\n GET|HEAD sanctum/csrf-cookie ...................................................................... sanctum.csrf-cookie › Laravel\\Sanctum › CsrfCookieController@show\n GET|HEAD signup ................................................................................................................... app.signup › AppController@signup\n GET|HEAD terms-conditions ........................................................................................................................................... \n GET|HEAD testimonials ............................................................................................................................................... \n GET|HEAD verify/success/{uuid} ...................................................................................... app.verifySuccess › AppController@verifySuccess\n GET|HEAD verify/{uuid} ............................................................................................................ app.verify › AppController@verify\n</code></pre>\n<p>And this is my <code>.env</code> configuration (credentials have been obfuscated):</p>\n<pre><code>APP_NAME=&quot;Baltxxx xxx xxx&quot;\nAPP_ENV=local\nAPP_KEY=base64:fx/xxx=\nAPP_DEBUG=true\nAPP_URL=http://localhost\n\nLOG_CHANNEL=stack\nLOG_DEPRECATIONS_CHANNEL=null\nLOG_LEVEL=debug\n\nDB_CONNECTION=mysql\nDB_HOST=127.0.0.1\nDB_PORT=3306\nDB_DATABASE=xxx\nDB_USERNAME=root\nDB_PASSWORD=\n\nBROADCAST_DRIVER=log\nCACHE_DRIVER=redis\nFILESYSTEM_DISK=local\nQUEUE_CONNECTION=sync\nSESSION_DRIVER=file\nSESSION_LIFETIME=120\n\nMEMCACHED_HOST=127.0.0.1\n\nREDIS_HOST=127.0.0.1\nREDIS_PASSWORD=null\nREDIS_PORT=6379\n\nMAIL_MAILER=smtp\nMAIL_HOST=sandbox.smtp.mailtrap.io\nMAIL_PORT=xxx\nMAIL_USERNAME=xxx\nMAIL_PASSWORD=xxx\nMAIL_ENCRYPTION=tls\nMAIL_FROM_ADDRESS=&quot;notxxx@balxxx.com&quot;\nMAIL_FROM_NAME=&quot;${APP_NAME}&quot;\n\nAWS_ACCESS_KEY_ID=\nAWS_SECRET_ACCESS_KEY=\nAWS_DEFAULT_REGION=us-east-1\nAWS_BUCKET=\nAWS_USE_PATH_STYLE_ENDPOINT=false\n\nPUSHER_APP_ID=\nPUSHER_APP_KEY=\nPUSHER_APP_SECRET=\nPUSHER_HOST=\nPUSHER_PORT=443\nPUSHER_SCHEME=https\nPUSHER_APP_CLUSTER=mt1\n\nVITE_APP_NAME=&quot;${APP_NAME}&quot;\nVITE_PUSHER_APP_KEY=&quot;${PUSHER_APP_KEY}&quot;\nVITE_PUSHER_HOST=&quot;${PUSHER_HOST}&quot;\nVITE_PUSHER_PORT=&quot;${PUSHER_PORT}&quot;\nVITE_PUSHER_SCHEME=&quot;${PUSHER_SCHEME}&quot;\nVITE_PUSHER_APP_CLUSTER=&quot;${PUSHER_APP_CLUSTER}&quot;\nCLOUDINARY_URL=xxx\nCLOUDINARY_CLOUD_NAME=xxx\nCLOUDINARY_UPLOAD_PRESET=xxx\nIPGEOLOCATION_KEY=xxx\nIPGEOLOCATION_API_KEY=xxx\n\nAPI_KEY=xxx\n</code></pre>\n<p>I also checked the session configuration (<code>SESSION_DRIVER=file</code>) and changed the permissions on the <code>storage</code> folder to 775 like this:</p>\n<pre><code>sudo chmod -R 775 /var/www/balxxx/storage\nsudo chown -R www-data:www-data /var/www/balxxx/storage\n</code></pre>\n<p>But after clearing cookies in the browser, I still cannot log in on my domain.</p>\n<p>Here is my GitHub Actions deployment workflow:</p>\n<pre><code>name: Deployment of xxx\n\non:\n push:\n branches:\n - main\n pull_request:\n branches:\n - main\n\njobs:\n deploy:\n runs-on: ubuntu-latest\n steps:\n - name: Get latest code\n uses: actions/checkout@v4\n ...\n - name: Deploy to Production\n run: |\n sshpass -p 'yourpassword' rsync -avz --delete -e &quot;ssh -o StrictHostKeyChecking=no&quot; ./ root@147.xxx:/var/www/baltxxx/\n sshpass -p 'yourpassword' ssh -o StrictHostKeyChecking=no root@14xxx &lt;&lt; 'EOF'\n # Laravel Commands\n php artisan key:generate --ansi\n php artisan migrate --force\n php artisan optimize:clear\n php artisan storage:link\n php artisan config:clear\n ...\n EOF\n</code></pre>\n<p>This is my login function on AuthController</p>\n<pre><code> public function login(Request $request)\n {\n $credentials = $request-&gt;only('email', 'password');\n $remember = $request-&gt;has('remember');\n\n if (Auth::attempt($credentials, $remember)) {\n $request-&gt;session()-&gt;regenerate();\n activity()-&gt;causedBy(Auth::user())-&gt;log('User logged in');\n return redirect()-&gt;intended('/app/dashboard');\n }\n return back()-&gt;withErrors([\n 'email' =&gt; 'Invalid credentials',\n ])-&gt;withInput($request-&gt;only('email'));\n }\n</code></pre>\n<p>Am I missing something in the deployment process, or could there be a configuration issue related to the session or authentication on the server?</p>\n<p>I am using PHP 8.3.</p>\n"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + "You’d better consult your domain administrators, because the conclusion from you “they were asked to input Windows user name and password which is not supposed to happen” is not true. To suppress the browser prompts in real world scenarios, domain administrators need to configure browser settings and sync among the devices, so they can guide you through all you need."^^ . + "paypal"^^ . + "The only reason it's "unnecessarily complicated" is because *you* made it so. Have your numbers in *array*, where they belong, and there will be no question at all."^^ . + "1"^^ . + . + . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + "-1"^^ . + . + "0"^^ . + "Thank you, gre_gor, for that fine comment. So what needs to be done instead?"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + "4"^^ . + "0"^^ . + "0"^^ . + . + . + . + "Please go read [ask] and [mre], and then edit your question accordingly."^^ . + "2"^^ . + "<p>I’m trying to load fixtures in my Symfony project using the command:</p>\n<pre><code>symfony console doctrine:fixtures:load\n</code></pre>\n<p>However, I’m encountering the following error:</p>\n<pre><code> Careful, database &quot;gestionexams&quot; will be purged. Do you want to continue? (yes/no) [no]:\n &gt; yes\n\n &gt; purging database\n &gt; loading App\\DataFixtures\\AppFixtures\n\nIn ExceptionConverter.php line 115:\n\n An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'semestre_id' cannot be null \n\n\nIn Exception.php line 24:\n\n SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'semestre_id' cannot be null \n\n\nIn Statement.php line 130:\n\n SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'semestre_id' cannot be null \n\n\ndoctrine:fixtures:load [--append] [--group GROUP] [--em EM] [--purger PURGER] [--purge-exclusions PURGE-EXCLUSIONS] [--purge-with-truncate]\n</code></pre>\n<h2>What I’ve Tried:</h2>\n<ul>\n<li><strong>Checked Database Server Status:</strong> Confirmed that MySQL/PostgreSQL is running.</li>\n<li><strong>Verified <code>.env</code> Configuration:</strong> My <code>.env</code> file contains:</li>\n</ul>\n<pre><code>DATABASE_URL=&quot;mysql://root:@127.0.0.1:3306/GestionExams?serverVersion=10.4.21-MariaDB&amp;charset=utf8mb4&quot;\n</code></pre>\n<ul>\n<li><strong>Tested Database Connection:</strong> I can connect to the database using a database client MySQL</li>\n<li><strong>Cleared Symfony Cache:</strong> i run <code>php bin/console cache:clear</code> to ensure the cache isn’t causing the issue.</li>\n</ul>\n<h3>Additional Information:</h3>\n<ul>\n<li><p><strong>Symfony Version:</strong> 6.3.</p>\n</li>\n<li><p><strong>Database:</strong> MySQL.</p>\n</li>\n<li><p><strong>Environment:</strong> Local development .</p>\n</li>\n<li><p>Relevant Code: My <code>DATABASE_URL</code> in <code>.env</code> is:</p>\n</li>\n</ul>\n<pre><code>DATABASE_URL=&quot;mysql://root:@127.0.0.1:3306/GestionExams?serverVersion=10.4.21-MariaDB&amp;charset=utf8mb4&quot;\n</code></pre>\n<ul>\n<li>this my (repo)[https://github.com/marouane-sadoune/GEXAMS] <a href="https://github.com/marouane-sadoune/GEXAMS" rel="nofollow noreferrer">repo</a></li>\n</ul>\n"^^ . + "1"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + "<p>You have multiple PHP versions on your system and you created (compiled) the .so (shared object) of the <em>runkit</em> extension for a different PHP version then you wanted.</p>\n<p>As you could already demonstrate, the binaries are not necessarily compatible across PHP versions, and yours specifically not.</p>\n<p>You compiled it for module API=20230831, that is PHP 8.3 on your system:</p>\n<pre class="lang-none prettyprint-override"><code>$ printf '%s\\n' php8.{0..4} | xargs -IPHP sh -c \\\n 'PHP -i | grep -F &quot;Extension Build&quot; | sed &quot;s/^/PHP: /&quot;'\n\nphp8.0: Zend Extension Build =&gt; API420200930,NTS &lt;------ your preferred\nphp8.0: PHP Extension Build =&gt; API20200930,NTS &lt;--´ target version\n\nphp8.1: Zend Extension Build =&gt; API420210902,NTS\nphp8.1: PHP Extension Build =&gt; API20210902,NTS\nphp8.2: Zend Extension Build =&gt; API420220829,NTS\nphp8.2: PHP Extension Build =&gt; API20220829,NTS\n\nphp8.3: Zend Extension Build =&gt; API420230831,NTS &lt;----- your actual\nphp8.3: PHP Extension Build =&gt; API20230831,NTS &lt;--´ runkit.so\n\nphp8.4: Zend Extension Build =&gt; API420240924,NTS\nphp8.4: PHP Extension Build =&gt; API20240924,NTS\n</code></pre>\n<p>You are using a Debian based Linux distribution, namely Ubuntu.</p>\n<p>Ondřej Surý is your package manager for the PHP packages, and he has been writing about <a href="https://github.com/oerdnj/deb.sury.org/wiki/PECL-Installation" rel="nofollow noreferrer"><em>PECL Installation</em> in the oerdnj/deb.sury.org Wiki (github.com)</a>.</p>\n<blockquote>\n<p>Before you run any pecl command, you switch your PHP version to the version you want the PECL module to be installed for. Lets say we pick [php8.0]</p>\n<pre class="lang-none prettyprint-override"><code>update-alternatives --set php /usr/bin/php8.0\nupdate-alternatives --set php-config /usr/bin/php-config8.0\nupdate-alternatives --set phpize /usr/bin/phpize8.0\n</code></pre>\n</blockquote>\n<p>That is, before you use <em>pecl(1)</em> you must choose the right version from the <a href="https://wiki.debian.org/DebianAlternatives" rel="nofollow noreferrer" title="DebianAlternatives - Debian Wiki (debian.org)"><em>Debian Alternatives System</em></a>.</p>\n<p>The wikipage has more details.</p>\n"^^ . + . + "1"^^ . + "Is there anything in particular that's unclear about the error? You're running PHP 7.2. You need at least PHP 8.1."^^ . + . + . + . + . + . + . + "<p>I'm currently building a website in Symfony 7 where I have two authenticators, one for the owner which reuses the basic &quot;make security:custom&quot; and another (the problematic one) which simply relies on a form inside a disclaimer.</p>\n<p>Problem is, I simply need the authenticator to call upon &quot;guest&quot; which is an instance of User with it:</p>\n<ol>\n<li>not having the [ROLE_USER]</li>\n<li>having [ROLE_GUEST].</li>\n</ol>\n<p>Those changes are of course temporary since they're used as long as the person doesn't login or exit the website, this is why I can't just add an additional role in the database from the start.</p>\n<p><strong>IN MY DATABASE</strong></p>\n<pre><code>id 2\nusername (Name of the user (not necessarily their actual name but an identifier)) guest\n[...]\nroles ((DC2Type:json)) []\n[...]\n</code></pre>\n<p><strong>IN MY USER ENTITY</strong></p>\n<pre><code>&lt;?php\n\nnamespace App\\Entity;\n\nuse App\\Script\\Traits\\Timestampable;\nuse App\\Repository\\UserRepository;\nuse Doctrine\\Common\\Collections\\ArrayCollection;\nuse Doctrine\\Common\\Collections\\Collection;\nuse Doctrine\\DBAL\\Types\\Types;\nuse Doctrine\\ORM\\Mapping as ORM;\nuse Symfony\\Component\\Security\\Core\\User\\UserInterface;\nuse Symfony\\Component\\Security\\Core\\User\\PasswordAuthenticatedUserInterface;\n\n#[ORM\\Entity(repositoryClass: UserRepository::class)]\n#[ORM\\HasLifecycleCallbacks] // Ensures lifecycle callbacks from the trait are recognized\n#[ORM\\Table(name: &quot;user&quot;)] // Specify table name if different from class name\nclass User implements UserInterface, PasswordAuthenticatedUserInterface\n{\n\n /**\n * The unique identifier for the User.\n */\n #[ORM\\Id]\n #[ORM\\GeneratedValue]\n #[ORM\\Column]\n private ?int $id = null;\n\n /**\n * The username of the user (not necessarily their actual name).\n */\n #[ORM\\Column(length: 25, options: [&quot;comment&quot; =&gt; &quot;Name of the user (not necessarily their actual name but an identifier)&quot;])]\n private string $username = '';\n\n /**\n * The email of the user used for verification and password resets.\n */\n #[ORM\\Column(length: 180, unique: true, options: [&quot;comment&quot; =&gt; &quot;Storing e-mail to send verification links, password resets&quot;])]\n private string $email = '';\n\n /**\n * The hashed password of the user.\n */\n #[ORM\\Column(options: [&quot;comment&quot; =&gt; &quot;Password of the person for logging on to the website.&quot;])]\n private string $password = '';\n\n /**\n * The timestamp indicating when the user last connected.\n */\n #[ORM\\Column(type: Types::DATETIME_IMMUTABLE, nullable: true, options: [&quot;comment&quot; =&gt; &quot;Tracks the last time a given user logged on using their account&quot;])]\n private ?\\DateTimeImmutable $lastConnect = null;\n\n /**\n * @var list&lt;string&gt; The user roles\n */\n #[ORM\\Column]\n private array $roles = [];\n\n /**\n * A trait used to add createdAt and updatedAt fields and their getter/lifecycles.\n */\n use Timestampable;\n\n // -------------------- Getters and Setters --------------------\n\n /**\n * Get the ID of the User.\n */\n public function getId(): ?int\n {\n return $this-&gt;id;\n }\n\n /**\n * Get the email of the User.\n */\n public function getEmail(): string\n {\n return $this-&gt;email;\n }\n\n /**\n * Set the email of the User.\n */\n public function setEmail(string $email): self\n {\n $this-&gt;email = strtolower($email); // Ensure email is lowercase for consistency\n\n return $this;\n }\n\n /**\n * Get the username of the User.\n */\n public function getUsername(): string\n {\n return $this-&gt;username;\n }\n\n /**\n * Set the username of the User.\n */\n public function setUsername(string $username): self\n {\n $this-&gt;username = $username;\n\n return $this;\n }\n\n /**\n * A visual identifier that represents this user.\n *\n * @see UserInterface\n */\n public function getUserIdentifier(): string\n {\n return $this-&gt;username;\n }\n\n\n /**\n * @see UserInterface\n *\n * @return list&lt;string&gt;\n */\n public function getRoles(): array\n {\n $roles = $this-&gt;roles;\n // guarantee every user at least has ROLE_USER\n $roles[] = 'ROLE_USER';\n\n return array_unique($roles);\n }\n\n /**\n * @param list&lt;string&gt; $roles\n */\n public function setRoles(array $roles): static\n {\n $this-&gt;roles = $roles;\n\n return $this;\n }\n\n /**\n * @see PasswordAuthenticatedUserInterface\n */\n public function getPassword(): ?string\n {\n return $this-&gt;password;\n }\n\n public function setPassword(string $password): static\n {\n $this-&gt;password = $password;\n\n return $this;\n }\n\n /**\n * @see UserInterface\n */\n public function eraseCredentials(): void\n {\n // If you store any temporary, sensitive data on the user, clear it here\n // $this-&gt;plainPassword = null;\n }\n\n}\n</code></pre>\n<p><strong>MY SECURITY.YAML</strong></p>\n<pre><code>security:\n # https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords\n password_hashers:\n Symfony\\Component\\Security\\Core\\User\\PasswordAuthenticatedUserInterface: 'auto'\n # https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider\n providers:\n # used to reload user from session &amp; other features (e.g. switch_user)\n app_user_provider:\n entity:\n class: App\\Entity\\User\n property: username\n firewalls:\n dev:\n pattern: ^/(_(profiler|wdt)|css|images|js)/\n security: false\n main:\n lazy: true\n provider: app_user_provider\n form_login: ~\n custom_authenticator:\n - App\\Security\\AppAuthenticator\n - App\\Security\\GuestAuthenticator\n entry_point: form_login\n logout:\n path: app_logout\n # where to redirect after logout\n # target: app_any_route\n login_throttling:\n max_attempts: 3 # per minute ...\n interval: '10 minutes' # ... or in a custom period\n\n remember_me:\n secret: '%kernel.secret%'\n lifetime: 604800\n path: /\n always_remember_me: true\n\n # activate different ways to authenticate\n # https://symfony.com/doc/current/security.html#the-firewall\n\n # https://symfony.com/doc/current/security/impersonating_user.html\n # switch_user: true\n\n # Easy way to control access for large sections of your site\n # Note: Only the *first* access control that matches will be used\n access_control:\n - { path: ^/login, roles: PUBLIC_ACCESS }\n - { path: ^/presite, roles: PUBLIC_ACCESS }\n - { path: ^/disclaimer, roles: PUBLIC_ACCESS }\n # - { path: ^/, roles: [ROLE_GUEST, ROLE_USER, ROLE_GUEST, ROLE_ADMIN, ROLE_OWNER] }\n\nwhen@test:\n security:\n password_hashers:\n # By default, password hashers are resource intensive and take time. This is\n # important to generate secure password hashes. In tests however, secure hashes\n # are not important, waste resources and increase test times. The following\n # reduces the work factor to the lowest possible values.\n Symfony\\Component\\Security\\Core\\User\\PasswordAuthenticatedUserInterface:\n algorithm: auto\n cost: 4 # Lowest possible value for bcrypt\n time_cost: 3 # Lowest possible value for argon\n memory_cost: 10 # Lowest possible value for argon\n\n</code></pre>\n<p><strong>THE PROBLEMATIC AUTHENTICATOR</strong></p>\n<pre><code>&lt;?php\n\nnamespace App\\Security;\n\nuse App\\Repository\\UserRepository;\nuse App\\Entity\\User;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFoundation\\Response;\nuse Symfony\\Component\\Security\\Http\\SecurityRequestAttributes;\nuse Symfony\\Component\\Security\\Http\\Authenticator\\Passport\\Passport;\nuse Symfony\\Component\\Security\\Core\\Exception\\AuthenticationException;\nuse Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface;\nuse Symfony\\Component\\Security\\Http\\Authenticator\\AbstractAuthenticator;\nuse Symfony\\Component\\Security\\Http\\Authenticator\\Passport\\Badge\\UserBadge;\nuse Symfony\\Component\\Security\\Http\\Authenticator\\Passport\\Badge\\CsrfTokenBadge;\nuse Symfony\\Component\\Security\\Http\\Authenticator\\Passport\\SelfValidatingPassport;\n\nclass GuestAuthenticator extends AbstractAuthenticator\n{\n private UserRepository $userRepository;\n\n public function __construct(UserRepository $userRepository)\n {\n $this-&gt;userRepository = $userRepository;\n }\n\n public function supports(Request $request): bool\n {\n dump('guestAuth');\n if ($request-&gt;get('auth') === 'guest') {\n return true;\n }\n return false;\n }\n\npublic function authenticate(Request $request): SelfValidatingPassport\n{\n return new SelfValidatingPassport(\n new UserBadge('guest', function () use ($request) {\n $guest = $this-&gt;userRepository-&gt;findOneBy(['username' =&gt; 'guest']);\n $roles = ['ROLE_GUEST'];\n if ($request-&gt;getSession()-&gt;get('sfw') === 'true') {\n $roles[] = 'ROLE_SFW';\n }\n $guest-&gt;setRoles($roles);\n dump($guest);\n return $guest;\n })\n );\n}\n\n public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response\n {\n return null;\n }\n\n public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response\n {\n // Optionally handle authentication failure.\n throw $exception;\n }\n}\n</code></pre>\n<p>As visible in the <code>public function authenticate(Request $request): SelfValidatingPassport</code>, I have made a query to my database to retrieve the guest row and assigned it the ROLE_GUEST before setting that in the auth-profile.\nHowever, it isn't being acknowledged by Symfony: if I keep the <code>line 46 dump</code> on GuestAuthenticator, it isn't logged and is only visible if I use it as a <code>dd</code> instead.</p>\n<pre><code>GuestAuthenticator.php on line 46:\nApp\\Entity\\User {#810 ▼\n -id: 2\n -username: &quot;guest&quot;\n -email: &quot;xxxx&quot;\n -password: &quot;''&quot;\n -lastConnect: DateTimeImmutable @1739119357 {#937 ▼\n date: 2025-02-09 17:42:37.0 Europe/Berlin (+01:00)\n }\n -roles: array:1 [▼\n 0 =&gt; &quot;ROLE_GUEST&quot;\n ]\n -createdAt: DateTimeImmutable @1739119357 {#807 ▼\n date: 2025-02-09 17:42:37.0 Europe/Berlin (+01:00)\n }\n -updatedAt: DateTimeImmutable @1739119357 {#808 ▼\n date: 2025-02-09 17:42:37.0 Europe/Berlin (+01:00)\n }\n}\n</code></pre>\n<p>This means that my GuestAuthenticator can't recognize that my nonexistent &quot;guest&quot; has the <code>ROLE_GUEST</code> and should be able to bypass the firewall, which results in me being booted back to my login.\nSo can I get the firewall to acknowledge that I have a USER?</p>\n"^^ . + "0"^^ . + . + "`userController` with lower `u` is not conventional, not sure if that would be the problem but try using upper case `U`. Laravel built-in authentication also has a `UserController`, are you using that, any chance your controller is clashing?"^^ . + . + . + . + . + "If I understand correctly, the menu click loads and inserts a form into the page? And then when you try to submit the dynamically inserted form, your JS handler is not catching it? https://stackoverflow.com/questions/34896106/attach-event-to-dynamic-elements-in-javascript, https://stackoverflow.com/questions/14258787/add-event-listener-on-elements-created-dynamically, https://stackoverflow.com/questions/203198/event-binding-on-dynamically-created-elements"^^ . + "1"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + "Can you clarify what exactly you mean by "the HasExtendedPermissions trait doesn't seam to inherit $this->currentForm"? Is there an error of some sort? Or something not happening that you expected / wanted to happen? Also, keep in mind that trait use is *not inheritance*; it is sometimes described as "compiler assisted copy-and-paste", and thinking of it this way can sometimes lead to clearer expectations of what it will do."^^ . + . + . + . + "0"^^ . + "1"^^ . + "@IłyaBursov NOWHERE it's a point. Because the point is that you MUST have an array allocated instead of these silly variables. OR if you want to be that pedantic, **INCLUDE variable declarations into your loop as well.** Right now your test is nothing but cheating. Not to mention that "wasted CPU/electricity/heat/etc" nonsense"^^ . + . + . + . + . + . + "1"^^ . + "What about a [custom loader](https://symfony.com/doc/current/routing/custom_route_loader.html#creating-a-custom-loader)?"^^ . + . + "1"^^ . + . + . + "@TomášRejka: Then it sounds like the problem has nothing to do with sessions. If you're looking to send data to the server without refreshing the page then the technology you're looking for is AJAX. Knowing that now, your next step is to continue your research to find examples and tutorials of using AJAX with PHP."^^ . + "4"^^ . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + "1"^^ . + "html-encode"^^ . + "This is the same as any database system anywhere, for any record. any DB admin can change anything. Part of the responsibility of having such a job is that you agree not to mess with production data. If you don't trust your DB administrator, fire them. Or at least give them some training and make them sign a really clear policy about their role and responsibility. Have some auditing/logging on the tables so you can see if anyone changed anything they shouldn't."^^ . + "1"^^ . + . + . + "Does character case matter in Leaf? ... you have `db()->lastInsertID();`, but [their documentation](https://leafphp.dev/docs/database/builder#getting-the-last-inserted-id) shows as: `db()->lastInsertId();` (the `D` to `d`)"^^ . + "<p>The migration is created, but it doesn't contain the user-defined columns automatically.\nI need help dynamically modifying the migration file before running migrate.\nIs there a better approach to save schema details and ensure the migration reflects user input?</p>\n<p>The user provides input.\nA migration file is generated with user-defined columns.\nThe schema details are stored in storage/schemas/{tableName}.txt.</p>\n"^^ . + . + "By default in WordPress:\n\nAuthors can write, edit, and publish their own posts but cannot add iframes because the WordPress editor strips out potentially harmful code, including iframes, for users with lower permissions.\nEditors can manage and publish posts (including those by other users), but they also cannot add iframes by default for security reasons.\nTo allow authors to use iframes, I used the 'wp_kses_allowed_html' filter, which overrides the default functionality, but it doesn’t work."^^ . + . + "<p><strong><code>In your css changes like this</code></strong></p>\n<p><code>.pagination{</code><br />\n<code>padding: 10px 0;</code><br />\n<code>display: flex;</code><br />\n<code>justify-content: center;</code><br />\n<code>align-items: center;</code><br />\n<code>border-top: 1px solid #eee;</code><br />\n<code>}</code><br />\n<code>.pagination .page-item{</code><br />\n<code>list-style: none;</code><br />\n<code>margin: 0 5px;</code><br />\n<code>}</code></p>\n<p><code>.pagination .page-item .page-link{</code><br />\n<code>padding: 8px 12px;</code><br />\n<code>border: 1px solid #ddd;</code><br />\n<code>border-radius: 5px;</code><br />\n<code>text-decoration: none;</code><br />\n<code>color: #109908;</code><br />\n<code>}</code></p>\n<p><code>.pagination .page-item.active .page-link{</code><br />\n<code>background-color: #109908;</code><br />\n<code>color: white;</code><br />\n<code>border-color: #109908;</code><br />\n<code>}</code><br />\n<code>.pagination .page-item.disabled .page-link{</code><br />\n<code>color: #ccc;</code><br />\n<code>pointer-events: none;</code><br />\n<code>}</code></p>\n<p><strong><code>modify your pagination like this</code></strong></p>\n<p><code>&lt;div class=&quot;pagination justify-content-center mt-4&quot;&gt;</code><br />\n<code>{{ $products-&gt;links('pagination::bootstrap-4') }}</code><br />\n<code>&lt;/div&gt;</code></p>\n"^^ . + "1"^^ . + "0"^^ . + . + "@LoicTheAztec, thank you. I'll check that hook out too."^^ . + "This is helpful, thanks. the script is working much better now."^^ . + "0"^^ . + "2"^^ . + "1"^^ . + . + . + . + "<p>The error (in production) looks like this:</p>\n<p><a href="https://i.sstatic.net/O9kLqCA1.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/O9kLqCA1.png" alt="enter image description here" /></a></p>\n<p>The proper version, still working perfectly in local/dev environment is responding like this:</p>\n<p><a href="https://i.sstatic.net/FXdPolVo.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/FXdPolVo.png" alt="enter image description here" /></a></p>\n<p>I think this bug was introduced as a side-effect of trying to set up some test <code>Rust</code> scripts (via <code> curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh</code>), which involved some work with Apache reverse proxies to try to get working in conjunction with a pre-existing PHP web app (dumb in retrospect?)</p>\n<p>I've tried to uninstall those Apache mods, and remove the lines of code in my <code>.conf</code> files, but the error still persist.</p>\n<p>Here are the HTTP headers from dev tools,</p>\n<p>Production:</p>\n<pre><code>Request URL:\nhttps://www.website.com/app/ajax/entry/note/get-new-note-view.php\nRequest Method:\nPOST\nStatus Code:\n200 OK\nRemote Address:\n164.92.119.217:443\nReferrer Policy:\nstrict-origin-when-cross-origin\ncache-control:\nno-cache, no-store, must-revalidate\nconnection:\nKeep-Alive\ncontent-encoding:\ngzip\ncontent-length:\n1474\ncontent-type:\ntext/html; charset=utf-8\ndate:\nTue, 18 Feb 2025 00:15:05 GMT\nexpires:\n0\nkeep-alive:\ntimeout=5, max=100\npragma:\nno-cache\nserver:\nApache/2.4.41 (Ubuntu)\nvary:\nAccept-Encoding\naccept:\napplication/json, text/javascript, */*; q=0.01\naccept-encoding:\ngzip, deflate, br, zstd\naccept-language:\nen-US,en;q=0.9\nconnection:\nkeep-alive\ncontent-length:\n25\ncontent-type:\napplication/x-www-form-urlencoded; charset=UTF-8\ncookie:\n__stripe_mid=f221d5df-c6c1-4ad1-aa70-67c8556062e6efba90; personnel_id=1; PHPSESSID=2n0e902a3brd7hi2shcnuipjk2; __stripe_sid=588f6b12-46ff-4fe3-9e28-9618d07a46e0eac31d; cookie_random_string=ar00HbYeTINvqs7lmOgurFFZCKQSDjnd\nhost:\nwww.website.com\norigin:\nhttps://www.website.com\nreferer:\nhttps://www.website.com/app?sec=new-note\nsec-ch-ua:\n&quot;Not(A:Brand&quot;;v=&quot;99&quot;, &quot;Google Chrome&quot;;v=&quot;133&quot;, &quot;Chromium&quot;;v=&quot;133&quot;\nsec-ch-ua-mobile:\n?0\nsec-ch-ua-platform:\n&quot;Windows&quot;\nsec-fetch-dest:\nempty\nsec-fetch-mode:\ncors\nsec-fetch-site:\nsame-origin\nuser-agent:\nMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36\nx-requested-with:\nXMLHttpRequest\n</code></pre>\n<p>Local:</p>\n<pre><code>Request URL:\nhttp://localhost/app/ajax/entry/note/get-new-note-view.php\nRequest Method:\nPOST\nStatus Code:\n200 OK\nRemote Address:\n[::1]:80\nReferrer Policy:\nstrict-origin-when-cross-origin\ncache-control:\nno-store, no-cache, must-revalidate\nconnection:\nKeep-Alive\ncontent-length:\n4540\ncontent-type:\ntext/html; charset=UTF-8\ndate:\nTue, 18 Feb 2025 00:15:13 GMT\nexpires:\nThu, 19 Nov 1981 08:52:00 GMT\nkeep-alive:\ntimeout=5, max=98\npragma:\nno-cache\nserver:\nApache/2.4.46 (Win64) OpenSSL/1.1.1h PHP/8.0.2\nx-powered-by:\nPHP/8.0.2\naccept:\napplication/json, text/javascript, */*; q=0.01\naccept-encoding:\ngzip, deflate, br, zstd\naccept-language:\nen-US,en;q=0.9\nconnection:\nkeep-alive\ncontent-length:\n25\ncontent-type:\napplication/x-www-form-urlencoded; charset=UTF-8\ncookie:\n__stripe_mid=9be9288f-f182-4059-aa0c-018babef617275e418; PHPSESSID=mcgb3t1spmuec3ue6fbj63egoi; personnel_id=1; cookie_random_string=jPuTmva9QCa0oROMhR8aQgYV92yPjUcq; __stripe_sid=0389a808-dfec-47f6-8720-47e74239fd4c2c79dd\nhost:\nlocalhost\norigin:\nhttp://localhost\nreferer:\nhttp://localhost/app?sec=new-note\nsec-ch-ua:\n&quot;Not(A:Brand&quot;;v=&quot;99&quot;, &quot;Google Chrome&quot;;v=&quot;133&quot;, &quot;Chromium&quot;;v=&quot;133&quot;\nsec-ch-ua-mobile:\n?0\nsec-ch-ua-platform:\n&quot;Windows&quot;\nsec-fetch-dest:\nempty\nsec-fetch-mode:\ncors\nsec-fetch-site:\nsame-origin\nuser-agent:\nMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36\nx-requested-with:\nXMLHttpRequest\n</code></pre>\n<p>Any idea how to get my production output to match my local output? They are definitely using the same codebase, so it must be my Apache <code>.conf</code>, or some other config related to the Rust install I did?</p>\n<p>Or what additional information I should provide?</p>\n<p>(I tagged this question Rust and PHP, in case the solution is related to their respective configuration settings, or if installing Rust can alter the Apache/Linux web server configuration that affects existing PHP files).</p>\n"^^ . + . + . + "<p>I have an image uploaded by a HTML form. After checking for a valid image it is saved to a tmp - folder. Later I want to move the file from the tmp - folder to the final uploads folder. For this i wrote the following function.</p>\n<pre><code>// 1. image was uploaded via html form to the folder &quot;images/tmp/&quot; with validation checks for image format\n// 2. show image from the &quot;images/tmp/&quot; folder on a summary page next to other form input data to the user\n// 3. after clicking &quot;save changes&quot; on the summary page the following function is called\n// 3.1 check if image size is big depending on $image_resolution calculated by getimagesize() function\n// 3.1.1 if image is bigger than $MAX_IMAGE_RESOLUTION --&gt; resize it down to a width of 1600px and safe to &quot;images/uploads&quot; as .webp file\n// 3.1.2 if image is smaller than $MAX_IMAGE_RESOLUTION --&gt; just copy the file from &quot;images/tmp/&quot; to &quot;images/uploads&quot; as .webp file\n\nfunction move_img_to_upl ($tmp_file, $upl_file, $field_name) {\n\n global $UPPER_DIR; // &quot;../&quot;\n global $UPL_DIR_IMG; // &quot;images/uploads/\n global $TMP_DIR_IMG; // &quot;images/tmp/&quot;\n global $MAX_IMAGE_RESOLUTION; // 1707200\n global $MAX_IMAGE_WIDTH; // 1600\n global $IMAGE_QUALITY; // 90\n $separator = &quot;_&quot;;\n\n $tempdir = $UPPER_DIR.$TMP_DIR_IMG;\n $uploaddir = $UPPER_DIR.$UPL_DIR_IMG;\n\n $image_size = getimagesize($tempdir.$tmp_file);\n $old_width = $image_size[0];\n $old_height = $image_size[1];\n $image_resolution = $old_width * $old_height;\n\n // if image resolution &gt; 1707200 px --&gt; resize to a max width of 1600 px\n if ($image_resolution &gt; $MAX_IMAGE_RESOLUTION) {\n\n $image_ratio = $old_height / $old_width;\n $new_height = round($MAX_IMAGE_WIDTH * $image_ratio);\n $new_width = $MAX_IMAGE_WIDTH;\n\n $image_name = pathinfo($tempdir.$tmp_file, PATHINFO_FILENAME);\n $destination = $uploaddir.$image_name.&quot;.webp&quot;;\n \n $image_old_mime_type = mime_content_type($tempdir.$tmp_file);\n \n if ($image_old_mime_type === &quot;image/png&quot;) {\n $image_old = imagecreatefrompng($tempdir.$tmp_file);\n }\n elseif ($image_old_mime_type === &quot;image/jpeg&quot;) {\n $image_old = imagecreatefromjpeg($tempdir.$tmp_file);\n }\n elseif ($image_old_mime_type === &quot;image/jpg&quot;) {\n $image_old = imagecreatefromjpeg($tempdir.$tmp_file);\n }\n elseif ($image_old_mime_type === &quot;image/webp&quot;) {\n $image_old = imagecreatefromwebp($tempdir.$tmp_file);\n }\n\n $image_new = imagecreatetruecolor($new_width, $new_height);\n imagecopyresampled($image_new, $image_old, 0, 0, 0, 0, $new_width, $new_height, $old_width, $old_height);\n imagewebp($image_new, $destination, $IMAGE_QUALITY);\n\n unlink($tempdir.$tmp_file);\n imagedestroy($image_old);\n imagedestroy($image_new);\n\n }\n // if image resoultion &lt;= 1707200 px --&gt; just move the file from the tmp directory to the uploads directory\n else {\n rename($tempdir.$tmp_file, $uploaddir.$upl_file);\n }\n}\n</code></pre>\n<p><strong>Only when a big .heic file is uploaded</strong> the script seems to rotate the image bei -90deg. When a small .heic file is uploaded it keeps like the original one.</p>\n<p>Hopefully one of you has a solution for that.\nThanks in advance Tom</p>\n<p>I also tested playing arround with the $MAX_IMAGE_RESOLUTION and $MAX_IMAGE_WIDTH variables. But it seems to depend only on the image size.</p>\n"^^ . + . + . + "Is there any difference between the URL that is used for the direct access and the access through clicking the link?"^^ . + "0"^^ . + "Hi Kamyar Safari, I was working all night trying to fix this issue but couldn't get it to work as expected. I finally decided to use a plugin instead. Thank you anyway for your help—I really appreciate it!"^^ . + . + "static"^^ . + . + . + . + "4"^^ . + . + "<p>I'm trying to learn and build a backend using Laravel 12, it comes with inertia that allows me to manage my auth tokens and CSRF token for a React app, but based on my understanding it's for the React app that is in tandem already with that laravel app.</p>\n<p>I have my own separate React app in which I want to call the APIs from. So what I'm trying to do is call some auth APIs in Laravel backend specifically the <code>'/register'</code> but it requires me to have CSRF token.</p>\n<p>So I tried to start session by hitting a get request on <code>'/'</code> , this will give me XSRF cookie in my frontend. I was able to get those cookie but then when I hit a request again on <code>'/register'</code>, the XSRF token is present but in cookies and not in the actual header of the request and this will give me error of <em>&quot;message: CSRF token mismatch.&quot;</em>.</p>\n<p>Response header for getting token looks like this:</p>\n<pre><code>access-control-expose-headers:\nXSRF-TOKEN\ncache-control:\nno-cache, private\nconnection:\nclose\ncontent-type:\ntext/html; charset=UTF-8\ndate:\nSun, 02 Mar 2025 07:59:55 GMT\nhost:\n127.0.0.1:8000\nlink:\n&lt;http://127.0.0.1:8000/build/assets/app-wKvlsDeH.css&gt;; rel=&quot;preload&quot;; as=&quot;style&quot;, &lt;http://127.0.0.1:8000/build/assets/app-0LmJ1Xg0.js&gt;; rel=&quot;modulepreload&quot;, &lt;http://127.0.0.1:8000/build/assets/welcome-CmFPhQLK.js&gt;; rel=&quot;modulepreload&quot;\nset-cookie:\nXSRF-TOKEN=eyJpdiI6InNHRFowZnVNSkoyUjZNN2R4Q3JpRHc9PSIsInZhbHVlIjoiQ0V2d0JsZDI4U0tGY0I0WkNnM0tzVnkwRWJNYmJNZWp5ZEx2bTZHRzUvZE81Y1JjZ0FzdXNFenM0citzUFJjcmV3bk1MZ2FaYjFqYTBBTFhzbWNabDMyalBkOFg1UTcxb1p3MlhWTllLWThHVE1DSVJRTVJ2WTRlTUhVazI5V2oiLCJtYWMiOiI4MzkyODVhMmNmYzAzMzYyYTNmNzRjZThjZDZiNjFlNTRhNDc3NDQ0OWZmZmVmOWNhMmQxNzg3MjAxOGM4NDM1IiwidGFnIjoiIn0%3D; expires=Sun, 02 Mar 2025 09:59:55 GMT; Max-Age=7200; path=/; secure; samesite=none\nset-cookie:\nlaravel_session=eyJpdiI6IkluY1hPRFFNWE52V3JpbTFCRmVyZVE9PSIsInZhbHVlIjoiOHduT3BZWWFza3pvdCt6K2ZLOFBnSG1UVVN2dVJNTUZiRHhYeUFDNld1WWlvNWZOQjRGMU80MlIzZk1uTjVVb2hEdytWNEtMYkJjYmlvdmdPTjJYL3JhQWZTWmc4MXlJMWg5RVBjN1NFTXMwU2ZKZlBLZkEyZ2owUzJtVW5JMlkiLCJtYWMiOiI3N2Y0MzYzMTQxNTU5MzdmODY3MDY5N2U1NGRjODA4MGUzOTQ4N2Y0MTAwMWNmY2E1MTI5MDIwYzIxNTIwMzQwIiwidGFnIjoiIn0%3D; expires=Sun, 02 Mar 2025 09:59:55 GMT; Max-Age=7200; path=/; secure; httponly; samesite=none\n</code></pre>\n<p>Request header for /register looks like this:</p>\n<pre><code>cookie:\nXSRF-TOKEN=eyJpdiI6IlM3SW5FMU5LOXV1emp1ckhvcWpFb1E9PSIsInZhbHVlIjoiWXhaaHFDQlRWdG5YclVHY2dJeUppY0ZtNlNENHdGblExbWc5VnJhNGQ1QW1FejVBMzZUOVJCSXNibFJ2Slc5QzNrMGo5RW9WVWpXOU55NmNta2N1cjl4dWxBcTlPT2tib3R1blhIV1hvdVdIaVBaM215ejRockNKTmc5b0RnSnQiLCJtYWMiOiJhMzBiNWRhYTliZWU4M2QyYTY2YTgxYzU3NTE3MTNhMzA5Y2U1ZmJkZWU0Mzg4MjQ2NGY0MjgzOTlkM2ZkNGY4IiwidGFnIjoiIn0%3D; laravel_session=eyJpdiI6Ikpwd0hwZnh1ZmM4d29mUHhKdXNnNUE9PSIsInZhbHVlIjoiNW5EWHpUMElQQWRPc3RLVGRUVndkUnRNZFBrWUtDYTV0eUU4RXYvUFhpRzU2VmN5dGtIaitxUU41dGZ6ODYyWDVRMDlDbGpTSFhGYi95Vmk5UDU4QklXK05jUFBVZTVaSkRWVlRFMFByVUE5Vmt5S0Q3UmwzZzE5ZHpRYk9jU2MiLCJtYWMiOiI0YmZiNWI1ZjY5ZjExZmIxN2FjYjhhZWQwNzc5NjQwNjc2OTBmNDVjOWYxZjU5YWZmZjE3NTcwNDBkZGM0MDc4IiwidGFnIjoiIn0%3D\nhost:\n127.0.0.1:8000\norigin:\nhttp://localhost:3000\n</code></pre>\n<p>I think this should have XSRF-TOKEN variable also in header to be successful. What am I doing wrong in here?</p>\n<pre><code>const axiosInstance: AxiosInstance = axios.create({\n baseURL: 'http://127.0.0.1:8000',\n withXSRFToken: true,\n withCredentials: true,\n headers: {\n &quot;Content-Type&quot;: &quot;application/json&quot;,\n &quot;Accept&quot;: &quot;application/json&quot;,\n },\n})\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + "0"^^ . + "@IMSoP But spliting 1 project to 50 projects means that i have now 50 application. So every `lordf/measurement-unit-length` has one vendor within, `lordf/measurement-unit-height` has one vendor within. I know when i pass to any application in composer.json something like "require: {"lordf/measurement-unit-length": "1.0", "lordf/measurement-unit-height": "1.0"} the application has 1 vendor. But that packages also has their own vendor itself."^^ . + . + "-1"^^ . + "0"^^ . + . + . + "<pre><code>if(isset($_POST['submit']))\n{\n $drivername = $_POST['drivername'];\n $operatorname = $_POST['operatorname'];\n $mtop = $_POST['mtop'];\n $platenumber = $_POST['platenumber'];\n $image = time() . '_' . $_FILES['image']['name'];\n\n $target = 'images/' . $image;\n\n if (move_uploaded_file($_FILES['image']['tmp_name'],$target)) {\n\n $postData = [\n 'drivername'=&gt;$drivername,\n 'operatorname'=&gt;$operatorname,\n 'mtop'=&gt;$mtop,\n 'platenumber'=&gt;$platenumber,\n 'img'=&gt;$image,\n\n ];\n $ref_table= &quot;details&quot;;\n $postRef_result = $database-&gt;getReference($ref_table)-&gt;push($postData);\n \n \n if( $postRef_result ) {\n echo '&lt;h3 align=&quot;center&quot; class=&quot;text text-success my-2&quot;&gt;Data Save Success !&lt;/h3&gt;';\n }else{\n die(mysqli_error($conn)) ;\n }\n \n }else{\n $msg = &quot;Failed to upload&quot;;\n $css_class = &quot;alert-danger&quot;;\n } \n}\n</code></pre>\n<p>How can I make my platenumber as my unqiue key ? When I insert data , the unique key is generated automatically. Is there solution for this?</p>\n"^^ . + . + . + "0"^^ . + "1"^^ . + "laravel-blade"^^ . + . + . + "Treat this like a documentation bug, please, i.e. file a ticket!"^^ . + "1"^^ . + . + "<p>The cookies.txt file is created if it doesn't already exist, and it should prevent the error</p>\n<pre><code>function third_party() {\n $cookie_path = __DIR__ . '/cookies.txt';\n \n // Check if the cookie file exists, if not create it\n if (!file_exists($cookie_path)) {\n file_put_contents($cookie_path, '');\n }\n\n $ch = curl_init();\n \n curl_setopt($ch, CURLOPT_URL, 'xyz.com');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n \n curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');\n curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_path);\n \n $headers = array();\n $headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7';\n $headers[] = 'Accept-Language: en-IN,en-GB;q=0.9,en-US;q=0.8,en;q=0.7';\n $headers[] = 'Connection: keep-alive';\n $headers[] = 'Sec-Fetch-Dest: document';\n $headers[] = 'Sec-Fetch-Mode: navigate';\n $headers[] = 'Sec-Fetch-Site: none';\n $headers[] = 'Upgrade-Insecure-Requests: 1';\n $headers[] = 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36';\n $headers[] = 'Sec-Ch-Ua: \\&quot;Not-A.Brand\\&quot;;v=\\&quot;99\\&quot;, \\&quot;Chromium\\&quot;;v=\\&quot;124\\&quot;';\n $headers[] = 'Sec-Ch-Ua-Mobile: ?0';\n $headers[] = 'Sec-Ch-Ua-Platform: \\&quot;Linux\\&quot;';\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($ch);\n if (curl_errno($ch)) {\n echo 'Error:' . curl_error($ch);\n }\n\n curl_close($ch);\n\n // After ensuring the cookie file exists, read it\n echo file_get_contents($cookie_path);\n}\n</code></pre>\n"^^ . + "1"^^ . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + "<p>There's a whole list of reasons:</p>\n<ol start="0">\n<li><p>Aliases are internal to the shell they were defined in; they don't automatically propagate &quot;down&quot; into programs (even if those programs are additional instances of Bash).</p>\n</li>\n<li><p>Bash only loads <code>~/.bashrc</code> when running in &quot;interactive&quot; mode. If run in non-interactive mode (like for a .sh script or a <code>system()</code> command), it doesn't load any startup scripts at all, and therefore won't load your alias definitions.</p>\n<p>So although your interactive shell has the aliases, any additional shell process run by <code>git</code> (like a hook script) won't have them.</p>\n</li>\n<li><p>Bash only <em>expands</em> aliases when running in &quot;interactive&quot; mode. If run in non-interactive mode (like for a .sh script or a &quot;system()&quot; command), it ignores all alias definitions it may have – though per #1, in this mode it won't have any alias definitions in the first place.</p>\n</li>\n<li><p>Not all command invocations even go through Bash in the first place. Yes, things like &quot;system()&quot; go through the shell, but the parent program <em>can</em> just as well execute another program directly (using the equivalent of PHP's &quot;pcntl_fork()&quot; + &quot;pcntl_exec()&quot;.)</p>\n</li>\n<li><p>Related to #3: As your message shows, the error occurs <em>not</em> when trying to execute the <code>php</code> command, but when trying to find it. That is, the failing script tries to do an early check using <code>which</code> to make sure that such a command exists in $PATH – and aliases do not exist in $PATH, so the script's pre-check cannot succeed. (That is, assuming if the script had any alias definitions, which it doesn't per #1.)</p>\n<ul>\n<li>This is in part because the check is done using the external <code>which</code> instead of the shell built-in <code>command -v</code>. Aliases are completely internal to the shell they were defined in, so even if the shell in question <em>had</em> any alias definitions (which per #1 it doesn't), those wouldn't be visible to the <code>which</code> program as it is external to the shell.</li>\n</ul>\n</li>\n</ol>\n<p>Recommendation: Replace the alias with a &quot;real&quot; shell script, e.g. <code>~/bin/php</code>. Then you will only need to ensure that ~/bin is in PATH, and it's much easier to have PATH propagate down into programs (it's automatic) than to make the same happen with aliases.</p>\n"^^ . + "1"^^ . + . + "0"^^ . + . + . + "0"^^ . + "1"^^ . + "rsa"^^ . + "Architecture (32 or 64 bit)? Xdebug?"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + . + "1"^^ . + . + "0"^^ . + "FYI: https://stackoverflow.com/a/76873451/367456 they at least have your new message and they talk about incompatible drivers. Haven't tooked into the traces, that website was too complicated for me. Btw. it also expires in a week."^^ . + "1"^^ . + . + "Sage odbc not working through PHP but is through Excel"^^ . + "<p>The ECONNRESET error in Postman when working with Laravel and Firestore basically indicates that the connection was reset during the communication process. This often happens when the server abruptly closes the connection before the response is complete.</p>\n<p>Here is a solution that may work.</p>\n<ul>\n<li><p>Verify that your firebase.json file contains the correct credentials. Ensure your Firebase project is properly set up and has Firestore enabled.</p>\n</li>\n<li><p>Check that the $collection and $documentId variables are defined correctly.</p>\n</li>\n<li><p>In Postman, increase the request timeout settings. Also in your Laravel app, consider increasing PHP script execution time</p>\n</li>\n</ul>\n"^^ . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + "1"^^ . + "<p>I have a web app that is frequently updated, so we use <code>php arisan down</code> with the <code>--render</code> option to display a helpful blade php view to let users know that we will be back soon.</p>\n<p>The page is displayed in English, but a significant portion of my users are Francophone. I am unable to get the right locale <code>app()-&gt;getLocale()</code> or relevant session <code>session()-&gt;get('Accept-Language')</code> or request <code>request()-&gt;getPreferredLanguage()</code> data on the rendered maintenance page. The <code>Accept-Language</code> key isn't even present in the <code>$_SERVER</code> variable. I suspect that is because that a significant portion of the app isn't booted up in maintenance mode.</p>\n<p>How do I get or set the right locale information for the rendered maintenance page so that French users can see it translated?</p>\n"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "<p><strong>Short answer:</strong> you have other points with <code>$image-&gt;user-&gt;...</code>, if $image-&gt;user is null there it will fail. It is expected behaviour.</p>\n<p>Here’s a simplified version of the code you shared:</p>\n<pre class="lang-php prettyprint-override"><code>@if ($image-&gt;user-&gt;image)\n &lt;div class=&quot;container-avatar&quot;&gt;\n &lt;img src=&quot;{{ route('user.avatar', ['filename' =&gt; $image-&gt;user-&gt;image]) }}&quot; class=&quot;avatar&quot;&gt; &lt;!-- Point A --&gt;\n &lt;/div&gt;\n@endif\n&lt;div class=&quot;data-user&quot;&gt;\n &lt;a href=&quot;&quot;&gt;\n {{ $image-&gt;user-&gt;name . ' ' . $image-&gt;user-&gt;surname }} &lt;!-- Point B --&gt;\n &lt;span class=&quot;nickname&quot;&gt;\n {{ ' | @' . $image-&gt;user-&gt;nick }}\n &lt;/span&gt;\n &lt;/a&gt;\n&lt;/div&gt;\n</code></pre>\n<p>I marked two important points:</p>\n<ul>\n<li><strong>Point A</strong> passes (inside the <code>@if</code> check).</li>\n<li><strong>Point B</strong> will throw the error <strong>if <code>$image-&gt;user</code> is null</strong> — and it isn’t inside any check.</li>\n</ul>\n<hr />\n<p>There are several options how you can fix it, and the best one depends on your business logic:</p>\n<h4>Wrap the entire block</h4>\n<pre class="lang-php prettyprint-override"><code>@if ($image-&gt;user)\n @if ($image-&gt;user-&gt;image)\n &lt;div class=&quot;container-avatar&quot;&gt;\n &lt;img src=&quot;{{ route('user.avatar', ['filename' =&gt; $image-&gt;user-&gt;image]) }}&quot; class=&quot;avatar&quot;&gt;\n &lt;/div&gt;\n @endif\n &lt;div class=&quot;data-user&quot;&gt;\n &lt;a href=&quot;&quot;&gt;\n {{ $image-&gt;user-&gt;name . ' ' . $image-&gt;user-&gt;surname }}\n &lt;span class=&quot;nickname&quot;&gt;\n {{ ' | @' . $image-&gt;user-&gt;nick }}\n &lt;/span&gt;\n &lt;/a&gt;\n &lt;/div&gt;\n... the rest of code\n@endif\n</code></pre>\n<h4>Use null-safe operator (Laravel 8+)</h4>\n<pre class="lang-php prettyprint-override"><code>{{ $image-&gt;user?-&gt;name ?? 'Anonymous' }}\n</code></pre>\n<h4>Provide default values</h4>\n<pre class="lang-php prettyprint-override"><code>{{ $image-&gt;user-&gt;name ?? 'Anonymous' }}\n</code></pre>\n<hr />\n<h3>My recommendation: Step back and handle it in the Controller with API Resources</h3>\n<p>It's best to <strong>prepare data in your controller</strong> using Resources. This way, you avoid mixing logic into your views.</p>\n<h4>Step 1: In your controller</h4>\n<pre class="lang-php prettyprint-override"><code>public function show(Image $image)\n{\n return new ImageResource($image);\n}\n</code></pre>\n<h4>Step 2: Create the resource</h4>\n<pre class="lang-bash prettyprint-override"><code>php artisan make:resource ImageResource\n</code></pre>\n<h4>Step 3: Add default fallbacks</h4>\n<pre class="lang-php prettyprint-override"><code>class ImageResource extends JsonResource\n{\n public function toArray($request)\n {\n return [\n 'avatar' =&gt; $this-&gt;user?-&gt;image ?? 'default-avatar.png',\n 'nick' =&gt; $this-&gt;user?-&gt;nick ?? 'Anonymous',\n 'full_name' =&gt; $this-&gt;user\n ? $this-&gt;user-&gt;name . ' ' . $this-&gt;user-&gt;surname\n : 'Anonymous',\n 'image_url' =&gt; route('image.file', ['filename' =&gt; $this-&gt;image_path]),\n 'description' =&gt; $this-&gt;description,\n 'likes_count' =&gt; $this-&gt;likes-&gt;count(),\n... add other fields\n ];\n }\n}\n</code></pre>\n<h4>You have more than one image?</h4>\n<p>No problem with this:</p>\n<pre class="lang-php prettyprint-override"><code>public function index(Request $request)\n{\n $images = Image::all(); /** Or whatever your logic is \nImage::paginate()\n*/\n \n return ImageResource::collection($images);\n}\n</code></pre>\n<h4>Passing it to blade template?</h4>\n<pre class="lang-php prettyprint-override"><code>public function show(Image $image)\n{\n return view('image', [$image =&gt; new ImageResource($image)]);\n}\n</code></pre>\n<hr />\n<h3>Final tip</h3>\n<p>If <code>$image-&gt;user</code> is unexpectedly null, double-check:</p>\n<ul>\n<li>Whether the related user was <strong>soft deleted</strong>.</li>\n<li>Whether the relationship is correctly defined in your <code>Image</code> model.</li>\n<li>Whether eager loading was used (<code>Image::with('user')-&gt;get()</code>), to avoid lazy loading issues.</li>\n</ul>\n"^^ . + "1"^^ . + . + . + . + . + . + "Thanks, that’s worked. Do you want to edit your answer to include then singleton and then I’ll mark it correct :)"^^ . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + . + "Thanks, but that didn't solved the issue. there is something with the "RequestOption" key that is not right."^^ . + "0"^^ . + . + . + "PhpStorm intellisense not working properly with method chaining + multiple classes"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "<p>Composer in version ^2.1 (June 2021) offers a way: ¹</p>\n<pre class="lang-php prettyprint-override"><code>use Composer\\InstalledVersions;\n\nInstalledVersions::getInstallPath('axi/mycalendar');\n</code></pre>\n<p>This seems cleaner than using a hard-encoded <em>/vendor</em> or parsing the <em>composer.json</em> file.</p>\n<hr />\n<p>¹ Compare <a href="https://getcomposer.org/doc/07-runtime.md#knowing-the-path-in-which-a-package-is-installed" rel="nofollow noreferrer" title="Runtime Composer utilities - Composer (getcomposer.org)"><em>Knowing the path in which a package is installed</em> (getcomposer.org)</a>.</p>\n"^^ . + . + . + "Made by AI... ?"^^ . + . + "0"^^ . + . + . + . + "Unable to programmatically update WooCommerce "Sent From" address"^^ . + "<p>This is not handled by Laravel; it is part of TailwindCSS. The configuration you provided works up to TailwindCSS v3.</p>\n<p>Starting from v4, the <code>tailwind.config.js</code> file and the legacy JavaScript-based configuration are removed, although it is still possible to use them via the <code>@config</code> directive.</p>\n<ul>\n<li><a href="https://stackoverflow.com/a/79383770/15167500">New CSS-first configuration option in v4</a> - StackOverflow</li>\n<li><a href="https://stackoverflow.com/a/79383770/15167500">TailwindCSS v4 is backwards compatible with v3</a> - StackOverflow</li>\n</ul>\n<p>In v4, dark mode is enabled by default but is activated based on the browser's <code>prefers-color-scheme</code> setting. It can be overridden manually, allowing you to control dark mode activation using the <code>.dark</code> class, for example. To achieve this, you need to override the behavior of the dark directive using <code>@custom-variant</code> a CSS-first configuration like this:</p>\n<pre class="lang-css prettyprint-override"><code>@import &quot;tailwindcss&quot;;\n\n@custom-variant dark (&amp;:where(.dark, .dark *));\n</code></pre>\n<ul>\n<li><a href="https://tailwindcss.com/docs/functions-and-directives#custom-variant-directive" rel="nofollow noreferrer"><code>@custom-variant</code> directive</a> - TailwindCSS v4 Docs</li>\n<li><a href="https://tailwindcss.com/docs/dark-mode#toggling-dark-mode-manually" rel="nofollow noreferrer">Toggling dark mode manually</a> - TailwindCSS v4 Docs</li>\n<li><a href="https://tailwindcss.com/docs/dark-mode#with-system-theme-support" rel="nofollow noreferrer">With system theme support</a> - TailwindCSS v4 Docs</li>\n</ul>\n<p>Related questions:</p>\n<ul>\n<li><a href="https://stackoverflow.com/a/79499827/15167500">How to use custom color themes in TailwindCSS v4?</a> - StackOverflow</li>\n<li><a href="https://stackoverflow.com/a/79487205/15167500">TailwindCSS v4 dark theme by class not working without dark tag</a> - StackOverflow</li>\n</ul>\n<p>Based on the details in your question and the fact that Laravel 12 defaults to supporting TailwindCSS v4, I think it would be worth reviewing the many breaking changes between v3 and v4. This will help you better understand the modifications and new features.</p>\n<ul>\n<li><a href="https://tailwindcss.com/docs/installation/using-vite" rel="nofollow noreferrer">Get started with TailwindCSS using Vite</a> - TailwindCSS v4 Docs</li>\n<li><a href="https://tailwindcss.com/docs/upgrade-guide" rel="nofollow noreferrer">Upgrading your TailwindCSS projects from v3 to v4</a> - TailwindCSS v4 Docs</li>\n<li><a href="https://stackoverflow.com/a/79383884/15167500">Cannot build frontend using Vite, TailwindCSS with PostCSS</a> - StackOverflow</li>\n<li><a href="https://stackoverflow.com/a/79380522/15167500">Problem installing TailwindCSS with Vite</a> - StackOverflow</li>\n</ul>\n"^^ . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + . + "Are you struggling with the PHP part or with the JS part?"^^ . + "1"^^ . + "@droopsnoot Why? That's the standard port for mail delivery (as opposed to mail submission through a relay)."^^ . + . + . + . + "warnings"^^ . + . + . + . + "intelephense"^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + "<p>I have eloquent model to store specific car brand model years:</p>\n<pre><code>&lt;?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass CarModel extends Model\n{\n protected $fillable = ['brand_id', 'name'];\n\n public function brand()\n {\n return $this-&gt;belongsTo(CarBrand::class, 'brand_id');\n }\n\n public function years()\n {\n return $this-&gt;hasMany(CarModelYear::class, 'model_id');\n }\n\n public function classifications()\n {\n return $this-&gt;hasMany(CarClassification::class, 'model_id');\n }\n\n public function scopeWithCarStats(Builder $query)\n {\n $query-&gt;withCount([\n 'classifications as totalClassifications',\n ]);\n\n $carClasses = CarClass::pluck('id');\n foreach ($carClasses as $carClassId) {\n $query-&gt;withCount([\n &quot;classifications as car_class_{$carClassId}&quot; =&gt; function (Builder $query) use ($carClassId) {\n $query-&gt;where('class_id', $carClassId);\n }\n ]);\n }\n\n $carYears = CarModelYear::query()\n -&gt;select('year')\n -&gt;distinct()\n -&gt;orderBy('year', 'asc')\n -&gt;pluck('year');\n\n if($carYears-&gt;isNotEmpty()) {\n foreach ($carYears as $year) {\n $query-&gt;selectRaw(&quot;\n (SELECT COUNT(*)\n FROM car_classifications\n JOIN car_model_years ON car_classifications.year_id = car_model_years.id\n WHERE car_classifications.model_id = car_models.id\n AND car_model_years.year = ?) as car_model_year_{$year}\n &quot;, [$year]);\n }\n }\n }\n}\n\nclass CarModelYear extends Model\n{\n protected $fillable = ['model_id', 'year'];\n\n public function model()\n {\n return $this-&gt;belongsTo(CarModel::class, 'model_id');\n }\n\n public function classifications()\n {\n return $this-&gt;hasMany(CarClassification::class, 'year_id');\n }\n\n public function scopeWithCarStats(Builder $query)\n {\n $query-&gt;withCount([\n 'classifications as totalClassifications',\n ]);\n\n $carClasses = CarClass::pluck('id');\n foreach ($carClasses as $carClassId) {\n $query-&gt;withCount([\n &quot;classifications as car_class_{$carClassId}&quot; =&gt; function (Builder $query) use ($carClassId) {\n $query-&gt;where('class_id', $carClassId);\n }\n ]);\n }\n }\n}\n</code></pre>\n<p>Here is my CarModel resource form:</p>\n<pre><code>public static function form(Form $form): Form\n{\n return $form\n -&gt;schema([\n Forms\\Components\\Section::make()\n -&gt;columns()\n -&gt;schema([\n Forms\\Components\\TextInput::make('name')\n -&gt;label('Model Name')\n -&gt;required()\n -&gt;maxLength(255),\n Forms\\Components\\Select::make('brand_id')\n -&gt;label('Car Brand')\n -&gt;relationship('brand', 'name')\n -&gt;searchable()\n -&gt;preload()\n -&gt;required(),\n Forms\\Components\\TagsInput::make('years')\n -&gt;label('Model Years')\n -&gt;placeholder('Enter model years, example: 2020, 2021, 2022')\n -&gt;required()\n -&gt;dehydrated(false)\n -&gt;unique()\n -&gt;splitKeys([',', ' '])\n -&gt;hint('Eneter model years with comma or space'),\n ])\n ]);\n}\n</code></pre>\n<p>I tried debugging in <code>CreateCarModel</code> method named <code>mutateFormDataBeforeCreate</code> but not triggered anything:</p>\n<pre><code>protected function mutateFormDataBeforeCreate(array $data): array\n{\n if(array_key_exists('years', $data)) {\n dd($data['years']);\n }\n\n return $data;\n}\n</code></pre>\n<p>I get error when try create some model with specific years:</p>\n<pre><code>SQLSTATE[42S22]: Column not found: 1054 Unknown column 'years' in 'where clause' (Connection: mysql, SQL: select count(*) as aggregate from `car_models` where `years` = 2024)\n</code></pre>\n<p>How I can correctly use TagsInput component to store car model years?</p>\n"^^ . + . + . + "Are you sure the middleware registered to the correct routes? Because I was able to get it working with your exact code!"^^ . + "1"^^ . + . + . + . + . + . + "I have used `attach` in the `add()` method. Should I use `syncWithoutDetaching` there too?"^^ . + "<h3>Chocolatey: the package manager for Windows</h3>\n<p>Chocolatey is a package manager for Windows that allows you to easily install, update, and manage software and tools from the command line. It simplifies the process of handling dependencies and versions for development environments and other software installations.</p>\n<ul>\n<li><a href="https://github.com/chocolatey/choco" rel="nofollow noreferrer"><code>chocolatey/choco</code></a> - GitHub</li>\n<li><a href="https://community.chocolatey.org/packages/php" rel="nofollow noreferrer">PHP for Chocholatey</a> - Chocholatey Community</li>\n</ul>\n<h3>Laragon</h3>\n<p>Laragon is a fast and lightweight local development environment for Windows, designed for PHP, Node.js, Python, and more. While similar to XAMPP, it offers a more flexible and customizable setup, with features like version switching and isolated environments for various technologies.</p>\n<ul>\n<li><a href="https://github.com/leokhoa/laragon" rel="nofollow noreferrer"><code>leokhoa/laragon</code></a> - GitHub</li>\n<li><a href="https://laragon.org/docs/install" rel="nofollow noreferrer">How to install</a> - Laragon Docs</li>\n</ul>\n<h3>PHP Version Manager for Windows</h3>\n<p>It used to seem interesting. It might be useful only for PHP, and it is actively developed.</p>\n<ul>\n<li><a href="https://github.com/hjbdev/pvm" rel="nofollow noreferrer"><code>hjbdev/pvm</code></a> - GitHub</li>\n</ul>\n<h3>WSL for Windows with asdf manager</h3>\n<p>Linux subsystems can be installed on Windows. On Linux, there's a much more developed set of tools for version management of PHP, Composer, Node, and Pnpm. For example, asdf is excellent at covering all version management for these tools.</p>\n<p>The advantage of WSL is that it can be imported and exported, allowing you to carry a built system between multiple Windows machines. You can separate the software and data needed for development from your personal private operating system.</p>\n<ul>\n<li><a href="https://learn.microsoft.com/en-us/windows/wsl/install" rel="nofollow noreferrer">How to install Linux on Windows with WSL</a> - Microsoft WSL Docs</li>\n<li><a href="https://github.com/asdf-vm/asdf" rel="nofollow noreferrer"><code>asdf-vm/asdf</code></a> - GitHub</li>\n<li><a href="https://asdf-vm.com/guide/getting-started.html" rel="nofollow noreferrer">Getting started</a> - asdf Docs</li>\n<li><a href="https://asdf-vm.com/manage/plugins.html" rel="nofollow noreferrer">Plugins</a> - asdf Docs\n<ul>\n<li><a href="https://github.com/asdf-vm/asdf-plugins?tab=readme-ov-file#plugin-list" rel="nofollow noreferrer">Plugin List</a> - GitHub</li>\n<li><a href="https://github.com/asdf-community/asdf-php" rel="nofollow noreferrer"><code>asdf-community/asdf-php</code> for PHP and Composer</a> - GitHub</li>\n<li><a href="https://github.com/asdf-vm/asdf-nodejs" rel="nofollow noreferrer"><code>asdf-vm/asdf-nodejs</code> for Node.js and NPM</a> - GitHub</li>\n<li><a href="https://github.com/jonathanmorley/asdf-pnpm" rel="nofollow noreferrer"><code>jonathanmorley/asdf-pnpm</code> for PNPM</a> - GitHub</li>\n</ul>\n</li>\n</ul>\n<h3>Others for Windows</h3>\n<ul>\n<li><a href="https://laravel.com/docs/11.x/homestead" rel="nofollow noreferrer">Laravel Homestead</a> - Laravel Docs\n<ul>\n<li><a href="https://github.com/laravel/homestead" rel="nofollow noreferrer"><code>laravel/homestead</code></a> - GitHub</li>\n</ul>\n</li>\n<li><a href="https://github.com/mlocati/powershell-phpmanager" rel="nofollow noreferrer"><code>mlocati/powershell-phpmanager</code></a> - GitHub</li>\n</ul>\n"^^ . + "simplesamlphp"^^ . + "1"^^ . + "0"^^ . + . + "pusher"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + "1"^^ . + . + "<p>So I am very new to XAMPP and php. Just installed it on my laptop which runs Pop!_OS 22.04. Works fine mostly but when I try to go to localhost/phpmyadmin I get this error:</p>\n<hr />\n<p>phpMyAdmin - Error</p>\n<p>Error during session start: please check your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser.</p>\n<p>session_start(): open(SESSION_FILE, O_RDWR) failed: Permission denied (13)</p>\n<p>session_start(): Failed to read session data: files (path: /opt/lampp/temp/)</p>\n<hr />\n<p>I'm not really sure what to do. I've already changed permissions for /opt/lampp using <code>sudo chown -R username /opt/lampp</code> and also <code>sudo chmod -R 755 /opt/lampp</code>. I feel like this should apply to all the lampp files right? Really don't know what else to do.</p>\n"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + "2"^^ . + . + . + "1"^^ . + . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + "2"^^ . + "Did you include the scripts (`<x-metapixel-head/>` and `<x-metapixel-body/>`) in Blade?"^^ . + . + . + . + . + . + "<p>This is completely normal behavior: logging to the console for console commands.</p>\n<p>The standard console logger is very minimalistic, making it difficult to achieve what you need.</p>\n<p>However, if you install Monolog, you can suppress log output in the prod environment by simply adding the line</p>\n<pre class="lang-php prettyprint-override"><code>$output-&gt;setVerbosity(OutputInterface::VERBOSITY_QUIET);\n</code></pre>\n<p>in the <code>execute</code> method before the first console output method is called (before the first log entry). It’s best to place it at the very beginning to avoid confusion. However, keep in mind that <code>-v</code>, <code>-vv</code>, and <code>-vvv</code> options will have no effect on the command, and you’ll need to handle these arguments separately.</p>\n"^^ . + . + . + . + "what is a "routine function"? "I've created it in laravel 10 with alpine tailwind,livewire and flowbite" - you have created all of that in your screenshot but don't know how to add a function?"^^ . + "0"^^ . + . + . + . + . + . + "2"^^ . + . + "You need to use the `APP ID` as `Client ID` and `Cert ID` as `Client Secret`. Check the [Doc here](https://developer.ebay.com/api-docs/static/oauth-credentials.html)."^^ . + "@AymDev Yes, we know for a fact that 0 is an unsed value in all our clients databases even for those that have the feature already enabled"^^ . + "2"^^ . + "0"^^ . + "0"^^ . + . + . + "Validate Childform DTOs before parent"^^ . + . + "0"^^ . + . + "0"^^ . + . + "Exactly, you got the logic correctly."^^ . + . + . + "Are you really storing the _string_ `2025-02-25 - 10:40:29` in your `datum_gebucht` column?"^^ . + . + "3"^^ . + "0"^^ . + . + . + . + . + . + . + "The question is not only "Sending forms through JavaScript" but rather "Sending form loaded with Javascript through JavaScript"."^^ . + . + "<h3>Problem:</h3>\n<p>When an allowed IP accesses the <code>/wp-admin</code> or <code>/wp-login.php</code> page, instead of rendering the page, the server downloads a PHP file. This issue occurs because PHP files are not being processed correctly, likely due to a missing or incorrect <code>fastcgi_pass</code> directive in the <code>wp-admin</code> location block.</p>\n<p><strong>Fix:</strong></p>\n<p>Replace:</p>\n<pre><code>location ~ ^/(wp-admin|wp-login\\.php) {\n\n if ($block_access) {\n return 403;\n }\n\n try_files $uri $uri/ /index.php?q=$uri&amp;$args;\n\n}\n</code></pre>\n<p>With:</p>\n<pre><code>location ~ ^/(wp-admin|wp-login\\.php) {\n \n if ($block_access) {\n return 403;\n }\n\n try_files $uri $uri/ /index.php?q=$uri&amp;$args;\n\n fastcgi_pass unix:/run/php-fpm/www.sock;\n fastcgi_index index.php;\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n include fastcgi_params;\n}\n</code></pre>\n<p>The issue occurs because the <code>/wp-admin</code> and <code>/wp-login.php</code> locations do not explicitly specify FastCGI processing.</p>\n<p>When a user accesses these paths, Nginx serves them as static files instead of executing PHP.</p>\n<p>Adding the FastCGI directives ensures that PHP files are passed to PHP-FPM for execution rather than being downloaded.</p>\n<p><strong>References:</strong></p>\n<p>- [Nginx WordPress Configuration] (<a href="https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/" rel="nofollow noreferrer">https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/</a>)</p>\n<p>- [Official Nginx PHP-FPM Documentation] (<a href="https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html" rel="nofollow noreferrer">https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html</a>)</p>\n<p>- [Restricting wp-admin Access in Nginx] (<a href="https://wordpress.org/support/article/nginx/" rel="nofollow noreferrer">https://wordpress.org/support/article/nginx/</a>)</p>\n"^^ . + . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + "1"^^ . + "Once you have a shell prompt, use the `sudo` command above, replacing `<yourwebuser>` with the username of the account that your PHP code runs as"^^ . + "For both the last known good and the new setup."^^ . + "How can I add separator as a rule line or stars between textarea messages written in a text file?"^^ . + "1"^^ . + "1"^^ . + . + "Passing data via POST from JavaScript/jQuery to a PHP script - Something isn't quite right"^^ . + . + . + . + "Just paste your code into 3v4l.org, execute it, and give me the new url. I'll review it for you."^^ . + . + . + . + "0"^^ . + . + . + . + "<p>In Laravel 11, you can chain both prefix() and middleware() methods before defining your route group. Here's how to achieve the same behavior as the previous version's array syntax:</p>\n<pre><code>Route::prefix('post')-&gt;middleware('auth')-&gt;group(function () {\n Route::get('all', [Controller::class, 'post']);\n Route::get('user', [Controller::class, 'post']);\n});\n</code></pre>\n<p>For multiple middleware:</p>\n<pre><code>Route::middleware(['auth', 'admin'])\n -&gt;prefix('admin')\n -&gt;group(function () {\n // Your routes here\n });\n</code></pre>\n<p>You can also chain other route group features:</p>\n<pre><code>Route::prefix('api')\n -&gt;middleware('api')\n -&gt;domain('api.example.com')\n -&gt;name('api.')\n -&gt;group(function () {\n // Your API routes\n });\n</code></pre>\n<blockquote>\n<p>This fluent interface approach is the recommended way in Laravel 11 for grouping routes with shared configuration. The old array-based syntax has been deprecated in favor of this more readable method chaining syntax.</p>\n</blockquote>\n<p><a href="https://www.slingacademy.com/article/route-prefixing-and-grouping-in-laravel-a-complete-guide/" rel="nofollow noreferrer">https://www.slingacademy.com/article/route-prefixing-and-grouping-in-laravel-a-complete-guide/</a><br />\n<a href="https://www.devgem.io/posts/how-to-use-prefix-with-middleware-in-laravel-11" rel="nofollow noreferrer">https://www.devgem.io/posts/how-to-use-prefix-with-middleware-in-laravel-11</a></p>\n"^^ . + . + "2"^^ . + . + . + "@hakre listen thanks for nothing I'll handle it myself"^^ . + . + . + . + "@NicoHaase added EDIT2, I don't think I can describe it any clearer."^^ . + "4"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + "<p>As it stands, you are assigning the vehicle ID as a key to an associated array rather than a key value within in the array. So, I think you have two options.</p>\n<ol>\n<li><p>Add <code>vehicle_id</code> to the array you are passing back. Something like</p>\n<pre><code>$events[$r[&quot;vehicle_id&quot;]] = [\n &quot;s&quot; =&gt; $r[&quot;evt_start&quot;], \n &quot;e&quot; =&gt; $r[&quot;evt_end&quot;],\n &quot;c&quot; =&gt; $r[&quot;evt_color&quot;], \n &quot;b&quot; =&gt; $r[&quot;evt_bg&quot;],\n &quot;t&quot; =&gt; $r[&quot;evt_text&quot;], \n &quot;v&quot; =&gt; $r[&quot;vehicle_id&quot;]\n];\n</code></pre>\n<p>With this, you could call it like you were... <code>$row['v']</code></p>\n</li>\n<li><p>The second option would be to loop through the array on the page and list the key. Something like</p>\n<pre><code>&lt;?php\nforeach($events as $key =&gt; $val) {\n ?&gt; &lt;input class=&quot;form-control&quot; type=&quot;hidden&quot; name=&quot;vehicle_id&quot; value=&quot;&lt;?php echo $key; ?&gt;&quot;/&gt;\n&lt;?php } ?&gt;\n</code></pre>\n</li>\n</ol>\n"^^ . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + "_"sometimes we forget to add a space between the command option and its value, which causes issues"_ - if you really need a technical workaround for something that could be solved by paying a modicum of attention ... Then use the option name as key of your array, and the value as value - and then implode / concatenate those with a space character in between first."^^ . + . + . + . + . + "-1"^^ . + "0"^^ . + . + . + . + "I would avoid to code a SQL query but a generated query is ok and always up-to-date. but how ?"^^ . + "google-api"^^ . + . + "@WilliamArcq _"@Honk der Hase Yes I read that on different sites, but where ?"_ First of fall in computing: Most resources are constrained, therefore limit exists. Therefore locate those limits, most often they are documented. For Apache HTTP you have two options: First the source code and second the applications manual. You can find both on [httpd.apache.org](https://httpd.apache.org/), including additional information. You may additionally find details on questions asked on third party Q&A sites like Stackoverflow."^^ . + . + "0"^^ . + "1"^^ . + . + "_"I then passed the variables into PHP"_ - no, you didn't. PHP executes on the server side, long before any JS on the client side does."^^ . + . + . + . + . + "Thanks for the answer! Unfortunately the learn_press_get_course_id_by_lesson_id function doesn't seem to be defined for me? I'm using the free version of learnpress if that makes a difference"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + "-1"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + . + "@TestDoang: Pass it through the constructor via `$this` then. This is how you can do it with Maatwebsite Excel. The library is a bit confusing that the import object is that distant to the actual objects to import, but with two, three inner-looping passes of values (assign to $this in the constructor, read from $this in the methods that are being called on the protocol), it still works to actually transport relevant data to configure the import at the point of invocation."^^ . + "This may be a possible solution for you, but this code is not compatible with the phpseclib/v1 code from the question, i.e. the decryption code matching the phpseclib/v1 code cannot decrypt the ciphertexts of the PHP/OpenSSL code, see my answer for more details."^^ . + . + . + "Great!!!!! This is the solution {$wpdb->prefix}wc_order_product_lookup"^^ . + "1"^^ . + . + "How to save a custom order item after HPOS update"^^ . + . + "1"^^ . + . + . + . + . + "0"^^ . + "<p>I want to implement webauthn using PHP (specifically Yii2 Framework) along with the SimpleWebAuthnBrowser library (<a href="https://simplewebauthn.dev/docs/packages/browser" rel="nofollow noreferrer">https://simplewebauthn.dev/docs/packages/browser</a>)</p>\n<p>When registering the device, here is my response for the challenge</p>\n<pre class="lang-php prettyprint-override"><code>return [\n 'challenge' =&gt; $challengeBase64,\n 'rp' =&gt; [\n 'name' =&gt; Yii::$app-&gt;name,\n 'id' =&gt; 'x-y-z.ngrok-free.app',\n ],\n 'user' =&gt; [\n 'id' =&gt; $userId,\n 'name' =&gt; $displayName,\n 'displayName' =&gt; $displayName,\n ],\n 'pubKeyCredParams' =&gt; [\n ['type' =&gt; 'public-key', 'alg' =&gt; -7],\n ['type' =&gt; 'public-key', 'alg' =&gt; -257],\n ],\n 'authenticatorSelection' =&gt; [\n 'authenticatorAttachment' =&gt; 'cross-platform',\n 'requireResidentKey' =&gt; false,\n 'userVerification' =&gt; 'discouraged',\n ],\n 'timeout' =&gt; 60000,\n 'attestation' =&gt; 'direct',\n 'transports' =&gt; ['usb'],\n];\n</code></pre>\n<p>On the registration view:</p>\n<pre class="lang-js prettyprint-override"><code>try {\n // get challenge\n let challengeResponse = await fetch('/user/challenge');\n\n if (!challengeResponse.ok) {\n throw new Error('Failed to get challenge from server');\n }\n let challengeData = await challengeResponse.json();\n\n const attResp = await SimpleWebAuthnBrowser.startRegistration(challengeData);\n\n // // get credential data\n let credential_id = attResp.rawId;\n let public_key = attResp.response.publicKey;\n let sign_count = 0;\n let transports = attResp.response.transports ? attResp.response.transports : [];\n let attestation_type = attResp.type;\n .....\n</code></pre>\n<p>The registration process is running well, and the credential saved to the database.</p>\n<p><img src="https://i.sstatic.net/wjTUjlBY.png" alt="Saved Credential" /></p>\n<p>But when I need to validate / do the authentication, the library has an error</p>\n<pre><code>NotAllowedError: The operation either timed out or was not allowed. See: https://www.w3.org/TR/webauthn-2/#sctn-privacy-considerations-client.\n</code></pre>\n<p>Here is my code on the view and return from the challenge.</p>\n<pre class="lang-js prettyprint-override"><code>try {\n const response = await fetch('/user/another-challenge', { method: 'GET' });\n const options = await response.json();\n\n const assertion = await SimpleWebAuthnBrowser.startAuthentication(options); // gives an error above\n\n</code></pre>\n<p>And here is the response for the <code>/user/another-challenge</code></p>\n<pre><code>return [\n 'challenge' =&gt; Base64Url::encode($challenge),\n 'rp' =&gt; [\n 'name' =&gt; Yii::$app-&gt;name,\n 'id' =&gt; 'x-y-z.ngrok-free.app',\n ],\n 'user' =&gt; [\n 'id' =&gt; Base64Url::encode($user-&gt;id),\n 'name' =&gt; $user-&gt;username,\n 'displayName' =&gt; $user-&gt;username,\n ],\n 'allowCredentials' =&gt; [\n [\n 'type' =&gt; 'public-key',\n 'id' =&gt; Base64Url::encode($credential-&gt;credential_id),\n 'transports' =&gt; ['usb'],\n ]\n ],\n 'timeout' =&gt; 60000,\n 'userVerification' =&gt; 'discouraged',\n];\n</code></pre>\n<p>I am wondering if this has something to do with the response from the registration challenge (from the registration phase).</p>\n<p>Any clue or guidance will be appreciated. Thank you.</p>\n"^^ . + . + "1"^^ . + "0"^^ . + . + . + "0"^^ . + . + "Yes, I can't decide whether this is intentional or not. Since InlayHints itself is a very useful extension for 7.4, as it enhances the visible code with extra data without added them to code."^^ . + . + "<p>I have to update vom php 7.4 to 8.0 and get an call to undefined function create_function error.</p>\n<p>Is there someone who could help me to rewrite it correctly?</p>\n<pre><code>$this-&gt;$base = create_function( '$atts, $contents = null, $base, $current', \n'$output = _WSH()-&gt;shortcodes-&gt;shortcode_output( $atts, $contents, $base, $current);\nreturn $output;'\n);\n</code></pre>\n<p>I can edit php code very well, but I'm reaching my limits here. I can't completely rewrite something from a lower version to the next higher version without help.</p>\n"^^ . + . + . + "1"^^ . + "<p>When two F3 applications hosted on the same domain are running on the same browser, the session variables are getting erased and hence causing conflicts.</p>\n<p>Is there anyway I can create session namespaces in F3? Something like using the <code>session_name()</code> method in the native PHP sessions?</p>\n"^^ . + . + . + "I will try it out and let you now if it works. If you want to contribute make the changes in the branch `add-tags-js`, but only after testing."^^ . + . + "0"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + . + "I cannot enable/disable debug mode via the backend, if I click on the switch and save, it will come back to its previous state. I can only set the mode via /config/defines.inc.php"^^ . + "@hakre\nThe problem has been solved. Magnie Mozios answered my question and it worked successfully \nThank you for modifying the question to be more clear"^^ . + . + "I added a Laravel Fallback handler, where for every .php URL, we try to redirect the user to the URL without the .php extension. Otherwise, it redirects to the / homepage."^^ . + "1"^^ . + "I'd separate the two out different files. When you post back to the same page with ajax, you're going to get the whole page again, plus the data that you're echoing. You're not going to be able to do much with the response."^^ . + . + . + "0"^^ . + . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + "0"^^ . + "<p>Good morning,\nI have a wordpress page where an html-php snippet asks for two dates and based on the values ​​entered by the user, it executes a query and returns the data in a table.\nThe page that returns with the table data, cleans the values ​​entered by the user in the two dates (from - to), I would like to keep the values ​​entered by the user.\nWhat do you recommend? session, cookie or other..\nI would appreciate some examples since I am a beginner.\nThanks to anyone who wants to answer me.\nBye</p>\n"^^ . + "doctrine-orm"^^ . + . + . + "0"^^ . + "1"^^ . + "What happens when you run the code you posted?"^^ . + "0"^^ . + "frontend"^^ . + . + "upgrade"^^ . + "0"^^ . + . + "2"^^ . + . + "0"^^ . + . + . + . + . + "1"^^ . + "1"^^ . + . + "0"^^ . + "What PHP settings? And what is LIVE?"^^ . + "We can't see what you do with $clientipAddress after this code ends so we have no idea how you're observing this output. Also have you actually done any proper debugging? Which one of those `if` blocks does the code actually enter when you call this function? Have you tried dumping out $_SERVER to see which of the fields is populated and might contain the value you're interested in?? Not much real testing seems to have gone on so far. We can't run your code in your environment so we can't tell you what exactly happens to it, that depends on the input values, which only you can observe"^^ . + "0"^^ . + "0"^^ . + . + . + . + "2"^^ . + . + . + "@PaulT. I am not running a webserver. I run php-cli."^^ . + "0"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + "1"^^ . + . + . + "1"^^ . + . + . + "1"^^ . + "Sending email to subscribers in MailChimp based on Tag"^^ . + "Yes my friend, it works!! Thank you very very much!!"^^ . + . + . + . + . + . + . + "Not the exact solution, but your code gave me some direction to proceed with the work, thank you for the code."^^ . + . + . + "<p>I recently faced an issue with my Laravel application after deploying it to a hosting server. When trying to log in, I kept getting the following error:</p>\n<p><strong>419 Page Expired</strong></p>\n<p>However, everything worked perfectly on my local development environment.</p>\n<p>I spent hours troubleshooting this issue and tried many solutions I found online, including clearing caches, modifying session settings, and checking CSRF tokens, but nothing worked. This was incredibly frustrating and exhausting. Finally, after extensive debugging, I found the solution and wanted to share it with everyone.</p>\n<p>The Issue:\nOn the hosting server, logging into Laravel resulted in a 419 Page Expired error, while it worked fine locally.</p>\n<p><strong>The proven solution that worked is the answer below</strong></p>\n"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + . + "I think it isn't very useful in this example, the longer formulation doesn't change much. In a case where the visible text is an abbreviation there because of lack of space, you could use `<abbr>`. Example: `<abbr title="Total">Tot.</abbr>`."^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "4"^^ . + . + "<p><strong>ARGH!</strong></p>\n<p>Yes, I did say I had disabled all extensions. I was wrong.</p>\n<p>I had arranged them in alphabetical order, each followed by any additional code they may require.</p>\n<p>So I started at the end, and methodically went up and commented out each extension… <strong>until</strong> I got to something that didn't look like an extension, and then I thought, &quot;Job done!&quot;</p>\n<p>But it wasn't done. <code>AccessControl</code> had some required settings following it's loading command, that I thoughtlessly meant I was at the end of the extension loading:</p>\n<pre><code>wfLoadExtension( 'AccessControl' ); # https://www.mediawiki.org/wiki/Extension:AccessControl\n$wgGroupPermissions['*']['read'] = true;\n$wgGroupPermissions['*']['createaccount'] = false;\n$wgGroupPermissions['*']['edit'] = false;\n$wgGroupPermissions['*']['writeapi'] = false;\n$wgGroupPermissions['*']['createpage'] = false;\n$wgGroupPermissions['*']['createtalk'] = false;\n</code></pre>\n<p>So since posting my question, I just found <code>AccessControl</code> not commented out. When properly commented it out, voila! It started working!</p>\n<p>So it appears that the MediaWiki extension <code>AccessControl</code> has some issues. I'll now go to its web page and report it.</p>\n"^^ . + "1"^^ . + "it's even better, the general rule on Stack Exchange is to ask one question at a time so if you have more questions please ask them separately. That being said I'd be very curious to know why errno.h is not found so if you asked a question about it I'd ask if you're working on a full FreeBSD installation and do you have /usr/include/errno.h."^^ . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + "I think this is relevant: https://stackoverflow.com/a/39475049/231316"^^ . + . + . + . + . + . + . + . + "PHPstan making bad assumption about array key"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + . + "<p>The issue is that after a user registers, their email is successfully stored in $_SESSION and displayed on the homepage, but firstname does not appear.</p>\n<p>After successful registration, both email and firstname should be stored in the session and displayed on home.php.</p>\n<p>What Happens Instead:\n$_SESSION['email'] works correctly and displays on the homepage.\n$_SESSION['firstname'] is missing or defaults to 'Guest' in home.php.</p>\n<p>Code:\nregister.php (Handles user signup and session creation)</p>\n<pre><code>session_start();\n\nif (!isset($_SESSION['user_id'])) {\n header(&quot;Location: login_style.html&quot;);\n exit();\n}\n\n// Retrieve user input\n$firstname = trim($_POST['firstname']);\n$email = trim($_POST['email']);\n$password = trim($_POST['password']);\n$repeat_password = trim($_POST['repeat-password']);\n\nif ($password !== $repeat_password) {\n die(&quot;Passwords do not match!&quot;);\n}\n\n// Database connection\n$conn = pg_connect(&quot;host=localhost port=5432 dbname=webappDB user=postgres password=your_password&quot;);\n\nif (!$conn) {\n die(&quot;Connection failed: &quot; . pg_last_error());\n}\n\n// Hash password\n$hashed_password = password_hash($password, PASSWORD_DEFAULT);\n\n// SQL Insert (Possible issue here?)\n$query = &quot;INSERT INTO users (firstname, email, password) VALUES ($1, $2, $3)&quot;;\n$result = pg_query_params($conn, $query, array($firstname, $email, $hashed_password));\n\nif ($result) {\n // Retrieve user data\n $query = &quot;SELECT user_id, firstname FROM users WHERE email = $1&quot;;\n $result = pg_query_params($conn, $query, array($email));\n\n if ($row = pg_fetch_assoc($result)) {\n $_SESSION['user_id'] = $row['user_id'];\n $_SESSION['firstname'] = $row['firstname']; // Set firstname in session\n $_SESSION['email'] = $email;\n $_SESSION['logged_in'] = true;\n\n var_dump($_SESSION); // Debugging\n header(&quot;Location: home.php&quot;);\n exit();\n } else {\n echo &quot;Error fetching user data!&quot;;\n }\n} else {\n echo &quot;Registration Failed: &quot; . pg_last_error($conn);\n}\n\npg_close($conn);\n?&gt;\n</code></pre>\n<p>home.php (Displays session data)</p>\n<pre><code>session_start();\n\nif (!isset($_SESSION['logged_in']) || $_SESSION['logged_in'] !== true) {\n header('Location: login_style.php');\n exit();\n}\n\n$user_email = $_SESSION['email'] ?? 'Guest';\n$user_name = $_SESSION['firstname'] ?? 'Guest'; // This does not work\n?&gt;\n</code></pre>\n<p>What I've Tried:</p>\n<ol>\n<li>Checked var_dump($_SESSION); in register.php → Shows firstname is set correctly.</li>\n<li>Checked for session start issues → session_start(); is at the top of both register.php and home.php.</li>\n<li>Tried reloading home.php → No change, still defaults to 'Guest'.</li>\n<li>Checked database query syntax → The insert and select queries seem correct.</li>\n</ol>\n"^^ . + . + . + "1"^^ . + . + "Thanks for your response!\nOne of the first things I did was check line 1812 in the file class-wpdb.php; however, it displays the formatting for the error!\nI fixed the issue by going back a few versions before the error appeared, which seems to work so far. I know it can't be my go-to answer, but at least it's something!\nI'll try your response next time this problem arises; thanks again for your input!"^^ . + "0"^^ . + "0"^^ . + "HTML form not sending expected value of radio button, sending "on" instead"^^ . + . + "@EdMorton you're right, stderr was not being included in the output, and adding it showed me what was really going wrong - it wasn't what I thought. Long story short, the `npm` commands were failing entirely. I'll post an answer with the details - thanks for the help, that pointed me in the right direction and enabled me to solve the problem"^^ . + . + . + . + . + . + . + . + "Highlight order in admin dashboard in woocommerce with specific shipping method"^^ . + . + . + . + "Two important things to know about floating point: (1) it's binary, so many decimal fractions like 0.3 and 0.4 can *not* be represented exactly, and (2) addition is *not* associative; the order in which you add numbers can matter."^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + "2"^^ . + . + . + "0"^^ . + . + . + . + . + . + "<p>I'm setting up a new method of deploying my personal <code>react</code> website, which is using vite for bundling. My idea is:</p>\n<ol>\n<li>I push un-bundled changes from local to remote repo</li>\n<li>a web hook informs my server (which has a listening <code>php</code> script)</li>\n<li>the <code>php</code> script triggers a <code>bash</code> script that: 1) runs an <code>npm install</code>, 2) runs an <code>npm run build</code> and 3) runs an <code>rsync</code> to copy the build contents to the web's live folder</li>\n</ol>\n<p>when I run the <code>bash</code> script manually via PuTTY, it works fine. I can watch while vite's build output scrolls in the terminal, and eventually the <code>rsync</code> is triggered. But when the <code>bash</code> script is run via the <code>php</code> script, it does not seem to wait for the build (and perhaps even the install) to complete. It just copies whatever is in the build folder over to the live site (which is always the result of the <em>last</em> build, because the <em>current</em> build has not completed yet).</p>\n<p>Is there a way to make the bash script wait for the install and the build to complete? I've tried adding a <code>pause 120</code> after the install and build statements, and I've tried chaining the commands, for example something like</p>\n<pre><code>npm install &amp;&amp; npm run build &amp;&amp; rsync ......\n</code></pre>\n<p>neither accomplishes the goal when the script is run via <code>php</code>, but both work perfectly when I run manually..</p>\n<p>The relevant line from the <code>php</code> script that calls the <code>bash</code> script is:</p>\n<pre><code>$commandOutput = shell_exec(&quot;/bin/bash ./sync.sh --repo=&quot; . $hook[&quot;repo&quot;] . &quot; --branch=&quot; . $hook[&quot;branch&quot;] . &quot; --subdomain=&quot; . $subdomain);\n</code></pre>\n<p><code>$hook[&quot;repo&quot;]</code> is the name of the repo, <code>$hook[&quot;branch&quot;]</code> is the current branch, and <code>$subdomain</code> is the subdomain being worked on (I have multiple set up).</p>\n<p>The bash script starts out by picking up the repo, branch, and subdomain and then makes the various <code>git</code> and <code>npm</code> commands. The relevant lines are:</p>\n<pre><code>if [[ ${repo} &amp;&amp; ${branch} &amp;&amp; ${subdomain} ]]; then\n git -C /path/&quot;${repo}&quot;/ checkout &quot;${branch}&quot;\n git -C /path/&quot;${repo}&quot;/ fetch\n git -C /path/&quot;${repo}&quot;/ pull origin &quot;${branch}&quot;\n npm --prefix /path/&quot;${repo}&quot;/ install\n npm --prefix /path/&quot;${repo}&quot;/ run build;\n rsync -auv /path/&quot;${repo}&quot;/htdocs/* /path/&quot;${subdomain}&quot;/htdocs;\nelse\n echo &quot;repo, branch and subdomain were not provided, I will not do anything.&quot;;\nfi\n</code></pre>\n"^^ . + . + . + . + . + . + "Oooof. Here you go: when you store an emoji as is, [it gets saved **AS IS**](https://phpize.online/s/yd). This is the **FACT** that you have to accept. If *your* code does otherwise, it means it's **YOUR CODE** does the conversion, PHP or JS. So you have two options: The hard one: find out which your code does the conversion and then remove this code. The easy one: just convert it back without much thinking, but making your code even worse a mess. Hope you can understand this one"^^ . + . + . + . + . + . + . + . + . + . + . + "Answer to @hakre if the problem is from PHP, i'm already changed my PHP is using Non-Thread-Safe. In another source, NGINX must be using PHP Non-Thread-Safe because It's single thread. But just using multiple request, why it's so complicated. If the conclusion is NGINX can't make multiple requests, so my program also can't using NGINX too? That i must using Apache until refactoring my web-apps?"^^ . + . + . + . + . + . + "Please [edit] your question to show the output your script produces when it succeeds and when it fails. Include both stdout and stderr. There may be a clue in the output telling us, for example, that one of your commands is failing and why it's failing. You should also change `git ... checkout ...` to `git ... checkout ... || { es="$?"; printf 'git checkout failed %s\\n' "$es" >&2; exit "$es"; }` and ditto for each of the other lines so you get a clear indication if one of them is failing, assuming you aren't discarding stderr which you must not do as it's crucial for debugging."^^ . + . + . + . + . + "1"^^ . + "Your `Content-Type` should be `application/x-www-form-urlencoded`, as that's what you're sending (the `$data` string). For further issues you can check the working implementation in the official library. https://github.com/DeepLcom/deepl-php/blob/main/src/HttpClientWrapper.php#L251"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + "1"^^ . + "0"^^ . + ""But also it is not that hard to imagine some similar problem when vendor is 2 GB space" - it really is. At the point you have a vendor directory that large, *you have a problem somewhere else*. I'm going to leave this question alone now; but I doubt you'll get anyone saying much different because *you're trying to solve a problem which nobody but you believes exists*."^^ . + . + . + . + . + "0"^^ . + "Struggling on Database using php language"^^ . + . + . + . + "1"^^ . + . + . + . + "Well, that's the php -i say. Is there some other CLI instruction I could try? But yes. And strangely, Apache reports it can't find openssl.dll, but I can copy and paste the reported 'not found' path, removed the extra backslashes, and load the 'not found' dll into (say) Notepad. And as noted, both gd and sosckets load and are enabled from the same \\ext directory"^^ . + "0"^^ . + "<p><strong>Update based on the comment</strong></p>\n<p>You are setting a random <code>string</code> value to the <code>additionalinfo</code> parameter. The only valid value listed in the <a href="https://developer.ups.com/tag/Rating?loc=en_PE&amp;tag=Rating#operation/Rate!in=query&amp;path=additionalinfo&amp;t=request" rel="nofollow noreferrer">API docs</a> is <code>timeintransit</code>. So either remove <code>additionalinfo</code> parameter or set it's value to <code>timeintransit</code>.</p>\n<p><strong>Original Answer</strong></p>\n<p>You have one <strong>required</strong> field missing in your data. For <strong>UnitOfMeasurement</strong> you need to provide both <strong>Code</strong> and <strong>Description</strong>. Check <a href="https://developer.ups.com/tag/Rating?loc=en_US&amp;tag=Rating#operation/Rate!path=RateRequest/Shipment/Package/PackageWeight/UnitOfMeasurement/Description&amp;t=request" rel="nofollow noreferrer">this</a>.</p>\n<div class="s-table-container"><table class="s-table">\n<thead>\n<tr>\n<th>Description</th>\n<th>string [ 1 .. 35 ] characters &lt;= 1</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>required</td>\n<td>Text description of the code representing the unit of measure associated with the package weight. Length and value are not validated.</td>\n</tr>\n</tbody>\n</table></div>\n<p>So add relevant text description to your data.</p>\n<pre class="lang-json prettyprint-override"><code> ...\n &quot;PackageWeight&quot;: {\n &quot;Weight&quot;: &quot;7.31&quot;,\n &quot;UnitOfMeasurement&quot;: {\n &quot;Code&quot;: &quot;LBS&quot;,\n // Set the relevant description here\n &quot;Description&quot;: &quot;Pounds&quot;\n }\n }\n ...\n</code></pre>\n"^^ . + . + . + . + "Are you seeing any errors in your server logs? Have you turned on WP_DEBUG? Also, does the term 'bons-cadeaux' exist on your en_GB content or are there separate taxonomies per language?"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + "<p>I have a PDF where I have a question which is in darker text colour and the answer is in lighter text colour. Other than text colour there is no other logic I can use to separate the question &amp; answer texts.</p>\n<p>I'm using tabulapdf to extract the content from the PDF, but in <code>PHP</code> application</p>\n<p>Appreciate any suggestions or guidance. Thanks!</p>\n"^^ . + . + . + "1"^^ . + . + . + "or I get "php-heic-to-jpg-linux-arm64: command not found""^^ . + "0"^^ . + "The field name (or the parameter that eventually gets submitted), needs the `[]` at the end, otherwise PHP will _overwrite_ multiple values with the last one. _"then exception throw that item_name is not valid"_ - but not from the code you have shown us, I assume, but from the part where this submitted data will get processed? Please quote the _exact_ exception message, and what it is referring to."^^ . + . + "0"^^ . + . + "<p>I have the following working code, which gets all products whose custom date field is today (in UK date format, thanks to the solution offered here) and updates the same field to yesterday. Although this works perfectly, it does not trigger either the woocommerce_update_product or woocommerce_process_product_meta hook, which is required by another plugin to refresh the product cache.</p>\n<pre><code>$args = array(\n 'post_type' =&gt; 'product',\n 'posts_per_page' =&gt; 500, \n 'meta_query' =&gt; array(\n array(\n 'key' =&gt; '_custom_date',\n 'value' =&gt; date(&quot;d/m/Y&quot;), // Convert current date to d/m/Y format\n 'compare' =&gt; '=',\n 'type' =&gt; 'CHAR', // Because _custom_date is stored as a string\n ),\n ),\n 'orderby' =&gt; 'meta_value',\n 'order' =&gt; 'ASC',\n);\n $yesterday = date('d/m/Y',strtotime(&quot;-1 days&quot;));;\n $loop = new WP_Query( $args );\n if ( $loop-&gt;have_posts() ): while ( $loop-&gt;have_posts() ): $loop-&gt;the_post();\n\n global $product;\n $product_id = $product-&gt;get_id();\n $product_date = $product-&gt;get_meta('_custom_date');\n update_post_meta($product_id, '_custom_date', $yesterday );\n \nendwhile; endif;\n</code></pre>\n<p>Is there a way to trigger either hook in this situation?</p>\n"^^ . + . + . + . + . + . + . + . + . + . + "6"^^ . + . + . + "0"^^ . + . + "webp"^^ . + "PHP: posix_seteuid() and posix_setuid() not reflected in exec() or proc_open()?"^^ . + . + . + "To get what I think you'd be expecting in the HTML output, the data would need to be like this: https://jsfiddle.net/qy14z576/1/"^^ . + . + . + . + . + "@JukKie-ai: Please check https://stackoverflow.com/q/78716482/367456 on how you can extend intelephense for laravel, access the log of intelephense, and if it does not yet resolve the issue for you, [edit] the question here and add information from the log (please as text, not as image, that is a bad example in the answer over there)."^^ . + "Try ``LIKE '%2025-02-25%10:40:29%'``. May be, your timestamp pattern is more complicated."^^ . + "<p>Yes a 'page' can control the settings for a cookie. So if you hit one page, you can customize each setting. Note that SameSite already should have been <code>Lax</code> when you <em>leave</em> to the payment gateway, you can't control it when a user comes back.</p>\n<p>I would avoid all this and pick settings that generally work well. You can also do an internal redirect after returning from the payment gateway so you can keep <code>Strict</code> everywhere.</p>\n"^^ . + . + . + . + . + "1"^^ . + "Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking."^^ . + . + . + . + "0"^^ . + . + "Start of the function declaration doesn't matter if PHP thinks the function declaration itself is inside a string. _"Is there a way to print out a trace"_ You can't get a stack trace on a syntax error because there's no stack to trace -- i.e., you haven't begun execution yet. _"this works under PHP 8"_ Don't think so."^^ . + . + "AFAIK, I think, edge sends `EdgeA` for android and `EdgeiOS` for iOS devices in user agent. I'm not 100% sure, but you can try these."^^ . + . + "i upload the project to github at: https://github.com/wolfpain/fibobet/tree/master if you can check somthing more on the master branches"^^ . + . + . + . + . + . + . + "@IanTornquist: ... And in this case: (1) The server-side code doesn't persist anything. It responds, but leaves no other evidence that it did so. (2) The client-side code does nothing with the response. Outside of observing the request/response in your browser's debugging tools, there's no other observation that this code did anything because, well, it doesn't really do anything. If you were expecting the page to automatically update then that's just an incorrect expectation. The point of AJAX is to communicate with the server *without* reloading the whole page."^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + . + "2"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + "The word is "bracket". A bracelet is a piece of jewelry you wear on your wrist."^^ . + . + "DOMPDF image rendering issue"^^ . + . + . + "Why I an unable to configure S3 as a service upon service container in Symfony?"^^ . + "0"^^ . + "0"^^ . + . + . + "3"^^ . + . + . + . + . + "<p>In order for PHP to recognize you are uploading multiple files under the same FormData key (in your case it's <code>file</code>) is to add <code>[]</code> in the key (as in <code>file[]</code>), and then append each file using that key.</p>\n<p>And as we need to append each file one by one, there is no need for another array containing the files like in your given code:</p>\n<pre class="lang-js prettyprint-override"><code>var fileArray = [];\nfor (var r = 1, n = table.rows.length; r &lt; n; r++) {\n var myInput = document.getElementById(&quot;myFileInput&quot; + r); \n fileArray.push(myInput.files[0]);\n}\n</code></pre>\n<p>just append it directly:</p>\n<pre class="lang-js prettyprint-override"><code>function submitFiles() {\n\n //File(s)\n var table = document.getElementById('FileTable');\n\n var form = new FormData();\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function () {\n if (xhr.readyState == XMLHttpRequest.DONE) {\n alert('Submited');\n }\n }\n\n for (var r = 1, n = table.rows.length; r &lt; n; r++) {\n var myInput = document.getElementById(&quot;myFileInput&quot; + r);\n form.append('file[]', myInput.files[0]);\n }\n\n xhr.open('post', 'uploadMinReproduceable.php', true);\n xhr.send(form);\n}\n</code></pre>\n<p>And then your PHP script can read each files as usual from <code>$_FILES</code>:</p>\n<pre><code>post params for upload file /astack/uploadMinReproduceable.php\nfiles params for upload file /astack/uploadMinReproduceable.php\nPHP Warning: Array to string conversion in /uploadMinReproduceable.php on line 12\nFiles key: file Files value: Array\n</code></pre>\n<p>But if this is on a <strong>development environment</strong>, I would strongly recommend you to just dump the whole <code>$_FILES</code> using <code>var_dump()</code> to see what's actually in it rather than using <code>error_log()</code>'s:</p>\n<pre class="lang-php prettyprint-override"><code>array(1) {\n [&quot;file&quot;]=&gt;\n array(6) {\n [&quot;name&quot;]=&gt;\n array(2) {\n [0]=&gt;\n string(20) &quot;testfile1.txt&quot;\n [1]=&gt;\n string(20) &quot;testfile2.txt&quot;\n }\n [&quot;full_path&quot;]=&gt;\n array(2) {\n [0]=&gt;\n string(20) &quot;testfile1.txt&quot;\n [1]=&gt;\n string(20) &quot;testfile2.txt&quot;\n }\n [&quot;type&quot;]=&gt;\n array(2) {\n [0]=&gt;\n string(9) &quot;text/plain&quot;\n [1]=&gt;\n string(9) &quot;text/plain&quot;\n }\n [&quot;tmp_name&quot;]=&gt;\n array(2) {\n [0]=&gt;\n string(27) &quot;/tmp/phpfocakln0gj0pdMWVdbJ&quot;\n [1]=&gt;\n string(27) &quot;/tmp/phpanin9iq82i1oaXUYre6&quot;\n }\n [&quot;error&quot;]=&gt;\n array(2) {\n [0]=&gt;\n int(0)\n [1]=&gt;\n int(0)\n }\n [&quot;size&quot;]=&gt;\n array(2) {\n [0]=&gt;\n int(5)\n [1]=&gt;\n int(7)\n }\n }\n}\n</code></pre>\n<hr />\n<p>Refer to the <a href="https://www.php.net/manual/en/features.file-upload.multiple.php" rel="nofollow noreferrer">docs</a> for more information.</p>\n"^^ . + . + "<p>We are trying to limit overall client_max_body_size to something relatively low across the server to limit it as an attack vector, but then allow larger requests to a specific endpoint that needs the larger upload limit.</p>\n<p>In this example config, the attempt was to specify overall limit of <code>50M</code> but then allow <code>500M</code> in <code>/uploadtest/index.php</code></p>\n<pre class="lang-none prettyprint-override"><code>user nginx;\nworker_processes auto;\nerror_log /var/log/nginx/error.log notice;\npid /run/nginx.pid;\n\n# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.\ninclude /usr/share/nginx/modules/*.conf;\n\nevents {\n worker_connections 1024;\n}\n\nhttp {\n log_format main '$remote_addr - $remote_user [$time_local] &quot;$request&quot; '\n '$status $body_bytes_sent &quot;$http_referer&quot; '\n '&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;';\n\n access_log /var/log/nginx/access.log main;\n sendfile on;\n tcp_nopush on;\n keepalive_timeout 1200;\n types_hash_max_size 4096;\n proxy_connect_timeout 1200;\n proxy_send_timeout 1200;\n proxy_read_timeout 1200;\n send_timeout 1200;\n\n include /etc/nginx/mime.types;\n default_type application/octet-stream;\n\n include /etc/nginx/conf.d/*.conf;\n\n server {\n listen 80;\n listen [::]:80;\n server_name _;\n root /usr/share/nginx/html;\n client_max_body_size 50M;\n\n # Load configuration files for the default server block.\n include /etc/nginx/default.d/*.conf;\n\n location / {\n try_files $uri $uri/ /index.php?$args;\n }\n\n location = /uploadtest/index.php {\n try_files $uri =404;\n fastcgi_split_path_info ^(.+\\.php)(.*)$;\n fastcgi_param HTTPS off;\n fastcgi_pass unix:/run/php-fpm/www.sock;\n fastcgi_read_timeout 1200;\n http2_push_preload on;\n fastcgi_buffers 16 128k;\n fastcgi_buffer_size 256k;\n fastcgi_busy_buffers_size 256k;\n client_max_body_size 500M;\n }\n\n location ~ \\.php$ {\n try_files $uri =404;\n fastcgi_split_path_info ^(.+\\.php)(.*)$;\n fastcgi_param HTTPS off;\n fastcgi_pass unix:/run/php-fpm/www.sock;\n fastcgi_read_timeout 1200;\n http2_push_preload on;\n fastcgi_buffers 16 128k;\n fastcgi_buffer_size 256k;\n fastcgi_busy_buffers_size 256k;\n } \n }\n}\n</code></pre>\n<p>No matter what, we receive &quot;Entity too large&quot; errors when trying to upload to <code>/uploadtest/index.php</code>.</p>\n<p>(Values in php.ini and php-fpm.conf are not restricting this and we're able to upload the files if we raise the entire server limit.)</p>\n<p>Also tried this the opposite way - setting large global limit and then restricting everything except <code>/uploadtest/index.php</code>, but this method doesn't end up restricting other upload paths and leaves <em>everything</em> open to the limit of <code>500m</code></p>\n<pre class="lang-none prettyprint-override"><code>server {\n listen 80;\n listen [::]:80;\n server_name _;\n root /usr/share/nginx/html;\n client_max_body_size 500M;\n\n # Load configuration files for the default server block.\n include /etc/nginx/default.d/*.conf;\n\n location = /uploadtest/index.php {\n try_files $uri =404;\n fastcgi_split_path_info ^(.+\\.php)(.*)$;\n fastcgi_param HTTPS off;\n fastcgi_pass unix:/run/php-fpm/www.sock;\n fastcgi_read_timeout 1200;\n http2_push_preload on;\n fastcgi_buffers 16 128k;\n fastcgi_buffer_size 256k;\n fastcgi_busy_buffers_size 256k;\n client_max_body_size 500M;\n }\n\n location ~ \\.php$ {\n try_files $uri =404;\n fastcgi_split_path_info ^(.+\\.php)(.*)$;\n client_max_body_size 50M;\n fastcgi_param HTTPS off;\n fastcgi_pass unix:/run/php-fpm/www.sock;\n fastcgi_read_timeout 1200;\n http2_push_preload on;\n fastcgi_buffers 16 128k;\n fastcgi_buffer_size 256k;\n fastcgi_busy_buffers_size 256k;\n }\n\n location / {\n try_files $uri $uri/ /index.php?$args;\n client_max_body_size 50M;\n }\n }\n</code></pre>\n<p>So - is there any way to restrict global upload limits in this manner? And if so, what am I missing?</p>\n"^^ . + . + "0"^^ . + . + "...where as this one: https://phpize.online/sql/mysql80/e3fe87adfaf43f216faf397fbc143a32/php/php84/1ec293bbb6b8d9fd28e6b0e8ad22e80a/ shows affected_rows 1 in both cases because the password is different (s instead of 5 in the middle, like your earlier example). Again, entirely expected."^^ . + . + . + . + . + "Still unclear why you couldn't add your code to your question - it took me 10 seconds to copy what you'd put in the comments. Use the editor to see how I've done it if you like"^^ . + "<p>Please explain how PHP interprets invokation of:</p>\n<pre><code>static::foo();\n</code></pre>\n<p>in the following code:</p>\n<pre><code>&lt;?php\n\nclass A\n{\n private function foo()\n {\n echo &quot;Success!\\n&quot;;\n }\n\n public function test()\n {\n $this-&gt;foo();\n static::foo();\n }\n}\n\n(new A)-&gt;test();\n</code></pre>\n<p>The confusion arises because the article on the <a href="https://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php" rel="nofollow noreferrer">Scope Resolution Operator (::)</a> does not explain how to use Paamayim Nekudotayim to call non-static methods, except for a single example showing how to call a method from a parent class when overriding.</p>\n<p>Does it mean that the exact same syntax using <code>Paamayim Nekudotayim</code> apply if either <code>foo</code> is a <code>static</code> or <code>non-static method</code>?</p>\n"^^ . + . + "1"^^ . + . + . + "I'm avoiding a direct curl call right now, as my Client is also doing a lot of stuff with certificates that I don't want to configure with curl now"^^ . + "<blockquote>\n<p>its not working with the xdebug.ini.</p>\n</blockquote>\n<p>Your <code>xdebug.mode=${XDEBUG_MODE}</code> in xdebug.ini is probably redundant: the <code>XDEBUG_MODE</code> parameter in the environment overrides the xdebug.mode ini setting.</p>\n<p>Therefore, you can replace <code>${XDEBUG_MODE}</code> in xdebug.ini with the mode you'd like to have -or- remove the setting completely if the default (= develop) already suits you.</p>\n<p>Compare: <a href="https://xdebug.org/docs/all_settings#mode" rel="nofollow noreferrer" title="Xdebug: Documentation » All settings (xdebug.org)"><em>string xdebug.mode = develop</em> (xdebug.org)</a>, and find there as well this warning:</p>\n<blockquote>\n<p><strong>WARNING:</strong> Some web servers have a configuration option to prevent environment variables from being propagated to PHP and Xdebug.</p>\n<p>For example, PHP-FPM has a <a href="https://www.php.net/manual/en/install.fpm.configuration.php#clear-env" rel="nofollow noreferrer" title="PHP: FastCGI Process Manager (FPM) - Configuration - Manual (php.net)"><code>clear_env</code> configuration setting</a> that is <strong><code>on</code></strong> by default, which you will need to turn <strong><code>off</code></strong> if you want to use <code>XDEBUG_MODE</code>.</p>\n<p>Make sure that your web server does not clean the environment, or specifically allows the <code>XDEBUG_MODE</code> environment variable to be passed on.</p>\n</blockquote>\n<p>For interpreting PHP-FPM phpinfo() output for the Xdebug3 extension, see as well <a href="https://stackoverflow.com/q/65107145/367456"><em>Docker PHP with Xdebug 3 env XDEBUG_MODE doesn't work</em> (Q&amp;A)</a>.</p>\n<hr />\n<p>The way you test the container environment is wrong. Instead of <code>run</code>, use <code>exec</code>:</p>\n<pre><code>$ cat .env\nFOO=BAR\n$ docker exec -i -t php php -r 'print_r(getenv());'\nArray\n(\n [PATH] =&gt; /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n [HOSTNAME] =&gt; f30ed99b9fed\n [TERM] =&gt; xterm\n [FOO] =&gt; BAR\n [PHPIZE_DEPS] =&gt; autoconf dpkg-dev file g++ gcc libc-dev make pkg-config re2c\n [PHP_INI_DIR] =&gt; /usr/local/etc/php\n [PHP_CFLAGS] =&gt; -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64\n [PHP_CPPFLAGS] =&gt; -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64\n [PHP_LDFLAGS] =&gt; -Wl,-O1 -pie\n [GPG_KEYS] =&gt; AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD\n [PHP_VERSION] =&gt; 8.4.3\n [PHP_URL] =&gt; https://www.php.net/distributions/php-8.4.3.tar.xz\n [PHP_ASC_URL] =&gt; https://www.php.net/distributions/php-8.4.3.tar.xz.asc\n [PHP_SHA256] =&gt; 5c42173cbde7d0add8249c2e8a0c19ae271f41d8c47d67d72bdf91a88dcc7e4b\n [HOME] =&gt; /root\n)\n</code></pre>\n<p>This is what you configured <em>docker compose</em> to do. See <a href="https://docs.docker.com/compose/how-tos/environment-variables/set-environment-variables/#use-the-env_file-attribute" rel="nofollow noreferrer" title="Set environment variables | Docker Docs (docker.com)"><em>Use the <code>env_file</code> attribute</em> (docker.com)</a>:</p>\n<blockquote>\n<p>Using an <code>.env</code> file lets you use the same file for use by a plain <strong><code>docker run</code></strong><code> --env-file ...</code> command [bold by me]</p>\n</blockquote>\n<p>If you insist to use <code>docker run</code> you have to add the <code>--env-file</code> switch on the command-line as you are running a <em>new</em> container independent to the configured composition:</p>\n<pre><code>$ docker run --env-file .env -i -t php php -r 'print_r(getenv());'\nArray\n(\n [HOSTNAME] =&gt; 7f87b21e6aac\n [PHP_INI_DIR] =&gt; /usr/local/etc/php\n ...\n [FOO] =&gt; BAR\n [PHPIZE_DEPS] =&gt; ...\n)\n</code></pre>\n"^^ . + . + . + . + . + . + "2"^^ . + "0"^^ . + . + . + . + "0"^^ . + "if-statement"^^ . + . + . + . + . + . + "Google reCPATCHA validation fails"^^ . + "Did you notice there are 2 lines of `echo ' </div>';`"^^ . + "It might help adding `ApiResource` to your Product class. ApiPlatform doesnt know what a product is, and all other definitions are `array`, which is does as it should. Are you aware of this page: https://api-platform.com/docs/core/dto/ ?"^^ . + . + "2"^^ . + . + . + "sure, absolute overdoing things. first orientate. then understand. and if still an action is necessary, execute. it seems you do this order instead: do something to make something to then look into something to finally not understand anything any longer.. now the problem arises that the system has moved on and the problem is even harder to detect. no offense, but this makes it especially cumbersome with a complete internet inbetween."^^ . + "1"^^ . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + ""John should appear at the top of the list half the time" Why 50% is this because 3/(sum(Probability)) = 0.5 ? or because of something else?"^^ . + "0"^^ . + . + . + . + "[And this one for the second question?](https://www.php.net/manual/en/language.oop5.references.php)"^^ . + "0"^^ . + . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + "What if it isn't "A versus B" but rather "A vs. A+"? To be more explicit on what's actually going on, the button in question reads "Sort by Date Submitted Ascending" (or "Descending" if they clicked on the former already). Long story short, I can't change the visible text here, but I feel like it could be better if there were connecting words to better capture the button's intended functionality. So, the aria-label I wish to use is "Sort [Foo] by Date Submitted in Ascending Order", which clearly carries the same idea but not in such a, perhaps, unhelpfully shorthand way as the visible text."^^ . + . + . + . + . + "0"^^ . + . + . + . + "<p>I have used Oauth with various service such as Google and Facebook but when I try to get an authorisation code with LinkedIn (OpenID signin) it always returns the following with a 401 http response</p>\n<pre><code>{\n &quot;error&quot;: &quot;invalid_client&quot;,\n &quot;error_description&quot;: &quot;Client authentication failed&quot;\n} \n\n</code></pre>\n<p>The initial call to <a href="https://www.linkedin.com/oauth/v2/authorization" rel="nofollow noreferrer">https://www.linkedin.com/oauth/v2/authorization</a> works fine. LinkedIn ask me to login accept the permissions and sends the code to the redirect page.</p>\n<p>Here is the PHP curl code being used</p>\n<pre class="lang-php prettyprint-override"><code> $url = 'https://www.linkedin.com/oauth/v2/accessToken'; \n $curlPostarray=array('grant_type' =&gt; 'authorization_code','code' =&gt; $code,'redirect_uri' =&gt; $redirect_uri,'client_id' =&gt; $client_id,'client_secret' =&gt; $client_secret);\n $ch = curl_init(); \n curl_setopt($ch, CURLOPT_URL, $url); \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); \n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($curlPostarray));\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));\n $data = curl_exec($ch);\n $http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n</code></pre>\n<p>and here is a print_r() of $curlPostarray.</p>\n<pre class="lang-php prettyprint-override"><code>Array\n(\n [grant_type] =&gt; authorization_code\n [code] =&gt; AQQ17WLswbJMyAwpNa7JcTREK3rp0emxrYyGZNWWYG3S8PL58wEsvQPaYLUZbZPPe-7y0b1Ot8fVaARsgsHOnVa2Z3FqeT3Hql4TpCfXyadA8M61VmJQdEqJCwfz_mZ2QLCqkZOGNb_R1dwo7dEfvadFQk8F0P_ar78RkXb5h4Hm4GiRST9YUqM1_xoUMObdPmtFkmzkMGUGcvrj4SU\n [redirect_uri] =&gt; https://www.example.com/slpw/plugin_sociallogin/linkedinredirect.php\n [client_id] =&gt; 86o7njo0ccd8y6\n [client_secret] =&gt; WPL_AP1.xxxxxxxBoS0pn.SEMvrg\n)\n</code></pre>\n<p>The code is correct (as returned) as are the other fields (just changed the domain and secret here). The same code works for other services so I am a bit lost. I have also tried two different LinkedIn Apps on two different accounts. Both do the same thing. Just to rule out a PHP Curl issue I test this using the `Rested App on the Mac. Same issue.</p>\n<p>If anyone can spot what I am dong wrong it would be really appreciated.</p>\n"^^ . + . + "@mickmackusa\n Gotcha"^^ . + "How to build a regex pattern from a list of words (in a string or array) and surround each word with word boundary anchors?"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + ""*This issue might be due to SSL not configured properly.*" - What does this even mean? How would `FORCE_SSL_ADMIN` suddenly fix an incorrect configuration of the SSL?"^^ . + . + "<p>Check mod_security rules to see if they are stripping the body from get requests.<br />\nEnsure php settings allows input data to be read from php://input.<br />\nVarify that CageFS and LIVE are configured correctly.</p>\n<pre><code>&lt;?php\necho strtoupper($_SERVER['REQUEST_METHOD']) . &quot;\\n\\n\\n&quot;;\n\nif ($_SERVER['REQUEST_METHOD'] === 'GET') {\n $data = $_GET;\n} else {\n $data = json_decode(file_get_contents('php://input'), true);\n}\n\nvar_dump($data);\n?&gt;\n</code></pre>\n"^^ . + . + . + . + "I don't want to put my real accountID on Stack Overflow. I figured that would be obvious. It's hard coded for testing, trying to get this to work. We're not using the SDK because this is all we're doing with Docusign and I don't want to integrate all of that into Wordpress. Did you even read my original post?"^^ . + "Welcome to [StackOverflow](https://stackoverflow.com/tour). Please review the guide on [How to Ask](https://stackoverflow.com/help/how-to-ask)."^^ . + "Create shortcode for each dimension property based on product ID in WooCommerce"^^ . + . + . + . + "1"^^ . + "1"^^ . + "<p>I am trying to use the Symfony UX LiveComponent, firstly I tried to use the first exemple of the documentation:</p>\n<pre class="lang-php prettyprint-override"><code>// ArticleSearch.php\n&lt;?php\n\nnamespace App\\Twig\\Components;\n\nuse App\\Repository\\ArticleRepository;\nuse Symfony\\UX\\LiveComponent\\Attribute\\AsLiveComponent;\nuse Symfony\\UX\\LiveComponent\\Attribute\\LiveProp;\nuse Symfony\\UX\\LiveComponent\\DefaultActionTrait;\n\n#[AsLiveComponent]\nclass ArticleSearch\n{\n use DefaultActionTrait;\n\n #[LiveProp(writable: true)]\n public string $search = '';\n\n public function __construct(private ArticleRepository $articleRepository)\n {\n }\n\n public function getArticles(): array\n {\n return $this-&gt;articleRepository-&gt;findBy(['title' =&gt; $this-&gt;search]);\n }\n}\n\n</code></pre>\n<pre class="lang-html prettyprint-override"><code>&lt;!-- ArticleSearch.html.twig --&gt;\n&lt;div {{ attributes }}&gt;\n &lt;input\n type=&quot;search&quot;\n data-model=&quot;search&quot;\n &gt;\n\n &lt;ul&gt;\n {% for article in this.getArticles %}\n &lt;li&gt;{{ article.title }}&lt;/li&gt;\n {% endfor %}\n &lt;/ul&gt;\n&lt;/div&gt;\n</code></pre>\n<p>The attributes are showing, but the value of $search is never updating, so nothing happends.</p>\n<p>It happends when I use the symfony local:server:start, can it cause a problem ?</p>\n<p>Thanks</p>\n<p>EDIT:</p>\n<p>Here's the content of my app.js and bootstrap.js:</p>\n<pre class="lang-js prettyprint-override"><code>// app.js\nimport './bootstrap.js';\n/*\n * Welcome to your app's main JavaScript file!\n *\n * This file will be included onto the page via the importmap() Twig function,\n * which should already be in your base.html.twig.\n */\nimport './styles/app.css';\n\nconsole.log('This log comes from assets/app.js - welcome to AssetMapper! ');\n</code></pre>\n<pre class="lang-js prettyprint-override"><code>// bootstrap.js\nimport { startStimulusApp } from '@symfony/stimulus-bundle';\n\nconst app = startStimulusApp();\n// register any custom, 3rd party controllers here\n// app.register('some_controller_name', SomeImportedController);\n</code></pre>\n"^^ . + . + "1"^^ . + . + . + "1"^^ . + . + . + . + . + . + . + "@KIKOSoftware Though I could do it like this, the StorePostRequest is used as a validation in laravel. I would like to leave the validation in the PostController@store's param instead of inside the method."^^ . + . + . + "1"^^ . + "Proper way to deploy Node.js"^^ . + . + . + . + . + . + "2"^^ . + . + . + . + . + . + "2"^^ . + "4"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + . + "0"^^ . + "Obviously without any validation there's a chance someone will fill your file full of total junk. They might even put malicious program code in there in the hope that you might accidentally execute it at some point. So if you want people to send email addresses specifically, I'd recommend a) using a POST request with the address in the request body (this is less likely to be logged along its route), and a HTTPS-only connection and b) validating that the incoming data looks like an email address before saving it or using it for anything else."^^ . + . + . + . + "0"^^ . + "Thank you, i've made major headway. i've gotten the stream to write now at the point of reading the results i get this `Audio data does not appear to be in a supported encoding. If you believe this to be incorrect, try explicitlyspecifying the decoding parameters.`. \nCan you advice on the right command to set in ffmpeg, this is what i'm currently using `ffmpeg -user_agent \\"FFmpeg\\" -i \\"https://npr-ice.streamguys1.com/live.mp3\\" -acodec pcm_s16le -ac 1 -ar 16000 -f s16le -` @hakre"^^ . + "<p>For its implicit &quot;Why?&quot; part, your question relates to<br />\nquestions <a href="https://stackoverflow.com/q/9086546">9086546</a>, <a href="https://stackoverflow.com/q/9831985">9831985</a>, <a href="https://stackoverflow.com/q/29243636">29243636</a>, <a href="https://stackoverflow.com/q/34768821">34768821</a>, <a href="https://stackoverflow.com/q/45708320">45708320</a>, <a href="https://stackoverflow.com/q/53867867">53867867</a>,<br />\nor Doctrine issues <a href="https://github.com/doctrine/dbal/issues/2305" rel="nofollow noreferrer">#2305</a>, <a href="https://github.com/doctrine/orm/issues/3542" rel="nofollow noreferrer">#3542</a>, <a href="https://github.com/doctrine/orm/issues/7116" rel="nofollow noreferrer">#7116</a>,\nor <a href="https://openclassrooms.com/forum/sujet/doctrine-subquery-dans-le-from" rel="nofollow noreferrer">OpenClassRooms discussion</a>.</p>\n<p>In essence: <strong>you can't do it in DQL</strong> which is object-oriented (and needs to handle full objects, apart from the final result that can be &quot;denormalized&quot; to single fields); either you'll have to:</p>\n<ol>\n<li>do it in SQL instead of DQL<br />\nusing the <code>Connection</code> instead of the <code>EntityManager</code><br />\n(and manually hydrating if you want results as objects)</li>\n<li>or find a functionally equivalent way of doing it which does not use <code>FROM (SELECT</code><br />\n(for example, users having asked the aforementioned questions could in fine resort to <code>EXISTS</code> or <code>IN</code>)</li>\n</ol>\n<p>Good news, for the &quot;How can I?&quot; part of your question, <strong>in your particular case</strong> (as you presented it), both options apply:</p>\n<ol>\n<li>You do not need objects, only scalar types: SQL is a possibility</li>\n<li>if I read correctly, you could <strong>directly <code>LEFT JOIN</code> to <code>Checkin</code> from the main query</strong>, adding the <code>= 10</code> to the join condition.</li>\n</ol>\n"^^ . + . + . + . + . + . + "What do the browser dev tools have to say? Anything about this in the console? In the network panel, do you see these request being made, and if so, what response are they getting?"^^ . + . + . + . + "2"^^ . + "Last metadata expiration check: 1:54:50 ago on Mon 03 Mar 2025 09:02:16 AM CET.\nremi-release-9.rpm 202 kB/s | 32 kB 00:00\nPackage remi-release-9.5-2.el9.remi.noarch is already installed.\nDependencies resolved."^^ . + "@AsiaTinsley: The code shown is *filled* with syntax errors and typos, as well as a variety of problems (described in previous comments above). Honestly, any tutorial which led you to this code should simply be abandoned. Aside from that, it's not really clear to me what you're trying to ask. We don't know what logic you're trying to implement for "sanitizing" your inputs, or what specifically that means in your context. The one thing we do know is that there are **many** problems in the code shown, and I wouldn't expect it to "work" in any sense of the word."^^ . + . + . + . + . + . + "<p>This seems like LimeSurvey is not recognizing your namespaced classes, likely due to autoloading issues. You need to make sure that the autoloader is picking up PluginCore and TemplatePlugin. Then you need to try including the files if needed.</p>\n<p>Furthermore, you need to check if config.xml correctly registers your plugin and follows LimeSurvey’s naming conventions. In other cases, test it with a non-namespaced version to see if the issue is namespace-related. I have practiced these steps for one of the clients website where they were focusing mainly on tech based services.</p>\n"^^ . + "0"^^ . + "1"^^ . + "0"^^ . + . + . + "How to resolve Eclipse PHPUnit 7478 port error?"^^ . + . + . + . + . + "<p>I'm working on a Laravel registration form where validation works for some fields but not for others. Specifically, PAN, GST, password confirmation, and the terms checkbox are not triggering validation errors even when left empty.</p>\n<h4><code>User.php</code> Model</h4>\n<pre class="lang-php prettyprint-override"><code>protected $fillable = [\n 'name',\n 'email',\n 'password',\n 'password_confirmation',\n 'checkbox',\n];\n</code></pre>\n<h4><code>UserController.php</code> Validator call</h4>\n<pre class="lang-php prettyprint-override"><code>public function store(Request $request)\n{\n $validator = Validator::make($request-&gt;all(), [\n 'name' =&gt; 'required|string|max:255',\n 'email' =&gt; 'required|email|unique:users,email',\n 'password_confirmation' =&gt; 'required|string',\n 'pan' =&gt; 'required|string|min:10|max:10', \n 'gst' =&gt; 'required|string|size:15',\n 'checkbox' =&gt; 'required|accepted',\n ]);\n\n if ($validator-&gt;fails()) {\n return redirect()-&gt;back()-&gt;withErrors($validator-&gt;errors())-&gt;withInput($request-&gt;except('password'));\n }\n\n $password = &quot;password&quot;;\n // $password = Str::random(12);\n\n $user = User::create([\n 'register_as' =&gt; $request-&gt;registerAs,\n 'contact' =&gt; $request-&gt;contact,\n 'name' =&gt; $request-&gt;name,\n 'email' =&gt; $request-&gt;email,\n 'checkbox' =&gt; $request-&gt;checkbox,\n 'password_confirmation' =&gt; $request-&gt;password_confirmation,\n 'pan' =&gt; $request-&gt;pan,\n 'gst' =&gt; $request-&gt;gst,\n 'password' =&gt; Hash::make($password),\n ]);\n</code></pre>\n<p><code>register.blade.php</code> -&gt; <code>'pan,gst,password_confirmation,terms checkbox'</code> validations are not working</p>\n<pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;form-group&quot;&gt;\n &lt;div class=&quot;input-group mb-3&quot;&gt;\n &lt;span class=&quot;input-group-text bg-transparent&quot;&gt;&lt;i class=&quot;ti-user&quot;&gt;&lt;/i&gt;&lt;/span&gt;\n &lt;input type=&quot;text&quot; name=&quot;name&quot; id=&quot;name&quot; class=&quot;form-control ps-15 bg-transparent w-100&quot; placeholder=&quot;Full Name&quot; value=&quot;{{old('name')}}&quot;&gt;\n &lt;/div&gt;\n &lt;x-input-error :messages=&quot;$errors-&gt;get('name')&quot; style=&quot;color: red;&quot; /&gt;\n&lt;/div&gt;\n&lt;div class=&quot;form-group&quot;&gt;\n &lt;div class=&quot;input-group mb-3&quot;&gt;\n &lt;span class=&quot;input-group-text bg-transparent&quot;&gt;&lt;i class=&quot;ti-email&quot;&gt;&lt;/i&gt;&lt;/span&gt;\n &lt;input type=&quot;email&quot; id=&quot;email&quot; name=&quot;email&quot; value=&quot;{{old('email')}}&quot; class=&quot;form-control ps-15 bg-transparent&quot; placeholder=&quot;Email&quot;\n pattern=&quot;.+@.+\\.com&quot;\n oninvalid=&quot;setCustomValidity('Please enter a valid email ending with @example.com')&quot;\n oninput=&quot;setCustomValidity('')&quot;&gt;\n &lt;/div&gt;\n &lt;x-input-error :messages=&quot;$errors-&gt;get('email')&quot; class=&quot;mt-2&quot; style=&quot;color: red;&quot; /&gt;\n&lt;/div&gt;\n&lt;div class=&quot;form-group&quot; id=&quot;organisationFields&quot; style=&quot;display: none;&quot;&gt;\n &lt;div class=&quot;input-group mb-3&quot;&gt;\n &lt;span class=&quot;input-group-text bg-transparent&quot;&gt;&lt;i class=&quot;ti-id-badge&quot;&gt;&lt;/i&gt;&lt;/span&gt;\n &lt;input type=&quot;text&quot; name=&quot;gst&quot; id=&quot;gst&quot; value=&quot;{{old('gst')}}&quot; class=&quot;form-control ps-15 bg-transparent&quot; placeholder=&quot;GST Number&quot;&gt;\n &lt;/div&gt;\n&lt;/div&gt;\n&lt;div class=&quot;form-group&quot; id=&quot;individualFields&quot;&gt;\n &lt;div class=&quot;input-group mb-3&quot;&gt;\n &lt;span class=&quot;input-group-text bg-transparent&quot;&gt;&lt;i class=&quot;ti-id-badge&quot;&gt;&lt;/i&gt;&lt;/span&gt;\n &lt;input type=&quot;text&quot; name=&quot;pan&quot; id=&quot;pan&quot; class=&quot;form-control ps-15 bg-transparent&quot; value=&quot;{{old('pan')}}&quot; placeholder=&quot;PAN Number&quot;&gt;\n &lt;/div&gt;\n&lt;/div&gt;\n&lt;div class=&quot;form-group&quot; style=&quot;display: none;&quot;&gt;\n &lt;div class=&quot;input-group mb-3&quot;&gt;\n &lt;span class=&quot;input-group-text bg-transparent&quot;&gt;&lt;i class=&quot;ti-user&quot;&gt;&lt;/i&gt;&lt;/span&gt;\n &lt;select name=&quot;role&quot; id=&quot;role&quot; class=&quot;form-control form-select&quot; id=&quot;inputGroupSelect02&quot;&gt;\n @foreach($roles as $index =&gt; $role)\n &lt;option value=&quot;{{ $role-&gt;id }}&quot; {{ $role-&gt;name === 'Seller' ? 'selected' : '' }}&gt;\n {{ $role-&gt;name }}\n &lt;/option&gt;\n @endforeach\n &lt;/select&gt;\n &lt;/div&gt;\n&lt;/div&gt;\n&lt;div class=&quot;form-group&quot;&gt;\n &lt;div class=&quot;input-group mb-3&quot;&gt;\n &lt;span class=&quot;input-group-text bg-transparent&quot;&gt;&lt;i class=&quot;ti-lock&quot;&gt;&lt;/i&gt;&lt;/span&gt;\n &lt;input type=&quot;password&quot; name=&quot;password_confirmation&quot; id=&quot;password_confirmation&quot; class=&quot;form-control ps-15 bg-transparent&quot; placeholder=&quot;Retype Password&quot;&gt;\n &lt;/div&gt;\n &lt;x-input-error :messages=&quot;$errors-&gt;get('password_confirmation')&quot; class=&quot;mt-2&quot; style=&quot;color: red;&quot; /&gt;\n&lt;/div&gt;\n&lt;div class=&quot;row&quot;&gt;\n &lt;div class=&quot;col-12&quot;&gt;\n &lt;div class=&quot;form-group row&quot;&gt;\n &lt;div class=&quot;col-12 d-flex align-items-center&quot;&gt;\n &lt;input type=&quot;checkbox&quot; name=&quot;checkbox&quot; id=&quot;basic_checkbox_1&quot; class=&quot;me-2&quot; value=&quot;1&quot;&gt;\n &lt;label for=&quot;basic_checkbox_1&quot;&gt;I agree to the &lt;a href=&quot;#&quot; class=&quot;hover-warning&quot;&gt;&lt;b&gt;Terms&lt;/b&gt;&lt;/a&gt;&lt;/label&gt;\n &lt;x-input-error :messages=&quot;$errors-&gt;get('checkbox')&quot; class=&quot;mt-2&quot; style=&quot;color: red;&quot; /&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n</code></pre>\n"^^ . + "@iainn For the "why set a relationship when I can leave it empty, I can't due to a design in the application. Years ago, the first dev choose to use "EasyAdmin", I don't quite have the right term but it's allowed the previous developpers to "skip" the "front-end" part of the app. The thing is, EA wants everything to be defined at all cost. It's a nightmare but in our dev envs, when I leave the relation as "Empty" it just refuses to load the page.\nFor the 0/1 issue, I think you're right, I'll try that next thing tomorrow and let you know ! Thanks a lot for your help !"^^ . + "0"^^ . + . + . + . + . + "FYI: `BenjaminFavre\\OAuthHttpClient` is not part of the Symfony package. Furtermore, you should make sure all your packages are PHP8.4+ ready"^^ . + "This doesn't answer why it wouldn't be OK to put the token in the request body instead. If a server was expecting that, it would be fine. Your answer seems to assume that all servers expect it in the headers"^^ . + "0"^^ . + "2"^^ . + . + "<p>I am working with an Excel file where users input dates, and I need to validate whether the entered date is valid (i.e., it actually exists). For example, if a user provides 31-02-2025, it should trigger a validation error since February 31st does not exist.</p>\n<p>I am importing this data into my system and need a way to detect such invalid dates before further processing.</p>\nid; $riskRegisterTypeId = RiskRegisterType::ermRisk()->id; foreach ($rows as $value) { $risk = new Risk(); $risk->title = $value['title']; $risk->is_corporate = false; $risk->is_functional = true; $risk->is_registered = false; $risk->risk_register_type_id = $riskRegisterTypeId; $risk->risk_classification_id = $value['risk_classification_id']; $risk->description = $value['description']; $risk->risk_category_id = $value['risk_category_id']; $risk->risk_sub_category_id = $value['risk_sub_category_id']; $risk->risk_date = Date::excelToDateTimeObject($value['risk_identification_date'])->format('Y-m-d'); $risk->next_review_user_level = 1; $risk->journey_next_review_user_level = 1; $risk->is_workflow = true; $risk->risk_owner_id = $value['risk_owner_id']; $risk->created_by = Auth::user()->id; $risk->risk_status_id = $statusId; $riskImpactsArray = explode(',', $value['risk_consequences']); //Save risk impacts $risk_consequences = []; $riskImpacts = []; if ($riskImpactsArray) { foreach ($riskImpactsArray as $riskImpactTitle) { if ((str_replace(' ', '', $riskImpactTitle))) { $risk_consequences[] = ['title' => $riskImpactTitle]; } } foreach ($risk_consequences as $riskImpactRow) { $riskImpact = new RiskImpact(); $riskImpact->title = $riskImpactRow['title']; $riskImpact->created_by = Auth::user()->id; $riskImpact->status_id = Status::active()->id; $riskImpacts[] = $riskImpact; } } $riskCausesArray = explode(',', $value['risk_causes']); $risk_Causes = []; $riskCauses = []; //Save risk causes if ($riskCausesArray) { foreach ($riskCausesArray as $riskCauseTitle) { if ((str_replace(' ', '', $riskCauseTitle))) { $risk_Causes[] = ['title' => $riskCauseTitle]; } } foreach ($risk_Causes as $riskCauseRow) { $riskCause = new RiskCause(); $riskCause->title = $riskCauseRow['title']; $riskCause->created_by = Auth::user()->id; $riskCause->status_id = Status::active()->id; $riskCauses[] = $riskCause; } } $riskTypeIds = explode(",", $value['risk_nature_ids']); $riskSources = explode(',', $value['risk_source_ids']); $riskAreaIds = explode(',', $value['risk_driver_ids']); $userIds = explode(',', $value['responsible_user_ids']); $divisionIds = explode(',', $value['division_ids']); $departmentIds = explode(',', $value['department_ids']); $sectionIds = explode(',', $value['section_ids']); $latestFunctionalRisk = Risk::where('is_functional', true) ->leftJoin('risk_department', 'risks.id', 'risk_department.risk_id') ->whereIn('risk_department.department_id', $departmentIds) ->latest('id') ->first(); if ($latestFunctionalRisk) { $matches = (int) filter_var($latestFunctionalRisk->reference_code, FILTER_SANITIZE_NUMBER_INT); } $latestFunctionalRiskId = $latestFunctionalRisk ? (int)$matches : 0; $departments = Department::select('id', 'code')->whereIn('id', $departmentIds)->get(); $code = ""; foreach ($departments as $department) { $code .= "$department->code"; } $isReferenceCodeEnabled = ErmSetting::enableReferenceCode(); if ($isReferenceCodeEnabled) { $risk->reference_code = $this->settingReferenceCode($risk, $value); $risk->save(); } else $risk->reference_code = $code . sprintf("%06d", $latestFunctionalRiskId + 1); $risk->save(); $risk->riskImpacts()->saveMany($riskImpacts); $risk->riskCauses()->saveMany($riskCauses); if (OrganizationSettings::getIsSubsidiary()) { $organizationIds = explode(',', $value['organization_ids']); $risk->organizations()->sync($organizationIds); } if (OrganizationSettings::getIsDivision()) { $divisionIds = explode(',', $value['division_ids']); $risk->divisions()->sync($divisionIds); } if (OrganizationSettings::getIsDepartment()) { $departmentIds = explode(',', $value['department_ids']); $risk->departments()->sync($departmentIds); } if (OrganizationSettings::getIsSection()) { $sectionIds = explode(',', $value['section_ids']); $risk->sections()->sync($sectionIds); } if (OrganizationSettings::getIsSubSection()) { $subSectionIds = explode(',', $value['sub_section_ids']); $risk->subSections()->sync($subSectionIds); } $risk->riskTypes()->sync($riskTypeIds); $risk->riskSources()->sync($riskSources); $risk->riskAreas()->sync($riskAreaIds); $risk->responsibleUsers()->sync($userIds); $workflow = Workflow::where('module_id', Module::$ermRisk)->first(); if ($workflow) { $workflowId = $workflow->id; //save the workflow users $workflowItems = Workflow::findOrFail($workflowId)->items; foreach ($workflowItems as $item) { $riskWorkFlowItem = getWorkFlowItemObject(new RiskWorkflowItem(), $item); $riskWorkFlowItem->risk_id = $risk->id; $riskWorkFlowItem->save(); setWorkflowItemUser($riskWorkFlowItem, $item); } } } } public function rules(): array { Validator::extend('validate_exists', function ($attribute, $value, $parameters, $validator) { $tablename = $parameters[0]; $field = $parameters[1]; $tablename = str_replace('*.', '', $tablename); $params = explode(',', $value); foreach ($params as $value) { if (!DB::table($tablename)->where($field, $value)->exists()) { return false; } } return true; }, __("validation.invalid_data")); Validator::replacer('validate_exists', function ($message, $attribute, $rule, $parameters, $value) { $row = explode('.', $attribute)[0]; $validationmessage = str_replace(':attribute', $attribute, $message); $validationmessage = str_replace(':row', $row, $validationmessage); return $validationmessage; }); return [ '*.title' => 'required', '*.risk_classification_id' => 'required|integer|exists:risk_classifications,id', '*.description' => 'nullable:risks,description', '*.risk_category_id' => 'required|integer|exists:risk_categories,id', '*.risk_sub_category_id' => 'required|integer|exists:risk_sub_categories,id', // '*.risk_date' => 'required|date|date_format:"Y-m-d"', '*.risk_identification_date' => 'required', '*.risk_owner_id' => 'required|integer|exists:users,id', '*.risk_consequences' => 'nullable', '*.risk_causes' => 'nullable', '*.risk_nature_ids' => "required|validate_exists:risk_types,id", '*.risk_source_ids' => "required|validate_exists:risk_sources,id", '*.risk_driver_ids' => "required|validate_exists:risk_areas,id", '*.risk_owner_id' => "required|exists:users,id", '*.responsible_user_ids' => "required|validate_exists:users,id", '*.organization_ids' => Rule::requiredIf((OrganizationSettings::getIsSubsidiary())) . "|validate_exists:organizations,id", '*.division_ids' => Rule::requiredIf(OrganizationSettings::getIsDivision()) . "|validate_exists:divisions,id", '*.department_ids' => Rule::requiredIf(OrganizationSettings::getIsDepartment()) . "|validate_exists:departments,id", '*.section_ids' => Rule::requiredIf(OrganizationSettings::getIsSection()) . "|validate_exists:sections,id", '*.sub_section_ids' => Rule::requiredIf((OrganizationSettings::getIsSubSection())) . "|validate_exists:sub_sections,id", ]; } public function customValidationAttributes(): array { return [ "title" => __("labels.title"), "risk_classification_id" => __("labels.risk_classification_id"), "description" => __("labels.description"), "risk_category_id" => __("labels.risk_category_id"), "risk_sub_category_id" => __("labels.risk_sub_category_id"), "risk_identification_date" => __("labels.risk_identification_date"), "risk_owner_id" => __("labels.risk_owner_id"), "risk_consequences" => __("labels.risk_consequences"), "risk_causes" => __("labels.risk_causes"), "risk_nature_ids" => __("labels.risk_nature_ids"), "risk_source_ids" => __("labels.risk_source_ids"), "risk_driver_ids" => __("labels.risk_driver_ids"), "responsible_user_ids" => __("labels.responsible_user_ids"), "organization_ids" => __("labels.organization_ids"), "division_ids" => __("labels.division_ids"), "department_ids" => __("labels.department_ids"), "section_ids" => __("labels.section_ids"), "sub_section_ids" => __("labels.sub_section_ids") ]; } public function sheets(): array { return [ 0 => $this, ]; } public function settingReferenceCode($risk, $value, $is_update = null) { $referenceCodeSettings = ErmSettingReferenceCode::orderBy('order')->get(); $referenceCode = ""; $newReferenceCode = 0; $codeDivider = !empty(ErmSettingReferenceCode::where('reference_type', 'code-divider')->first()) ? ErmSettingReferenceCode::where('reference_type', 'code-divider')->first()->title : '/'; if (!$risk->is_corporate) { $latestFunctionalRisk = Risk::where('is_functional', true) ->leftJoin('risk_division','risks.id','risk_division.risk_id') ->whereIn('risk_division.division_id', [$value['division_ids']]) ->latest('id') ->first(); if ($latestFunctionalRisk) { $latestId = explode($codeDivider, $latestFunctionalRisk->reference_code); $newReferenceCode = (int) abs(filter_var(end($latestId), FILTER_SANITIZE_NUMBER_INT)); } } else { $latestCorporateRisk = Risk::where('is_corporate', true)->latest('id')->first(); if ($latestCorporateRisk) { $latestId = explode($codeDivider, $latestCorporateRisk->reference_code); $newReferenceCode = (int) abs(filter_var(end($latestId), FILTER_SANITIZE_NUMBER_INT)); } } foreach ($referenceCodeSettings as $key => $referenceCodeSetting) { if ($referenceCodeSetting->order) { switch ($referenceCodeSetting->reference_type) { case 'division': if (!empty($value['division_ids'])) { $divisionIds = array_filter(explode(',', $value['division_ids']), 'strlen'); $referenceCode .= Division::findOrFail($divisionIds[0])->code; $referenceCode .= $codeDivider; } break; case 'department': if (!empty($value['department_ids'])) { $departmentIds = array_filter(explode(',', $value['department_ids']), 'strlen'); $referenceCode .= Department::findOrFail($departmentIds[0])->code; $referenceCode .= $codeDivider; } break; case 'section': if (!empty($value['section_ids'])) { $sectionIds = array_filter(explode(',', $value['section_ids']), 'strlen'); $referenceCode .= Section::findOrFail($sectionIds[0])->code; $referenceCode .= $codeDivider; } break; case 'company-code': case 'level': case 'prefix': case 'risk-prefix': $referenceCode .= $referenceCodeSetting->title; $referenceCode .= $codeDivider; break; case 'year': $referenceCode .= date("Y"); $referenceCode .= $codeDivider; break; default: // Handle any other cases if needed } } } if ($is_update == true) { $latestId = explode($codeDivider, $risk->reference_code); $newReferenceCode = (int) abs(filter_var(end($latestId), FILTER_SANITIZE_NUMBER_INT)); $referenceCode .= sprintf("%04d", $newReferenceCode); } else { $referenceCode .= sprintf("%04d", $newReferenceCode + 1); } return $referenceCode; } public function registerEvents(): array { return [ BeforeImport::class => function (BeforeImport $event) { $this->mapHeaderRow($event); } ]; } /** * Get the header mappings for the import. * Should match the column order from the template export * @see App\\Exports\\ERMRiskManagement\\ERMRiskERMRiskTemplateExport@sheets * @return array */ public function getHeaderMappings() { $standardColumnNames = [ 'sl', 'risk_classification_id', 'title', 'description', 'risk_consequences', 'risk_causes', 'risk_nature_ids', 'risk_source_ids', 'risk_category_id', 'risk_sub_category_id', 'risk_driver_ids', 'risk_identification_date' ]; if (OrganizationSettings::getIsSubsidiary()) { $standardColumnNames[] = 'organization_ids'; } if (OrganizationSettings::getIsDivision()) { $standardColumnNames[] = 'division_ids'; } if (OrganizationSettings::getIsDepartment()) { $standardColumnNames[] = 'department_ids'; } if (OrganizationSettings::getIsSection()) { $standardColumnNames[] = 'section_ids'; } if (OrganizationSettings::getIsSubSection()) { $standardColumnNames[] = 'sub_section_ids'; } $standardColumnNames[] = 'responsible_user_ids'; $standardColumnNames[] = 'risk_owner_id'; $this->headerMappings = []; foreach ($standardColumnNames as $index =>$standardColumnName) { foreach(Language::all() as $language) { $this->headerMappings[$index][$standardColumnName][] = Str::slug(__("labels.{$standardColumnName}", [], $language->code), '_'); } } } private function mapHeaderRow(BeforeImport $event) { $this->getHeaderMappings(); $worksheet = $event->getDelegate()->getActiveSheet(); $headerRow = $worksheet->getRowIterator(1)->current()->getCellIterator(); foreach ($headerRow as $cell) { $headerValue = Str::slug($cell->getValue(), "_"); // $columnLetter = $cell->getColumn(); // Convert letter index to numerical index (0, 1, 2, ...) $columnIndex = \\PhpOffice\\PhpSpreadsheet\\Cell\\Coordinate::columnIndexFromString($columnLetter) - 1; if (!isset($this->headerMappings[$columnIndex])) { break; } // Find the correct key in header mappings $header = $this->headerMappings[$columnIndex]; foreach($header as $expectedHeader => $aliases) { if (in_array($headerValue, $aliases)) { $cell->setValue($expectedHeader); // Set the cell to the standard header break; } } } } }\n\n\nCan anyone edit this code and share it\n"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + "xhprof"^^ . + . + . + . + . + "0"^^ . + "AWS SDK PHP – How to add Content-MD5 for PutBucketLifecycleConfiguration?"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + "Hence my comment @ADyson that is was 'supposed to help...' But as Chris said, let's just focus on one version. Longer term though, different projects need to be brought up from different old levels and may have interim steps on the way, hencing hoping to be able to move between versions without great pain. So far my only issue has been the inability to load openssl.dll. To switch between versions seems to be down to repointing Apache at the correct php module and updating php.ini to point to the right ext directory..."^^ . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + "Deploying Laravel to a subfolder"^^ . + . + . + "0"^^ . + . + . + "2"^^ . + . + . + . + . + . + . + . + . + . + . + . + "_Is_ the CLI command your are executing, actually run using PHP 7.4? Since you are using `php7.4 -m` to get your list of modules, I am guessing that this might not be the _default_ PHP CLI version ...?"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + "You changed file ownership to www-data... it's usually the other way around: the user from the host system is added to docker and owns all the shared files... usually you also don't copy files, but use a volume for that, so you can edit files in your IDE."^^ . + "0"^^ . + . + "Absolutely, and thanks for editing. If the file can actually be uploaded via such a request, then there is no doubt that an urgent fix is needed. But if the testers merely received what they felt was an inaccurate HTTP response, and no file was actually saved on the server, then it's more of a nice-to-have change to make it return something better, IMO, and not particularly high priority. OP should edit their post to clarify what actually happened as a result of the test, as I already asked them to do. If the testers did see that a file was uploaded, it's unclear if they provided evidence."^^ . + . + . + . + . + . + "<p>I would suggest you dynamically add CSS classes based on the post type the link points to.\nHere are the steps to do it :</p>\n<p>1- Add javascript something like :</p>\n<pre><code>jQuery(document).ready(function ($) {\n $(&quot;a&quot;).each(function () {\n var link = $(this);\n var url = link.attr(&quot;href&quot;);\n\n // Ensure it's an internal link\n if (url &amp;&amp; url.startsWith(window.location.origin)) {\n $.ajax({\n type: &quot;POST&quot;,\n url: ajaxData.ajaxurl,\n data: {\n action: &quot;get_post_type&quot;,\n url: url\n },\n success: function (response) {\n if (response.type === &quot;people&quot;) {\n link.addClass(&quot;link-people&quot;);\n } else if (response.type === &quot;events&quot;) {\n link.addClass(&quot;link-events&quot;);\n }\n }\n });\n }\n });\n});\n</code></pre>\n<p>2- Add ajax code in functions.php like this :</p>\n<pre><code>function get_post_type_by_url() {\n if (isset($_POST['url'])) {\n $post_id = url_to_postid($_POST['url']);\n if ($post_id) {\n $post_type = get_post_type($post_id);\n wp_send_json(array('type' =&gt; $post_type));\n }\n }\n wp_send_json(array('type' =&gt; ''));\n}\nadd_action('wp_ajax_get_post_type', 'get_post_type_by_url');\nadd_action('wp_ajax_nopriv_get_post_type', 'get_post_type_by_url');\n</code></pre>\n<p>3- Add css</p>\n<pre><code>.link-people {\n color: red !important;\n}\n.link-events {\n color: green !important;\n}\n</code></pre>\n"^^ . + "`what's the reason for saying $GLOBALS are available in global scope, and not saying $GLOBALS are available in all scopes`...it doesn't say that. Read it carefully. It says it _references_ variables that are globals. In other words, the variables/values available _within_ $GLOBALS are the ones which have global scope. $GLOBALS _itself_ is available anywhere. I think you've just misunderstood the wording."^^ . + . + "3"^^ . + . + "From your regular CLI that is working, try running `php -r "var_dump(exec('which php'));"`. If that is different than the web's version, you could try hard-coding the web version to run using the path from your known-working one."^^ . + "@Chimdi "when someone types d/file/ or d/file in the url bar, it loads the same content (duplicate content)" - that is something you should control in your PHP router. Your PHP code must be resolving both requests into one for both URLs to return the same response - perhaps you should not be doing that, then one will naturally result in a 404 (assuming that's what your router does). Or redirect one to the other in your PHP router/script - by doing this in PHP you can selectively redirect only the URLs that need redirecting and not URLs that would otherwise result in a 404 anyway."^^ . + . + "1"^^ . + "1"^^ . + . + "Problems with complexity in dependency conditional injection with PHP-DI"^^ . + . + . + . + . + "0"^^ . + . + "Note that, auth code can be used only once and you need to use new auth code for every access token generation. Alternatively, you can persist the refresh token and use it to get a new access token when the old one expires."^^ . + "<p>Sorry for my bad english, it is not my first language.</p>\n<p>I'm developing an application in Symfony 7, where you can only access the app if you are logged in. I followed the Symfony documentation to generate registration and login process. I have these pages now, I can create a user, and log in with it.</p>\n<p>Here is my <code>security.yaml</code> file:</p>\n<pre><code>security:\n# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords\npassword_hashers:\n Symfony\\Component\\Security\\Core\\User\\PasswordAuthenticatedUserInterface: 'auto'\n# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider\nproviders:\n # used to reload user from session &amp; other features (e.g. switch_user)\n app_user_provider:\n entity:\n class: App\\Entity\\User\n property: email\nfirewalls:\n dev:\n pattern: ^/(_(profiler|wdt)|css|images|js)/\n security: false\n main:\n lazy: true\n provider: app_user_provider\n form_login:\n login_path: app_login\n check_path: app_login\n enable_csrf: true\n default_target_path: app_dashboard\n logout:\n path: app_logout\n # where to redirect after logout\n target: app_login\n\n # activate different ways to authenticate\n # https://symfony.com/doc/current/security.html#the-firewall\n\n # https://symfony.com/doc/current/security/impersonating_user.html\n # switch_user: true\n\n# Easy way to control access for large sections of your site\n# Note: Only the *first* access control that matches will be used\naccess_control:\n - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }\n - { path: ^/logout, roles: IS_AUTHENTICATED_ANONYMOUSLY }\n - { path: ^/register, roles: IS_AUTHENTICATED_ANONYMOUSLY }\n\n - { path: ^/, roles: IS_AUTHENTICATED_FULLY }\n</code></pre>\n<p>When I try to access the page, and I logged out, it is always redirecting to the login url and I get a ERR_TOO_MANY_REDIRECTS error on the page.</p>\n<p>I assume that the problem is with the order of the <code>access_control</code> section, but I belive it should be working in this order.</p>\n<p>What could cause this issue?</p>\n"^^ . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + "notifications"^^ . + "vscodium"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + "I have tried numerous php7 builds. See **php version experiments** at the end. All suffer the same issue of unable to find openssl.dll even though they quote the correct path in the log line! Very odd. Just tried an x86 version of php, but that won't load (Cannot load c:\\\\php\\\\php7-4-33x86\\\\php7apache2_4.dll into server: %1 is not a valid Win32 application.), I guess as an x86 add-in to a x64 Apache ... but it was an experiment. Note **all** the php7 builds fail to load OpenSSL, 8.4.4 seems to have a memory access problem, but 8.3.3, 8.3.19 and 8.4.5 all work!"^^ . + "*"decimal and numeric are synonyms and can be used interchangeably"* ([source](https://learn.microsoft.com/en-us/sql/t-sql/data-types/decimal-and-numeric-transact-sql?view=sql-server-ver16))"^^ . + . + . + . + "1"^^ . + "I have integrated your code to mine, it works very well, I would like you to take a look at it and answer a couple of my questions if you can"^^ . + . + "0"^^ . + . + "Thanks, that makes sense but not sure how I would code that and make sure that they line up correctly. I am not a programmer, just tinker with my own website that no one else uses but me. That way I have my own layout just the way I like without having a third party constantly change things around, making the site slower, charging subscriptions, ads, etc."^^ . + "1"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + . + "Unable to attach user to an object in Filament"^^ . + "Great idea, but I will be looking for a solution that requires less differentiation from what I already have."^^ . + "1"^^ . + . + . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + "The logic Olivier posted will work only on systems where the OpenSSL/PHP combination is correctly installed/compatible. Sadly there are several environments where OpenSSL 3 is installed on a [not-supported PHP version](https://www.php.net/manual/en/openssl.requirements.php). In that case the `openssl_get_cipher_methods()` method will "lie" about the supported ciphers!"^^ . + "0"^^ . + "memory"^^ . + . + . + "1"^^ . + . + . + "Do a `var_dump($data);`, to see what it actually contains. You don't have multiple "rows" of data here that you could iterate over, you only have fetched the data for _one_ single record."^^ . + . + . + . + "composer update on cpanel terminal wrong php version"^^ . + "0"^^ . + . + . + . + . + . + "You handle these errors in a try-catch block as any other error. You need to figure out the exact error handling steps beyond this as it is up to the business logic to decide what to do with this error."^^ . + "0"^^ . + . + . + . + . + "<p>I'm developing a LimeSurvey plugin that extends PluginBase and organizes code into a structured namespace. The plugin installs fine and doesn't break limesurvey when the conditional if (!class_exists(...)) statement is used before subclass initialization. However, when I attempt to modify the settings of the plugin in the LimeSurvey admin panel, I get a popup error saying &quot;Can't load the plugin.&quot;</p>\n<p>I have TemplatePlugin extends PluginCore:</p>\n<pre><code>&lt;?php\n\nnamespace MyPlugin;\n\nuse MyPlugin\\Services\\PluginCore;\n\nif (!class_exists('MyPlugin\\\\TemplatePlugin')) {\n class TemplatePlugin extends PluginCore {\n\n }\n}\n</code></pre>\n<p>And the PluginCore class:</p>\n<pre><code>namespace MyPlugin\\Services;\n\nuse LimeSurvey\\PluginManager\\PluginBase;\n\nclass PluginCore extends PluginBase {\n\n protected $storage = 'DbStorage';\n static protected $description = 'Webhook for Limesurvey: send a curl POST after every response submission.';\n static protected $name = 'Hook';\n protected $surveyId;\n \n public function init()\n {\n $this-&gt;subscribe('beforeSurveySettings');\n }\n \n // Globale settings\n protected $settings = array(\n 'bUse' =&gt; array(\n 'type' =&gt; 'select',\n 'options' =&gt; array(\n 0 =&gt; 'No',\n 1 =&gt; 'Yes'\n ),\n 'default' =&gt; 1,\n 'label' =&gt; 'Send a hook for every survey by default?',\n 'help' =&gt; 'Overwritable in each Survey setting'\n ),\n );\n \n /**\n * Add setting on survey level: send hook only for certain surveys / url setting per survey / auth code per survey / send user token / send question response\n */\n public function beforeSurveySettings()\n {\n $oEvent = $this-&gt;event;\n $settings = array(\n 'bUse' =&gt; array(\n 'type' =&gt; 'select',\n 'label' =&gt; 'Send a hook for this survey',\n 'options' =&gt; array(\n 0 =&gt; 'No',\n 1 =&gt; 'Yes',\n 2 =&gt; 'Use site settings (default)'\n ),\n 'default' =&gt; 2,\n 'help' =&gt; 'Leave default to use global setting',\n 'current' =&gt; $this-&gt;get('bUse', 'Survey', $oEvent-&gt;get('survey'))\n ),\n );\n \n $oEvent-&gt;set(&quot;surveysettings.{$this-&gt;id}&quot;, array(\n 'name' =&gt; get_class($this),\n 'settings' =&gt; $settings\n ));\n }\n</code></pre>\n<p>Any insights into potential issues with my class structure, namespace usage, or settings implementation would be greatly appreciated!</p>\n<p>I have used the same syntax for previous plugins not including the namespace structure, where they have worked fine, but this plugin is very large and requires a more structured layout.</p>\n<p>I have experimented with different folders, namespaces and locations, and generally been trying to debug the issue to the best of my abilities.</p>\n"^^ . + "0"^^ . + . + "<p>I created an application with reverb where I made a simple channel and an event that receives a message and transmits it to the subscribers on the reverb channel. It turns out that when I tried to make a connection with the frontend in React using <code>echo.js</code> I ended up not receiving any type of information from the channel. How can I implement reverb correctly? The documentation does not have the information I am looking for.</p>\n<p>Reverb log:\n<code>INFO Starting server on 0.0.0.0:8080 (192.168.1.69)</code></p>\n<p>Laravel Event:</p>\n<pre><code>&lt;?php\n\nnamespace App\\Events;\n\nuse Illuminate\\Broadcasting\\Channel;\nuse Illuminate\\Broadcasting\\InteractsWithSockets;\nuse Illuminate\\Broadcasting\\PresenceChannel;\nuse Illuminate\\Broadcasting\\PrivateChannel;\nuse Illuminate\\Contracts\\Broadcasting\\ShouldBroadcast;\nuse Illuminate\\Contracts\\Broadcasting\\ShouldBroadcastNow;\nuse Illuminate\\Foundation\\Events\\Dispatchable;\nuse Illuminate\\Queue\\SerializesModels;\n\nclass Chat implements ShouldBroadcastNow\n{\n use Dispatchable, InteractsWithSockets, SerializesModels;\n\n public $msg;\n /**\n * Create a new event instance.\n */\n public function __construct($msg)\n {\n //\n $this-&gt;msg = $msg;\n }\n\n /**\n * Get the channels the event should broadcast on.\n *\n * @return array&lt;int, \\Illuminate\\Broadcasting\\Channel&gt;\n */\n public function broadcastOn(): array\n {\n return [\n new Channel('chat'),\n ];\n }\n}\n\n</code></pre>\n<p>Laravel Channel:</p>\n<pre><code>&lt;?php\n\nuse Illuminate\\Support\\Facades\\Broadcast;\n\nBroadcast::channel('App.Models.User.{id}', function ($user, $id) {\n return (int) $user-&gt;id === (int) $id;\n});\n\nBroadcast::channel('Chat', function () {\n});\n\n</code></pre>\n<p>Call:</p>\n<pre><code>Route::get('/ws', function(){\n Broadcast(new Chat('test'));\n});\n</code></pre>\n<p>Echo.js front-react</p>\n<pre><code>import Echo from 'laravel-echo';\nimport Pusher from 'pusher-js';\n\nconst echo = new Echo({\n broadcaster: 'pusher',\n key: process.env.REACT_APP_PUSHER_APP_KEY, // Chave do Pusher\n wsHost: '192.168.1.69', // Host do Reverb\n wsPort: 8080, // Porta do Reverb\n forceTLS: false, \n disableStats: true,\n});\n\nexport default echo;\n</code></pre>\n<p>app.js</p>\n<pre><code>import React, { useEffect, useState } from 'react';\nimport echo from './echo'; // Importe o Echo configurado\n\nfunction App() {\n const [mensagem, setMensagem] = useState('');\n\n useEffect(() =&gt; {\n // Ouvir um canal público\n echo.channel('chat')\n .listen('Chat', (e) =&gt; {\n setMensagem(e.mensagem); // Atualize o estado com a mensagem recebida\n console.log('Evento recebido:', e);\n });\n\n // Limpar a inscrição ao desmontar o componente\n return () =&gt; {\n echo.leaveChannel('canal-reverb');\n };\n }, []);\n\n return (\n &lt;div&gt;\n &lt;h1&gt;Mensagem Recebida:&lt;/h1&gt;\n &lt;p&gt;{mensagem}&lt;/p&gt;\n &lt;/div&gt;\n );\n}\n\nexport default App;\n</code></pre>\n<p>I can successfully receive connections from the machine where the local server is located, but when I try to make connections with other machines, Reverb does not identify connections.</p>\n<p><a href="https://i.sstatic.net/XCQCLucg.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XCQCLucg.png" alt="enter image description here" /></a></p>\n<p>It runs normally on the local machine.</p>\n"^^ . + "1"^^ . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + "My intention is to use a JavaScript library similar to **[Select 2](https://select2.org/)**, but without jQuery. Would the above solution be viable and/or helpful?"^^ . + . + "1"^^ . + "0"^^ . + . + "1"^^ . + "It will see your server's IP address as the client."^^ . + . + "telegram-bot"^^ . + . + . + "nginx"^^ . + . + "1"^^ . + . + . + . + "If your backend code doesn't save it anywhere else either then yeah, it's gone, sorry. You need to fix your bug"^^ . + "0"^^ . + . + . + . + "2"^^ . + "Using one code line `return pll_the_languages(['hide_current' => 1, 'echo' => 0]);` solves the issue, so no need for buffering."^^ . + "0"^^ . + . + . + "1"^^ . + "hyperlink"^^ . + "<p>To fix this, you need to use do_shortcode() inside the shortcode that expects the match ID. Here's how you can solve it.</p>\n<p>Instead of using [match_id] inside another shortcode directly, pass the extracted value dynamically.</p>\n<p>If you want to use it inside [fp-predictions], modify it like this:</p>\n<pre><code>function fp_predictions_with_match_id($atts) {\n $match_id = get_match_id_from_url();\n $atts = shortcode_atts(\n array('text' =&gt; 'No data', 'match' =&gt; $match_id),\n $atts\n );\n return do_shortcode('[fp-predictions text=&quot;' . esc_attr($atts['text']) . '&quot; match=&quot;' . esc_attr($atts['match']) . '&quot;]');\n}\nadd_shortcode('fp_match_predictions', 'fp_predictions_with_match_id');\n</code></pre>\n<p>Now to use it :</p>\n<pre><code>[fp_match_predictions text=&quot;No data&quot;]\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + . + "<p>My initial advice to use a regex pattern with <code>preg_split()</code> revealed itself as an inappropriate suggestion because:</p>\n<ol>\n<li>simply imploding the 5200 element array exceeded PCRE's character limit, and</li>\n<li>Germany's valid phone number list is &quot;open&quot; and therefore prone to expansion over time -- maintenance of even a working, compacted regex would be difficult to maintain in the future. (<a href="https://www.regexlib.com/RETester.aspx?regexp_id=3187" rel="nofollow noreferrer">Here's a broken regex that I found.</a>)</li>\n</ol>\n<p>Instead, I endorse a script similar to Olivier's answer because key-based comparisons always outperform value-based comparisons in PHP.</p>\n<p>From your existing array, you can populate a segmented lookup array which is structured to efficiently facilitate your task.</p>\n<pre class="lang-php prettyprint-override"><code>var_export(\n array_reduce(\n $area_codes,\n function($result, $ac) {\n $result[strlen($ac)][$ac] = '';\n return $result;\n },\n []\n )\n);\n</code></pre>\n<p>The printed result can be simply copied to a config file in your application. Once this is established, manual maintainance will be intuitive and simple. This structure also allows you to store the tele-name or region affiliated with the area codes -- in case you want that later.</p>\n<pre class="lang-php prettyprint-override"><code>define('GERMAN_AREA_CODE_LOOKUP', [\n 5 =&gt; [\n '01511' =&gt; 'T-Mobile',\n '01512' =&gt; 'T-Mobile',\n '01514' =&gt; 'T-Mobile',\n '01515' =&gt; 'T-Mobile',\n '01516' =&gt; 'T-Mobile',\n '01517' =&gt; 'T-Mobile',\n ],\n 6 =&gt; [\n '015019' =&gt; 'T-Mobile',\n '015020' =&gt; 'T-Mobile',\n '015180' =&gt; 'T-Mobile',\n '015181' =&gt; 'T-Mobile',\n '015182' =&gt; 'T-Mobile',\n '015183' =&gt; 'T-Mobile',\n '015184' =&gt; 'T-Mobile',\n '015185' =&gt; 'T-Mobile',\n ]\n]);\n</code></pre>\n<p>Now a small helper function can iterate as many times as needed to parse a phone number into its two halves:</p>\n<pre class="lang-php prettyprint-override"><code>function parseGermanPhoneNumber(string $phone): array\n{\n foreach (GERMAN_AREA_CODE_LOOKUP as $length =&gt; $set) {\n if (\n sscanf($phone, &quot;%{$length}s%s&quot;, $area_code, $subscriber_number)\n &amp;&amp; isset($set[$area_code])\n ) {\n return compact('area_code', 'subscriber_number');\n }\n }\n throw new Exception(&quot;Phone number's area code not found in whitelist&quot;);\n}\n</code></pre>\n<p>Tests: <a href="https://3v4l.org/6mN7A" rel="nofollow noreferrer">Demo</a></p>\n<pre class="lang-php prettyprint-override"><code>$tests = ['015169999999', '015180999999'];\nvar_export(\n array_map(\n parseGermanPhoneNumber(...),\n $tests\n )\n);\n</code></pre>\n"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + "Hi @migli, thanks for the reply. I think there are several factors but I can't figure out yet. The entire project is on `public_html` folder, the `index.php` entry point though is in `public` directory. The server is Apache I think, I need to somehow point the domain to `public/index.php`. I tried to achieve this via .htaccess then I get that error."^^ . + "<p>I'm creating a custom plugin for a Laravel-based ecommerce system that uses a core ShippingStatusEnum class to manage shipping statuses. I need to add a new status, &quot;in transit&quot;, without modifying the original core enum file.</p>\n<p>I attempted to create an extended class like this:</p>\n<pre><code>namespace Botble\\OrderManagement\\Enums;\n\nuse Botble\\Ecommerce\\Enums\\ShippingStatusEnum;\nuse Botble\\Base\\Facades\\BaseHelper;\nuse Illuminate\\Support\\HtmlString;\n\nclass ExtendedShippingStatusEnum extends ShippingStatusEnum\n{\n public const IN_TRANSIT = 'in_transit';\n\n public function toHtml(): HtmlString|string\n {\n $color = match ($this-&gt;value) {\n self::IN_TRANSIT =&gt; 'primary',\n default =&gt; parent::toHtml(),\n };\n\n return BaseHelper::renderBadge($this-&gt;label(), $color);\n }\n}\n\n</code></pre>\n<p>but the new item I added to the list doesn't appear when ShippingStatusEnum.php is called.</p>\n<p>For reference, here is the core code for ShippingStatusEnum.php:</p>\n<pre><code>&lt;?php\n\nnamespace Botble\\Ecommerce\\Enums;\n\nuse Botble\\Base\\Facades\\BaseHelper;\nuse Botble\\Base\\Supports\\Enum;\nuse Illuminate\\Support\\HtmlString;\n\nclass ShippingStatusEnum extends Enum\n{\n public const NOT_APPROVED = 'not_approved';\n public const APPROVED = 'approved';\n public const PENDING = 'pending';\n public const ARRANGE_SHIPMENT = 'arrange_shipment';\n public const READY_TO_BE_SHIPPED_OUT = 'ready_to_be_shipped_out';\n public const PICKING = 'picking';\n public const DELAY_PICKING = 'delay_picking';\n public const PICKED = 'picked';\n public const NOT_PICKED = 'not_picked';\n public const DELIVERING = 'delivering';\n public const DELIVERED = 'delivered';\n public const NOT_DELIVERED = 'not_delivered';\n public const AUDITED = 'audited';\n public const CANCELED = 'canceled';\n\n public static $langPath = 'plugins/ecommerce::shipping.statuses';\n\n public function toHtml(): HtmlString|string\n {\n $color = match ($this-&gt;value) {\n self::NOT_APPROVED, self::PENDING, self::DELAY_PICKING, self::APPROVED =&gt; 'warning',\n self::PICKING, self::READY_TO_BE_SHIPPED_OUT, self::DELIVERING, self::ARRANGE_SHIPMENT =&gt; 'info',\n self::NOT_PICKED, self::CANCELED, self::NOT_DELIVERED =&gt; 'danger',\n self::DELIVERED, self::AUDITED =&gt; 'success',\n default =&gt; 'primary',\n };\n\n return BaseHelper::renderBadge($this-&gt;label(), $color);\n }\n} ```\n</code></pre>\n"^^ . + . + "Ok, but then example 2 should fail the IF test, but it doesn't. `if($var['x']??5 < 1 )` still returns `true`"^^ . + . + . + . + . + . + . + . + . + . + . + . + "PI Network app_to_user Payment Completion Issue"^^ . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + "it's working now in sql server, but a little error in php: Invalid character value for cast specification: 206 [Microsoft][ODBC SQL Server Driver][SQL Server]Operand type clash: text is incompatible with datetime"^^ . + "oh, yes it's in the login.php file. I'll try debugging it as you said. Thanks for the help, I'll try that."^^ . + "<p>Working in PHP, I have some strings with both Korean and English:</p>\n<pre><code>example = array [0] 역시also\n</code></pre>\n<p>I want to divide the string into separate languages:</p>\n<pre><code>Array\n(\n [0] =&gt; 역시\n [1] =&gt; also\n)\n</code></pre>\n<p>I have looked everywhere and I just can't seem to get this to work. I have limited experience with regular expressions so perhaps that is the key but I am failing to see it. All I really need is how to find the position of the first English letter, big or little, then I could just cut the string but I just can't seem to find anything that returns anything.</p>\n<p>BTW- I am aware of <a href="https://stackoverflow.com/questions/40581251/split-string-with-preg-split-on-english-and-non-english-letters#comment68398383_40581251">this answer</a>\nIt does not work for me. I am not sure if it because of the space in the other answer or because my question is connected to Korean but that answer returned nothing for me.</p>\n"^^ . + . + . + . + "0"^^ . + "1"^^ . + "0"^^ . + . + "1"^^ . + . + . + "0"^^ . + "Table Name in Doctrine QueryBuilder"^^ . + "I want my play number to be the unique key"^^ . + . + . + "0"^^ . + "What I mean by "the `HasExtendedPermissions` trait doesn't seam to inherit $this->currentForm" is that no matter what I do, `$this->currentForm` is never available within the `HasExtendedPermissions` trait. But thinking of it as "compiler assisted copy-and-paste" is giving me a new outlook on this, let me try a few options popping in my head now."^^ . + . + "0"^^ . + "0"^^ . + "2"^^ . + . + . + . + "PHP Search and Insert Matching Term on Multidimensional Array"^^ . + . + . + "2"^^ . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + "<p>I am Working on a Chat Application developed By laravel (Laravel Reverb) and reactjs.</p>\n<p>Two Projects are developed separately and also i am configuring with Laravel Passport.</p>\n<p>The Backend basically serve the Api and Chat server where the frontend configuring the chat server and implementing Apis.</p>\n<p>For Tracking User Activity (Online or Offline Status) I am Configuring Presence Channel.</p>\n<p>Previously, my task was, when a user connected to the channel A User History Saved on Redis. Which Perfectly Work without any issue.</p>\n<p>Now I am trying to configure user disconnected system. When a user is disconnected from the channel it will remove that user history from Redis.</p>\n<p>Now Every where i am founding calling a api from frontend so that it can remove that entity.</p>\n<p>But I need to Determine the user disconnection from Backend cause When connection stablish i can see Connection stablish message on debug panel and also connection closed message inside debug console.</p>\n<p>So I think i can track the connection and disconnection from the server side rather than implementing something on frontend.</p>\n<p>So is there a way to track the connection status from the backend side? I can't Handel The Laravel Reverb Disconnect When Tab is closed</p>\n<p>I am giving you the whole code. So that any one can understand what is doing and what to do next.</p>\n<pre><code>&lt;?php\n\nnamespace App\\Listeners;\n\nuse App\\Events\\UserStatus;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Support\\Facades\\Log;\nuse Illuminate\\Support\\Facades\\Redis;\n\nclass UserStatusListener\n{\n /**\n * Create the event listener.\n */\n public function __construct()\n {\n //\n }\n\n /**\n * Handle the event.\n */\n public function handle(UserStatus $event): void\n {\n $user_id = $event-&gt;user_id;\n $status = $event-&gt;status;\n\n Log::info(&quot;User Status Changed: User ID {$user_id} is now {$status}&quot;);\n\n if ($status === &quot;connected&quot;) {\n // Store user as online in Redis\n Redis::setex(&quot;user:online:{$user_id}&quot;, 300, json_encode([\n 'user_id' =&gt; $user_id,\n 'status' =&gt; 'online',\n 'last_seen' =&gt; now()-&gt;toDateTimeString(),\n ]));\n } elseif ($status === &quot;disconnected&quot;) {\n // Remove user from Redis (user disconnected)\n Redis::del(&quot;user:online:{$user_id}&quot;);\n }\n }\n}\n\n</code></pre>\n<p>This is my <code>UserStatusListner</code> Where I am determining the User Connected status and store this inside Redis.</p>\n<pre><code>&lt;?php\n\nnamespace App\\Events;\n\nuse Illuminate\\Broadcasting\\Channel;\nuse Illuminate\\Broadcasting\\InteractsWithSockets;\nuse Illuminate\\Broadcasting\\PresenceChannel;\nuse Illuminate\\Broadcasting\\PrivateChannel;\nuse Illuminate\\Contracts\\Broadcasting\\ShouldBroadcast;\nuse Illuminate\\Contracts\\Broadcasting\\ShouldBroadcastNow;\nuse Illuminate\\Foundation\\Events\\Dispatchable;\nuse Illuminate\\Queue\\SerializesModels;\n\n\nclass UserStatus implements ShouldBroadcastNow\n{\n use Dispatchable, InteractsWithSockets, SerializesModels;\n \n public $user_id;\n public $status;\n\n /**\n * Create a new event instance.\n */\n public function __construct($user_id, $status)\n {\n $this-&gt;user_id = $user_id;\n $this-&gt;status = $status;\n }\n\n /**\n * Get the channels the event should broadcast on.\n *\n * @return array&lt;int, \\Illuminate\\Broadcasting\\Channel&gt;\n */\n public function broadcastOn()\n {\n return new PresenceChannel('presence-user-status-'.$this-&gt;user_id);\n }\n\n public function broadcastAs()\n {\n return 'user.status'; // Custom event name\n }\n}\n</code></pre>\n<p>This is my <code>UserStatus</code> Event Where i called when a Presence Channel is successfully connected.</p>\n<pre><code>Broadcast::channel('presence-user-status-{user_id}', function ($user, $user_id) {\n // Check the authenticated user from multiple guards\n $staffUser = Auth::guard('staff_users')-&gt;user();\n $businessUser = Auth::guard('business_users')-&gt;user();\n $normalUser = Auth::guard('users')-&gt;user();\n\n $userData = [];\n if ($normalUser &amp;&amp; (int) $normalUser-&gt;user_id === (int) $user_id) {\n $userData = [\n 'user_id' =&gt; $normalUser-&gt;user_id,\n 'type' =&gt; &quot;user&quot;\n ];\n\n }\n\n if ($businessUser &amp;&amp; (int) $businessUser-&gt;user_id === (int) $user_id) {\n $userData = [\n 'user_id' =&gt; $businessUser-&gt;user_id,\n 'type' =&gt; &quot;business&quot;\n ];\n }\n\n if ($staffUser &amp;&amp; (int) $staffUser-&gt;staff_id === (int) $user_id) {\n $userData = [\n 'user_id' =&gt; $staffUser-&gt;staff_id,\n 'type' =&gt; &quot;staff&quot;\n ];\n \n }\n\n if (!empty($userData)) {\n Redis::setex(&quot;user:online:{$user_id}&quot;, 300, json_encode([\n 'user_id' =&gt; $userData['user_id'],\n 'type' =&gt; $userData['type'],\n 'last_seen' =&gt; now()-&gt;toDateTimeString(),\n ]));\n \n // Fire the UserStatus event for tracking\n event(new UserStatus($userData['user_id'], 'connected'));\n return $userData;\n }\n\n return false; \n});\n</code></pre>\n<p>This is my channel Code of the Presence Channel inside <code>routes/channels</code></p>\n<p>Here When user is online i can store the data into Redis but when a user is disconnect i can't track that. Anyone have any advise or any way to resolve this issue?</p>\n<p>N.B - I am Using Laravel 10 Version.</p>\n"^^ . + . + "0"^^ . + . + . + "Change rights to the folder to 0766 aka read/write for group and other. Or change the owner to the user who runs the webserver (wwwrun). Error message says, that it can't write.. the "5" stands for r-x (read, execute), but it would need "6" for rw- (read, write).. execute not required"^^ . + "0"^^ . + . + . + . + . + . + . + "FYI, collation has nothing to do with these problems. And there is no DSN parameter called "collation", it's just ignored, so you better remove it. The problem you are having is related to **charset**. Which has to be set to match the client data charset. In case your input data charset is Windows-1252, you must use charset=cp1252 in the DSN for this operation. Or recode it into utf-8 before adding to database"^^ . + . + . + "0"^^ . + . + . + "<p>I am trying to get a two currencies on shop/product/card and checkout page's.</p>\n<pre><code>function display_dual_currency_prices() {\n global $product;\n if (!$product) return;\n \n \n $price_bgn = $product-&gt;get_price();\n $regular_price_bgn = $product-&gt;get_regular_price();\n $sale_price_bgn = $product-&gt;get_sale_price();\n \n \n $conversion_rate = 0.51; // 1 BGN = 0.51 EUR\n \n \n $price_eur = $price_bgn * $conversion_rate;\n $regular_price_eur = $regular_price_bgn * $conversion_rate;\n $sale_price_eur = $sale_price_bgn ? $sale_price_bgn * $conversion_rate : 0;\n \n \n echo '&lt;div class=&quot;dual-currency-display&quot;&gt;';\n echo '&lt;div class=&quot;eur-price&quot;&gt;€' . number_format($price_eur, 2) . ' EUR&lt;/div&gt;';\n echo '&lt;/div&gt;';\n}\n\n\nadd_action('woocommerce_after_shop_loop_item_title', 'display_dual_currency_prices', 11);\nadd_action('woocommerce_single_product_summary', 'display_dual_currency_prices', 11);\n</code></pre>\n<p>Added this to functions.php file and kind a works. Both are visible but only in shop and product page's. When I add a product and check the card or process to checkout it's showing only that currency by default. So any idea how to deal with that?</p>\n"^^ . + . + . + . + . + "0"^^ . + "<blockquote>\n<p>It appears that the super long message is just the contents of intelephense.js?</p>\n</blockquote>\n<p>No, the output is from node(1) on your computer system, that is the command you have commanded your computer-system to execute.</p>\n<p>So what <em>appears to you</em> being the contents of some ECMA Script file (a.k.a. javascript script file) is the output of node(1) executing the script file.</p>\n<p>So it is related, but not the same.</p>\n<blockquote>\n<p>Any idea what is going on here?</p>\n</blockquote>\n<p>You are executing a command: <code>intelephense --version</code></p>\n<p>The actual command you execute is named <code>intelephense</code>, what follows after the first field separator are passed as arguments to the command (<code>--version</code> is the single argument that there is).</p>\n<p>In the Unix Programming Environment, that is the one on your system that you are making use of, you can identify the pathname of the command with the <code>command</code> special built-in:</p>\n<pre class="lang-php prettyprint-override"><code>$ command -v intelephense\n/...\n</code></pre>\n<p>This <em>command</em> invocation is <em>successful</em> if the command name (&quot;intelephense&quot;) can be resolved to a pathname. The commands' <em>pathname</em> will be written to the <em>standard output</em>. In your case it must be successful. You can simply try this, <code>command -v</code> is safe to use, it does not execute the command for what follows as <em>command-name</em> (without <code>-v</code> it would however).</p>\n<p>Now you have identified the pathname of the <em>actual</em> command you are executing.</p>\n<p>This allows you to look into that file with standard file utilities. For example file(1) if you have installed it. But you could also just display the first 10 lines of it with the head(1) utility that should normally be always enabled.</p>\n<p>You would then eventually gain the information that it is an executable script file and the executable that is used to execute the script file is the node(1) utility.</p>\n<p>This is crucial to understand as it is the only way to explain to yourself <em>how</em> what you see is the &quot;contents&quot; of the script file.</p>\n<p>Now as written above, its not exactly the <em>contents</em>, <em>but</em> related. So this is worth to check it out.</p>\n<p>The actual contents you face is a so called diagnostic message on the diagnostic channel, also known as <em>standard error</em>. If you would have checked the exit status of your node(1) invocation, it would have likely shown you FAILURE (not SUCCESS).</p>\n<p>And if you would have redirected the diagnostic channel, you would not have seen what you describe as the <em>assumed contents of script file</em> at all as it is entirely diagnostic and not the scripts <em>standard output</em>.</p>\n<p>These are some of the basic pillars of the Unix Programming Environment you are making use of to execute your development commands. Node(1) is just compatible with these so called <em>standard streams</em> and the <em>exit status</em>.</p>\n<p>Read your systems development or maintenance manual what these are. Additionally consult a second source (probably <em>via</em> Wikipedia) to better understand how fundamental these corner-stones are as you will face them not only with javascript script files and node(1) but also with php script files and php(1) and countless other <em>scripts</em>.</p>\n<p>Additionally, for what you see on the screen: As node(1) is a script interpreter, it provides debugging information on the diagnostic channel. In your concrete case what you see there is called an error trace or stack trace, also known as backtrace.</p>\n<p>Most correctly worded for Node(1) it is an <em>error trace</em> IIRC.</p>\n<p>You have been shocked by it because it contains so much information (honestly, actually, very little for a trace, but it's OK). That much information even you conflate it with the contents of the script file itself, at least at the point in time trying to find own words to describe what you see. That's also totally OK. And sure you never conflated it, it was just exactly what you mean. I'm just talking about how it was for me for the first time. YMMV.</p>\n<p>But more important and in short, it is just an error.</p>\n<p>Errors are totally normal, but remain cumbersome if unexpected and then hard to identify.</p>\n<p>Let's make it easy by taking this puzzling output of an error trace apart:</p>\n<ol>\n<li>It's just an error</li>\n<li>Every error yielded by Node has a message describing it.</li>\n<li>Node(1) writes the errors' description in an error trace at the very beginning (starts at the first line)</li>\n<li>After the error message, the trace is shown. Node writes out what was called (all lines after the message line(s))</li>\n<li>The trace is from the position in the main script as passed on the command line down (first) to the position where the actual error was thrown/came from (last).</li>\n</ol>\n<p>Now only an error comes with a description upfront, it must not mean that we can understand it. However, the description requires reading nevertheless.</p>\n<p>(Sometimes an error is just described as &quot;Error&quot;, helpful, right?)</p>\n<p>Hmm.</p>\n<p>A message might not yet speak to us. Then we have to re-read it and re-read it over and over again until it does. To do so, the first thing you have to do is to reproduce the error. Are you able to reproduce the error? So before you re-read the message the second time, reproduce it a second time and then re-read the message. Remember it is only an error, and errors are normal, however errors are always <em>caused</em>, and if you can't cause an error again, you will never be able to understand the description in full. However if you can't reproduce it, you already have gathered other great insights (most often, can't promise you a rose garden).</p>\n<p>Simple example: You execute a command and it deletes all files on your system it has access to. So it might even delete the script file itself. You won't be able to reproduce the error until you were able to restore your files from backup.</p>\n<p>You probably now think: Who executes commands without reading their documentation how the command is to be executed, a.k.a. <em>invocation</em>? Well, answer that yourself, only those who do, know. Commands provide utility, but only we decide if those utilities are useful for us.</p>\n<p>Computers are stupid, humans make errors.</p>\n<p>You then reproduce the error over and over again until you understand both the command you execute <em>and</em> the error description you are causing over and over again until you understand how you can cause the error with your command. Theoretically only now, let's read more first:</p>\n<p>Now what is the trace then helpful for?</p>\n<p>As it shows you all script files that are collaborating to &quot;help&quot; you provoke the error &quot;successfully&quot;, you can traverse all scripts and read the source code in there at those locations to understand what the node(1) command that you commanded is doing there. The trace <em>may</em> help you diagnose the error. But there is a caveat: While that will finally result in the situation that you would also understand the description of the error in full, it requires a lot of reading and understanding of the source-code first. This can take endlessly, e.g. the script is under constant change.</p>\n<p>But perhaps you were not interesting in debugging the script you are executing? Then this is perhaps not the information you're looking for in the first place but instead you should focus on understanding the command itself you are executing and start with the first script, which is the one on the command line, the first entry in the trace (the entries are sometimes called <em>frames</em>, and the first is the <em>main</em> or <em>entry</em> frame).</p>\n<p>Similar to what the documentation of node(1) has about its <em>invocation</em> many scripts designed to run in the Unix Programming Environment, a.k.a. on your command-line, also document their <em>invocation</em>.</p>\n<p>Locate the manual/documentation of the script and learn about its invocation if you are <em>not</em> interested in debugging/developing/maintaining the script file itself in the first place.</p>\n<p>History has shown, that humans benefit from reading about a command first, before executing it, despite we have to play with each command <em>anyway</em>.</p>\n<p>Otherwise, if you are interested in exactly that development work of the command, read the whole documentation of the script file first, then the developer documentation and then read all the source-code.</p>\n<p>Perhaps the error handling of that scripts' contents can be easily improved for command-line use if the diagnostic messaging would have been more user-friendly? Perhaps this was caused by a bug? If you can fix it, you have probably finally understood it. Between now and then, there can be quite some journey. Benefit from the documentation that exists, benefit from the code that exists and you'll learn more than you have asked for.</p>\n<p>But first read about how to invoke the command in the first place.</p>\n"^^ . + . + "I didn't use AI for ideas & content, but I used it to generate the code, which just saves a little time in this case."^^ . + . + "encoding"^^ . + "1"^^ . + . + . + . + . + "So does the PHP manual say"^^ . + . + . + . + . + "0"^^ . + . + "0"^^ . + "mailto"^^ . + . + "<p><code>Auth::user()</code> returns <code>\\Illuminate\\Contracts\\Auth\\Authenticatable|null</code>. Which does not have your method.</p>\n<p>You can safely ignore this message. Personally I use <a href="https://github.com/barryvdh/laravel-ide-helper" rel="nofollow noreferrer">https://github.com/barryvdh/laravel-ide-helper</a>\nWhich resolves such issues by rewriting the expected output to your User model.</p>\n"^^ . + "polylang"^^ . + . + "pihole"^^ . + . + . + "1"^^ . + . + . + "0"^^ . + . + "How to use symbolic algebra in programming?"^^ . + . + "<blockquote>\n<p>If i import on direct 'TargetHeaderImport' its safe, but in excel i have a 2 sheets and i just only want one sheet to import.</p>\n</blockquote>\n<p>The sheets method has no parameters in its protocol <em>and</em> you have to tell which sheet you want to import by the return array (<a href="https://docs.laravel-excel.com/3.1/imports/multiple-sheets.html" rel="nofollow noreferrer">https://docs.laravel-excel.com/3.1/imports/multiple-sheets.html</a>).</p>\n<p>Obtain <code>$data</code> from <code>$this-&gt;data</code> instead of a parameter that does not exists and if the construction of your sheet importer needs it.</p>\n<pre class="lang-php prettyprint-override"><code>public function sheets(): array\n{\n return [\n 'THIS THE SHEET NAME I WANT IMPORT - ONLY ONE!'\n =&gt; new TargetHeaderImport($this-&gt;data),\n ###########\n #########\n #######\n #####\n ###\n #\n\n // and this is the data //\n ];\n}\n</code></pre>\n"^^ . + . + . + . + . + "<p>You have a few errors in the validation.</p>\n<ul>\n<li><code>password_confirmation</code> is not required.</li>\n<li><code>pan</code> &amp; <code>gst</code> fields are missing.</li>\n<li>Password field validation is missing <code>confirmed</code>.</li>\n<li>Missing error for <code>pan</code> and <code>gst</code>.</li>\n</ul>\n<hr />\n<p><code>User.php</code></p>\n<pre><code>protected $fillable = [\n 'name',\n 'email',\n 'password',\n 'pan',\n 'gst',\n 'checkbox',\n 'contact',\n 'register_as',\n];\n</code></pre>\n<p><code>UserController.php</code></p>\n<pre class="lang-php prettyprint-override"><code>$validator = Validator::make($request-&gt;all(), [\n 'name' =&gt; 'required|string|max:255',\n 'email' =&gt; 'required|email|unique:users,email',\n 'password' =&gt; 'required|string|confirmed|min:6',\n 'pan' =&gt; 'required|string|size:10',\n 'gst' =&gt; 'required|string|size:15',\n 'checkbox' =&gt; 'accepted', # to ensures checkbox must be checked\n]);\n</code></pre>\n<p>In blade</p>\n<pre class="lang-html prettyprint-override"><code>&lt;x-input-error :messages=&quot;$errors-&gt;get('pan')&quot; class=&quot;mt-2&quot; style=&quot;color: red;&quot; /&gt;\n\n&lt;x-input-error :messages=&quot;$errors-&gt;get('gst')&quot; class=&quot;mt-2&quot; style=&quot;color: red;&quot; /&gt;\n</code></pre>\n"^^ . + "0"^^ . + . + . + . + . + . + "Compose automatically creates a network named `default` for you, and attaches containers to it. For most setups you should not need `networks:` at all."^^ . + "Hard to tell from the outside what you've done. Can you revert the changes or have a backup? It's probably your best option."^^ . + "2"^^ . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + "This answer has a very high confidence score for AI generated content, and I suspect this is ChatGPT, and should be discarded."^^ . + . + "0"^^ . + . + . + . + "1"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + "OK. Thanks for the additional code but you still haven't explained what debugging you've done, to narrow down the issue? Have you stepped through the code to see which path it takes through your logic? At which line did it fail to do what you expected it to?"^^ . + "Which server did you start at http://127.0.0.1:5000 ? Did you start it before running the login command? I ask, because 5000 is a pretty common development port, probably it was already in use but does not handle the platform.sh project you are developing."^^ . + "0"^^ . + . + . + "0"^^ . + "<p><a href="https://www.yiiframework.com/doc/api/2.0/yii-base-arrayabletrait#toArray()-detail" rel="nofollow noreferrer">toArray</a> calls <a href="https://www.yiiframework.com/doc/api/2.0/yii-base-arrayabletrait#resolveFields()-detail" rel="nofollow noreferrer">resolveFields</a> in order to determine what fields are needed.</p>\n<p>This is what the documentation says:</p>\n<blockquote>\n<p>This method will first extract the root fields from the given fields. Then it will check the requested root fields against those declared in fields() and extraFields() to determine which fields can be returned. This is the source-code of <code>getFields</code>:</p>\n</blockquote>\n<pre><code> /**\n * Determines which fields can be returned by [[toArray()]].\n * This method will first extract the root fields from the given fields.\n * Then it will check the requested root fields against those declared in [[fields()]] and [[extraFields()]]\n * to determine which fields can be returned.\n * @param array $fields the fields being requested for exporting\n * @param array $expand the additional fields being requested for exporting\n * @return array the list of fields to be exported. The array keys are the field names, and the array values\n * are the corresponding object property names or PHP callables returning the field values.\n */\n protected function resolveFields(array $fields, array $expand)\n {\n $fields = $this-&gt;extractRootFields($fields);\n $expand = $this-&gt;extractRootFields($expand);\n $result = [];\n\n foreach ($this-&gt;fields() as $field =&gt; $definition) {\n if (is_int($field)) {\n $field = $definition;\n }\n if (empty($fields) || in_array($field, $fields, true)) {\n $result[$field] = $definition;\n }\n }\n\n if (empty($expand)) {\n return $result;\n }\n\n foreach ($this-&gt;extraFields() as $field =&gt; $definition) {\n if (is_int($field)) {\n $field = $definition;\n }\n if (in_array($field, $expand, true)) {\n $result[$field] = $definition;\n }\n }\n\n return $result;\n }\n</code></pre>\n<p>and of <code>extractRootFields</code>:</p>\n<pre><code> /**\n * Extracts the root field names from nested fields.\n * Nested fields are separated with dots (.). e.g: &quot;item.id&quot;\n * The previous example would extract &quot;item&quot;.\n *\n * @param array $fields The fields requested for extraction\n * @return array root fields extracted from the given nested fields\n * @since 2.0.14\n */\n protected function extractRootFields(array $fields)\n {\n $result = [];\n\n foreach ($fields as $field) {\n $result[] = current(explode('.', $field, 2));\n }\n\n if (in_array('*', $result, true)) {\n $result = [];\n }\n\n return array_unique($result);\n }\n</code></pre>\n<p>We see that if any field equals <code>*</code>, then it returns <code>[]</code>. And of <code>fields()</code>:</p>\n<pre><code> /**\n * Returns the list of fields that should be returned by default by [[toArray()]] when no specific fields are specified.\n *\n * A field is a named element in the returned array by [[toArray()]].\n *\n * This method should return an array of field names or field definitions.\n * If the former, the field name will be treated as an object property name whose value will be used\n * as the field value. If the latter, the array key should be the field name while the array value should be\n * the corresponding field definition which can be either an object property name or a PHP callable\n * returning the corresponding field value. The signature of the callable should be:\n *\n * ```php\n * function ($model, $field) {\n * // return field value\n * }\n * ```\n *\n * For example, the following code declares four fields:\n *\n * - `email`: the field name is the same as the property name `email`;\n * - `firstName` and `lastName`: the field names are `firstName` and `lastName`, and their\n * values are obtained from the `first_name` and `last_name` properties;\n * - `fullName`: the field name is `fullName`. Its value is obtained by concatenating `first_name`\n * and `last_name`.\n *\n * ```php\n * return [\n * 'email',\n * 'firstName' =&gt; 'first_name',\n * 'lastName' =&gt; 'last_name',\n * 'fullName' =&gt; function () {\n * return $this-&gt;first_name . ' ' . $this-&gt;last_name;\n * },\n * ];\n * ```\n *\n * In this method, you may also want to return different lists of fields based on some context\n * information. For example, depending on the privilege of the current application user,\n * you may return different sets of visible fields or filter out some fields.\n *\n * The default implementation of this method returns the public object member variables indexed by themselves.\n *\n * @return array the list of field names or field definitions.\n * @see toArray()\n */\n public function fields()\n {\n $fields = array_keys(Yii::getObjectVars($this));\n return array_combine($fields, $fields);\n }\n</code></pre>\n<p>As we can see, <code>fields()</code> takes into account all fields. <code>resolveFields</code> will add all fields that were either explicitly specified, or, if we received empty array, then all of them. So since your <code>UserModel</code> behaves differently, it's highly probable that it overrides <code>toArray</code>. If not, then you can debug framework/base/ArrayableTrait.php and see how and where is it ending up with no fields.</p>\n"^^ . + "2"^^ . + "that worked! Thank you! I don't get the logic though, since I used my upper code for turning the field into a WYSIWYG-field for other widgets that way. Anyways..."^^ . + . + "0"^^ . + . + ""Convert session data" is probably the wrong way to think about it. Are you trying to send data from the client to the server? (e.g. using AJAX) The example shown doesn't make much sense. If the goal is simply to write a client-side value to the page then you'd do that client-side. PHP wouldn't be involved."^^ . + . + . + . + "@AhmedMahamedAbdallh Can you include your `php.ini` values and `phpinfo()` in your question? @CodeHungerPvtLtd's answer lists the most important ones."^^ . + . + . + . + . + "_"Or should I just forget about this and use htaccess only on the live server?"_ - IMHO, you should forget about this, _and_ not do it on the live system either. Why would _files_ get requested with a trailing slash to begin with, are there links set anywhere with those "wrong" URLs? And why do you want to remove it when the path targets a folder in the first place?"^^ . + . + "0"^^ . + "Check the documentation for this "clouddrive". it seems it doesn't understand the multipart transfers. May be it's webDAV, mey be it's urlencoded transfer, may be something else."^^ . + . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + "libz"^^ . + "0"^^ . + . + "Thanks guys ... Am slowly building the expression and getting there very slowly but at least am making progress and starting to understand the structure more :)\nWill post the complete regex once completed and mark as resolved :)"^^ . + . + . + "2"^^ . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + "2"^^ . + . + "1"^^ . + "0"^^ . + "0"^^ . + . + . + "-1"^^ . + "2"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + "Your script fails when given a full array (5266 codes): https://3v4l.org/k07ip"^^ . + . + . + "I suspect nothing has changed in the output, you're just opening it in a different application. In Excel, that codepoint (the three bytes you're adding) acts as a hint to open as UTF-8; in some text editors, it's invisible; in others, it's shown so that you can see it's there."^^ . + "1"^^ . + . + "0"^^ . + . + "0"^^ . + . + "-3"^^ . + "2"^^ . + "Explained why no duplicate, will write my own answer."^^ . + "5"^^ . + . + . + . + "@MerryX are you check it env file"^^ . + . + . + . + "`s%` should be `%s`."^^ . + "vue.js"^^ . + . + "0"^^ . + . + . + . + . + . + "The query might simply not return any records, for whatever you are passing in as `$column`. In which case you would need to decide, what to do then. You obviously _can't_ make a calculation based on a value that you don't _have_."^^ . + "The file list is in the torrent file’s info block. But you don’t have a torrent file, you have a magnet link with an infohash. So you first have to obtain the torrent file. If you’re up for a programming challenge, you can try to implement the BitTorrent protocol in PHP so you can ask the provided trackers for peers that know about the torrent with that infohash (and/or implement DHT for magnet links without trackers) and then set up the necessary peer-to-peer connections to download the torrent file from those peers. But that won’t be easy."^^ . + . + . + "Also it was trying to use mysqli_free_result on the statements which were not msqli_query types"^^ . + . + "If the server returns status 200 in both cases, then checking for status obviously won't work."^^ . + . + "<p>Finally I ended by writing my own <a href="https://github.com/IonicaBizau/simple-pinecone-php" rel="nofollow noreferrer">PHP wrapper for Pinecone</a>. It is pretty raw, but very intuitive to use by knowing the docs.</p>\n<pre><code>&lt;?php\n require &quot;pinecone.php&quot;;\n\n $pinecone = new Pinecone(PINECONE_API_KEY, PINECONE_HOST);\n $indexes = $pinecone-&gt;getRequest(&quot;https://api.pinecone.io/indexes&quot;);\n\n header(&quot;Content-Type: application/json&quot;);\n\n // List the vector IDs\n $vectorIds = $pinecone-&gt;getRequest(&quot;/vectors/list&quot;, [\n &quot;namespace&quot; =&gt; &quot;example-namespace&quot;\n ]);\n echo json_encode($vectorIds);\n\n // Upsert vector\n $text = &quot;Hello World&quot;;\n\n // Define the function to compute the embedding (via OpenAI etc)\n $embedding = getEmbedding($text);\n $vector = [\n 'id' =&gt; md5($text),\n 'values' =&gt; $embedding,\n 'metadata' =&gt; [\n 'title' =&gt; &quot;Example&quot;\n ]\n ];\n\n // Upsert the vector\n $res = $pinecone-&gt;postRequest(&quot;/vectors/upsert&quot;, [\n &quot;vectors&quot; =&gt; [$vector]\n ]);\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + "*"your use case is nowhere near the limit"* Looks like you're wrong: https://3v4l.org/Jdr6J"^^ . + . + "-2"^^ . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + "0"^^ . + "3"^^ . + "1"^^ . + . + . + . + . + . + . + . + "2"^^ . + "0"^^ . + . + "1"^^ . + . + "1"^^ . + . + . + . + . + "The question isn't suitable for SO. First of all, you need a hosting that's capable of running node, it's unknown if this is your case. "I tried a subdomain but I was unable to run it from there" - it's unknown why. Generally you run node app at some port (e.g. 3000) and use a reverse proxy (nginx or else) to bind 127.0.0.1:3000 to subdomain.yourdomain.com or yourdomain.com/yourpath"^^ . + . + . + "Symfony7 shared installations with cross repo and exclusive feature"^^ . + . + . + "How do I solve this issue regarding collection in vendor line 1443?"^^ . + "`If I had a working example I wouldn't have an issue`...that's not what was meant, surely you realise that. We need you to provide some code that actually demonstrates and proves this issue, because it sounds implausible/impossible based on documentation and what we know of how SQL works. Perhaps you have a very unusual scenario. You've already described it enough times, you need to show us it in practice. the phpize site is ideal for that because you can create a sample database and then have php code to interact with it. That's should be sufficient for demonstrating what you're saying."^^ . + "1"^^ . + . + "Compare the env with the user where it works. Also compare the groups of both users. Linux should be fine, at least has never been wrong to learn for me."^^ . + . + . + "1"^^ . + "Paginated pages not showing for non-logged-in users"^^ . + . + . + "aws-fargate"^^ . + . + "allright, I did:\n\n{"snippet":{"playlistId":"PLD0xxxxxxx","resourceId":{"kind":"youtube#video","videoId":"xxxxxx"}}}\n\nand I dont know what to do with it"^^ . + "0"^^ . + . + . + . + "0"^^ . + "6"^^ . + "Try saving permalinks once again. Go to settings->permalinks-> click save button"^^ . + . + . + "Not that I've found. Believe me, I've used every google search phrase I could come up with. I've seen 1 or 2 examples of how to read a torrent file, but nothing for when you want to start with a magnet link."^^ . + . + . + . + "1"^^ . + "0"^^ . + . + "1"^^ . + . + "-1"^^ . + "<p>I want to have option to buy 2x or 3x product with discount (custom) price.\nIf chosen 2x or 3x all the attributes have same price.</p>\n<p>The issue is that the custom price (e.g., 19.9) is not being applied to the cart item, and the base prices (price: &quot;22.90&quot;, regular_price: &quot;34.90&quot;) are still being used. This indicates that the custom price is not being properly passed to the server or applied to the cart item.</p>\n<ol>\n<li><p>Custom Price Not Applied:\nThe custom price is sent to the server, but it is not being applied to the cart item.\nThe base prices (price, regular_price, sale_price) are still being used.</p>\n</li>\n<li><p>WooCommerce REST API Not Handling Custom Price:\nThe WooCommerce REST API (/wp-json/wc/store/v1/batch) does not natively support custom prices. You need to handle this on the server side.</p>\n</li>\n<li><p>JavaScript and PHP Integration:\nThe JavaScript code sends the custom price to the server, but the PHP code is not properly applying it to the cart item.</p>\n</li>\n</ol>\n<p><strong>To solve this problem, i need to:</strong></p>\n<ol>\n<li><p>Ensure the Custom Price is Passed to the Server:\nThe JavaScript code must send the custom price to the server when adding items to the cart.</p>\n</li>\n<li><p>Apply the Custom Price to the Cart Item:\nUse WooCommerce hooks to override the product price when it is added to the cart.</p>\n</li>\n<li><p>Retain the Custom Price in the Cart Session:\nEnsure the custom price is retained in the cart session after page refresh.</p>\n</li>\n<li><p>Display the Custom Price in the Mini-Cart and Cart Page:\nEnsure the custom price is displayed correctly in the mini-cart and cart page.</p>\n</li>\n</ol>\n<p>My functions code:</p>\n<pre><code>function custom_pricing_options_html() {\n if (!is_product()) return;\n\n global $product;\n\n // Check if the product is simple or variable\n if (!$product-&gt;is_type('simple') &amp;&amp; !$product-&gt;is_type('variable')) return;\n\n $product_id = $product-&gt;get_id();\n $currency = get_woocommerce_currency_symbol();\n\n // Get prices for 1x, 2x, and 3x quantities\n $regular_price = $product-&gt;is_type('variable') \n ? floatval($product-&gt;get_variation_regular_price('min')) \n : floatval($product-&gt;get_regular_price());\n $sale_price = $product-&gt;is_type('variable') \n ? floatval($product-&gt;get_variation_sale_price('min')) \n : floatval($product-&gt;get_sale_price());\n\n // Get custom pricing options from ACF fields\n $price_option_2 = floatval(get_field('pricing_option_2', $product_id)) ?: 0;\n $price_option_3 = floatval(get_field('pricing_option_3', $product_id)) ?: 0;\n\n // Calculate discounts\n $calculate_discount = function($regular, $sale) {\n return ($regular &gt; 0 &amp;&amp; $sale &gt; 0) ? round((($regular - $sale) / $regular) * 100) : 0;\n };\n\n $discount_1 = $calculate_discount($regular_price, $sale_price);\n $discount_2 = $calculate_discount($regular_price, $price_option_2);\n $discount_3 = $calculate_discount($regular_price, $price_option_3);\n\n // Pricing options for 1x, 2x, and 3x\n $pricing_options = [\n 1 =&gt; ['price' =&gt; $sale_price, 'discount' =&gt; $discount_1],\n 2 =&gt; ['price' =&gt; $price_option_2, 'discount' =&gt; $discount_2],\n 3 =&gt; ['price' =&gt; $price_option_3, 'discount' =&gt; $discount_3],\n ];\n\n ob_start();\n ?&gt;\n\n &lt;div class=&quot;pricing-container&quot;&gt;\n &lt;?php foreach ($pricing_options as $qty =&gt; $option) :\n if ($option['price'] &lt;= 0) continue; // Skip empty values\n ?&gt;\n &lt;div class=&quot;pricing-option &lt;?php echo $qty === 1 ? 'selected' : ''; ?&gt;&quot; \n data-qty=&quot;&lt;?php echo esc_attr($qty); ?&gt;&quot; \n data-price=&quot;&lt;?php echo esc_attr($option['price']); ?&gt;&quot; \n data-percent=&quot;&lt;?php echo esc_attr($option['discount']); ?&gt;&quot; \n data-regular=&quot;&lt;?php echo esc_attr($regular_price); ?&gt;&quot; \n data-currency-symbol=&quot;&lt;?php echo esc_attr($currency); ?&gt;&quot;&gt;\n \n &lt;div class=&quot;discount-badge-wrapper&quot;&gt;\n &lt;div class=&quot;discount-badge&quot;&gt;\n &lt;span class=&quot;save-label&quot;&gt;Save&lt;/span&gt; -&lt;?php echo esc_html($option['discount']); ?&gt;%\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;div class=&quot;qty-discount-qty&quot;&gt;&lt;?php echo esc_html($qty); ?&gt;x&lt;/div&gt;\n &lt;span class=&quot;qty-discount-price&quot;&gt;\n &lt;strong&gt;&lt;?php echo esc_html($option['price'] . ' ' . $currency); ?&gt;&lt;/strong&gt;\n &lt;/span&gt;\n &lt;div class=&quot;qty-discount-kos&quot;&gt;per pair&lt;/div&gt;\n &lt;/div&gt;\n &lt;?php endforeach; ?&gt;\n &lt;/div&gt;\n \n &lt;!-- Dynamic price display based on selected option --&gt;\n &lt;div class=&quot;quantity-discount-price&quot;&gt;\n &lt;div class=&quot;price-placeholder&quot;&gt;\n &lt;div class=&quot;variable-price-box&quot;&gt;\n &lt;div class=&quot;left-price-wrapper&quot;&gt;\n &lt;div class=&quot;limited-offer-label&quot;&gt;&lt;?php echo esc_html('Količina: 1'); ?&gt;&lt;/div&gt;\n &lt;div class=&quot;discount-badge-price&quot;&gt;-&lt;?php echo esc_html($discount_1); ?&gt;% popust&lt;/div&gt;\n &lt;/div&gt;\n &lt;div&gt;\n &lt;del&gt;&lt;?php echo esc_html(number_format($regular_price * 1, 2) . ' ' . $currency); ?&gt;&lt;/del&gt;\n &lt;ins&gt;&lt;?php echo esc_html(number_format($sale_price * 1, 2) . ' ' . $currency); ?&gt;&lt;/ins&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n \n &lt;!-- Hidden field to store the selected price --&gt;\n &lt;!--input type=&quot;hidden&quot; id=&quot;custom_price&quot; name=&quot;custom_price&quot; value=&quot;&lt; ?php echo esc_attr($sale_price); ?&gt;&quot;--&gt;\n\n &lt;?php\n echo ob_get_clean();\n}\nadd_action('woocommerce_before_add_to_cart_form', 'custom_pricing_options_html');\n\n\n// Add hidden input field for both product types\nadd_action('woocommerce_before_add_to_cart_button', 'custom_hidden_product_field', 11);\nfunction custom_hidden_product_field() {\n global $product;\n \n // Get initial price based on product type\n if ($product-&gt;is_type('variable')) {\n $price = $product-&gt;get_variation_price('min', true);\n } else {\n $price = $product-&gt;get_sale_price() ?: $product-&gt;get_regular_price();\n }\n \n echo '&lt;input type=&quot;hidden&quot; id=&quot;custom_price&quot; name=&quot;custom_price&quot; class=&quot;custom_price&quot; value=&quot;' . esc_attr($price) . '&quot;&gt;';\n}\n\n// Save custom price for both product types\nadd_filter('woocommerce_add_cart_item_data', 'save_custom_fields_data_to_cart', 10, 3);\nfunction save_custom_fields_data_to_cart($cart_item_data, $product_id, $variation_id) {\n error_log('POST data: ' . print_r($_POST, true));\n \n if (!empty($_POST['custom_price'])) {\n $custom_price = floatval(sanitize_text_field($_POST['custom_price']));\n \n // For variable products, store both product and variation ID\n if ($variation_id) {\n $cart_item_data['custom_price'] = $custom_price;\n $cart_item_data['variation_id'] = $variation_id;\n } \n // For simple products\n else {\n $cart_item_data['custom_price'] = $custom_price;\n }\n \n $cart_item_data['unique_key'] = md5(microtime().rand());\n \n } else {\n error_log('Missing custom_price for product ID: ' . $product_id);\n if ($variation_id) {\n error_log('Variation ID: ' . $variation_id);\n }\n }\n return $cart_item_data;\n}\n\n// Price display adjustments (same as before)\nadd_action('woocommerce_cart_item_price', 'filter_cart_item_price', 10, 2);\nfunction filter_cart_item_price($price, $cart_item) {\n if (isset($cart_item['custom_price'])) {\n $args = ['price' =&gt; floatval($cart_item['custom_price'])];\n $product_price = WC()-&gt;cart-&gt;display_prices_including_tax() \n ? wc_get_price_including_tax($cart_item['data'], $args) \n : wc_get_price_excluding_tax($cart_item['data'], $args);\n return wc_price($product_price);\n }\n return $price;\n}\n\n// Price calculation (same as before)\nadd_action('woocommerce_before_calculate_totals', 'change_cart_item_price', 30, 1);\nfunction change_cart_item_price($cart) {\n if (is_admin() &amp;&amp; !defined('DOING_AJAX')) return;\n \n foreach ($cart-&gt;get_cart() as $cart_item) {\n if (!empty($cart_item['custom_price'])) {\n $cart_item['data']-&gt;set_price($cart_item['custom_price']);\n }\n }\n}\n</code></pre>\n<p>My javascript:</p>\n<pre><code>\njQuery(document).ready(function($) {\n const $body = $('body');\n const $pricingOptions = $('.pricing-option');\n const $customPrice = $('#custom_price');\n const $variationsForm = $('form.variations_form');\n const $addToCartButton = $('.single_add_to_cart_button');\n\n // Event delegation for pricing options\n $body\n .on('click', '.pricing-option', function () {\n $pricingOptions.removeClass('selected');\n $(this).addClass('selected');\n const qty = $(this).data('qty'); \n\n // Update the hidden input field\n const price = $(this).data('price'); // Get the selected price\n console.log('Selected Price:', price);\n \n $('#custom_price').val(price);\n console.log('Updated hidden input value:', $('#custom_price').val()); // Debug\n\n duplicateVariationSelection(qty);\n updatePriceTotal();\n updateSimpleQuantity(qty);\n maybeDisableVariableAddToCartButton();\n })\n .on('click', '.qty-appended .filter-item-list li', function () {\n $(this).parents('.qty-appended').find('.filter-item-list li').removeClass('active');\n $(this).addClass('active');\n maybeDisableVariableAddToCartButton();\n })\n .on('click', '.product-type-variable .single_add_to_cart_button', function (e) {\n e.preventDefault();\n\n const selectedPrice = $('#custom_price').val();\n console.log('Price sent to server:', selectedPrice);\n\n if ($(this).hasClass('wc-variation-selection-needed') &amp;&amp; $('.qty-appended').length &gt; 0) {\n alert('Please select all variations before adding to cart.');\n return;\n }\n\n // Add the product to the cart using WooCommerce's standard AJAX add-to-cart\n addAppendedItemsToCart(selectedPrice);\n });\n\n // Duplicate variations based on selected quantity\n function duplicateVariationSelection(qty) {\n if ($('.product-type-variable').length &lt;= 0) return;\n\n const label = $('.variations .label label').first().text();\n const list = $('.variations .value ul.filter-item-list').clone().html().replace(/active/g, '');\n\n $('.qty-appended').remove(); // Remove previous appended rows\n\n for (let i = 2; i &lt;= qty; i++) {\n $('.variations tbody').append(`\n &lt;tr class=&quot;qty-appended qty-${i}&quot;&gt;\n &lt;th class=&quot;label&quot;&gt;&lt;label&gt;${label} ${i}&lt;/label&gt;&lt;/th&gt;\n &lt;td&gt;&lt;ul class=&quot;filter-item-list&quot;&gt;${list}&lt;/ul&gt;&lt;/td&gt;\n &lt;/tr&gt;\n `);\n }\n\n maybeDisableVariableAddToCartButton();\n }\n\n // Enable/disable the &quot;Add to Cart&quot; button based on selected variations\n function maybeDisableVariableAddToCartButton() {\n const totalAppended = $('.qty-appended').length;\n const totalSelected = $('.filter-item-list li.active').length;\n\n $addToCartButton.prop('disabled', totalAppended + 1 !== totalSelected);\n }\n\n // Add items to the cart\n function addAppendedItemsToCart(selectedPrice) {\n // Disable button\n $('.single_add_to_cart_button').prop('disabled', true);\n\n const attributeName = $('[data-attribute_name]').data('attribute_name'); // attribute_size\n const variationData = $('[data-product_variations]').data('product_variations');\n const totalAppended = $('.qty-appended').length;\n let cartData = [];\n\n let itemAttributeOriginal = $('table.variations tr:not(.qty-appended) li.active a').data('value');\n\n // Original selected variation. \n $.each(variationData, function (key, value) {\n if (value['attributes'][attributeName] === itemAttributeOriginal) {\n cartData.push({\n path: '/wc/store/v1/cart/add-item',\n method: 'POST',\n cache: 'no-store',\n headers: { 'Nonce': product_js_vars.woononce },\n body: {\n id: value.variation_id,\n quantity: 1,\n custom_price: selectedPrice // Make sure this is included\n }\n });\n }\n });\n\n // If multiple appended\n if ($('.qty-appended').length &gt; 0) {\n for (let i = 1; i &lt; totalAppended + 1; i++) {\n let counter = i + 1;\n const itemAttribute = $(`.qty-${counter} .filter-item-list li.active a`).data('value');\n \n $.each(variationData, function (key, value) {\n if (value['attributes'][attributeName] === itemAttribute) {\n cartData.push({\n path: '/wc/store/v1/cart/add-item',\n method: 'POST',\n cache: 'no-store',\n headers: {\n 'Nonce': product_js_vars.woononce\n },\n body: {\n id: value.variation_id,\n quantity: 1,\n custom_price: selectedPrice\n }\n });\n } \n });\n }\n }\n\n $.ajax({\n url: '/wp-json/wc/store/v1/batch',\n method: 'POST',\n dataType: 'json',\n headers: {\n 'Nonce': product_js_vars.woononce\n },\n data: JSON.stringify({\n requests: cartData\n }),\n contentType: 'application/json',\n success: function(response) {\n $('.single_add_to_cart_button').prop('disabled', false);\n $(document.body).trigger('added_to_cart');\n console.log(&quot;Items added to cart:&quot;, response);\n },\n error: function(xhr) {\n console.error('Error adding item to cart:', xhr.responseJSON);\n }\n });\n }\n \n // Add this to ensure price updates for variable products\n $variationsForm.on('show_variation', function(event, variation) {\n $('#custom_price').val(variation.display_price);\n });\n\n // Update the displayed price\n function updatePriceTotal() {\n const selectedOption = $('.pricing-option.selected');\n const price = selectedOption.data('price');\n const qty = selectedOption.data('qty');\n const percent = selectedOption.data('percent');\n const regular = selectedOption.data('regular');\n const currency = selectedOption.data('currency-symbol');\n\n const totalRegular = (regular * qty).toFixed(2);\n const totalPrice = (price * qty).toFixed(2);\n\n $('.price-placeholder').html(`\n &lt;div class=&quot;variable-price-box&quot;&gt;\n &lt;div class=&quot;left-price-wrapper&quot;&gt;\n &lt;div class=&quot;limited-offer-label&quot;&gt;Quantity: ${qty}&lt;/div&gt;\n &lt;div class=&quot;discount-badge-price&quot;&gt;-${percent}% discount&lt;/div&gt;\n &lt;/div&gt;\n &lt;div&gt;\n &lt;del&gt;${totalRegular} ${currency}&lt;/del&gt;\n &lt;ins&gt;${totalPrice} ${currency}&lt;/ins&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n `);\n }\n\n // Update quantity for simple products\n function updateSimpleQuantity(qty) {\n if ($('.product-type-variable').length &gt; 0) return;\n $('form.cart .quantity input.qty').val(qty).trigger('change');\n }\n \n console.log('Final hidden price before submit:', $('#custom_price').val());\n});\n\n</code></pre>\n"^^ . + . + "Laravel: ResetPassword::createUrlUsing has no affect in AppServiceProvider's boot method"^^ . + . + . + . + "Thanks. Data format could still be made easier for us to re-use. Also, how fast does this run currently, for given sizes of array? Is the speed giving you problems? How much of an improvement would be useful?"^^ . + . + "0"^^ . + . + "<p>Due to a refactoring I have the use case to throw a LogicException if, and only if, a certain class instance is serialized via <code>json_encode</code>. (Currently, a lot of serialization happens silently under the hood, generating broken/empty data structures, yet the code runs fine as no error is thrown. I prefer Exceptions to really catch all the places.)</p>\n<p>E.g.:</p>\n<pre><code>class ValueObject\n{\n public function __construct(public string $someProperty)\n {\n }\n}\n$an_object = new ValueObject('example');\n$result = json_encode($an_object, JSON_PRETTY_PRINT); // this should throw as an instance of ValueObject is passed\necho $result;\n</code></pre>\n<p>This should also work if the instances appear nested, e.g. in an array but also as part of other object's properties:</p>\n<pre><code>$nested_array = [\n [\n 'foo',\n new ValueObject('foo'),\n new ValueObject('GNARF'),\n ],\n 'gnarf' =&gt; new ValueObject('poit'),\n];\n$nested_result = json_encode($nested_array, JSON_PRETTY_PRINT); // should fail too\necho $nested_result;\n</code></pre>\n"^^ . + . + "You forgot to tell us what the specific error is when you try to access the server. But yes the most likely issue is that you didn't use the publicly-accessible IP. If the server is on a standard domestic internet connection you also probably have a dynamic public IP issued by your ISP which may change every so often. [dynamic DNS](https://www.cloudflare.com/en-gb/learning/dns/glossary/dynamic-dns/) can help your domain name stay in sync with the IP changes."^^ . + . + "@HEXALIX the pretty much default WP .htaccess you suggested, lets requests for existing files pass through unmodified, and the screenshots from network panel already suggest that the resources loaded fine, and also appeared to contain actual CSS code ... So I doubt this will change anything. And since they are still in the process of installing WP here, the fact that there currently isn't a .htaccess file doesn't mean much either, because WP will create the file itself during the installation process."^^ . + . + "`Does it matter if file size is less than 3mb?`...you should still be able to use the large file upload for small files, it just might be slightly less efficient, and is obviously a bit more complex to code - but the sample provided should take the strain of most of that, you just need to provide the file. But might be better than having two different processes behind the scenes (obviously it wouldn't change anything in your front-end)"^^ . + "Azure WebJobs with WordPress WebApp?"^^ . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + "xml"^^ . + . + . + "Please share more details about this. How is Symfony UX related to the problem at all? The code you've shared doesn't mention it at all"^^ . + . + . + "@disinfor I don’t think that’s the issue. I’ve already tried changing both the path and the route, but it still doesn’t work."^^ . + "2"^^ . + . + "PHP: pcntl_exec does not work even when valid executable path provided"^^ . + "-3"^^ . + . + . + . + . + "3"^^ . + . + "0"^^ . + "1"^^ . + . + . + "0"^^ . + "0"^^ . + "Keep in mind that Laravel 9 is EOL since Feb 2024. Maybe you're facing any bug or incompatibility with the PHP version you're using?"^^ . + "I'm building a WordPress plugin that fetches blog data via API and posts it as an 'editor' user, but WordPress strips iframe tags"^^ . + . + . + . + "@KenLee It's probably useful for people who think that typing in the code, letter by letter, is what takes the longest when coding."^^ . + . + . + . + "1"^^ . + . + . + . + . + "Ideally you should normalize your database, using another table to hold associative data (one row per key). If you really need to keep the associative array, you could convert it to JSON, as MySQL has built-in JSON functions. But lots of things still aren't easy, like searching arrays."^^ . + . + "0"^^ . + . + . + "1"^^ . + . + . + . + "In your $group stage, you have put `'$tipoDocumentoIdentificacion'` and `'$numDocumentoIdentificacion'`. So your result look like this: https://mongoplayground.net/p/06UBpXV4YhG Those fields don't exist at the **top-level** so the group `_id` is null and it becomes just a count of all documents. Those lines should be `'$usuarios.tipoDocumentoIdentificacion'` and `'$usuarios.numDocumentoIdentificacion'` because they are still under the `usuarios` field, even after unwinding. Then your result would be: https://mongoplayground.net/p/Wv6jHudEOom"^^ . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + "<p>Thanks to help from comments i fixed this error by passing in $pdo into my call statement and including a while loop for my options instead of select and it has come out exactly has hoped for, my code now is:</p>\n<pre class="lang-php prettyprint-override"><code>\n &lt;?php displayST($pdo)?&gt;\n\n</code></pre>\n<p>and:</p>\n<pre class="lang-php prettyprint-override"><code>\n function displayST(object $pdo)\n {\n $query = &quot;SELECT * FROM icons ;&quot;;\n $stmt = $pdo-&gt;prepare($query);\n $stmt-&gt;execute();\n\n\n echo &quot;&lt;select name='ST' class='player' id='ST1'&gt;&quot;;\n while ($row = $stmt-&gt;fetch(PDO::FETCH_ASSOC) ){\n echo &quot;&lt;option value=echo $row[lastName]' $row[firstName]'&gt;$row[lastName] $row[firstName]&lt;/option&gt;&quot;;\n }\n}\n\n</code></pre>\n"^^ . + . + . + . + . + "1"^^ . + "<p>There is no readily available method to automatically convert data passed to <code>load()</code> method. Your options are:</p>\n<ol>\n<li>Convert the data in array before you pass them to <code>load()</code> method.</li>\n<li>Override <code>load()</code> method in your top level DTO to do the conversion before passing the data to <code>parent::load()</code> call.</li>\n<li>Force the access to your <code>OrderDto::$orderedProducts</code> to go through getter/setter and do the conversion in the setter.</li>\n</ol>\n<p>Overriding <code>load()</code> method might look like this:</p>\n<pre class="lang-php prettyprint-override"><code>class OrderDto extends Model\n{\n public function load($data, $formName = null)\n {\n $scope = $formName === null ? $this-&gt;formName() : $formName;\n if ($scope === '' &amp;&amp; !empty($data)) {\n $data = $this-&gt;transformData($data);\n } elseif (isset($data[$scope])) {\n $data[$scope] = $this-transformData($data[$scope]);\n }\n return parent::load($data, $formName);\n }\n\n private function transformData($data)\n {\n // ... logic to transform array data to lower level DTOs\n }\n \n //... other OrderDto stuff\n}\n</code></pre>\n<p>Forcing access through getters/setters might look like this:</p>\n<pre class="lang-php prettyprint-override"><code>class OrderDto extends Model\n{\n private $_orderedProduct;\n\n public function getOrderedProduct()\n {\n return $this-&gt;_orderedProduct;\n }\n\n public function setOrderedProduct($data)\n {\n // ... logic to convert array data to lower level DTOs\n $this-&gt;_orderedProduct = $data;\n }\n \n // ... other OrderDto stuff\n}\n</code></pre>\n<p>Making sure that <code>setOrderedProduct()</code> method exists but <code>$orderedProduct</code> property doesn't exist will make sure that <code>setAttribute()</code> method called inside <code>Model::load()</code> will use setter instead of directly assigning value to property.</p>\n"^^ . + "1"^^ . + . + . + . + "2"^^ . + . + . + "0"^^ . + . + . + "2"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + "Should I upload the `composer.json`, `composer.lock` and the `.env` files also to server as well?"^^ . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + . + "taxonomy-terms"^^ . + . + . + . + . + . + "1"^^ . + "<p>I encountered an issue where paths couldn't be resolved properly in my vanilla PHP projects using Laravel Herd. The system would only recognize <code>index.php</code> files. For example, when accessing <code>http://x.test/case-studies</code>, it wouldn't resolve to <code>http://x.test/case-studies.php</code>, even though that was the expected behavior.</p>\n<p>To address this, I implemented a custom driver that fixed the issue, allowing the system to correctly resolve paths without requiring the .php extension. However, now when accessing <code>http://x.test/services/</code>, it should automatically route to <code>http://x.test/services/index.php</code>. Instead, I'm encountering a 404 error.</p>\n<p><strong>Error 1</strong></p>\n<blockquote>\n<p>2025/03/05 10:45:18 [error] 90478#1248117: *34 &quot;Users/jack-brogan/Herd/x/html/services//index.html&quot; is not found (2: No such file or directory), client: 127.0.0.1, server: , request: &quot;GET /services/ HTTP/1.1&quot;, upstream: &quot;fastcgi://unix:/Users/jack-brogan/Library/Application Support/Herd/herd.sock&quot;, host: &quot;x.test&quot;, referrer: &quot;</p>\n</blockquote>\n<p>I'm unsure as to why its being resolved with two forward slashes at the end of <code>Users/jack-brogan/Herd/x/html/services//</code> and also why its looking for the <code>index.html</code> and not <code>index.php</code>.</p>\n<p><strong>Error 2</strong></p>\n<blockquote>\n<p>2025/03/05 10:45:18 [error] 90478#1248117: *34 FastCGI sent in stderr: &quot;PHP message: Servers is truePHP message: Current site path: /Users/jack-brogan/Herd/x/htmlPHP message: Current URI: /favicon.icoPHP message: Raw URI: /favicon.icoPHP message: sitepath 1: /Users/jack-brogan/Herd/x/html/favicon.ico.phpPHP message: sitepath 2: /Users/jack-brogan/Herd/x/html/favicon.ico/index.php&quot; while reading response header from upstream, client: 127.0.0.1, server: , request: &quot;GET /favicon.ico HTTP/1.1&quot;, upstream: &quot;fastcgi://unix:/Users/jack-brogan/Library/Application Support/Herd/herd.sock:&quot;, host: &quot;x.test&quot;, referrer: &quot;http://x.test/services/&quot;</p>\n</blockquote>\n<p><strong>Driver</strong></p>\n<pre><code>// namespace Valet\\Drivers;\n\nuse Valet\\Drivers\\ValetDriver;\n\nclass LocalValetDriver extends ValetDriver\n{\n /**\n * Determine if the driver serves the request.\n */\n public function serves(string $sitePath, string $siteName, string $uri): bool\n {\n if (file_exists($sitePath . '/index.php')) {\n return true;\n }\n return true;\n // return file_exists($sitePath . $uri . '.php');\n }\n\n /**\n * Resolve the incoming request to a valid PHP script.\n */\n public function isStaticFile($sitePath, $siteName, $uri)\n {\n if (file_exists($staticFilePath = $sitePath . $uri)) {\n return $staticFilePath;\n }\n\n return false;\n }\n\n /**\n * Directs Nginx to the correct file.\n */\n public function frontControllerPath(string $sitePath, string $siteName, string $uri): string\n {\n\n error_log(&quot;Current site path: &quot; . $sitePath);\n error_log(&quot;Current URI: &quot; . $uri);\n error_log(&quot;Raw URI: &quot; . $_SERVER['REQUEST_URI']);\n \n // Check if request is for a PHP file\n if (file_exists($sitePath . $uri . '.php')) {\n return $sitePath . $uri . '.php';\n }\n\n // Default to index.php if no other match is found\n return $sitePath . $uri . '/index.php'; // Ensure correct path to index.php\n }\n}\n</code></pre>\n<p>It seems to be correctly going through the serves method but the issue is with the <code>frontControllerPath</code>.</p>\n"^^ . + . + . + . + "Yes i was going to do that, but my solution is not complete yet. I can't get any transcriptions even while the stream runs successfully. please can you help with that @hakre"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + "It looks like it. I haven't personally used the NativeQuery class myself, but [their documentation here](https://www.doctrine-project.org/projects/doctrine-orm/en/3.3/reference/native-sql.html) looks pretty straightforward. Hopefully someone with a little more hands-on experience with it can provide a more definitive answer."^^ . + . + "-5"^^ . + "Hmm, last time I looked the previously suggested [_Custom Validation Rules_ (Laravel Validation)](https://laravel.com/docs/validation#custom-validation-rules) are still a thing. As you ask what can be improved _after_ answering, consider that and make it a _concrete_, but new question as it is now different."^^ . + . + "How can I show it to you? Should I create a new answer?"^^ . + . + . + "1"^^ . + . + . + . + . + "<pre><code>function 3rd_party(){\n $cookie_path = __DIR__ . '/cookies.txt';\n $ch = curl_init();\n \n curl_setopt($ch, CURLOPT_URL, 'xyz.com');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n \n curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');\n curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_path);\n $headers = array();\n $headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7';\n $headers[] = 'Accept-Language: en-IN,en-GB;q=0.9,en-US;q=0.8,en;q=0.7';\n $headers[] = 'Connection: keep-alive';\n $headers[] = 'Sec-Fetch-Dest: document';\n $headers[] = 'Sec-Fetch-Mode: navigate';\n $headers[] = 'Sec-Fetch-Site: none';\n $headers[] = 'Upgrade-Insecure-Requests: 1';\n $headers[] = 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36';\n $headers[] = 'Sec-Ch-Ua: \\&quot;Not-A.Brand\\&quot;;v=\\&quot;99\\&quot;, \\&quot;Chromium\\&quot;;v=\\&quot;124\\&quot;';\n $headers[] = 'Sec-Ch-Ua-Mobile: ?0';\n $headers[] = 'Sec-Ch-Ua-Platform: \\&quot;Linux\\&quot;';\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n $result = curl_exec($ch);\n if (curl_errno($ch)) {\n echo 'Error:' . curl_error($ch);\n }\n curl_close($ch);\n echo(file_get_contents($cookie_path));\n}\n</code></pre>\n<p>It says:</p>\n<blockquote>\n<p>Warning: file_get_contents(/storage/emulated/0/htdocs/cookies.txt):\nFailed to open stream: No such file or directory in\n/storage/emulated/0/htdocs/k.php on line 31</p>\n</blockquote>\n<p>and from second request it start returning data but previous one like when i run it second time it return cookie that received from 1st request</p>\n<p>The problem is that it don't save cookie even i closed curl</p>\n<p>What is the solution</p>\n<p>When i check cookies after function close it works but not working when check from inside function</p>\n"^^ . + . + "It's $buttonPin = $gpio->getInputPin(3);\n\nAs for PHP 8, I was just speculating. I know sometimes newer version of PHP can cause libraries to fail."^^ . + . + . + . + "Google takes a little more time to update the favicon for your website. Please wait a few more days."^^ . + "0"^^ . + . + "1"^^ . + "domdocument"^^ . + . + "<p>In complement to @LoicTheAztec answer, I use this hook :</p>\n<pre><code>woocommerce_payment_complete\n</code></pre>\n<p>The code :</p>\n<pre><code>#[Action('woocommerce_payment_complete')]\nfunction validate_newsletter_opt_in($order_id)\n{\n $order = wc_get_order($order_id);\n $newsletter_opt_in = $order-&gt;get_meta('newsletter_opt_in');\n\n if ($newsletter_opt_in) {\n $email = $order-&gt;get_billing_email();\n\n if ($email) {\n //here the code to subscribe\n }\n }\n}\n</code></pre>\n"^^ . + . + . + "garbage-collection"^^ . + "<p>I have code that looks more or less like this:</p>\n<p>It's not my actual code, but just to show the concept of what I'm trying to do:</p>\n<p>I have a form where each individual field is required and then some checks are run on the values of multiple fields in combination.</p>\n<pre class="lang-php prettyprint-override"><code>class testForm extends AbstractType\n{\n public function configureOptions(OptionsResolver $resolver)\n {\n $resolver-&gt;setDefault(\n 'constraints', \n [new Callback(\n ['callback' =&gt; function (\n $payload, \n ExecutionContextInterface $context\n ) \n {\n $data = $context-&gt;getObject()-&gt;getData();\n\n if (strcasecmp($data['field1'], $data['field2']))\n {\n $context\n -&gt;buildViolation('fields must be equal')\n -&gt;atPath('[field1]')\n -&gt;addViolation();\n }\n }\n ]\n )]\n );\n }\n\n public function buildForm(FormBuilderInterface $builder, array $options)\n {\n $builder\n -&gt;add('field1', TextType::class, ['constraints' =&gt; [new NotBlank]])\n -&gt;add('field2', TextType::class, ['constraints' =&gt; [new NotBlank]]);\n }\n}\n</code></pre>\n<p>The problem I'm having with this code is that it will throw a notice when you submit with empty fields (null is not allowed as parameters for string functions like <em>strcasecmp()</em> since PHP 8.0).</p>\n<p>AFAICT this is because the parent validation runs before the child validation, so it only checks if the fields have values after the upper level validation has run.</p>\n<p>What I am looking for is a way to reverse this, i.e. run the child validation before the parent validation is called. Looking at the Symfony documentation, there's a <em>Valid</em> constraint that seems to do exactly that, but it only seems to work with entities (my form doesn't use an entity, but a simple DTO).</p>\n<p>So I remain wondering about a way to either make <em>Valid</em> work without entities, or some other way to remedy the constraints of doing this.</p>\n"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + "Maybe `php artisan optimize:clear` helps..."^^ . + . + . + "dompdf/dompdf showing up on machines that don't have composer installed, resulting in missing classes from the library"^^ . + "@IamArobot I also created a brand-new installation, and it just works. Right now is difficult to guess what's wrong, since with the exact same steps (plus adding a working user provider), I'm able to login successfully."^^ . + "1"^^ . + . + . + "<pre class="lang-php prettyprint-override"><code>Route::group([\n 'prefix' =&gt; LaravelLocalization::setLocale(),\n 'middleware' =&gt; ['localeSessionRedirect', 'localizationRedirect', 'localeViewPath']\n], function () {\n Route::get('/', function () {\n return view('welcome');\n })-&gt;name('home');\n\n require __DIR__ . '/dash.php';\n});\n</code></pre>\n<hr />\n<ul>\n<li>Request URL: <a href="http://127.0.0.1:8000/livewire/update" rel="nofollow noreferrer">http://127.0.0.1:8000/livewire/update</a></li>\n<li>Request Method: POST</li>\n<li>Status Code: 404 (Not Found)</li>\n<li>Remote Address: 127.0.0.1:8000</li>\n<li>Referrer Policy: strict-origin-when-cross-origin</li>\n</ul>\n<p>My issue is that when I use the camera to capture routes and add a local language, the Livewire update component throws a 404 error for actions like delete or search. However, if I use any route without this package, Livewire works fine. Please help me solve this issue.</p>\n"^^ . + "testing"^^ . + . + . + . + . + . + "0"^^ . + "The script always finishes without error, it never fails. But when run via php it runs *too fast* without waiting for the install/build to finish before running the copy command. I don't have it in front of me right now but when I get to my computer I'll paste the output, it is being logged to the db"^^ . + . + "2"^^ . + "0"^^ . + . + "Okay, I also wondered because you should have seen a fatal. Now replace `: self` with `: static` on that functions return value, otherwise it remains true that _Transaction_ has no method named _setDueDate_. It may also for the trait, but I'm not sure just quick. I'll also test in Phpstorm if you like."^^ . + "0"^^ . + . + . + . + . + . + "radio-button"^^ . + ""it would have the incorrect/the wrong signers signature on it." - NOPE, of course it wouldn't. It would have wrong signers *linked* to it, but the signer verification will obviously FAIL"^^ . + . + . + "0"^^ . + . + "Just a tip: You can use an easily readable/editable array in PHP and then convert it to an URL query string using: [http_build_query()](https://www.php.net/manual/en/function.http-build-query.php) See: https://3v4l.org/b20XN (partial example). You should not try to create the query string itself with custom code."^^ . + . + . + "Apache only serve files if requested by certain resources?"^^ . + . + . + . + . + "1"^^ . + . + "2"^^ . + . + . + . + "https://www.php.net/manual/en/book.sqlite3.php"^^ . + . + "<p>Yes, setting headers in AJAX requests is a crucial part of CSRF (Cross-Site Request Forgery) protection. Most frameworks use <strong>CSRF tokens</strong> to verify that the request originates from a trusted source. Here’s how it typically works:</p>\n<h3>1. <strong>CSRF Token in Headers</strong></h3>\n<p>Many web frameworks generate a CSRF token and expect it in AJAX requests. You must include it in the headers when making a request.</p>\n<p>For example, in <strong>jQuery AJAX</strong>:</p>\n<pre><code>$.ajax({\n url: &quot;/your-endpoint&quot;,\n type: &quot;POST&quot;,\n headers: {\n &quot;X-CSRF-TOKEN&quot;: $('meta[name=&quot;csrf-token&quot;]').attr('content') // Extracting from meta tag\n },\n data: { key: &quot;value&quot; },\n success: function(response) {\n console.log(&quot;Success&quot;, response);\n }\n});\n</code></pre>\n<p>In <strong>Fetch API</strong>:</p>\n<pre><code>fetch(&quot;/your-endpoint&quot;, {\n method: &quot;POST&quot;,\n headers: {\n &quot;Content-Type&quot;: &quot;application/json&quot;,\n &quot;X-CSRF-TOKEN&quot;: document.querySelector('meta[name=&quot;csrf-token&quot;]').getAttribute(&quot;content&quot;)\n },\n body: JSON.stringify({ key: &quot;value&quot; })\n})\n.then(response =&gt; response.json())\n.then(data =&gt; console.log(data));\n</code></pre>\n<h3>2. <strong>Laravel, Django, and Other Frameworks</strong></h3>\n<ul>\n<li><p><strong>Laravel</strong> automatically includes the CSRF token in a meta tag (<code>&lt;meta name=&quot;csrf-token&quot; content=&quot;your_token&quot;&gt;</code>).</p>\n</li>\n<li><p><strong>Django</strong> expects it in the request header as <code>X-CSRFToken</code>.</p>\n</li>\n</ul>\n<h3>3. <strong>Using <code>withCredentials</code> for Cookies (Same-Site Protection)</strong></h3>\n<p>If your CSRF token is stored in a cookie, you must send credentials:</p>\n<pre><code>fetch(&quot;/your-endpoint&quot;, {\n method: &quot;POST&quot;,\n credentials: &quot;include&quot;, // Ensures cookies are sent\n headers: {\n &quot;X-CSRF-TOKEN&quot;: getCsrfTokenFromCookie() // Function to get token from cookies\n }\n});\n</code></pre>\n<h3><strong>When You DON'T Need Headers</strong></h3>\n<ul>\n<li><p>If you're using <strong>Same-Site cookies</strong> (<code>SameSite=Strict</code> or <code>SameSite=Lax</code>), they inherently prevent CSRF.</p>\n</li>\n<li><p>If your framework has <strong>middleware handling CSRF with session tokens</strong>, you may not need explicit headers.</p>\n</li>\n</ul>\n<h3></h3>\n"^^ . + . + . + "<p>I have a string of text and a series of words:</p>\n<pre><code>String: Auch ein blindes Huhn findet einmal ein Korn.\nWords: auch, ein, sehendes\n</code></pre>\n<p>I want to check which of the words is contained in the string. I am using <code>preg_match_all</code> for that:</p>\n<pre><code>$pattern = &quot;/\\bauch\\b|\\bein\\b|\\bsehendes\\b/i&quot;;\n$subject = &quot;Auch ein blindes Huhn findet einmal ein Korn.&quot;;\n\npreg_match_all($pattern, $subject, $matches);\nprint_r($matches);\n\nArray\n(\n [0] =&gt; Array\n (\n [0] =&gt; Auch\n [1] =&gt; ein\n [2] =&gt; ein\n )\n\n)\n</code></pre>\n<p>This works as expected, but since I have to edit the pattern frequently, and I find it confusing to find and replace words when they are all surrounded by word boundary anchors (<code>\\b</code>), I would like to define the list of words <em>without</em> the word boundary anchors and add them in a second step. Something like:</p>\n<pre><code>$pattern = &quot;auch|ein|sehendes&quot;;\n$pattern = &quot;/\\b&quot; . $pattern . &quot;\\b/i&quot;;\n</code></pre>\n<p>That, of course, doesn't work as expected.</p>\n<p>I could fill an array with the words and loop over it to build the pattern, but I'd like to avoid loops. Any ideas how to do this <em>fast?</em> The real string and the real number of words are quite large.</p>\n<p>Eventually I need the number of matches, as it is returned by <code>preg_match_all</code>. For the example the expected output is &quot;3&quot;.</p>\n<hr />\n<p>Here is a similar question where this is done in Javascript: <a href="https://stackoverflow.com/questions/49238835/apply-a-word-boundary-anchor-to-all-tokens-in-a-single-regex">Apply a word-boundary anchor to all tokens in a single regex</a></p>\n"^^ . + "<p>I have a custom post type in WordPress called Resources and a custom taxonomy called Resource Type. I want the URLs to be:</p>\n<p>CPT: site-url/custom-tax/post-title</p>\n<p>Taxonomy Archive: site-url/resources/custom-tax/</p>\n<p>Archive: site-url/resources</p>\n<p>The code below works to get what I want but it 404s the other archive pages - blog, author etc. I've only included the code that is not working. I have pinpointed it to the post type slug %resource-type% that breaks the other archives. How do I get the other archive pages working?</p>\n<pre><code>/* ## Resources ## */\nfunction register_resource_post_type() {\n $args = array(\n 'rewrite' =&gt; array(\n 'slug' =&gt; '%resource-type%',\n 'with_front' =&gt; false\n ),\n );\n register_post_type('resource', $args);\n}\nadd_action('init', 'register_resource_post_type');\n\n/* ## Resource Types ## */\nfunction register_resource_type_taxonomy() {\n $args = array(\n 'rewrite' =&gt; array(\n 'slug' =&gt; 'resources',\n 'with_front' =&gt; false,\n ),\n );\n register_taxonomy('resource-type', array('resource'), $args);\n}\nadd_action('init', 'register_resource_type_taxonomy');\n\n\n/* # Permalink Rewrite # */\n\nfunction wpd_taxonomy_pagination_rewrites(){\n add_rewrite_rule(\n 'resource-type/([^/]+)/page/([0-9]+)/?$',\n 'index.php?resource-type=$matches[1]&amp;paged=$matches[2]',\n 'top'\n );\n}\nadd_action( 'init', 'wpd_taxonomy_pagination_rewrites' );\n\nfunction wpd_post_link( $post_link, $id = 0 ){\n $post = get_post($id); \n if ( is_object( $post ) &amp;&amp; $post-&gt;post_type == 'resource' ){\n $terms = wp_get_object_terms( $post-&gt;ID, 'resource-type' );\n if( $terms ){\n foreach( $terms as $term ){\n if( 0 == $term-&gt;parent ){\n return str_replace( '%resource-type%' , $term-&gt;slug , $post_link );\n }\n }\n } else {\n return str_replace( '%resource-type%' , 'uncategorized', $post_link );\n }\n }\n return $post_link;\n}\nadd_filter( 'post_type_link', 'wpd_post_link', 1, 3 );\n</code></pre>\n"^^ . + "<ol>\n<li><p><strong>Flush Rewrite Rules</strong></p>\n<ul>\n<li><p>Add this temporarily in <code>functions.php</code> and visit the site once:</p>\n<p><code>add_action('init', function() { </code><br />\n<code> flush_rewrite_rules();</code><br />\n<code>}); </code></p>\n</li>\n<li><p>Remove it afterward.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Ensure Query Vars Are Passed</strong></p>\n<ul>\n<li><p>Modify your query vars filter:</p>\n<p><code>function year_add_query_vars($vars) { </code><br />\n<code> $vars[] = 'variable'; </code><br />\n<code> $vars[] = 'paged'; </code><br />\n<code> return $vars;</code><br />\n<code>} </code></p>\n<p><code>add_filter('query_vars', 'year_add_query_vars'); </code></p>\n</li>\n</ul>\n</li>\n<li><p><strong>Fix Permalink Structure</strong></p>\n<ul>\n<li>Check if <strong>Settings → Permalinks</strong> is set to &quot;Post Name&quot; and save.</li>\n</ul>\n</li>\n<li><p><strong>Check Server Cache</strong></p>\n<ul>\n<li>If using a caching plugin or Cloudflare, clear the cache.</li>\n</ul>\n</li>\n</ol>\n"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + "mpdf"^^ . + . + . + "Why is a question asking for "the fastest way" opinion based? There are 16,000 questions that ask for "the fastest way" to do something in programming that haven't been closed for geing opinion based. Benchmarking different programming solutions is a central part of programming. But as you wish."^^ . + "1"^^ . + . + "2"^^ . + . + "Agreed, just do a GET instead of a HEAD. It's not going to tell you that the site is "working" per se (i.e., a "down for maintenance" page is still going to return a success), but you're not getting that now and this will at least tell you if the server is actively responding."^^ . + . + . + . + "Both `define()` and `const` create a constant. So there's no real difference. They can however not be used in the same places. `const` is used for constant properties in classes, they are called [class constants](https://www.php.net/manual/en/language.oop5.constants.php), whereas `define()` is used for global constants. Yes, the difference is annoying, why not use `const` for both? I guess is because they are quite different. The irony doesn't escape me. Anyway, you don't want to many global constants, better used class constants."^^ . + . + . + . + "4"^^ . + . + . + "2"^^ . + "0"^^ . + "How to include Class when running php file (Yii 2) in terminal"^^ . + "Markdown snippets in HydePHP"^^ . + . + . + . + "2"^^ . + "0"^^ . + . + . + "@mrmcwolf that's all right. just make yourself familiar with exceptions. It's a wonderful mechanism that lets us validate results only when needed, and leave 99% statements alone."^^ . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + "thanks yeah my DB didn't have enough value storage"^^ . + . + "Generic is unavailable in PHP as of now, but you can use PHPdocs if your IDE recognizes it: https://phpstan.org/blog/generics-in-php-using-phpdocs"^^ . + . + . + "vuejs3"^^ . + . + . + . + "0"^^ . + . + "<p>I am working on a <strong><a href="https://github.com/Ajax30/BraveCMS-2.0" rel="nofollow noreferrer">blogging application in Laravel 8</a></strong>.</p>\n<p>I am trying to display articles by tag at the following route:</p>\n<pre><code>Route::get('/tag/{tag_id}', [ArticlesController::class, 'tag'])-&gt;name('tag');\n</code></pre>\n<p>In the <code>ArticlesController</code> controller, I have the <code>tag()</code> method, which is supposed to display all posts that contain a certain tag:</p>\n<pre><code>public function tag($tag_id)\n{\n $tag = Tag::firstWhere('id', $tag_id);\n $articles = Article::where('id', $tag-&gt;id)-&gt;orderBy('id', 'desc')-&gt;paginate($this-&gt;per_page);\n\n return view(\n 'themes/' . $this-&gt;theme_directory . '/templates/index',\n array_merge($this-&gt;data, [\n 'tag' =&gt; $tag,\n 'articles' =&gt; $articles\n ])\n );\n}\n</code></pre>\n<p>There is a many-to-many relationship between articles and tags. I have an <code>article_tag</code> pivot table:</p>\n<p><a href="https://i.sstatic.net/7QDvm2eKm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7QDvm2eKm.png" alt="enter image description here" /></a></p>\n<p>In the <code>Tag</code> model I have:</p>\n<pre><code>class Tag extends Model\n{\n use HasFactory;\n\n protected $fillable = ['name'];\n\n public function article()\n {\n return $this-&gt;belongsToMany(Article::class);\n } \n}\n</code></pre>\n<p>To the <code>Article</code> model I have added the <code>tags()</code> method</p>\n<pre><code>public function tags()\n{\n return $this-&gt;belongsToMany(Tag::class)-&gt;as('tags');\n}\n</code></pre>\n<h3>The problem</h3>\n<p>The <code>/tag/1</code> displays only one article and that article does <strong>not</strong> contain a tag with the id of 1.</p>\n<p>What is my mistake?</p>\n"^^ . + "MVC is a generic pattern. What happens when your page is loaded will depend on your implementation. You've posted no code, so we can't help. See [ask]"^^ . + . + . + . + . + "First we need to figure out whether this is a client-side issue, a server-side issue or there is an issue at both. In order to differentiate where your problem is, the following questions need to be answered: 1. Is your view displaying properly whatever you already have in the database? 2. When you send a request (insert/update/delete items) to the server, is the request and its payload correct? 3. If the server gets proper, correct input, does it respond properly? You need to address these questions as well as provide detailed information of your experiments, including sample data and result"^^ . + . + . + "But...your solution only needs to be something like: `$textareacontent .= "\\n";` - like I said just add a newline onto your textarea string before you write it to the file. What was preventing you from doing that, if you knew that's what you needed?"^^ . + "<p>I have this error:</p>\n<p><code>Request is not well-formed, syntactically incorrect, or violates schema.</code></p>\n<p>This is my request:</p>\n<p>I was looking to make payments with Credit or Debit Cards with Paypal (not with any other), but without having to log in and use the function to make the payment.</p>\n<pre><code>if ($transaction['payment_provider'] == 'card') { \n // Validar que los datos de la tarjeta están presentes\n $cardName = $request-&gt;get('card-name');\n $cardNumber = $request-&gt;get('card-number');\n $cardExpiry = $request-&gt;get('card-expiry');\n $cardCVV = $request-&gt;get('card-cvv');\n\n if (!$cardName || !$cardNumber || !$cardExpiry || !$cardCVV) {\n return $this-&gt;paymentHandler-&gt;redirectByTransaction($transaction, __('Missing card details'));\n }\n\n // Formatear fecha de vencimiento para pasarela de pago (ejemplo: MM/AA → MMYY)\n $cardExpiryFormatted = str_replace('/', '', $cardExpiry);\n\n // Simulación de procesamiento de pago con tarjeta (AQUÍ IRÍA LA INTEGRACIÓN REAL)\n $paymentResponse = $this-&gt;processCardPayment([\n 'amount' =&gt; $transaction['amount'],\n 'currency' =&gt; $transaction['currency'],\n 'card_name' =&gt; $cardName,\n 'card_number' =&gt; $cardNumber,\n 'card_expiry' =&gt; $cardExpiryFormatted,\n 'card_cvv' =&gt; $cardCVV\n ]);\n\n if ($paymentResponse['status'] == 'success') {\n $transaction['status'] = Transaction::APPROVED_STATUS;\n } else {\n $transaction['status'] = Transaction::DECLINED_STATUS;\n return $this-&gt;paymentHandler-&gt;redirectByTransaction($transaction, __('Payment declined: ') . $paymentResponse['message']);\n }\n\n // $transaction-&gt;save();\n // return Redirect::route('feed')-&gt;with('success', __('Payment successful!'));\n}\n</code></pre>\n<pre><code>private function processCardPayment($cardData)\n{\n // Configurar credenciales desde config/paypal.php\n $clientId = config('paypal.client_id');\n $clientSecret = config('paypal.secret');\n $paypalUrl = config('paypal.test_mode') \n ? 'https://api-m.sandbox.paypal.com' \n : 'https://api-m.paypal.com';\n\n Log::info(&quot;aaaa&quot;);\n try {\n // 1️⃣ Obtener el token de acceso de PayPal\n $client = new \\GuzzleHttp\\Client();\n $authResponse = $client-&gt;request('POST', &quot;$paypalUrl/v1/oauth2/token&quot;, [\n 'auth' =&gt; [$clientId, $clientSecret],\n 'form_params' =&gt; [\n 'grant_type' =&gt; 'client_credentials'\n ]\n ]);\n Log::info(&quot;bbbb&quot;);\n\n\n $authData = json_decode($authResponse-&gt;getBody(), true);\n $accessToken = $authData['access_token'];\n Log::info(&quot;cccc&quot;);\n\n // 2️⃣ Crear una orden en PayPal con pago con tarjeta\n $response = $client-&gt;request('POST', &quot;$paypalUrl/v2/checkout/orders&quot;, [\n 'headers' =&gt; [\n 'Authorization' =&gt; &quot;Bearer $accessToken&quot;,\n 'Content-Type' =&gt; 'application/json',\n 'PayPal-Request-Id' =&gt; (string) \\Illuminate\\Support\\Str::uuid() // ID único\n ],\n 'json' =&gt; [\n 'intent' =&gt; 'CAPTURE',\n 'purchase_units' =&gt; [[\n 'amount' =&gt; [\n 'currency_code' =&gt; $cardData['currency'],\n 'value' =&gt; $cardData['amount']\n ]\n ]],\n 'payment_source' =&gt; [\n 'card' =&gt; [\n 'number' =&gt; $cardData['card_number'],\n 'expiry' =&gt; $cardData['card_expiry'],\n 'security_code' =&gt; $cardData['card_cvv'],\n 'name' =&gt; $cardData['card_name'],\n 'billing_address' =&gt; [\n 'address_line_1' =&gt; '123 Fake Street',\n 'admin_area_2' =&gt; 'Fake City',\n 'admin_area_1' =&gt; 'Fake State',\n 'postal_code' =&gt; '12345',\n 'country_code' =&gt; 'US'\n ]\n ]\n ]\n ]\n ]);\n\n Log::info(&quot;eeeee&quot;);\n\n\n $order = json_decode($response-&gt;getBody(), true);\n Log::info(&quot;ffff&quot;);\n\n\n if (!isset($order['id'])) {\n return [\n 'status' =&gt; 'failed',\n 'message' =&gt; 'Error al crear la orden en PayPal'\n ];\n }\n\n // 3️⃣ Capturar el pago con tarjeta\n $orderId = $order['id'];\n $captureResponse = $client-&gt;request('POST', &quot;$paypalUrl/v2/checkout/orders/$orderId/capture&quot;, [\n 'headers' =&gt; [\n 'Authorization' =&gt; &quot;Bearer $accessToken&quot;,\n 'Content-Type' =&gt; 'application/json'\n ]\n ]);\n\n $captureData = json_decode($captureResponse-&gt;getBody(), true);\n\n if (isset($captureData['status']) &amp;&amp; $captureData['status'] === 'COMPLETED') {\n return [\n 'status' =&gt; 'success',\n 'transaction_id' =&gt; $captureData['id'],\n 'message' =&gt; 'Pago aprobado'\n ];\n }\n\n return [\n 'status' =&gt; 'failed',\n 'message' =&gt; 'Pago no completado'\n ];\n\n } catch (\\Exception $e) {\n return [\n 'status' =&gt; 'failed',\n 'message' =&gt; $e-&gt;getMessage()\n ];\n }\n}\n</code></pre>\n<p>The blogs are because I was checking, how should it be structured to be able to work?</p>\n<p>How to structure the json to send a request to Paypal?</p>\n"^^ . + "<blockquote>\n<p>So, I went to install it via pear and get invalid package name/package file &quot;pdo-mysql&quot;</p>\n</blockquote>\n<p>Note you've used a dash here, not an underscore. The proper name of the module is <code>pdo_mysql</code>.</p>\n<p>You probably don't need that though. It looks like you're compiling yourself, and you've indicated that you want this module to be included statically:</p>\n<pre><code>--with-pdo-mysql\n</code></pre>\n<p>This means that it will be built-in to the main executable and there won't be a separate load-time module that needs to be referenced in the INI file.</p>\n<p>If you want to compile dynamically (which will give you that <code>pdo_mysql.so</code> file), then you need to do:</p>\n<pre><code>--with-pdo-mysql=shared\n</code></pre>\n<p>However, in this case, I think your easiest solution is to just comment out the <code>extension=pdo_mysql</code> line. Since you've compiled statically, the module is already present and enabled.</p>\n<p>Then run <code>php -m</code> from the command line and/or <code>phpinfo()</code> from a script to see what modules are live.</p>\n"^^ . + . + "2"^^ . + "@C3roe Thanks, but regrdless of using order as the keyholder there, the data is not recognised on the template page"^^ . + . + "1"^^ . + . + . + . + . + "2"^^ . + "<p>Error: MySQL shutdown unexpectedly.</p>\n<p>Stop XAMPP completely.</p>\n<p>Rename C:\\xampp\\mysql\\data to data_old.</p>\n<p>Create a new data folder inside C:\\xampp\\mysql.</p>\n<p>Copy the contents of C:\\xampp\\mysql\\backup into the new data folder.</p>\n<p>Copy your old database folders (except ibdata1, ib_logfile0, etc.) from data_old into data.</p>\n<p>Restart MySQL in XAMPP.</p>\n<p>Doing this every week but its temporary any permanent solution to fix this?</p>\n"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + "PHP scripts no more accessing SSL"^^ . + . + . + "Well, for security reasons, in this case, I wouldn't store the Laravel project in the `htdocs` (just a public files) folder. For example, if you move it to the `D:\\AppName` folder (from `D:\\xampp\\htdocs\\AppName`), then in the `D:\\xampp\\htdocs\\index.php` file, you need to modify `DIR.'/../` so that it correctly points to the Laravel project: `DIR.'/../../AppName/`. (This means that 'current folder . go back one folder / go back one folder / go to the folder named 'appname'.)"^^ . + . + . + . + . + . + . + "<p>Let's suppose <code>$pile</code> is the array you mentioned (after &quot;Here is a sample of the data I'd like to do this with.&quot;).</p>\n<p>You can list all the strings next to &quot;Location:&quot; in the same line using a regex like this:</p>\n<pre><code>$picturelinks = array_map(\n function($string) {\n preg_match('/^Location:\\s*([^\\r\\n]+)/m', $string, $matches);\n return $matches[1] ?? null;\n },\n $pile\n);\n</code></pre>\n<p>But I suppose you can parse <code>$photo['Data']</code> once:</p>\n<pre><code>preg_match_all('/^Location:\\s*([^\\r\\n]+)/m', $photo['Data'], $matches);\n$picturelinks = $matches[1] ?? [];\n</code></pre>\n<p>I tested it using: <a href="https://onlinephp.io/" rel="nofollow noreferrer">https://onlinephp.io/</a></p>\n<p><a href="https://i.sstatic.net/nIvga9PN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/nIvga9PN.png" alt="PHP Sand Box Test" /></a></p>\n"^^ . + . + . + "1"^^ . + . + . + "0"^^ . + "<p>I added a filter by product to WooCommerce admin orders page, using:</p>\n<pre><code>function add_my_product_filter_to_orders() {\n global $typenow;\n\n if ($typenow !== 'shop_order') return;\n\n if (!current_user_can('administrator')) { return; }\n\n $args = array(\n 'post_type' =&gt; 'product',\n 'posts_per_page' =&gt; -1,\n 'tax_query' =&gt; array(\n array(\n 'taxonomy' =&gt; 'product_cat',\n 'field' =&gt; 'slug',\n 'terms' =&gt; 'test',\n ),\n ),\n );\n\n $products = get_posts($args);\n if (!$products) return;\n\n $selected_product = isset($_GET['my_product_filter']) ? esc_attr($_GET['my_product_filter']) : '';\n\n echo '&lt;select name=&quot;my_product_filter&quot;&gt;';\n echo '&lt;option value=&quot;&quot;&gt;filter by product&lt;/option&gt;';\n \n foreach ($products as $product) {\n echo '&lt;option value=&quot;' . $product-&gt;ID . '&quot; ' . selected($selected_product, $product-&gt;ID, false) . '&gt;' . get_the_title($product-&gt;ID) . '&lt;/option&gt;';\n }\n\n echo '&lt;/select&gt;';\n}\nadd_action('restrict_manage_posts', 'add_my_product_filter_to_orders', 25);\n</code></pre>\n<p>We used <code>pre_get_posts</code> hook for filtration.</p>\n<pre><code>function filter_orders_by_my_product($query) {\n global $pagenow, $typenow, $wpdb;\n\n if ($pagenow !== 'edit.php' || $typenow !== 'shop_order' || empty($_GET['my_product_filter'])) {\n return;\n }\n\n $product_id = intval($_GET['my_product_filter']);\n\n $order_ids = $wpdb-&gt;get_col($wpdb-&gt;prepare(&quot;\n SELECT order_id FROM {$wpdb-&gt;prefix}woocommerce_order_items oi\n JOIN {$wpdb-&gt;prefix}woocommerce_order_itemmeta oim ON oi.order_item_id = oim.order_item_id\n WHERE oim.meta_key = '_product_id' AND oim.meta_value = %d\n &quot;, $product_id));\n\n if (!empty($order_ids)) {\n $query-&gt;query_vars['post__in'] = $order_ids;\n } else {\n $query-&gt;query_vars['post__in'] = array(0);\n }\n}\nadd_action('pre_get_posts', 'filter_orders_by_my_product');\n</code></pre>\n<p>On start the dropdown is displayed and everything is fine, but after filtering, it disappears and <code>$products = get_posts($args)</code> returns an empty array after filtration. How to fix that issue?</p>\n"^^ . + . + . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + "2"^^ . + . + "<p>I want to create a relationship between parents (which can be Mother or Father models) and their children (Son and Daughter models). For exemple purposes, they are defined like this:</p>\n<pre><code>father:\n id\n name\n\nmother:\n id\n name\n\nson:\n id\n name\n\ndaughter:\n id\n name\n</code></pre>\n<p>I created a pivot table parent_child:</p>\n<pre><code>parent_child:\n parent_id\n child_id\n parent_type\n child_type\n</code></pre>\n<p>How can I create the laravel relations? Most polymorphic relations I can find in the doc only work when one of the two sides of the relation is polymorphic, not both.</p>\n"^^ . + . + . + "0"^^ . + "<p>you would need to modify both your <code>docker-compose.yml</code> and <code>.env</code> with the following:</p>\n<ol>\n<li><code>docker-compose.yml</code> → Add netowkrs.</li>\n</ol>\n<pre><code>networks: # add this\n backend:\n name: &quot;mybackend&quot;\n\nservices:\n web:\n image: app-name:latest\n build:\n target: web\n context: .\n env_file:\n - .env\n ports:\n - &quot;8000:80&quot;\n volumes:\n - .:/var/www/html\n depends_on:\n - db\n networks: # add this\n - &quot;backend&quot;\n \n db:\n platform: &quot;linux/amd64&quot;\n image: mysql:5.7\n env_file:\n - .env\n environment:\n MYSQL_ROOT_PASSWORD: root\n MYSQL_DATABASE: laravel\n MYSQL_USER: laravel\n MYSQL_PASSWORD: secret\n ports:\n - &quot;3307:3306&quot;\n volumes:\n - dbdata:/var/lib/mysql\n networks: # add this\n - &quot;backend&quot;\n\nvolumes:\n dbdata:\n</code></pre>\n<ol start="2">\n<li><code>.env</code> → fix your DB_PORT number.</li>\n</ol>\n<pre><code>DB_CONNECTION=mysql\nDB_HOST=db\nDB_PORT=3306\nDB_DATABASE=laravel\nDB_USERNAME=laravel\nDB_PASSWORD=secret\n</code></pre>\n<p>Explanation:</p>\n<p>In your <code>db</code> services, the ports is defined as <code>3307:3306</code> and you've written <code>3307</code> at the <code>.env</code> file. Since the laravel app is running in your <code>web</code> service, the connection between <code>web</code> and <code>db</code> would be through the docker network.</p>\n<p>3307 is for your host machine to connect, while 3306 is used within the docker network.</p>\n<p>For the networks portion, I add it just to be sure that these containers are in the same network.</p>\n<p>Hope this helps.</p>\n<p>Regards,</p>\n"^^ . + . + . + . + . + "0"^^ . + . + . + . + "@PatrickJanser understand. David wrote me the same. I am already looking for AJAX PHP. It will be for me little bit harder, because I am not realy good in javascript, but thank you for the way."^^ . + "Good news that you have one tool (`openssl s_client`) that works, to elaborate on it! I'm puzzled by your use of different CA bundles (`C:\\php\\cacert.pem` for `openssl`, `C:\\xampp\\apache\\bin\\curl-ca-bundle.crt` for `curl`): did you try `curl` with `C:\\php\\cacert.pem`? `CERT_TRUST_IS_PARTIAL_CHAIN` seems to be a Windows-only error code. Maybe the schannel version of cURL only recognizes Windows-configured CA certs: have you tried with a pure OpenSSL cURL? (see [this answer](https://superuser.com/a/442797/609145) and [that one](https://stackoverflow.com/a/61650198/1346819))"^^ . + . + . + "I've answered a couple of that "_culture_" and always wrote "**encrypt bytes, not text**". The same applies to this Q here: don't encrypt `String` anywhere. It seems to be black magic to most rookies that strings can differ as per language a lot and one should **never assume** the formula `1 byte = 1 character`. Again: get rid of the type `String` in all your code and use an array of bytes (or `TBytes`). Problem solved. If you use bytes you automatically have to take care of how text should be encoded."^^ . + . + . + "bindparam"^^ . + "1"^^ . + "Thanks this has helped me a lot, I am encountering 404 not found when trying to connect to the function which I am currently troubleshooting but definitely a lot further than I was with web jobs!! This explanation is also really helpful since I'm new to web development stuff so thanks!!"^^ . + "0"^^ . + "_Small Note_ E_STRICT appears to be a deprecated constant in 8.4 :)"^^ . + . + "1"^^ . + . + "Are you 100% certain that the two log lines always appear literally one after the other, with absolutely zero chance of another log entry being added in between the two?"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + "1"^^ . + "0"^^ . + "1"^^ . + . + "Try changing subject to:\n\nRe: TNT(TNT)\n\nThe chain into message threads thing is a Gmail only issue and they decide wherther or not to chain them."^^ . + . + . + . + "xampp"^^ . + "0"^^ . + "<p>I’m working with a Blocksy child theme and have implemented a star rating system for posts. However, I’m facing an issue where:</p>\n<p>I need the star rating to appear above the default WordPress comment form.\nThe rating should be hidden after a user submits a rating, but they should still be able to post unlimited comments.\nThe star rating does not display for logged-in users—it only appears for guests.\nI have placed my code in the Blocksy child theme’s functions.php file. Everything else works fine, except the issues mentioned above.</p>\n<p>If anyone can help me fix this, I’d really appreciate it!</p>\n<pre><code>&lt;?php\nif (!defined('ABSPATH')) {\n die('Direct access forbidden.');\n}\n\n// Enqueue styles and scripts\nadd_action('wp_enqueue_scripts', function () {\n wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');\n wp_enqueue_style('font-awesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css');\n wp_enqueue_script('jquery');\n\n // Custom script for comment functionality\n wp_enqueue_script('comment-rating-script', get_stylesheet_directory_uri() . '/reviews/reviews.js', array('jquery'), '1.0', true);\n wp_localize_script('comment-rating-script', 'ajax_object', array(\n 'ajax_url' =&gt; admin_url('admin-ajax.php'),\n 'nonce' =&gt; wp_create_nonce('comment_edit_delete_nonce')\n ));\n});\n\n// Step 1: Add rating field to comment form\nfunction add_rating_field_to_comment_form($fields) {\n $rating_field = '&lt;p class=&quot;comment-form-rating&quot;&gt;\n &lt;label for=&quot;rating&quot;&gt;Rating:&lt;/label&gt;\n &lt;span class=&quot;rating-stars&quot;&gt;\n &lt;input type=&quot;radio&quot; id=&quot;rating-5&quot; name=&quot;rating&quot; value=&quot;5&quot; required&gt;\n &lt;label for=&quot;rating-5&quot;&gt;&lt;i class=&quot;fas fa-star&quot;&gt;&lt;/i&gt;&lt;/label&gt;\n &lt;input type=&quot;radio&quot; id=&quot;rating-4&quot; name=&quot;rating&quot; value=&quot;4&quot;&gt;\n &lt;label for=&quot;rating-4&quot;&gt;&lt;i class=&quot;fas fa-star&quot;&gt;&lt;/i&gt;&lt;/label&gt;\n &lt;input type=&quot;radio&quot; id=&quot;rating-3&quot; name=&quot;rating&quot; value=&quot;3&quot;&gt;\n &lt;label for=&quot;rating-3&quot;&gt;&lt;i class=&quot;fas fa-star&quot;&gt;&lt;/i&gt;&lt;/label&gt;\n &lt;input type=&quot;radio&quot; id=&quot;rating-2&quot; name=&quot;rating&quot; value=&quot;2&quot;&gt;\n &lt;label for=&quot;rating-2&quot;&gt;&lt;i class=&quot;fas fa-star&quot;&gt;&lt;/i&gt;&lt;/label&gt;\n &lt;input type=&quot;radio&quot; id=&quot;rating-1&quot; name=&quot;rating&quot; value=&quot;1&quot;&gt;\n &lt;label for=&quot;rating-1&quot;&gt;&lt;i class=&quot;fas fa-star&quot;&gt;&lt;/i&gt;&lt;/label&gt;\n &lt;/span&gt;\n &lt;/p&gt;';\n \n $fields = array_merge(['rating' =&gt; $rating_field], $fields);\n return $fields;\n}\nadd_filter('comment_form_fields', 'add_rating_field_to_comment_form');\n\n// Step 2: Save rating data\nfunction save_rating_data($comment_id) {\n if (isset($_POST['rating'])) {\n $rating = intval($_POST['rating']);\n if ($rating &gt;= 1 &amp;&amp; $rating &lt;= 5) {\n update_comment_meta($comment_id, 'rating', $rating);\n }\n }\n}\nadd_action('comment_post', 'save_rating_data');\n\n// Step 3: Display rating stars in comments\nfunction display_rating_stars($comment_id) {\n $rating = get_comment_meta($comment_id, 'rating', true);\n if ($rating) {\n $stars = '';\n for ($i = 1; $i &lt;= 5; $i++) {\n if ($i &lt;= $rating) {\n $stars .= '&lt;i class=&quot;fas fa-star&quot; style=&quot;color: #ffd700;&quot;&gt;&lt;/i&gt;';\n } else {\n $stars .= '&lt;i class=&quot;far fa-star&quot; style=&quot;color: #ffd700;&quot;&gt;&lt;/i&gt;';\n }\n }\n return '&lt;div class=&quot;comment-rating&quot;&gt;' . $stars . '&lt;/div&gt;';\n }\n return '';\n}\n\nfunction add_rating_to_comment($comment_text, $comment) {\n return display_rating_stars($comment-&gt;comment_ID) . $comment_text;\n}\nadd_filter('comment_text', 'add_rating_to_comment', 10, 2);\n\n// Include edit and delete functionality\n// Step 5: Add edit/delete links to comments\nfunction add_comment_edit_delete_link($comment_text, $comment) {\n // Only show edit/delete for logged in users who authored the comment\n if (is_user_logged_in() &amp;&amp; $comment-&gt;user_id == get_current_user_id()) {\n $edit_nonce = wp_create_nonce('edit-comment_' . $comment-&gt;comment_ID);\n $delete_nonce = wp_create_nonce('delete-comment_' . $comment-&gt;comment_ID);\n \n $buttons = '&lt;div class=&quot;comment-actions&quot;&gt;';\n $buttons .= '&lt;a href=&quot;#&quot; class=&quot;comment-edit-link&quot; data-comment-id=&quot;' . $comment-&gt;comment_ID . '&quot;&gt;Edit&lt;/a&gt; | ';\n $buttons .= '&lt;a href=&quot;#&quot; class=&quot;comment-delete-link&quot; data-comment-id=&quot;' . $comment-&gt;comment_ID . '&quot;&gt;Delete&lt;/a&gt;';\n $buttons .= '&lt;/div&gt;';\n \n $comment_text .= $buttons;\n }\n return $comment_text;\n}\nadd_filter('comment_text', 'add_comment_edit_delete_link', 20, 2);\n\n// Step 6: Add JavaScript for edit/delete functionality\nfunction comment_edit_delete_scripts() {\n if (is_singular() &amp;&amp; comments_open()) {\n ?&gt;\n &lt;script&gt;\n jQuery(document).ready(function($) {\n // Function to create a modal\n function createModal(content) {\n const modal = document.createElement('div');\n modal.className = 'custom-modal';\n modal.innerHTML = `\n &lt;div class=&quot;modal-content&quot;&gt;\n &lt;span class=&quot;close-modal&quot;&gt;&amp;times;&lt;/span&gt;\n ${content}\n &lt;/div&gt;\n `;\n document.body.appendChild(modal);\n $(modal).find('.close-modal').on('click', function() {\n $(modal).remove();\n });\n return modal;\n }\n\n // Handle Edit Comment\n $(document).on('click', '.comment-edit-link', function(e) {\n e.preventDefault();\n \n const commentId = $(this).data('comment-id');\n const commentElement = document.getElementById('comment-' + commentId);\n const commentContent = $(commentElement).find('.comment-content p').text().trim();\n \n const form = `\n &lt;form id=&quot;edit-comment-form&quot;&gt;\n &lt;textarea name=&quot;comment&quot; rows=&quot;5&quot;&gt;${commentContent}&lt;/textarea&gt;\n &lt;p&gt;Rating cannot be changed.&lt;/p&gt;\n &lt;input type=&quot;hidden&quot; name=&quot;comment_id&quot; value=&quot;${commentId}&quot;&gt;\n &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;edit_comment&quot;&gt;\n &lt;input type=&quot;hidden&quot; name=&quot;security&quot; value=&quot;${ajax_object.nonce}&quot;&gt;\n &lt;button type=&quot;submit&quot; class=&quot;button&quot;&gt;Save&lt;/button&gt;\n &lt;button type=&quot;button&quot; class=&quot;close-modal button&quot;&gt;Cancel&lt;/button&gt;\n &lt;/form&gt;\n `;\n \n const modal = createModal(form);\n \n $(modal).find('#edit-comment-form').on('submit', function(e) {\n e.preventDefault();\n \n const formData = new FormData(this);\n \n fetch(ajax_object.ajax_url, {\n method: 'POST',\n body: formData\n })\n .then(response =&gt; response.json())\n .then(data =&gt; {\n if (data.success) {\n $(commentElement).find('.comment-content').html(data.data.comment_content);\n $(modal).remove();\n }\n });\n });\n });\n\n // Handle Delete Comment\n $(document).on('click', '.comment-delete-link', function(e) {\n e.preventDefault();\n \n const commentId = $(this).data('comment-id');\n \n const confirmBox = `\n &lt;p&gt;Are you sure you want to delete this comment?&lt;/p&gt;\n &lt;button id=&quot;confirm-delete&quot; class=&quot;button&quot;&gt;Delete&lt;/button&gt;\n &lt;button class=&quot;close-modal button&quot;&gt;Cancel&lt;/button&gt;\n `;\n \n const modal = createModal(confirmBox);\n \n $(modal).find('#confirm-delete').on('click', function() {\n const formData = new FormData();\n formData.append('action', 'delete_comment');\n formData.append('comment_id', commentId);\n formData.append('security', ajax_object.nonce);\n \n fetch(ajax_object.ajax_url, {\n method: 'POST',\n body: formData\n })\n .then(response =&gt; response.json())\n .then(data =&gt; {\n if (data.success) {\n $('#comment-' + commentId).remove();\n $(modal).remove();\n }\n });\n });\n });\n });\n &lt;/script&gt;\n &lt;style&gt;\n /* Rating stars styling */\n .rating-stars {\n display: flex;\n flex-direction: row-reverse;\n justify-content: flex-end;\n }\n .rating-stars input {\n display: none;\n }\n .rating-stars label {\n cursor: pointer;\n font-size: 25px;\n padding: 0 5px;\n color: #ddd;\n }\n .rating-stars label:hover,\n .rating-stars label:hover ~ label,\n .rating-stars input:checked ~ label {\n color: #ffd700;\n }\n .comment-rating {\n margin-bottom: 10px;\n }\n \n /* Edit/Delete styling */\n .comment-actions {\n margin-top: 10px;\n font-size: 0.9em;\n }\n .comment-edit-form {\n margin-top: 10px;\n }\n .comment-edit-form textarea {\n width: 100%;\n margin-bottom: 10px;\n }\n .comment-edit-form button {\n margin-right: 10px;\n }\n \n /* Modal styling */\n .custom-modal {\n position: fixed;\n z-index: 9999;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0,0,0,0.4);\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .modal-content {\n background-color: #fefefe;\n padding: 20px;\n border-radius: 5px;\n width: 80%;\n max-width: 500px;\n }\n .close-modal {\n cursor: pointer;\n }\n #edit-comment-form textarea {\n width: 100%;\n margin-bottom: 10px;\n }\n #edit-comment-form button {\n margin-right: 10px;\n }\n &lt;/style&gt;\n &lt;?php\n }\n}\nadd_action('wp_footer', 'comment_edit_delete_scripts');\n\n// Step 7: Handle AJAX requests for comment editing\nfunction handle_edit_comment() {\n check_ajax_referer('comment_edit_delete_nonce', 'security');\n \n $comment_id = isset($_POST['comment_id']) ? intval($_POST['comment_id']) : 0;\n $comment_content = isset($_POST['comment']) ? sanitize_textarea_field($_POST['comment']) : '';\n \n // Check if user can edit this comment\n $comment = get_comment($comment_id);\n \n if (!$comment || $comment-&gt;user_id != get_current_user_id()) {\n wp_send_json_error('Permission denied');\n }\n \n // Update the comment\n $comment_data = array(\n 'comment_ID' =&gt; $comment_id,\n 'comment_content' =&gt; $comment_content\n );\n \n $updated = wp_update_comment($comment_data);\n \n if ($updated) {\n wp_send_json_success(array(\n 'comment_content' =&gt; apply_filters('comment_text', $comment_content, $comment)\n ));\n } else {\n wp_send_json_error('Failed to update comment');\n }\n}\nadd_action('wp_ajax_edit_comment', 'handle_edit_comment');\n\n// Step 8: Handle AJAX requests for comment deletion\nfunction handle_delete_comment() {\n check_ajax_referer('comment_edit_delete_nonce', 'security');\n \n $comment_id = isset($_POST['comment_id']) ? intval($_POST['comment_id']) : 0;\n \n // Check if user can delete this comment\n $comment = get_comment($comment_id);\n \n if (!$comment || $comment-&gt;user_id != get_current_user_id()) {\n wp_send_json_error('Permission denied');\n }\n \n // Trash the comment\n $deleted = wp_trash_comment($comment_id);\n \n if ($deleted) {\n wp_send_json_success();\n } else {\n wp_send_json_error('Failed to delete comment');\n }\n}\nadd_action('wp_ajax_delete_comment', 'handle_delete_comment');\n\n// Average Rating and Total Reviews Shortcode\nfunction average_rating_shortcode() {\n $args = array(\n 'post_id' =&gt; get_the_ID(),\n 'status' =&gt; 'approve',\n );\n $comments = get_comments($args);\n $total_ratings = 0;\n $total_comments = 0;\n \n foreach ($comments as $comment) {\n $rating = get_comment_meta($comment-&gt;comment_ID, 'rating', true);\n if ($rating) {\n $total_ratings += $rating;\n $total_comments++;\n }\n }\n \n if ($total_comments &gt; 0) {\n $average_rating = $total_ratings / $total_comments;\n $average_rating = round($average_rating, 1);\n $output = '&lt;span class=&quot;average-rating&quot;&gt;' . $average_rating . ' &lt;i class=&quot;fas fa-star&quot; style=&quot;color: #ffd700;&quot;&gt;&lt;/i&gt; (' . $total_comments . ' ' . _n('review', 'reviews', $total_comments) . ')&lt;/span&gt;';\n } else {\n $output = '&lt;span class=&quot;average-rating&quot;&gt;No ratings yet&lt;/span&gt;';\n }\n \n return $output;\n}\nadd_shortcode('average_rating', 'average_rating_shortcode');\n\n// Individual Reviews Shortcode\nfunction individual_reviews_shortcode() {\n $args = array(\n 'post_id' =&gt; get_the_ID(),\n 'status' =&gt; 'approve',\n );\n $comments = get_comments($args);\n $output = '';\n \n foreach ($comments as $comment) {\n $rating = get_comment_meta($comment-&gt;comment_ID, 'rating', true);\n if ($rating) {\n $output .= '&lt;div class=&quot;individual-review&quot;&gt;';\n $output .= '&lt;img src=&quot;' . get_avatar_url($comment-&gt;user_id) . '&quot; alt=&quot;' . get_comment_author($comment-&gt;comment_ID) . '&quot;&gt;';\n $output .= '&lt;span class=&quot;review-author&quot;&gt;' . get_comment_author($comment-&gt;comment_ID) . '&lt;/span&gt;';\n $output .= '&lt;span class=&quot;review-rating&quot;&gt;';\n \n for ($i = 1; $i &lt;= 5; $i++) {\n if ($i &lt;= $rating) {\n $output .= '&lt;i class=&quot;fas fa-star&quot; style=&quot;color: #ffd700;&quot;&gt;&lt;/i&gt;';\n } else {\n $output .= '&lt;i class=&quot;far fa-star&quot; style=&quot;color: #ffd700;&quot;&gt;&lt;/i&gt;';\n }\n }\n \n $output .= '&lt;/span&gt;';\n $output .= '&lt;p class=&quot;review-content&quot;&gt;' . get_comment_text($comment-&gt;comment_ID) . '&lt;/p&gt;';\n $output .= '&lt;/div&gt;';\n }\n }\n \n return $output;\n}\nadd_shortcode('individual_reviews', 'individual_reviews_shortcode');\n</code></pre>\n<p>I tried modifying my Blocksy child theme’s functions.php to add the star rating above the WordPress comment form. I expected it to display properly for all users, disappear after rating while still allowing unlimited comments, and work for both guests and logged-in users.</p>\n<p>However, the star rating does not appear for logged-in users. I also attempted using JavaScript and PHP conditions to hide the rating after submission, but it didn't work as expected.</p>\n<p>I even tried asking AI to evaluate the code, but no luck. The issue persists, and I need help figuring out what’s wrong.</p>\n"^^ . + . + "Are you using a virtual machine such as Vagrant/Homestead, or Docker? if so, you need to remove the port from the URL, since the request will happen within the virtual machine."^^ . + "1"^^ . + . + . + . + "dbal"^^ . + . + . + . + . + . + . + "This sounds like a question for https://security.stackexchange.com, https://softwareengineering.stackexchange.com or https://crypto.stackexchange.com, as it pertains to the overall system design. Generally, anyone with access to the database can change _anything_ in it, including private keys, documents, hashes and anything else. If you want to ensure trustability, you'll need something more fundamental than considerations about a relational table."^^ . + . + . + "<p>I am trying to use the Events API in Slack. However, setting my endpoint to: <code>https://mywebsite.com/api/slack/events</code> is giving the error:</p>\n<p><code>the URL didn't respond with the value of the challenge parameter</code></p>\n<p>Slack posts the following:</p>\n<pre><code>{\n &quot;token&quot;: &quot;Jhj5dZrVaK7ZwHHjRyZWjbDl&quot;,\n &quot;challenge&quot;: &quot;3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P&quot;,\n &quot;type&quot;: &quot;url_verification&quot;\n}\n</code></pre>\n<p>Obviously the challenge is a random code.</p>\n<p>I have a function in SlackController.php:</p>\n<pre><code>public function returnChallenge(Request $request)\n {\n return response()-&gt;json(['challenge' =&gt; $request-&gt;json()-&gt;get('challenge')]);\n }\n</code></pre>\n<p>in api.php:</p>\n<p><code>Route::post('slack/events', 'SlackController@returnChallenge');</code></p>\n<p>Since the Laravel and Nginx error log file is empty, I decided to look in Nginx access.log:</p>\n<pre><code>&quot;POST /api/slack/events HTTP/1.1&quot; 400 224 &quot;-&quot; &quot;Slackbot 1.0 (+https://api.slack.com/robots)&quot;\n</code></pre>\n<p>There is no firewall that blocks Slack.\nWhat is the issue here?</p>\n<p><strong>What I tried:</strong></p>\n<ul>\n<li>Logging all requests, however Slack doesn't even hit the endpoint.</li>\n<li>Using a PHP script to rule out any issues with Laravel or weird middleware rules, also no error from Slack.</li>\n</ul>\n<p>I followed everything on <a href="https://api.slack.com/events/url_verification" rel="nofollow noreferrer">Slack URL verification</a> to the point, without results.</p>\n<p>The endpoint gives a <code>status 200</code> in Postman and it returns the given challenge in JSON.</p>\n"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + "1"^^ . + . + "<p>I can't install composer on my Windows 11 machine.</p>\n<p>And I got the error</p>\n<blockquote>\n<p>OpenSSL failed with a 'certificate verify failed' error. This\nindicates a problem with the Certificate Authority file(s) on your\nsystem, which either cannot be found or may be out of date.</p>\n<p>ScriptOutput: The &quot;https://getcomposer.org/versions&quot; file could not be\ndownloaded: SSL operation failed with code 1. OpenSSL Error messages:\nerror:0A000086:SSL routines::certificate verify failed Failed to\nenable crypto Failed to open stream: operation failed</p>\n</blockquote>\n<p>I have installed the latest version of the cacert.pem certificate</p>\n<p>In my php.ini, I have initialized the variable for this certificate</p>\n<blockquote>\n<p>curl.cainfo = C:\\PHP\\PHP8.2.17\\cacert.pem</p>\n</blockquote>\n<p>What can I do more ?\nI suspect an issue with windows 11 (I just migrated on this release)</p>\n<p>edit : I also tried to desactivate the firewall. Without success</p>\n"^^ . + . + "0"^^ . + . + . + "0"^^ . + "2"^^ . + "Gotcha, well the advice from sajibriddho is worth following then; use the `::class` device to get the full classname, including the namespace."^^ . + "Thanks @IMSoP, I'm relatively new in PHP, I'll see if there is a way to change the PHP version to 8. But for right now I want to make this work on 7.4"^^ . + . + "0"^^ . + "1"^^ . + . + "0"^^ . + . + "@Aquaholic: *"so looking for any viable options"* - JavaScript is a viable option for client-side logic. If your preference is to use a `<meta>` tag in the header of the page, have you tried that? Did something not work as expected in that attempt?"^^ . + "Try with a version below 9.5. Check with your operating system the port is not blocked."^^ . + . + "datetime"^^ . + . + . + . + . + "The file that contains the class' code needs to be included at some point, and in the web context, Yii does this via the autoloader functionality, https://www.yiiframework.com/doc/guide/2.0/en/concept-autoloading But when you try to execute a file like the one above "stand-alone", then no such autoloading has happened. You would have to include the file that performs this task of auto-loading the classes; or explicitly include all the relevant class files yourself."^^ . + . + . + . + "1"^^ . + . + . + "<p>I am attempting to programmatically update the &quot;sent from&quot; address for a particular WooCommerce email. Specifically the customer_new_account email. I am aware of the woocommerce_email_from_address filter and I am able to (theoretically) update the address using the following:</p>\n<pre><code>function custom_send_from_address ( $from_email, $wc_email ) {\n if( $wc_email-&gt;id == 'customer_new_account' )\n $from_email = 'welcome@mywebsite.org';\n return $from_email;\n}\nadd_filter( 'woocommerce_email_from_address', 'custom_send_from_address', 10, 2 );\n</code></pre>\n<p>However, this only seems to update the &quot;reply to&quot; address, not the &quot;sent from&quot; address. We are using the FluentSMTP plugin, and I have added a connection to this email address to the plugin. I’m not sure if I am missing a step somewhere that would give WordPress access to this email address?</p>\n"^^ . + . + . + . + "Why all the down votes for this question? I did a careful search prior to posting and did not find anything that I understood clearly enough to apply. Many thanks to those who did bother to help!"^^ . + . + "0"^^ . + . + "1"^^ . + "<p>I am trying to create a function to add a new user role to any customer who purchases a specific item via Woocommerce.</p>\n<p>I have the following code which achieves this with a paid product, however, the product that triggers this is a free item. I am not sure if the code &quot;paying_customer&quot; is stopping this function from working with a free item order.</p>\n<p>Is there an alternative to using &quot;paying_customer&quot; or a better way of achieving this?</p>\n<p>Below is the code that works for paid products, but not for free products.</p>\n<p>Thanks</p>\n<pre><code>function change_role_on_purchase( $order_id ) {\n\n $order = new WC_Order( $order_id );\n $items = $order-&gt;get_items();\n\n foreach ( $items as $item ) {\n $product_name = $item['name'];\n $product_id = $item['product_id'];\n $product_variation_id = $item['variation_id'];\n\n if ( $order-&gt;user_id &gt; 0 &amp;&amp; $product_id == '13874904' ) {\n update_user_meta( $order-&gt;user_id, 'paying_customer', 1 );\n $user = new WP_User( $order-&gt;user_id );\n // Remove role\n $user-&gt;remove_role( 'subscriber' ); \n // Add role\n $user-&gt;add_role( 'special_subscriber' );\n }\n }\n}\nadd_action( 'woocommerce_order_status_processing', 'change_role_on_purchase' );\n</code></pre>\n"^^ . + . + "3"^^ . + . + "Angular 15 with php routing requests and title"^^ . + "1"^^ . + "0"^^ . + "But your other issue is the result of this rewrite: `/page/123` gets requested, doesn't match an existing file - so you append `.php` to it, but I'm pretty sure `/page/123.php` won't actually exist in your system either."^^ . + . + . + "1"^^ . + "@JulianKoster this is my first LiveComponent, I tried to clear the cache without any success, the console shows no error but no success neither (so I'm not sure the stimulus is working), I already had problems when I tried to implement the passkey connection (which uses stimulus too), it just wasn't working at all... So it may be related to stimulus... I edited my post to add the content of my app.js and bootstrap.js"^^ . + . + . + "@C3roe yes you are right its download the file how i change that ? ."^^ . + . + "2"^^ . + "For the `sql.source` and `xml.source` parameters, could you use the `#[Inject]` [attribute](https://php-di.org/doc/attributes.html) in the class definitions which should better allow for autowiring?"^^ . + . + . + . + . + . + . + . + "algorithm"^^ . + "2"^^ . + . + . + . + . + . + "@HEXALIX The multiple select works fine. It is when a tag is deleted that the bug happens. The 2 instances of `console.log(selectedTags)` output the set slightly different, but by all appearances ok."^^ . + "@IanTornquist: *"I don't need the JS to do anything other than post the value."* - Well, if that's what it's doing now then it sounds like the code works as designed. So what are you asking? *"It is PHP that I need to then work with that."* - The code currently does exactly that. Though all PHP does with this value is conditionally change how it responds to the AJAX request. Which doesn't really matter because the JavaScript code ignores the response anyway. It sounds like you may be misunderstanding what these tools do in the first place."^^ . + . + . + . + . + "1"^^ . + "3"^^ . + . + "<p>Im trying to write twig loader that would load templates depending on the city and the partner who announced me in the app. And im getting error when i run my php app. Сlass is loaded correctly into the cache the first time, but then for some reason I try to create another class</p>\n<p><code>Compile Error: Cannot redeclare class __TwigTemplate_91fb729aa360daba88c8f80ea708ed40 (previously declared in /var/www/var/cache/dev/twig/f1/f1f0c5a29775ffb735cb305c2a82df1f.php:16)</code></p>\n<p>Here is my code:</p>\n<pre><code>\nreadonly class PartnerTemplateLoader implements LoaderInterface\n{\n const string DEFAULT_TEMPLATES_PATH = &quot;Default&quot;;\n\n const string VIEWS_DIR = 'Resources/views';\n\n public function __construct(\n private KernelInterface $kernel,\n private Partner $partner,\n private City $city,\n private string $defaultTemplatesPath = self::DEFAULT_TEMPLATES_PATH\n ) {}\n\n public function getSourceContext($name): Source\n {\n $template = $this-&gt;loadTemplate($name);\n return new Source(\n file_get_contents(\n $this-&gt;kernel-&gt;locateResource($template-&gt;absoluteName)\n ),\n $template-&gt;name,\n $template-&gt;absoluteName\n );\n }\n\n public function getCacheKey($name): string\n {\n $template = $this-&gt;loadTemplate($name);\n return $template-&gt;name;\n }\n\n public function isFresh($name, $time): bool\n {\n $template = $this-&gt;loadTemplate($name);\n\n return filemtime($this-&gt;kernel-&gt;locateResource($template-&gt;absoluteName)) &lt;= $time;\n }\n\n public function exists($name): bool\n {\n return $this-&gt;findTemplate($name);\n }\n\n private function loadTemplate(string $name): Template\n {\n $name = str_replace(\n &quot;:/&quot;,\n &quot;:&quot;,\n preg_replace(&quot;#/{2,}#&quot;, &quot;/&quot;, strtr($name, &quot;\\\\&quot;, &quot;/&quot;))\n );\n\n if (str_contains($name, &quot;..&quot;)) {\n throw new \\RuntimeException(\n sprintf('Template name &quot;%s&quot; contains invalid characters.', $name)\n );\n }\n\n preg_match('/^([^:]*)\\/([^:]*)\\/(.+)\\.([^\\.]+)\\.([^\\.]+)$/', $name, $matches);\n\n try {\n if (count($matches) === 0) {\n return new Template($name);\n }\n } catch (\\Throwable $e) {}\n\n try {\n $absoluteName = $this-&gt;prepareAbsolutePartnerName($matches, $this-&gt;city-&gt;getSlug());\n $name = $this-&gt;preparePartnerName($matches, $this-&gt;city-&gt;getSlug());\n if ($this-&gt;kernel-&gt;locateResource($absoluteName)) {\n return new Template($name, $absoluteName);\n }\n } catch (\\Throwable $e) {}\n\n try {\n $absoluteName = $this-&gt;prepareAbsolutePartnerName($matches, $this-&gt;defaultTemplatesPath);\n $name = $this-&gt;preparePartnerName($matches, $this-&gt;defaultTemplatesPath);\n if ($this-&gt;kernel-&gt;locateResource($absoluteName)) {\n return new Template($name, $absoluteName);\n }\n } catch (\\Throwable $exception) {}\n\n $absoluteName = $this-&gt;prepareAbsoluteDefaultName($matches);\n $name = $this-&gt;prepareDefaultName($matches);\n if ($this-&gt;kernel-&gt;locateResource($this-&gt;prepareAbsoluteDefaultName($matches))) {\n return new Template($name, $absoluteName);\n }\n\n throw new \\RuntimeException('Cannot load template!');\n }\n\n private function findTemplate(string $name): bool\n {\n $found = false;\n $name = str_replace(\n &quot;:/&quot;,\n &quot;:&quot;,\n preg_replace(&quot;#/{2,}#&quot;, &quot;/&quot;, strtr($name, &quot;\\\\&quot;, &quot;/&quot;))\n );\n\n if (str_contains($name, &quot;..&quot;)) {\n throw new \\RuntimeException(\n sprintf('Template name &quot;%s&quot; contains invalid characters.', $name)\n );\n }\n\n preg_match('/^([^:]*)\\/([^:]*)\\/(.+)\\.([^\\.]+)\\.([^\\.]+)$/', $name, $matches);\n\n try {\n if (count($matches) === 0 &amp;&amp; $this-&gt;kernel-&gt;locateResource($name)) {\n $found = true;\n }\n } catch (\\Throwable $e) {}\n\n try {\n if ($this-&gt;kernel-&gt;locateResource($this-&gt;prepareAbsolutePartnerName($matches, $this-&gt;city-&gt;getSlug()))) {\n $found = true;\n }\n } catch (\\Throwable $e) {}\n\n try {\n if ($this-&gt;kernel-&gt;locateResource($this-&gt;prepareAbsolutePartnerName($matches, $this-&gt;defaultTemplatesPath))) {\n $found = true;\n }\n } catch (\\Throwable $e) {}\n\n try {\n if ($this-&gt;kernel-&gt;locateResource($this-&gt;prepareAbsoluteDefaultName($matches))) {\n $found = true;\n }\n } catch (\\Throwable $e) {}\n\n return $found;\n }\n\n private function prepareDefaultName(array $matches): string\n {\n return &quot;{$matches[1]}/{$this-&gt;defaultTemplatesPath}/{$matches[2]}/{$matches[3]}.{$matches[4]}.{$matches[5]}&quot;;\n }\n\n private function preparePartnerName(array $matches, string $city): string\n {\n return &quot;{$matches[1]}/{$this-&gt;partner-&gt;getTemplatesPath()}/{$city}/{$matches[2]}/{$matches[3]}.{$matches[4]}.{$matches[5]}&quot;;\n }\n\n private function prepareAbsoluteDefaultName(array $matches): string\n {\n $absoluteBundlePath = $matches[1] . &quot;/&quot; . self::VIEWS_DIR;\n return &quot;{$absoluteBundlePath}/{$this-&gt;defaultTemplatesPath}/{$matches[2]}/{$matches[3]}.{$matches[4]}.{$matches[5]}&quot;;\n }\n\n private function prepareAbsolutePartnerName(array $matches, string $city): string\n {\n $absoluteBundlePath = $matches[1] . &quot;/&quot; . self::VIEWS_DIR;\n return &quot;{$absoluteBundlePath}/{$this-&gt;partner-&gt;getTemplatesPath()}/{$city}/{$matches[2]}/{$matches[3]}.{$matches[4]}.{$matches[5]}&quot;;\n }\n}\n</code></pre>\n<p>I tried to clear and warmup my cache and change template names</p>\n"^^ . + . + . + . + . + . + . + . + "Unable to cURL to localhost web app from within Docker container"^^ . + "1"^^ . + "@C3roe this may be the case honestly. the one thing that makes me say otherwise is the 'Database Connection Failed2' is an error message is put in my api.php that happens when it doesn't find db.php, and that's the first thing that pops up in the dump despite it not being the first thing in the file so honestly I don't think so but maybe."^^ . + . + "How to conditionally hide payment method based on shipping country in WooCommerce block-based checkout?"^^ . + "Yes i have tried to add php artisan migrate and I am getting another error "sqLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for db failed: Try again (Connection: mysql, SQL: select exists (select 1 from information_schema.tables where table_schema = schema() and table_name = 'migrations' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED')) as `exists`)" can you please help me if you have time?"^^ . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + "<p>I believe the filament blog is causing the issue.</p>\n<p>Make sure that you have your <code>filamentblog.route.prefix</code> enabled, or configured to a different route. If not, then it will cause conflict with the rest of your routes.</p>\n<p>Check the documentation <a href="https://filamentphp.com/plugins/firefly-blog#:%7E:text=Now%20you%20can%20start%20using%20the%20Filament%20Blog%20Plugin%20to%20manage%20your%20blog%20posts%20effectively.%20yourdomain.com/blogs%20You%20can%20change%20the%20route%20prefix%20in%20the%20filamentblog.php%20config%20file." rel="nofollow noreferrer">here</a>.</p>\n"^^ . + . + . + . + "1"^^ . + . + "We don't know the details, but in general yes applications can send HTTP requests to other domains. Are you having a specific problem or concern about this, in relation to your application?"^^ . + "php-glide"^^ . + . + . + . + "You still haven't explained anything about the problem itself. "(...) is not solved in this way" - what does that mean?"^^ . + "deprecated"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + "Wordpress stylesheet not loading, css styles not appearing, docker compose"^^ . + . + "0"^^ . + "0"^^ . + . + "1"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + "3"^^ . + . + . + "-1"^^ . + "0"^^ . + . + "substr"^^ . + . + "Everyone who assisted, thanks for the input. This turned out to be related to `www.` prefix in the website name. See my answer below."^^ . + . + . + . + . + . + "Ah ok, you mean after `$n =& $p`, `$n` doesn't point to the memory location that stores the actual value, it points indeed to the in memory ZVAL structure (which in turns stores the actual value). In case of class's instances (i.e. objects) the ZVAL structure stores an ID pointing to the actual object/instance in memory. Right ?"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + "Also, missing the JSON body of the envelope that you're trying to create"^^ . + "learnpress"^^ . + . + . + . + . + . + "<p>You have to pass an Object of type <code>Key</code> to the decode-method, not the textual key itself.</p>\n<pre><code>$publicKey = new Key(file_get_contents('publicKey.key'), 'RS256');\n$decodedJWT = JWT::decode($jwt, $publicKey);\n</code></pre>\n"^^ . + . + . + . + "I don't use Laravel, but have you seen the discussion here: https://github.com/laravel/framework/discussions/50902"^^ . + . + . + "3"^^ . + "@Dmitry Take a look at the addition in my answer, it should work as you expect."^^ . + . + "0"^^ . + "http-status-code-405"^^ . + . + . + . + "2"^^ . + "0"^^ . + "1"^^ . + . + "-1"^^ . + "0"^^ . + "2"^^ . + . + . + "0"^^ . + . + "Which version of Laravel 5 is it? Did you dump the query to see what is really executing? do basic debugging and come back with info please"^^ . + "-2"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + "0"^^ . + "Your code is wrong on so many levels. I'd suggest starting with David's advice, there are a lot of `if` that have syntax errors."^^ . + . + "^^ this is what I mean in the Staging Ground when I asked you to provide the "rendered HTML". It just means the _output_ of your code - i.e. the final HTML data that your PHP code constructs sends to the browser for display. It doesn't mean a screenshot of your page - we can't fix pictures, only code."^^ . + . + . + . + "1"^^ . + . + "@Sitepor500.com.br: it isn't really "a long string" as you say in your question, not sure your test is significant. Things you can try: 1) test it without the "first character discrimination". (remove the first non-capturing group too) 2) distribute the last word-boundary in the two branches. Other approach: if you have several transformations to do on a same string, try to make them all at once using intl/transliterator."^^ . + . + . + . + "1"^^ . + . + "'You can use this too' doesn't really explain how the answer solves the problem."^^ . + "What in case the three chars not appear as last? Are you certain that never happens? For example `112233344`"^^ . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + "1"^^ . + "This is not possible. Returns 0 means you didn't change the data. Hence it didn't change. Before starting to argue with me, please proceed to https://phpize.online/, write a code that behaves the way you describe here, and submit a link here in the comments. This will make this argument more substantial than a thousand words"^^ . + . + "<p>Given this class:</p>\n<pre><code>class ValueObject\n{\n public function __construct(public string $value)\n {\n }\n\n public function __toString(): string\n {\n return $this-&gt;value . &quot;; this I can control&quot;;\n }\n}\n</code></pre>\n<p>Instances will can be casted to <code>bool</code>, <code>int</code>, and <code>float</code> yet their value is a truthy 1 / true result. It should not be allowed:</p>\n<pre><code>$object = new ValueObject('42');\nprint_r([\n (int) $object, // should throw\n (float) $object, // should throw\n (bool) $object, // should throw, but only for this class instances, yet ok if not possible\n (string) $object, // I can make it throwable via `::__toString()`\n]);\n</code></pre>\n<p>will print:</p>\n<pre><code>Array\n(\n [0] =&gt; 1\n [1] =&gt; 1\n [2] =&gt; 1\n [3] =&gt; 42; this I can control\n)\n</code></pre>\n<p>I do see warnings for float and int:</p>\n<pre><code>PHP Warning: Object of class Application\\ValueObject could not be converted to int \nPHP Warning: Object of class Application\\ValueObject could not be converted to float\n</code></pre>\n<p>yet on first glance the code appears as if working, yet it uses meaningless data.</p>\n<p>How can I turn these warnings into an error?</p>\n<p>Either for all of these int and float castings, yet better: only for this very class instances.</p>\n<p>I can hook into the <code>::__toString()</code> magic methods, yet there are no equivalents for like <code>::__toFloat()</code> or <code>::__toInt()</code>.</p>\n<hr />\n<p>I am on php 8.0.30.</p>\n<hr />\n<p>I realized that <a href="https://stackoverflow.com/a/32822054/457268">this answer</a> would work for me:</p>\n<pre><code>function exception_error_handler(int $errno, string $errstr, string $errfile = null, int $errline) {\n if (!(error_reporting() &amp; $errno)) {\n // This error code is not included in error_reporting\n return;\n }\n throw new \\ErrorException($errstr, 0, $errno, $errfile, $errline);\n}\nset_error_handler(__NAMESPACE__ . &quot;\\\\exception_error_handler&quot;);\n</code></pre>\n<p>Yet I rather only have certain warnings be converted to an Error, not all due to legacy codebase and keeping the impact as low as possible.</p>\n<p>Hence, want to throw the error only for specific instances.</p>\n"^^ . + "This is a valiant effort to answer an unclear question, but we prefer instead to have the asker first clarify their question. The good news is that 3 people have already found this answer helpful."^^ . + "`\\K` is brilliant. It often spares the need for capture groups."^^ . + . + . + . + . + . + "0"^^ . + "Could it be a caching issue?"^^ . + "How to initialize member variable for phpunit test for them to be defined during dataProvider?"^^ . + "1"^^ . + "<p>I have a HTML / php form that I initially tried to to use,\n<code>$ipAddress = $_Server[‘HTTP_CLIENT_IP’]; </code>\nbut that only returned a &quot;NULL&quot; in my DB (DB data type is set to VARCHAR)</p>\n<p>So I did some digging and found someone suggested i use the following...</p>\n<pre><code>function get_client_ip() {\n $ipAddress = '';\n if ($_SERVER['HTTP_CLIENT_IP'])\n $ipAddress = $_SERVER['HTTP_CLIENT_IP'];\n else if ($_SERVER['HTTP_X_FORWARDED_FOR'])\n $ipAddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if ($_SERVER['HTTP_X_FORWARDED'])\n $ipAddress = $_SERVER['HTTP_X_FORWARDED'];\n else if ($_SERVER['HTTP_FORWARDED_FOR'])\n $ipAddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if ($_SERVER['HTTP_FORWARDED'])\n $ipAddress = $_SERVER['HTTP_FORWARDED'];\n else if ($_SERVER['REMOTE_ADDR'])\n $ipAddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipAddress = 'UNKNOWN';\n\n return $ipAddress;\n}\n$clientipAddress = get_client_ip();\n</code></pre>\n<p>I thought this would at least get it to return an &quot;UNKONWN&quot; value, but its still returning &quot;NULL&quot;.</p>\n<p>Is this a sure sign that my issue is on the DB side and not the PHP?</p>\n"^^ . + "its didnt group by data by id ;("^^ . + . + . + . + . + . + . + "0"^^ . + . + "3"^^ . + . + "If there was any actual error with the query, surely that should throw an exception. Does it go wrong for _all_ of the possible integers you are passing in, or just for some?"^^ . + . + . + . + . + . + . + . + . + "<p>I want to test runkit7 pecl library for php8.0.</p>\n<p>I installed it via:</p>\n<pre><code>pecl install runkit7-4.0.0a6\n</code></pre>\n<p>I have added in my <code>php.ini</code>:</p>\n<pre><code>runkit.internal_override\n</code></pre>\n<p>I made sure that my proper <code>php.ini</code> is used, yet when I try to use it via:</p>\n<pre><code>&lt;?php\n\n// phpinfo();\n\nclass OverrideMe\n{\n\n public static function getFoo(): string\n {\n return 'gnarf!';\n }\n}\n\nrunkit7_method_redefine(OverrideMe::class, 'getFoo', 'return \\'Foo\\'');\n\nvar_dump(OverrideMe::getFoo());\nvar_dump(OverrideMe::getFoo() === 'Foo');\n</code></pre>\n<p>I still I see the error:</p>\n<blockquote>\n<p>PHP Fatal error: Uncaught Error: Call to undefined function\nrunkit7_method_redefine()</p>\n</blockquote>\n<p>What am I missing?</p>\n"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + "Answer for @hakre this is same connection, same API Laravel. I just request to that API Laravel using NGINX why it's very complicated. Because, using Apache it's okay, no problem with my request. It just when i want using NGINX. It means i can't using NGINX or NGINX can't multiple request like my example?"^^ . + . + "Phpmyadmin return blank page on digital ocean vps with LAMP installed (mbstring error)"^^ . + . + . + . + "1"^^ . + . + . + "0"^^ . + . + ""I added a custom permalink" - Usually when you register a custom route with dynamic parameters you register those parameter names with WordPress which allows you to use [`get_query_var`](https://developer.wordpress.org/reference/functions/get_query_var/) to pull them out."^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + "<p>Try adding networks to your docker compose. Like this</p>\n<pre><code> db:\n platform: &quot;linux/amd64&quot;\n image: mysql:5.7\n env_file:\n - .env\n environment:\n MYSQL_ROOT_PASSWORD: root\n MYSQL_DATABASE: laravel\n MYSQL_USER: laravel\n MYSQL_PASSWORD: secret\n ports:\n - &quot;3307:3306&quot;\n volumes:\n - dbdata:/var/lib/mysql\n networks:\n network_default:\n aliases:\n - 'laravel.db.host'\n</code></pre>\n<p>At the end of your docker-compose.yml add</p>\n<pre><code>networks:\n network_default: ~\n</code></pre>\n<p>And in your.env set DB_HOST</p>\n<pre><code>DB_HOST=laravel.db.host\n</code></pre>\n"^^ . + . + . + "0"^^ . + . + . + . + . + . + "2"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + . + "0"^^ . + . + . + . + . + . + "A DataProcessor should not be responsible when it's already saved "wrong" to the database. For that, the HTMLparser_db RTE/TS config would be used, so we'd have to inspect that. parseFunc would only be for the output, I sadly overread that it's happening for saving already. Try to edit the active Processing.yaml directive `processing.allowTags` to add video/source/track there. Could also be that the htmlSanitizer is mangilng this, so also try to set htmlSanitize: false in your YAML to see if that is changing this on SAVE."^^ . + . + "1"^^ . + "0"^^ . + . + "0"^^ . + . + . + "drupal"^^ . + . + "1"^^ . + . + . + . + . + . + "In general you cannot use PHP packages anymore without something like Composer. That's regrettable, but for all those that do use Composer it makes life a lot easier."^^ . + . + . + . + . + "What would be the runtime performance of such an approach with 5266 codes? Not to mention the [PCRE limits](https://stackoverflow.com/questions/20428649/pcre-not-supporting-patterns-more-than-1024-length-in-c)."^^ . + "permission-denied"^^ . + . + "0"^^ . + "Why can't you use composer? If you can't use composer on your server, you can use it in your local development environment. Install everything locally using composer, develop and test your code, and then when you're ready to deploy it you can just copy the files that composer installed directly to your server. No need to re-run composer on the server."^^ . + "0"^^ . + . + "samesite"^^ . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "Brilliant, thank you - running that in Terminal gives **/usr/local/bin/php**, so my new PHP command is: `$cmd = '/usr/local/bin/php tasks/simple.php';` - and it now works! Do you want to add that as a quick answer, so I can accept it. Thanks again. :-)"^^ . + . + . + "recaptcha-v3"^^ . + . + . + . + . + "django"^^ . + . + "0"^^ . + . + "<p>The following code is simple and works when trying to compare previous values from one column to the next. The only problem is that it is displayed one row below where I want. So the numbers do not line up such as:</p>\n<pre><code>$300 - \n$100 - 200% increase\n$50 - 100% increase\n</code></pre>\n<p>So it looks like its showing that there was a 200% increase between $50 and $100 when that should be pushed up one row so that the 200% is from $100 to $300. I would like it to display like:</p>\n<pre><code>$300 - 200% increase\n$100 - 100% increase\n$50 - \n</code></pre>\n<p>This is the code I am using:</p>\n<p>I added this inside of the while loop:</p>\n<pre><code>while ($change_row = mysql_fetch_array($result)\n{\n\n if ($prev_row &amp;&amp; ($prev_row &gt; $change_row['change_pay']) ) \n {\n\n\n // The percentage increase from 30 to 40 is: \n // (40-30)/30 * 100 = 33% \n\n $change_diff = (($prev_row-$change_row['change_pay'])/$change_row['change_pay'] * 100);\n\n $change = '&lt;font color=&quot;green&quot;&gt;'. number_format($change_diff, 2).'%&lt;/font&gt;';\n }\n elseif ( strlen($prev_row) &lt; 2 )\n {\n $change = '-';\n }\n else\n {\n\n //The percentage decrease from 40 to 30 is:\n // (40-30)/40 * 100 = 25%. \n\n $change_diff = (($prev_row-$change_row['change_pay'])/$prev_row * 100);\n\n $change = '&lt;font color=&quot;red&quot;&gt;'. number_format($change_diff, 2).'&lt;/font&gt;';\n }\n\n $prev_row = $change_row['change_pay'];\n}\n</code></pre>\n<p>the $change variable will be displayed inside the while loop that I didn't show in the code above next to the current value, like:</p>\n<pre><code>&lt;td class=&quot;bigtext&quot;&gt; &lt;b&gt;'.$change.'&lt;/b&gt; &lt;/td&gt;\n&lt;td class=&quot;bigtext&quot;&gt; &lt;b&gt;'.$change_row['change_pay'].'&lt;/b&gt; &lt;/td&gt;\n</code></pre>\n<p>I am wondering how to modify this code so that it pushes the results up one row, or is it impossible and have to be rewritten? The only thing I can think of is somehow using the while loop for the mysql results from the DB and then placing the $change values in an array then using a foreach loop for the html rows? Or maybe you know a better way. Thanks</p>\n"^^ . + . + "And keep in mind that gmail ignores quite a lot of characters in the first part of the email address. To gmail, `ss@gmail.com` and `s.s@gmail.com` are both valid email addresses, and will deliver to the `ss` mailbox."^^ . + "2"^^ . + . + "OK, and so how did you actually solve it?"^^ . + "I'm using the free version of JQgrid, version. (this is my first experience with JQgrid so I wasn't aware of the Guriddo version) Personally, I would love to just create the grid using standard JavaScript but I'm still learning how to use it and having trouble getting my AJAX calls to work correctly. (I'm a core PHP developer and not really a big fan of frameworks)"^^ . + . + "<p>APCu is not working properly and I'm hoping to get help to understand what the problem might be, and hopefully how to fix it.</p>\n<p>apcu_store('x') stores an entry and a value just fine. But when the entry is deleted and created again with a new value it starts switching back and forth between the old and the new value. I've tried both apcu_add('x') and apcu_store('x') but they are equally unreliable.</p>\n<p>Also there is issue with that apcu_exists('x') doesn't find the entry at all, sometimes! When I run apcu_cache_info() there is an entry stored, but apcu_exists() doesn't always find it. Sometimes it does, but sometimes it doesn't...</p>\n<p>Eventually the data is lost completely from the cache even though the ttl of the entry is set to several hours (21600).</p>\n<p>Can anyone please tell me what the issue might be and if I can fix it?</p>\n<p>I want to store a few lines of ID's in an array from the database, not much data to be talking about at all!</p>\n<p>Windows 11\nx64-system\nPHP 8.1.23\nAPCu version 5.1.23 (NTS for x64, PHP 8.1) (also tried 5.1.24)\nLocalWP running a WordPress site.</p>\n<p>SUMMARY:\nI tried apcu_fetch('x') and expect correct value in return.\nAfter apcu_delete('x') and apcu_store('x') with new value I get sometimes the new value and sometimes the old value with apcu_fetch('x').</p>\n<p>I tried to check for the entry with apcu_exists('x') but this also give unreliable returns. Sometimes it finds the entry, sometimes it doesn't.</p>\n<p>I use apcu_cache_info() to see that there is a stored value, but eventually the cache is cleared even though not close to have ttl run out.</p>\n"^^ . + . + . + . + "How can I count how many times multiple items show up in a database?"^^ . + . + . + "0"^^ . + . + . + "1"^^ . + . + . + . + "1"^^ . + "<p>I solved this problem by changing the permission that had a double command in my YML. That's my mistake.</p>\n<pre><code> # Set ownership for the entire project\n chown -R www-data:www-data /var/www/balxxx\n\n # Set appropriate permissions for storage and cache directories\n chmod -R 775 /var/www/baltic-union-bank/storage /var/www/balxxx/bootstrap/cache\n</code></pre>\n<p>I change to this</p>\n"^^ . + . + "fee"^^ . + . + . + . + . + "-1"^^ . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + "@hakre\nAs for the old method that I was talking about, I saw it in one of the videos and I do not have it now. I apologize for this matter."^^ . + . + . + "2"^^ . + . + "hash"^^ . + "Not really sure exactly what you're asking. What does "seems to work" mean? You devise some test cases which would elicit the behaviour you're expecting. Then you test against them. Either it passes, or it doesn't - it's hard to understand how you can only conclude that it "seems to" work, it's very much a binary thing. If you're still not sure you've got satisfactory information to be sure you've met your requirements, consider applying different tests. We don't know what test you used or what results you got."^^ . + . + . + "2"^^ . + "0"^^ . + . + . + . + "<p>I am working on <code>Laravel 11</code> app. I am using <code>yajra/datatables</code> and datetimes in the db are correct but however when <code>yajra/datatables</code> displays them in the frontend they are an hour behind? I've been googling for an hour can't find anything useful. It happens for all my <code>datatables</code>. My timezone in <code>app.php</code> is &quot;Europe/Berlin&quot;. Here is an example <code>DataTable</code> file:</p>\n<pre><code>&lt;?php\n\nnamespace App\\DataTables;\n\nuse App\\Helpers\\Helper;\nuse App\\Models\\Tool;\nuse Illuminate\\Database\\Eloquent\\Builder as QueryBuilder;\nuse Yajra\\DataTables\\EloquentDataTable;\nuse Yajra\\DataTables\\Html\\Builder as HtmlBuilder;\nuse Yajra\\DataTables\\Html\\Column;\nuse Yajra\\DataTables\\Services\\DataTable;\n \nclass PeopleDataTable extends DataTable\n{\n public function dataTable(QueryBuilder $query): EloquentDataTable\n {\n return (new EloquentDataTable($query))-&gt;setRowId('id');\n }\n \n public function query(Tool $model): QueryBuilder\n {\n return $model-&gt;newQuery();\n }\n \n public function html(): HtmlBuilder\n {\n return $this-&gt;builder()\n -&gt;setTableId('people-table')\n -&gt;parameters(Helper::datatablesLanguageParameters())\n -&gt;columns($this-&gt;getColumns())\n -&gt;minifiedAjax()\n -&gt;selectStyleSingle()\n -&gt;orderBy(0, 'asc')\n -&gt;ajax(route('people.data'));\n }\n \n public function getColumns(): array\n {\n return [\n Column::make('id'),\n ['name' =&gt; 'name', 'data' =&gt; 'name', 'title' =&gt; __('text.name')],\n ['name' =&gt; 'department', 'data' =&gt; 'department', 'title' =&gt; __('text.department')],\n ['name' =&gt; 'phone', 'data' =&gt; 'phone', 'title' =&gt; __('text.phone')],\n ['name' =&gt; 'email', 'data' =&gt; 'email', 'title' =&gt; __('text.email')],\n ['name' =&gt; 'updated_at', 'data' =&gt; 'updated_at', 'title' =&gt; __('text.updated_at')],\n ['name' =&gt; 'actions', 'data' =&gt; 'actions', 'title' =&gt; __('text.actions')],\n ];\n }\n \n protected function filename(): string\n {\n return 'People_'.date('YmdHis');\n }\n}\n</code></pre>\n<p>and here is the data route in the controller:</p>\n<pre><code>/**\n * Provides data in json for the indexTableView endpoint.\n * \n * @return JsonResponse \n * @throws Exception \n */\nfunction data()\n{\n $people = Person::query()\n -&gt;select(\n [\n 'people.id', \n 'people.name', \n 'people.department',\n 'people.phone',\n 'people.email',\n 'people.created_at', \n 'people.updated_at', \n 'rfids.rfid_unique_id',\n 'rfids.status',\n ]\n )\n -&gt;leftJoin('rfids', 'rfids.id', '=', 'people.rfid_id');\n\n return (new DataTables)\n -&gt;eloquent($people)\n -&gt;addColumn('status', function (Person $person) {\n return HtmlService::statusHtml($person);\n })\n -&gt;addColumn('actions', function (Person $person) {\n return HtmlService::generateActions($person, 'person');\n })\n -&gt;rawColumns(['status', 'actions'])\n -&gt;toJson();\n}\n</code></pre>\n<p>EDIT 1! When I add this:</p>\n<pre><code>-&gt;editColumn('updated_at', function (Person $person) {\n return $person-&gt;updated_at;\n })\n</code></pre>\n<p>the datetime is correct. Still, I don't want to add <code>editColumn</code> to all my <code>datatables</code> there must be a way to disable this behaviour.</p>\n"^^ . + . + . + "0"^^ . + . + . + . + . + "1"^^ . + . + "0"^^ . + "1"^^ . + . + "darkmode"^^ . + "0"^^ . + . + "Activate scheduled command task in laravel 11"^^ . + "2"^^ . + . + "0"^^ . + . + . + "<p>I'm trying to build PHP 8.4 from source with GD/zlib enabled on Unix</p>\n<pre><code>root@dev:/ # uname -a\nFreeBSD dev 14.2-RELEASE FreeBSD 14.2-RELEASE releng/14.2-n269506-c8918d6c7412 GENERIC amd64\n</code></pre>\n<p>When I run <em>make</em> I get (just showing the first few lines)</p>\n<pre><code>ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC\n&gt;&gt;&gt; defined in /usr/local/lib/libz.a(gzwrite.o)\n&gt;&gt;&gt; referenced by gzwrite.c\n&gt;&gt;&gt; gzwrite.o:(gzwrite) in archive /usr/local/lib/libz.a\n\nld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC\n&gt;&gt;&gt; defined in /usr/local/lib/libz.a(gzread.o)\n&gt;&gt;&gt; referenced by gzread.c\n&gt;&gt;&gt; gzread.o:(gzread) in archive /usr/local/lib/libz.a\n\nld: error: relocation R_X86_64_32S cannot be used against local symbol; recompile with -fPIC\n&gt;&gt;&gt; defined in /usr/local/lib/libz.a(gzlib.o)\n&gt;&gt;&gt; referenced by gzlib.c\n&gt;&gt;&gt; gzlib.o:(gz_open) in archive /usr/local/lib/libz.a\n</code></pre>\n<p>My configure command (PKG_CONFIG_PATH set to overcome a libjpeg error):</p>\n<pre><code>setenv PKG_CONFIG_PATH /usr/local/lib/pkgconfig\n./configure \\\n--with-apxs2=/usr/local/apache/bin/apxs \\\n--without-pdo-sqlite --without-sqlite3 --without-iconv \\\n--with-config-file-path=/usr/local/etc \\\n--enable-bcmath --without-cdb \\\n--enable-gd --without-iodbc \\\n--without-gdbm --with-ndbm --without-db2 --without-dbm \\\n--without-readline --with-openssl \\\n--without-db3 --enable-dba \\\n--with-curl \\\n--with-jpeg --enable-calendar \\\n--with-mhash --enable-mbstring=all \\\n--with-zlib \\\n--enable-exif --with-zip \\\n--with-mysqli=mysqlnd\n</code></pre>\n<p>I tried setenv ZLIB_CFLAGS -fPIC before running configure and make</p>\n<p>I tried to rebuild zlib</p>\n<pre><code>root@dev:/usr/local/zlib-1.3.1 # make -fPIC\nmake: cannot open PIC.\n</code></pre>\n<p>I also installed zlib from pkg install lzlib-1.14_1 - still getting the error</p>\n<p>On csh</p>\n"^^ . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + . + "1"^^ . + "Yes, I've thought about it. All three solutions address this issue. One of Laravel's best features is its routing system, which every native PHP application should also implement. Of course, on very old websites, it might be missing."^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + "datepicker"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + "How to prevent race condition laravel 11"^^ . + . + "0"^^ . + "0"^^ . + . + . + "1"^^ . + . + . + . + "`to give users the possibility to set privacy rights`...what do you mean? Perhaps you need to [edit] your question and explain the situation a little better. Are you saying you want each user to choose whether _other users_ can write things about them? Originally it sounded like you wanted to allow each user to choose what they themselves are allowed to write."^^ . + . + "<p>I'm using <strong>AWS SDK for PHP (Version 3)</strong> to configure S3 bucket lifecycle rules via <code>PutBucketLifecycleConfiguration</code>. However, I’m getting the following error:</p>\n<pre><code>Aws\\S3\\Exception\\S3Exception: Error executing &quot;PutBucketLifecycleConfiguration&quot; on &quot;http://ceph:8000/testcachebucket?lifecycle&quot;; AWS HTTP error: Client error: `PUT http://ceph:8000/testcachebucket?lifecycle` resulted in a `400 Bad Request` response:\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;Error&gt;&lt;Code&gt;InvalidRequest&lt;/Code&gt;&lt;Message&gt;Missing required header for this reques (truncated...)\n InvalidRequest (client): Missing required header for this request: Content-MD5 - &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;Error&gt;&lt;Code&gt;InvalidRequest&lt;/Code&gt;&lt;Message&gt;Missing required header for this request: Content-MD5&lt;/Message&gt;&lt;BucketName&gt;testcachebucket&lt;/BucketName&gt;&lt;RequestId&gt;tx000000000000000000608-0067bc52d0-16f97-default&lt;/RequestId&gt;&lt;HostId&gt;16f97-default-default&lt;/HostId&gt;&lt;/Error&gt;\n</code></pre>\n<p>According to the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html" rel="nofollow noreferrer">AWS documentation</a>, the <code>Content-MD5</code> header is required when making a REST API request. However, the PHP SDK documentation does not explain how to include it.</p>\n<p>Here’s my current code:</p>\n<pre class="lang-php prettyprint-override"><code>$this-&gt;s3Client-&gt;PutBucketLifecycleConfiguration([\n 'Bucket' =&gt; $bucket,\n 'LifecycleConfiguration' =&gt; [\n 'Rules' =&gt; $opts,\n ],\n]);\n</code></pre>\n<p>How can I correctly make a request that includes the <code>Content-MD5</code> header in AWS SDK for PHP?</p>\n"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + "'is a vendor file that I cannot delete' - could you apply a patch to the vendor's code after install but before the class definition is loaded? Then you could append something like 'Orig' to the name of the original class, then you'd be free to define your own class with the vendor's class name"^^ . + "0"^^ . + "0"^^ . + . + "<p>Ok I finally found a &quot;solution&quot;.<br />\nThe problem comes from version of my Ceph server which is in <strong>Pacific</strong> version. Normally, middleware (<code>ApplyChecksumMiddleware.php</code>) should add this check automatically, but this is not the case on older Ceph servers like mine.</p>\n<p>Indeed, AWS has modified its SDK to use <strong>CRC32 or SHA</strong> instead of <strong>MD5</strong> in recent versions, making compatibility with Ceph Pacific problematic.</p>\n<p><strong>Solution:</strong><br />\nTo get around this problem, simply add the following constraint to <strong>composer.json</strong> to prevent the installation of incompatible versions of the SDK:</p>\n<pre class="lang-json prettyprint-override"><code>“conflict&quot;: {\n “aws/aws-sdk-php&quot;: ”^3.337”\n}\n</code></pre>\n<p>This forces the use of an earlier version of the SDK that maintains the MD5 verification required by Ceph Pacific.</p>\n"^^ . + . + "0"^^ . + "0"^^ . + "Sadly, your answer does not work for my data. It does not split the data at all and returns the whole string unchanged and an empty string as the output. This is why I posted a question as my situation seems to have more to it than the proposed answer on the other post."^^ . + "@JensV I am using a Windows OS, I read `no. 6` was a common problem in Windows. My aim is to solve `Unable to find the controller for path &quot;/api/login_check&quot;. The route is wrongly configured. (404\n Not Found)`"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + "How to setup php project on web hosting"^^ . + . + . + . + . + "ffmpeg-php"^^ . + . + . + "Thanks for your answer! Unfortunately the finish call in the Rest API doesn't seem to be accessible to me (returning a 404)?"^^ . + . + "1"^^ . + "Failed Image Conversion on Laravel Queue from Spatie Media Library"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + . + "0"^^ . + . + . + "Is it possible you have multiple yables with the same name, just in different databases? The query in the php code has a database name specified in the from clause, while the one executed in the sql client does not."^^ . + . + "0"^^ . + "Not able to access POST params in PHP when called from JS"^^ . + . + "1"^^ . + "1"^^ . + "`errors persist during the process` - can you document what these are other than `Error messages related to UUID creation`?"^^ . + "1"^^ . + . + . + . + . + "<p>I've got the Xdebug plugin working with Sublime Text 3 (as well as the SFTP plugin), and I can successfully set breakpoints and have the Xdebug Context pane populate with every variable in my phpBB site; and I can expand arrays and examine their contents. But it escapes me as to how to find, among the hundreds of variables in the list, a particular variable of interest and its value. Nor can I find where it's documented as to how to find it. Are there any good resources for this? As I say, I have the basics working - this fundamental step eludes me and prevents me from debugging.</p>\n<p><img src="https://i.sstatic.net/TMIXTazJ.jpg" alt="Xdebug Context pane" /></p>\n<p>I tried issuing printf's in the console window, but no matter what I enter there, I get &quot;SyntaxError: invalid syntax&quot;</p>\n<hr />\n<p><strong>Edit:</strong> I've stumbled on the solution! Once you've hit a breakpoint and the Xdebug Context presents, give that tab focus and do a <kbd>Ctrl + F</kbd> - a &quot;Find&quot; dialog presents at the bottom of the Sublime window that permits you to search for a variable. The <code>&quot;&quot;</code> button permits you to constrain the search to exactly what's typed, because e.g., &quot;alpha&quot; is contained within &quot;alphanumeric&quot;:</p>\n<p><a href="https://i.sstatic.net/ZxiuRImS.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZxiuRImS.jpg" alt="Screenshot of Find Dialog" /></a></p>\n"^^ . + . + . + . + . + "<p>I add something similar and I manually forced several times till it works :</p>\n<ul>\n<li>Add this line in your code <code>&lt;meta name=&quot;robots&quot; content=&quot;noindex, nofollow&quot;&gt;</code></li>\n<li>In Google Search Console go to setting and in the Crawl Stats you can click on <strong>Request Indexing</strong>.\nGoogle will then re-crawl your site.</li>\n</ul>\n<p>Do not hesitate to check the size of your icon : if it is bigger than <strong>48x48px</strong> the crawlers may not find it.\nLast thing you can do is use <strong>absolute</strong> path instead of relative one.</p>\n<p>Hope this help</p>\n"^^ . + . + . + "so php wont work in any way right? because php only render at load, not for each route change ? I think that I had the impression that angular change meta tags and title, but it just change the title from angular title service.. In reality, php don't know how to handle these routes"^^ . + . + . + . + . + "_"Is there generic way to do this?"_ No, because this greatly varies / it is unclear what is _exactly_ wanted. This does not work generically. An example is how PHP is doing it generically and how MySql is doing it generically, for example in [_How to subtract/add years/month intervals to a date (like MySQL INTERVAL expression)_ (Q&A)](https://stackoverflow.com/a/79391813/367456). It also has more references, e.g. to SQLite for comparison."^^ . + . + . + "0"^^ . + "@Richard - yes, you are correct! A mix of PHP-HTML without any client side scripts that are prone to be manipulated."^^ . + . + . + . + . + "Update 2 : The new code works when 1 product added to cart but not when more than 1 added."^^ . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + "<p>The problem was in the Java code line:</p>\n<pre><code>if(APIRequest.checkIP(incomingIP, incomingHostname)) {\n}\n</code></pre>\n<p>Turns out the API request to check if the IP is in the list of allowed IPs took too long which caused the PHP script to timeout.</p>\n<p>I removed the API request to check and moved the IP check into the java code itself for testing, basically I hard-coded the hostname which it needed to check if the incoming hostname matches that since then I wouldn't need to wait for the API to respond.</p>\n<p>But that also gave me some troubles as <code>addr.getHostName();</code> and <code>contains()</code> in an <code>if</code> statement still caused the script to take too long sometimes so I removed it temporarily. After I removed the <code>addr.getHostName()</code> check completely, the script works perfectly. I'm not sure why it still times out even with hard-coded values.</p>\n"^^ . + "0"^^ . + . + . + "command-line-interface"^^ . + . + "3"^^ . + . + . + . + "0"^^ . + . + . + "Among other things, the *date* of the book is important here; a lot of internal implementation details changed dramatically in PHP 7. The linked answer goes into that and a whole lot of other details."^^ . + . + . + . + "1"^^ . + . + "1"^^ . + "4"^^ . + . + . + . + "0"^^ . + . + . + . + "Sorry Sir, It's working now, forgot to input the dates ^^. Thank you so much."^^ . + . + . + . + . + . + . + "0"^^ . + "Try `Auth::guard('api')` instead of just `Auth`"^^ . + . + "<p>Yes. This is exactly why CURLOPT_REFERER exist: to customize the referer header.\nSee</p>\n<pre><code>hans@LAPTOP-O1AO16UE:~$ cat wut.php \n&lt;?php\n\n$ch = curl_init();\ncurl_setopt_array($ch,array(\nCURLOPT_URL=&gt;'http://example.com',\nCURLOPT_REFERER=&gt;'http://google.com/',\nCURLOPT_VERBOSE=&gt;1\n));\ncurl_exec($ch);\nhans@LAPTOP-O1AO16UE:~$ php wut.php \n* Host example.com:80 was resolved.\n* IPv6: 2600:1406:bc00:53::b81e:94ce, 2600:1406:bc00:53::b81e:94c8, 2600:1406:3a00:21::173e:2e66, 2600:1406:3a00:21::173e:2e65, 2600:1408:ec00:36::1736:7f24, 2600:1408:ec00:36::1736:7f31\n* IPv4: 23.192.228.84, 96.7.128.198, 23.215.0.138, 23.215.0.136, 23.192.228.80, 96.7.128.175\n* Trying 23.192.228.84:80...\n* Connected to example.com (23.192.228.84) port 80\n&gt; GET / HTTP/1.1\nHost: example.com\nAccept: */*\nReferer: http://google.com/\n\n&lt; HTTP/1.1 200 OK\n&lt; Content-Type: text/html\n(...)\n</code></pre>\n<p>The keyword here is <code>Referer: http://google.com/</code></p>\n"^^ . + "Custom Post Type Wordpress, issue saving Image Gallery"^^ . + . + "APCu being unreliable, how to fix it?"^^ . + "This is rare, and what you have up there should work out of the box. If adding `@livewireStyles` and `@livewireScripts` doesn't help, i suggest trying another browser or machine"^^ . + "0"^^ . + "Your common Sense: my code actually is mysqli_query, not mysql_query. What problems are there in my code other than that?"^^ . + . + . + . + . + "I always found it easier to keep track of the token expiry date/time within my code, check the expiry datetime prior to trying to access any endpoint and refresh it if needed, rather than try to trap the error and retry my code. It's been a while since I was active on the Xero API, though. I'd also probably have your `refreshAccessToken()` function return the new tokens, rather than making the calling code retrieve them from a database every time. You're storing `ExpiresIn`, but not the date/time it applies to - better to add that value to current datetime and store it."^^ . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + "See https://stackoverflow.com/questions/39831708/catastrophic-backtracking, it is probably even a valid duplicate for this question."^^ . + "What is the question?"^^ . + "[How much research effort is expected of Stack Overflow users?](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users) . And [this](https://www.google.com/search?q=php+Null+Coalesce+assignment+%3F%3F%3D+operator). Really shouldn't have needed a new question with human intervention. Could have saved everyone some time - including yourself."^^ . + . + . + . + . + . + . + "[How to partially download a remote file with cURL?](https://stackoverflow.com/q/2032924)"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + . + "<p><a href="https://smarty-php.github.io/smarty/stable/designers/language-modifiers/" rel="nofollow noreferrer">https://smarty-php.github.io/smarty/stable/designers/language-modifiers/</a></p>\n<p>When working with arrays, the <code>|@foo</code> modifier syntax indicates to pass the whole array to the function callback, this is useful when performing counts eg <code>{$myArray|@count}</code></p>\n<p>In your situation you can omit the <code>@</code> prefix and create a callback function that works for a single string translation, and it will be applied to each item in the array. Or keep using the <code>@</code>, and handle the iteration inside of your callback function, and return the whole array, or invoke the <code>implode</code> function here to get your string output.</p>\n<p>The other approach is to avoid performing too much work in the smarty template engine, and perform your translations prior to assignment in your native PHP code.</p>\n"^^ . + "2"^^ . + . + . + . + . + . + . + "1"^^ . + "<p>I'm working in a PHP web service in which I need to concat PDF files into a single file.</p>\n<p>The problem is: Most PDFs are v1.7 and some are higher versions and I need to downgrade to PDF 1.4.</p>\n<p>I tried GhostScript and TCPDF but it seems not to work for all PDF versions and I don't know why.</p>\n<p>I need something that help me downgrade to 1.4 or something that can concat all PDF files regardless of version.</p>\n<p>It also needs to be something that works in both Linux and Windows OS because this service runs in many servers and there are some linux servers and a few windows servers (that can't be pivoted to linux servers).</p>\n<p>Do anyone has something that can help me out or give me a better direction?</p>\n"^^ . + "<p>Use <code>Chirp::with('user')-&gt;paginate(10)</code> directly in the Blade template without storing it in the state.</p>\n<p>Modify your Volt component to this:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php \nuse App\\Models\\Chirp;\nuse Livewire\\WithPagination;\n\n$chirps = Chirp::with('user')-&gt;latest()-&gt;paginate(10); \n?&gt;\n</code></pre>\n<p>Modify the Blade View:</p>\n<pre class="lang-html prettyprint-override"><code>&lt;div&gt;\n &lt;div class=&quot;mt-6 bg-white shadow-sm rounded-lg divide-y&quot;&gt;\n @foreach ($chirps as $chirp)\n &lt;div class=&quot;p-6 flex space-x-2&quot; wire:key=&quot;{{ $chirp-&gt;id }}&quot;&gt;\n ...\n &lt;/div&gt;\n @endforeach\n &lt;/div&gt;\n\n {{ $chirps-&gt;links() }}\n&lt;/div&gt;\n</code></pre>\n"^^ . + . + . + . + . + . + "<p>Hi i need php or other web languagues that have box ( ip address ) and two bottom ban or unban</p>\n<p>if select ban fetch ip address from box and run shell script</p>\n<p>script is gobgp global rib add -a ipv4 $ip/32 community 65000:666</p>\n<p>If select unban fetch ip address from box and run this shell script</p>\n<p>gobgp global rib del -a ipv4 $ip/32 community 65000:666</p>\n"^^ . + . + "0"^^ . + . + . + "<p>I am trying to search for future dated Woocommerce products, but the query is not working. As it happens, the _custom_date field values are stored in UK date format e.g. 24/01/2025. Any ideas?</p>\n<pre><code>$args = array(\n 'post_type' =&gt; 'product',\n 'posts_per_page' =&gt; 500, \n 'meta_query' =&gt; array(\n array(\n 'key' =&gt; '_custom_date',\n 'value' =&gt; date(&quot;d-m-Y&quot;),\n 'compare' =&gt; '&gt;=',\n 'type' =&gt; 'DATETIME',\n ),\n ),\n 'order' =&gt; 'ASC',\n );\n</code></pre>\n"^^ . + . + . + . + . + "Please [edit] your question with any and all updates such as code or data."^^ . + "403 means "Forbidden", so you have an issue with your authentication. It looks like you have an extra dot just before `$authKey` in the `Authorization` header."^^ . + . + "0"^^ . + "<p>Is it possible to build SPA (single page application) with Laravel?</p>\n<p>I want to build single page app that submits a form to that page, inserts a new number (into db) to the list and updates the list without reloading the full page.</p>\n<p>If that is possible, can you explain me how to do it?</p>\n<p>I added a button to delete the numbers table rows for resetting the number sequence, like this:</p>\n<pre><code> &lt;form action=&quot;/delete&quot; method=&quot;GET&quot;&gt;\n @csrf\n &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;Delete sequence&lt;/button&gt;\n &lt;/form&gt;\n</code></pre>\n<p>This is the route for that button:</p>\n<pre><code>Route::get('/delete', [NumberController::class, 'destroy'])-&gt;name('delete');\n</code></pre>\n<p>And this is the controller function:</p>\n<pre><code>public function destroy(Number $number)\n {\n DB::table('numbers')-&gt;delete();\n $data = Number::all();\n if ($data) {\n $bid = NumberController::checkBid();\n }\n $numbers = Number::all();\n return view('index', ['numbers' =&gt; $numbers, 'bid' =&gt; $bid]);\n }\n</code></pre>\n<p>But when I reset the table with the button I get this error:</p>\n<blockquote>\n<p>Attempt to read property &quot;id&quot; on null</p>\n</blockquote>\n<p>...on another function of the same controller which controls whether the number is in a specific interval.</p>\n<p>This is the function:</p>\n<pre><code>public function checkBid()\n{\n $bid = ['bid' =&gt; 'Fai girare', 'count' =&gt; 0];\n\n\n $lastNumber = DB::table('numbers')-&gt;orderBy('created_at', 'desc')-&gt;first();\n $lastColumn1 = DB::table('numbers')-&gt;where('column', '=', 1)-&gt;orderBy('created_at', 'desc')-&gt;first();\n $column1count = $lastNumber-&gt;id - $lastColumn1-&gt;id;\n\n $lastColumn2 = DB::table('numbers')-&gt;where('column', '=', 2)-&gt;orderBy('created_at', 'desc')-&gt;first();\n $column2count = $lastNumber-&gt;id - $lastColumn2-&gt;id;\n\n $lastColumn3 = DB::table('numbers')-&gt;where('column', '=', 3)-&gt;orderBy('created_at', 'desc')-&gt;first();\n $column3count = $lastNumber-&gt;id - $lastColumn3-&gt;id;\n\n $lastRow1 = DB::table('numbers')-&gt;where('row', '=', 1)-&gt;orderBy('created_at', 'desc')-&gt;first();\n $row1count = $lastNumber-&gt;id - $lastRow1-&gt;id;\n\n $lastRow2 = DB::table('numbers')-&gt;where('row', '=', 2)-&gt;orderBy('created_at', 'desc')-&gt;first();\n $row2count = $lastNumber-&gt;id - $lastRow2-&gt;id;\n\n $lastRow3 = DB::table('numbers')-&gt;where('row', '=', 3)-&gt;orderBy('created_at', 'desc')-&gt;first();\n $row3count = $lastNumber-&gt;id - $lastRow3-&gt;id;\n\n if ($column1count &gt;= 5) {\n $bid = [\n 'bid' =&gt; 'column1',\n 'count' =&gt; $column1count,\n ];\n return $bid;\n } elseif ($column2count &gt;= 5) {\n $bid = [\n 'bid' =&gt; 'column2',\n 'count' =&gt; $column2count,\n ];\n return $bid;\n } elseif ($column3count &gt;= 5) {\n $bid = [\n 'bid' =&gt; 'column3',\n 'count' =&gt; $column2count,\n ];\n return $bid;\n } elseif ($row1count &gt;= 5) {\n $bid = [\n 'bid' =&gt; 'row1',\n 'count' =&gt; $row1count,\n ];\n return $bid;\n } elseif ($row2count &gt;= 5) {\n $bid = [\n 'bid' =&gt; 'row2',\n 'count' =&gt; $row2count,\n ];\n return $bid;\n } elseif ($row3count &gt;= 5) {\n $bid = [\n 'bid' =&gt; 'row3',\n 'count' =&gt; $row3count,\n ];\n return $bid;\n } else {\n $bid = [\n 'bid' =&gt; 'Fai girare la ruota',\n 'count' =&gt; 0,\n ];\n return $bid;\n }\n return $bid;\n}\n</code></pre>\n<p>I get the error on this line becouse <code>$lastColum1-&gt;id</code> is null:</p>\n<pre><code> $column1count = $lastNumber-&gt;id - $lastColumn1-&gt;id;\n</code></pre>\n"^^ . + "parsing"^^ . + "0"^^ . + . + "<p>I have new Laptop which has windows 11 installed. I have also install XAMPP which has php 8.2.12 version. Now i want to install composer in my system but it is not allowing me to install. It gives me error like</p>\n<pre><code>The Composer installer script was not successful [exit code 1].\n\nOpenSSL failed with a 'certificate verify failed' error. This indicates a problem with \nthe Certificate Authority file(s) on your system, which may be out of date.\n\nCertificate location [from openssl.cafile ini setting]: \nC:\\xampp\\php\\cacert.pem\n\nThe php.ini used by your command-line PHP is: C:\\xampp\\php\\php.ini\n\nScript Output:\nThe &quot;https://getcomposer.org/versions&quot; file could not be downloaded: SSL operation \nfailed with code 1. OpenSSL Error messages:\nerror:0A000086:SSL routines::certificate verify failed\nFailed to enable crypto\nFailed to open stream: operation failed\n</code></pre>\n<p>I have change certificate file as suggest from CHAT GPT. as given below</p>\n<pre><code>curl.cainfo = &quot;C:\\xampp\\php\\cacert.pem&quot;\nopenssl.cafile = &quot;C:\\xampp\\php\\cacert.pem&quot;\n</code></pre>\n<p>I have also set environment variable PATH to C:\\XAMPP\\PHP\\PHP.exe and also check in CMD that it shows me PHP version 8.2.12 which is currently installed. I have also try to install composer manually using commands like</p>\n<pre><code>php -r &quot;copy('https://getcomposer.org/installer', 'composer-setup.php');&quot;\nphp composer-setup.php\nphp -r &quot;unlink('composer-setup.php');&quot;\n</code></pre>\n<p>But it gives me error like below</p>\n<pre><code>Downloading...\nThe &quot;https://getcomposer.org/versions&quot; file could not be downloaded: SSL operation failed \nwith code 1. OpenSSL Error messages:\nerror:0A000086:SSL routines::certificate verify failed\nFailed to enable crypto\nFailed to open stream: operation failed\nRetrying...\nThe &quot;https://getcomposer.org/versions&quot; file could not be downloaded: SSL operation failed \nwith code 1. OpenSSL Error messages:\nerror:0A000086:SSL routines::certificate verify failed\nFailed to enable crypto\nFailed to open stream: operation failed\nRetrying...\nThe &quot;https://getcomposer.org/versions&quot; file could not be downloaded: SSL operation failed \nwith code 1. OpenSSL Error messages:\nerror:0A000086:SSL routines::certificate verify failed\nFailed to enable crypto\nFailed to open stream: operation failed\nThe download failed repeatedly, aborting.\n</code></pre>\n<p>Can anyone suggest me what to do with this issue?</p>\n"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + "2"^^ . + . + "1"^^ . + . + . + "Not that it matters as `zen_not_null` is pretty consistent throughout the versions, this is being error'd on ZenCart 1.5.5 and 1.5.7."^^ . + . + . + . + "1"^^ . + "1"^^ . + . + . + "<p>I added my own error handler and check the <code>$errstr</code> for my <code>ValueObject::class</code> (this may in certain edge cases trigger false positive, yet for my usecase this suffices).</p>\n<p>I used:</p>\n<ul>\n<li><a href="https://stackoverflow.com/questions/32821976/convert-errors-notices-warnings-into-exceptions">Convert errors (notices/warnings) into exceptions?</a></li>\n<li><a href="https://stackoverflow.com/a/24303951/457268">Pass php error to default php error handler in my custom error handler</a></li>\n</ul>\n<p>for references.</p>\n<p>One has to keep in mind that the return value of the custom error handler is important, so one must return <code>false</code> there, otherwise the other warnings and errors would only be silenced.</p>\n<p>Hence this works as wanted for php7 (look at the linked answer for more recent versions):</p>\n<pre><code>&lt;?php\n\nnamespace YourNameSpace;\n\nfunction exception_error_handler(int $errno, string $errstr, string $errfile = null, int $errline) {\n if (!(error_reporting() &amp; $errno)) {\n // This error code is not included in error_reporting\n return false;\n }\n\n $needle = ValueObject::class;\n if (!str_contains($errstr, $needle)) {\n return false;\n }\n\n throw new \\ErrorException($errstr, 0, $errno, $errfile, $errline);\n}\nset_error_handler(__NAMESPACE__ . &quot;\\\\exception_error_handler&quot;);\n\nclass ValueObject\n{\n public function __construct(public string $value)\n {\n }\n\n public function __toString(): string\n {\n return $this-&gt;value . &quot;; this I can control&quot;;\n }\n}\n\nunlink('path_to_file_that_does_not_exist'); // normal warning behavior applies\n\nclass Allowed extends ValueObject {};\n\n$object = new Allowed('42');\nprint_r([\n 'works' =&gt; (int) $object,\n 'works_too' =&gt; (float) $object,\n]);\n\n\n$object = new ValueObject('42');\nprint_r([\n (int) $object, // throws\n (float) $object, // throws, won't be reached of course\n]);\n</code></pre>\n<p>One still sees the other warnings only as warnings:</p>\n<pre><code>PHP Warning: unlink(path_to_file_that_does_not_exist): No such file or directory\n</code></pre>\n<p>One can can allow the casting on certain classes, as <code>Allowed</code> would still only issue those warnings</p>\n<pre><code>PHP Warning: Object of class YourNameSpace\\Allowed could not be converted to int\nPHP Warning: Object of class YourNameSpace\\Allowed could not be converted to float\n</code></pre>\n<p>and <code>ValueObject</code> will throw:</p>\n<pre><code>PHP Fatal error: Uncaught ErrorException: Object of class YourNameSpace\\ValueObject could not be converted to int in ../application/ShouldNotCast.php:45\nStack trace:\n#0 application/ShouldNotCast.php(45): YourNameSpace\\exception_error_handler()\n#1 {main}\n thrown in application/ShouldNotCast.php on line 45\n\nProcess finished with exit code 129 (interrupted by signal 1:SIGHUP)\n</code></pre>\n"^^ . + "1"^^ . + "1"^^ . + "0"^^ . + "fedora"^^ . + . + . + . + "0"^^ . + "<p>Firstly, make sure you distinguish between custom date selection and using the preset. Because &quot;Feb 28th&quot; is not the same as &quot;end of month Feb&quot;.</p>\n<p>So you can do for first case:</p>\n<pre><code>$date = &quot;2025-02-28&quot;; \necho date('Y-m-d', strtotime($date . ' - 1 year'));\n</code></pre>\n<p>And for the other case you can use</p>\n<pre><code>function endOfMonth($date) {\n return date('Y-m-t', strtotime($date));\n}\n</code></pre>\n"^^ . + . + "0"^^ . + . + "dimensions"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + "-1"^^ . + "Well, someone has to pay for the electricity, hardware and support so it's tricky to do that for free. There are a few hosts which do it but inject ads into your site instead, and reliability/performance tends to be poor. But that might not matter if it's just a demo for school. Or you could try the free/dev tier on things like Azure Web Apps. Opening your own machine to the Web, even with ngrok, is fraught with security risks, I wouldn't suggest that as a good solution unless you really know what you're doing - which, with all due respect, it sounds like you probably don't."^^ . + . + . + "1"^^ . + . + "Woocommerce - ajax load more not working when ajax filtering by two or more categories"^^ . + "<p>I don't know why you are doing that in your app. You can easily retrieve your full database at the database level using a MySQL command or phpMyAdmin.\n<br></p>\n<p>Example:</p>\n<pre><code>mysqldump -u root -p my_database &gt; my_database_backup.sql\n</code></pre>\n"^^ . + "Unable to consume php nusoap web service"^^ . + . + "0"^^ . + . + . + . + . + "<p>It seems that the problem is that you take the article using the tag id, and do not check whether this tag is attached to the article <code>where('id', $tag-&gt;id)</code></p>\n<p>Try using <code>whereHas</code> in the articles query:</p>\n<pre><code>$articles = Article::whereHas('tags', function (Builder $query) use ($tag) {\n $query-&gt;where('id', $tag-&gt;id);\n})-&gt;orderBy('id', 'desc')-&gt;paginate($this-&gt;per_page);\n</code></pre>\n<p><a href="https://laravel.com/docs/8.x/eloquent-relationships" rel="nofollow noreferrer">https://laravel.com/docs/8.x/eloquent-relationships</a></p>\n"^^ . + . + "1"^^ . + . + "@droopsnoot, thank you for your valuable time."^^ . + "2"^^ . + . + "0"^^ . + "1"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + "<p>Cashier automatically listens/processes webhooks from Paddle if configured correctly with the <code>.env</code> variables. By adding the webhook route to the <code>web.php</code> file, I was overriding the default behavior of Cashier because this was taking precedence:</p>\n<pre><code>Route::post('/paddle/webhook', WebhookController::class);\n</code></pre>\n<p>The solution would be to remove this line so Cashier can process webhooks and create the Transaction &amp; Subscription records when the webhooks are received. Defining that route in <code>web.php</code> is not necessary.</p>\n"^^ . + . + "@Fredvuni Please edit and show step 1"^^ . + "1"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + . + "<p>I am trying to access outlook mails with <a href="https://github.com/microsoftgraph/msgraph-sdk-php/tree/main" rel="nofollow noreferrer">msgraph-sdk-php</a>. I could get the access token and refresh token with http request, but when I use the tokens to InMemoryAccessTokenCache class I get error below:</p>\n<p>InvalidArgumentException: Unable to initialize cache key for context using access token in file /var/www/html/...</p>\n<p>The code I am testing is below:</p>\n<pre><code> $tokenRequestContext = new AuthorizationCodeContext(\n &quot;tenantId&quot;,\n &quot;clientId&quot;,\n &quot;clientSecret&quot;,\n &quot;authCode&lt;placeholder&gt;&quot;,\n &quot;redirectUrl&quot;\n );\n\n $cache = new InMemoryAccessTokenCache(\n $tokenRequestContext,\n new AccessToken(\n [\n 'access_token' =&gt; $token-&gt;access_token,\n 'refresh_token' =&gt; $token-&gt;refresh_token,\n 'expires' =&gt; 3600\n ]\n )\n );\n\n $client = GraphServiceClient::createWithAuthenticationProvider(\n GraphPhpLeagueAuthenticationProvider::createWithAccessTokenProvider(\n GraphPhpLeagueAccessTokenProvider::createWithCache(\n $cache,\n $tokenRequestContext,\n [&quot;offline_access&quot;, &quot;user.read&quot;, &quot;mail.read&quot;, &quot;mail.send&quot;, &quot;mail.readbasic&quot;, &quot;mail.readwrite&quot;, &quot;imap.accessasuser.all&quot;, &quot;smtp.send&quot;]\n )\n )\n );\n</code></pre>\n<p>I would like to know how to use tokens correctly.</p>\n<p>And also, when I make GraphServiceClient class with &quot;authCode&quot;, I could request only once and after that I could get &quot;Invaild grant&quot; error. How can I request many times with the class?</p>\n"^^ . + . + . + "0"^^ . + "1"^^ . + . + "<p>I'm trying to connect to RabbitMQ from a PHP consumer using <code>PhpAmqpLib</code>. The connection occasionally <em>silently</em> closes. Mean time to failure is around a couple weeks; I have tried to replicate by blocking ports, shutting down the PHP consumer, and force-closing the connection from the RabbitMQ Management UI - but none of those replicates the error:</p>\n<ul>\n<li>When the connection is closed, no error event is sent to the consumer.</li>\n<li>Messages wait in the queue until the consumer is rebooted.</li>\n<li>On restart, the consumer reconnects without error.</li>\n</ul>\n<p>The error appears to only happen if there are no messages on the queue for an extended period. I assume the problem is that there's no heartbeat, and this seems to be confirmed by the Management UI:\n<a href="https://i.sstatic.net/oTlSOmuA.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/oTlSOmuA.png" alt="enter image description here" /></a></p>\n<p>Great, so I just need to find out how to turn on heartbeats. <a href="https://www.rabbitmq.com/docs/heartbeats#heartbeats-timeout" rel="nofollow noreferrer">According to the RabbitMQ docs</a>, it is <em>sufficient</em> to set a non-zero heartbeat with <em>either</em> the client or the server.</p>\n<p><em>Both</em> have non-zero heartbeats.</p>\n<p>Here's the relevant lines from <code>rabbitmq-diagnostics</code> on the server:</p>\n<pre><code># rabbitmq-diagnostics environment | grep -i heartbeat\n {heartbeat_interval,100},\n {heartbeat,60},\n</code></pre>\n<p>Here's an excerpt from the class where I'm creating the connection, adapted from (undocumented) code I inherited:</p>\n<pre><code>use PhpAmqpLib\\Connection\\AMQPConnectionConfig;\nuse PhpAmqpLib\\Connection\\AMQPSSLConnection;\nuse PhpAmqpLib\\Connection\\AMQPStreamConnection;\n...\n private AMQPStreamConnection $connection;\n...\n $heartbeat = 20;\n $conconf = new AMQPConnectionConfig();\n $conconf-&gt;setHeartbeat($heartbeat);\n $conconf-&gt;setKeepalive(true);\n\n # See\n # https://php-amqplib.github.io/php-amqplib/classes/PhpAmqpLib-Connection-AMQPStreamConnection.html\n $this-&gt;connection = new AMQPStreamConnection(\n $this-&gt;host,\n $this-&gt;port,\n $this-&gt;user,\n $this-&gt;password,\n '/', # $vhost\n # $insist - insist on connecting to a specified server, default\n # value:\n false, \n AMQPConnectionConfig::AUTH_AMQPPLAIN, # $login_method, default value\n null, # $ login_response, default value\n 'en_US', # $locale, default value\n 3.0, # $connection_timeout, default value\n 40.0, # $read_write_timeout, supposed to be at least 2*heartbeat?\n null, # $context, default value\n true, # $ keepalive\n null, # $io, default value\n # $heartbeat, heartbeat interval; default is 0 which RabbitMQ\n # recommends against. See \n # https://www.rabbitmq.com/docs/heartbeats\n $heartbeat,\n 0.0, # $channel_rpc_timeout,\n null, # $ssl_protocol ?\n $conconf # $config\n );\n</code></pre>\n<p>It works to consume messages until the connection drops, so it seems like I'm close...</p>\n"^^ . + . + . + . + "0"^^ . + "0"^^ . + "_"As mentioned the html display is correct"_ ... I'm not sure how that could be the case? Here's a demo of displaying the sample data you've provided: https://jsfiddle.net/qy14z576/ - as you can see, because it's been HTML-encoded too many times it doesn't display correctly at all. What you're telling us, and the data you've provided us with, don't agree with each other. So either you're mistaken in some way, or you've missed a step somewhere in what your application is doing with this data in different places."^^ . + "0"^^ . + . + . + . + . + "Thanks, I'll try the woocommerce_registration_errors \n and woocommerce_process_registration_errors filters and see if that helps the issue. Not sure the honeypot will help in my case, as the spam registrations coming through aren't filling in any custom fields."^^ . + "0"^^ . + "I can't add anything as you're in a different scenario - I was doing a "machine to machine" connection via a Windows Service so there was only one user, and I didn't use a client secret. Other than that, my code seems very similar to yours. Does your user have the `offline_access` scope? You'll need that for a refresh token."^^ . + . + "2"^^ . + "0"^^ . + . + . + . + . + . + . + "<p>I have different custom Module paths/ Namespaces in my CodeIgniter4 project, and I just recently upgraded to version 4.4.0. in this upgrade the route settings will move from <em>Config/Routes.php</em> to <em>Config/Routing.php</em> file.</p>\n<p>Now while I load my modules/namespace routes; my module routes are not identified because the <strong>$defaultNamespace</strong> setup is now in a different file.</p>\n<p>How can I handle this?</p>\n<p>I have added the Routes path to the $routesFiles parameter in the Routing.php</p>\n<pre><code>public array $routeFiles = [\n APPPATH . 'Config/Routes.php',\n 'BudgetingModule\\Config/Routes.php',\n 'FeeModule\\Config/Routes.php',\n ];\n \n</code></pre>\n"^^ . + . + . + . + . + . + . + . + . + "<blockquote>\n<p>Am I missing something here?</p>\n</blockquote>\n<p>Enumerations <em>by design</em> are not stringable. (okay, this is probably too easy for an answer, let's extend:)</p>\n<blockquote>\n<p>The enum solution certainly appears more maintainable to me than a dump of constants in the global namespace, then why is it such hardship to write it out? Funny enough, with all its dynamic typing, PHP won't let me use <code>Pages::Start</code>, because it is not implicitly replaced by the value.</p>\n</blockquote>\n<p>All fair points.</p>\n<p>Let's see, given enumerations are not stringable <em>by design</em>, it may make sense you have a hardship using them as you're looking for string constants:</p>\n<pre class="lang-php prettyprint-override"><code>enum Pages : string {\n case Start = 'start';\n case News = 'news';\n}\n</code></pre>\n<p>Replacing constants as</p>\n<pre class="lang-php prettyprint-override"><code>abstract class /* or: interface */ Pages {\n const Start = 'start';\n const News = 'news';\n}\n</code></pre>\n<p>with the enumeration cases of static singletons (that needs to be defined in advance for all cases), then it's probably not the writing but the use, because only that is different:</p>\n<pre class="lang-php prettyprint-override"><code>Pages::Start-&gt;value; # not: Pages::Start-&gt;name as you have it string backed\n# vs.\nPages::Start;\n</code></pre>\n<p>So if you only focus on the string-ability, the constant is more fitting (but less expressive) for your refactoring as it retains the stringable properties.</p>\n<hr />\n<p>As object oriented programming requires experimentation, you <em>may</em> want to go with the enumerations regardless <em>after</em> the initial refactoring to (pure) abstract class constants, as enumerations allow you to make instance checks for a group of &quot;constants&quot; more precisely than abstract (or pure abstract) class constants can do.</p>\n<p>Let's have a <em>session</em>, and <em>entity</em> and a <em>form</em> function just for the example:</p>\n<pre class="lang-php prettyprint-override"><code>function session(Pages $page) {}\nfunction entity(Pages $page) {}\nfunction form(Pages $page) {}\n</code></pre>\n<p>You can't that easily <em>match</em> on a page's expression if it would be the constant.</p>\n<hr />\n<p>A recent example on SO where we used an enum to extend from a single string to multiple without relying to constants (after the first hard-encoded string value) can be found in <a href="https://stackoverflow.com/q/79421392/367456"><em>How to Validate Bitbucket Webhook Signature Using Secret Key?</em> (Q&amp;A)</a>. It is <a href="https://stackoverflow.com/a/79425616/367456"><em>not</em> string backed intentionally</a>, so it <em>may</em> show how an earlier refactoring before introducing constants <em>could</em> have looked-alike.</p>\n"^^ . + . + . + "private-repository"^^ . + "Speaking of "The script on the linked page" - did you actually try to *run* it? All the point of providing a working example is in running it. Your example doesn't run, and therefore doesn't prove anything. You're supposed to create a working code. Which replicates the behavior you are talking about (supposedly when you update a row with a different value and it returns 0 affected rows or whatever else your problem is)."^^ . + "0"^^ . + "1"^^ . + . + "0"^^ . + . + ""is it right to write the count() method in the number controller or is better to make a new controller for that method?" - you do not need another controller for a simple helper function. Keep it in the same class."^^ . + . + "0"^^ . + . + . + . + "This can have multiple reasons, but your nose is good and then this is related to autoloading. I would start with a very simple autoloader test-script for the class in question so that you can more easily trouble-shoot it and protect against regressions while you migrate your project. You can find a full example incl. integration with composer and bindings to composer dump-autoload in https://stackoverflow.com/a/72621611/367456 (Next steps: 2.2. and following)"^^ . + "@ David - Exactly! I don't need the JS to do anything other than post the value. It is PHP that I need to then work with that.\n@ ADyson - That was my bad, I didn't notice the extra comments you had made on the other question. I made this post w/ what I thought was a more concise and easier to see example of the issue I have. I will look at the other question again and review your comments."^^ . + . + "1"^^ . + . + . + . + "<p>++ You can use this too</p>\n<pre><code>function splitChunks($string) {\n return implode(' ', strlen($string) % 2 \n ? array_merge(str_split(substr($string, 0, -3), 2), [substr($string, -3)]) \n : str_split($string, 2)\n );\n}\n\necho splitChunks('2233444'), PHP_EOL;\n</code></pre>\n"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "@ADyson - a marketing campaign aimed at collecting "impulsive" user responses/feedback."^^ . + . + "0"^^ . + "1"^^ . + "0"^^ . + "1"^^ . + "<p>We've been getting a lot of spam registrations so I am attempting to block registrations from going through that are missing required fields. I have added some additional checks via the woocommerce_register_post, woocommerce_process_registration_errors, and woocommerce_registration_errors filters.</p>\n<pre><code>function register_validate_custom_fields( $username, $email, $validation_errors ) {\n // make sure all required fields are present\n $required_fields = [&quot;email&quot;, &quot;billing_first_name&quot;, &quot;billing_last_name&quot;, &quot;billing_address_1&quot;, &quot;billing_city&quot;, &quot;billing_state&quot;, &quot;billing_postcode&quot;];\n foreach ($required_fields as $field) {\n if (!isset($_POST[$field]) || $_POST[$field] == &quot;&quot;) {\n $validation_errors-&gt;add('required_field', __('Required field missing', 'woocommerce'));\n }\n }\n return $validation_errors;\n}\nadd_action('woocommerce_register_post', 'register_validate_custom_fields', 10, 3);\n\nfunction custom_registration_errors( $validation_error ) {\n // make sure all required fields are present\n $required_fields = [&quot;email&quot;, &quot;billing_first_name&quot;, &quot;billing_last_name&quot;, &quot;billing_address_1&quot;, &quot;billing_city&quot;, &quot;billing_state&quot;, &quot;billing_postcode&quot;];\n foreach ($required_fields as $field) {\n if (!isset($_POST[$field]) || empty($_POST[$field])) {\n $validation_error = new WP_Error( 'required_field', __( 'Required field missing', 'woocommerce' ) );\n }\n }\n return $validation_error;\n}\nadd_action( 'woocommerce_process_registration_errors', 'custom_registration_errors' );\n\nfunction validate_required_fields( $errors, $username, $email ) {\n // make sure all required fields are present\n $required_fields = [&quot;email&quot;, &quot;billing_first_name&quot;, &quot;billing_last_name&quot;, &quot;billing_address_1&quot;, &quot;billing_city&quot;, &quot;billing_state&quot;, &quot;billing_postcode&quot;];\n foreach ($required_fields as $field) {\n if (!isset($_POST[$field]) || empty($_POST[$field])) {\n $errors-&gt;add('required_field', __('Required field missing', 'woocommerce'));\n }\n }\n return $errors;\n}\nadd_filter( 'woocommerce_registration_errors', 'validate_required_fields', 10, 3 );\n</code></pre>\n<p>However, fake registrations without the required fields still seem to be getting through. We have even got some that were completely blank. Do these filters only return form errors, and not actually block the registrations? Is there another filter that would actually prevent the accounts from being created, and prevent the new account registration emails from being triggered?</p>\n"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + "1"^^ . + "post"^^ . + . + . + . + . + . + "twitter-typeahead"^^ . + "1"^^ . + . + "-1"^^ . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "`I’ve decided not to rely on external Composer packages`....because? Is this an intellectual challenge, or you just decided to make life difficult?"^^ . + . + "0"^^ . + "0"^^ . + "1"^^ . + "`they may just have been warnings`...you'll know because warnings say "Warning" at the start of the message. Errors generally say "fatal error". If you're unsure what to do with the errors you've got, google them in the first instance. If you're still unsure how to resolve them, [edit] your question to post them here for us."^^ . + . + . + "0"^^ . + "0"^^ . + "I think you are right. I ended up using another library (https://github.com/lbuchs/WebAuthn) and it works fine now. Thank you."^^ . + "0"^^ . + . + "0"^^ . + "<p>The solution you currently have would assume the day's half is at 12:00.</p>\n<p>With that assumption in mind you could also take the diff in hours and apply modulo 24 over them (120%24 -&gt; 12).</p>\n<p>If the value resulted is exactly 12 than you can consider it half day, but by using this you will only allow splitting the day in to halves.</p>\n<p>I'd recommend using a different mechanism for the hours off.</p>\n<p>Calculate the full days + compute the working hours that you want to take off afterwards.</p>\n<p>Assuming working day is 08-16 (to accomodate the 12:00 half day)</p>\n<p>Having the difference as float won't help as if an employee takes time off from Thursday 16:00 until Monday 10:00 the difference would be 1.7 when in fact a full working day and 2 hours were actually taken off, which would compute to 1.25.</p>\n"^^ . + "0"^^ . + . + . + "use WithPagination styling issue in laravel Livewire component"^^ . + . + . + . + "There does seem to be a sign change: https://carbon.nesbot.com/docs/#api-carbon-3"^^ . + . + . + . + . + . + . + . + . + "<p>PHP <a href="https://www.php.net/manual/en/language.types.singleton.php" rel="nofollow noreferrer">singleton type documentation</a> says little about the <strong>false type</strong> and <strong>true type</strong> (both are also considered singleton types).</p>\n<p>Could anybody please explain why does:</p>\n<pre class="lang-php prettyprint-override"><code>function myFunction(): false\n{\n return 1 &lt; 0;\n}\n\n$result = myFunction();\nvar_dump($result);\n</code></pre>\n<p>Return <strong>bool(false)</strong> and not something like <strong>false(false)</strong> or <strong>singleton(false)</strong>?</p>\n<p>This is quite frustrating because since the documentation doesn't specify whether <strong>false type</strong> and <strong>true type</strong> are return-only types or value types, I expected them to be value types, meaning creating a variable of this type should be valid, which turns out not to be the case.</p>\n"^^ . + . + . + . + "Yes, that should be possible. Do you have any **specific** question about this?"^^ . + . + "<p>I have a problem with modal in Filament PHP that installed for a Laravel project.</p>\n<p>In whole admin panel modals dialog is not showing but only modal transparent background shows up.</p>\n<p>To clarification major customization that I implemented on filament admin panels are:</p>\n<ul>\n<li>filapanel/classic-theme installed.</li>\n<li>althinect/filament-spatie-roles-permissions Installed.</li>\n<li>And I change panel admin model from \\App\\Models\\User to \\App\\Models\\Admin.</li>\n</ul>\n<p>And I checked rendered HTML code from browser Inspection Element Section:</p>\n<pre><code>&lt;div x-show=&quot;isOpen&quot; x-transition.duration.300ms.opacity=&quot;&quot;\n class=&quot;fixed inset-0 z-40 min-h-full overflow-y-auto overflow-x-hidden transition flex items-center&quot;&gt;\n &lt;div aria-hidden=&quot;true&quot; x-on:click=&quot;$dispatch('close-modal', { id: 'sVttJcBXUY2PvsaJXQmH-form-component-action' })&quot;\n class=&quot;fi-modal-close-overlay fixed inset-0 bg-gray-950 dark:bg-gray-950 cursor-pointer&quot;\n style=&quot;will-change: transform&quot;&gt;&lt;/div&gt;\n\n &lt;div x-ref=&quot;modalContainer&quot; class=&quot;pointer-events-none relative w-full transition my-auto p-4&quot;\n x-on:modal-closed.stop=&quot;const mountedFormComponentActionShouldOpenModal = false\n\n\n if (mountedFormComponentActionShouldOpenModal) {\n $wire.unmountFormComponentAction(false)\n }&quot;&gt;\n &lt;div x-data=&quot;{ isShown: true }&quot; x-init=&quot;\n $nextTick(() =&gt; {\n isShown = isOpen\n $watch('isOpen', () =&gt; (isShown = isOpen))\n })\n &quot;\n x-on:keydown.window.escape=&quot;$dispatch('close-modal', { id: 'sVttJcBXUY2PvsaJXQmH-form-component-action' })&quot;\n x-show=&quot;isShown&quot; x-transition:enter=&quot;duration-300&quot; x-transition:leave=&quot;duration-300&quot;\n x-transition:enter-start=&quot;scale-95&quot; x-transition:enter-end=&quot;scale-100&quot; x-transition:leave-start=&quot;scale-95&quot;\n x-transition:leave-end=&quot;scale-100&quot; class=&quot;&quot; data-has-alpine-state=&quot;true&quot; style=&quot;display: none;&quot;&gt;\n &lt;!--[if BLOCK]&gt;&lt;![endif]--&gt;&lt;!--[if ENDBLOCK]&gt;&lt;![endif]--&gt;\n\n &lt;!--[if BLOCK]&gt;&lt;![endif]--&gt;&lt;!--[if ENDBLOCK]&gt;&lt;![endif]--&gt;\n\n &lt;!--[if BLOCK]&gt;&lt;![endif]--&gt;&lt;!--[if ENDBLOCK]&gt;&lt;![endif]--&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n<p>I have no idea what is problem. I need to resolve these problems.</p>\n<p>If need more information please tell me to share that.</p>\n"^^ . + . + . + "1"^^ . + . + . + "1"^^ . + "you can check what exactly happening here by replacing `dump` with `var_dump` which will make it clear why this is behaving like this\nand this isn't just a PHP issue; it happens in all programming languages because of how floats are represented in binary"^^ . + . + . + . + . + "0"^^ . + . + "https://psalm.dev/docs/security_analysis/#debugging-the-taint-graph may be useful to see what the taint analysis did. Also did you PDO's query() method as a [taint sink](https://psalm.dev/docs/security_analysis/#taint-sinks) in the annotations? I don't know the tool well but from the docs I don't get the impression it's there by default"^^ . + . + "Since Auth works but Firestore doesn't, double-check that your service account has explicit Firestore permissions."^^ . + "1"^^ . + . + "Hiding price in whole Woocommerce store (including cart and checkout pages)"^^ . + . + "1"^^ . + . + . + "@AdrianKlaver, yes, I get that, but looking at the php connections and queries I have, the database is provided in the connection info, and the table name, without the schema is used in the update calls (could just be my single schema database doesn't need it either). It's almost like php ignores the quoting and applies the `'.'` as an additional concatenation operator in the example above. I've not seen that with properly quoted strings -- it shouldn't happen."^^ . + . + . + . + "0"^^ . + . + "1"^^ . + . + "As I wrote, I don't know how to apply an object shape in that structure of code, in large part because the objects don't have variable names to reference in an annotation."^^ . + . + "0"^^ . + "2"^^ . + . + "<p><img src="https://i.sstatic.net/5vMQSiHO.png" alt="simple example for my question" /></p>\n<p>As you can see in the screenshot, there's an error detected by Cursor IDE.</p>\n<p>I specified the Model Contract as a type for a variable used in the function giveMeAContract.</p>\n<p>But the problem is, at the function wtf() context,\nthe giveMeAContract() function seems to only want laravel query builder rather than a Model.</p>\n<p>Problem is, the error message coming from the red underline says that you have to put a Model in it not the query builder. I think it's exactly opposite of what I did.</p>\n<p>Plus, it only happens when I eager load the collection.</p>\n<p>Any hint for this? I solved it by a type hinting annotation but it is just temporary I guess.</p>\n"^^ . + . + "0"^^ . + . + . + . + . + . + . + ""Does not work" and "return 0 rows affected" are different matters that are never related to each other, hence you cannot draw the former from the latter. *Everything works already*"^^ . + . + "1"^^ . + . + "in the same directory as my index.php?, NO, but but even in my local installation it is not present, or maybe im looking the wrong directory @HEXALIX\nim looking in /var/www/html\n\nits weird because my local installation (in wsl ubuntu) is presnet in /srv/www/wordpress but in my docker image it is in /var/www/html"^^ . + "2"^^ . + . + . + . + . + "2"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + "<p>I'm having trouble with a PHP invoicing app that I inherited from a new client. On the invoice page there's a Jquery Grid that manages the details of the invoice (quantity, price, description, total cost, etc.) and it all works fine as long as you don't make any changes to the grid row. If you change anything in a grid row, the changes are being made to the database but the grid isn't refreshing with the updated data unless you refresh the entire page. Unfortunately, my JavaScript and jQuery skills are pretty basic so I can't seem to get it to work. I'm including the code for the grid as well as the code for the processing page that updates the database. Any help would be greatly appreciated. Thank you.</p>\n<pre><code> //JQgrid code//\n&lt;script type=&quot;application/javascript&quot;&gt;\n function autocomplete_element(value, options) {\n var $ac = $('&lt;input type=&quot;text&quot; size=&quot;450&quot;/&gt;');\n $ac.val(value);\n $ac.autocomplete({source: &quot;autocompleteopr.php&quot;});\n return $ac;\n } \n function autocomplete_value(elem, op, value) {\n if (op == &quot;set&quot;) {\n $(elem).val(value);\n }\n return $(elem).val();\n }\n $(document).ready(function() {\n var mkinline\n $grid = $(&quot;#list&quot;),\n numberTemplate = {\n formatter: 'number', align: 'right', sorttype: 'number',\n editrules: {number: true, required: true}\n };\n var selectedRow = 0;\n $grid.jqGrid({\n datatype: 'json',\n url:'orderdetails_json.php',\n colNames: ['ProductID', 'Qty.', 'Product', 'Count', 'Unit', 'Unit Price', 'Total Price'],\n colModel: [\n {name:'ProductID', index:'ProductID', align:'right', hidden:true, editable:true, key:true},\n {name:'Quantity', index:'Quantity', editable:true, width:50, align:'right', edittype:'text', editoptions: editOptions},\n {name:'Description', index:'Description', editable:true, width:450, align:'left', edittype: 'custom', editoptions: {'custom_element' : autocomplete_element, 'custom_value' : autocomplete_value}},\n {name:'Count', index:'Count', editable:true, width:100, align:'left', edittype: 'text', required:false},\n {name:'Unit', index:'Unit', editable:true, width:100, align:'left', edittype: 'text', required:false},\n {name:'UnitPrice', index:'UnitPrice', editable:true, required:false, width: 80, template: numberTemplate},\n {name:'ExtendedPrice', index:'ExtendedPrice', editable:true, required:false, width: 80, template: numberTemplate},\n ],\n onSelectRow: function(id){\n if(id &amp;&amp; id!==mkinline){\n jQuery('#list').saveRow(mkinline);\n jQuery('#list').editRow(id,true);\n mkinline=id;\n }\n }, \n reloadAfterSubmit: true,\n afterSubmit: function () {\n $('#list').jqGrid(&quot;setGridParam&quot;, {datatype: 'json'});\n return [true];\n },\n\n cmTemplate: {editable: true},\n loadonce:false,\n rowNum: 100,\n rowList: [],\n pgbuttons: false,\n pgtext: null,\n pager: '#pager',\n rownumbers: false,\n sortname: '',\n viewrecords: false,\n sortorder: '',\n height: '100%',\n width:850,\n editurl: 'addeditdeldetails.php',\n caption: 'Order Details',\n jsonReader: {repeatitems: false, id: &quot;ProductID&quot;},\n });\n var editOptions = {\n keys: true,\n mtype: &quot;POST&quot;,\n successfunc: function () {\n var $self = $(list);\n setTimeout(function () {\n window.location.reload(false);\n }, 50);\n }\n };\n jQuery(&quot;#list&quot;).jqGrid(&quot;navGrid&quot;,&quot;#pager&quot;,{celledit:true,edit:false,add:false,del:true,save:false,search:false,refresh:false}, {}, {}, {closeAfterDelete:true,caption:&quot;Delete&quot;,msg:&quot;Delete selected&quot;,width:&quot;400&quot;});\n jQuery(&quot;#list&quot;).jqGrid(&quot;inlineNav&quot;, &quot;#pager&quot;,{celledit:true,edit:true,add:true,del:false,search:false,save:false,refresh:false,addParams:{position:&quot;last&quot;, addRowParams: editOptions}, editParams: editOptions});\n });\n function resetForm() {\n window.location.reload(false);\n }\n&lt;/script&gt;\n\n//processing page code (the &quot;add&quot; and &quot;del&quot; functions are working correctly but the &quot;edit&quot; function isn't//\n&lt;?php\n if (session_status() == PHP_SESSION_NONE) { session_start(); }\n include('db_connect.php');\n $oper = $_POST['oper'];\n $OrderID = $_SESSION['pid'];\n //this works\n if($oper == &quot;add&quot;) {\n $Quantity = $_POST['Quantity'];\n $Product = $_POST['Description'];\n $arr = explode(&quot; | &quot;, $Product, 3);\n $Description = $arr[0];\n $Count = $arr[1];\n $Unit = $arr[2];\n $qgetproduct = &quot;SELECT product_id FROM tbl_products WHERE product_desc = ? AND count = ? AND unit = ?&quot;;\n $getproduct = $pdo-&gt;prepare($qgetproduct);\n $getproduct-&gt;execute([$Description,$Count,$Unit]);\n $ProductID = $getproduct-&gt;fetchColumn();\n $qgetprice = &quot;SELECT price FROM tbl_orderdata WHERE product_id = ?&quot;;\n $getprice = $pdo-&gt;prepare($qgetprice);\n $getprice-&gt;execute([$ProductID]);\n $UnitPrice = $getprice-&gt;fetchColumn();\n $ExtendedPrice = $UnitPrice*$Quantity;\n $qadddetails = &quot;INSERT INTO tblorderdetails (order_id, product_id, quantity, product_desc, count, unit, price, extended_price) VALUES (?, ?, ?, ?, ?, ?, ?, ?)&quot;;\n $adddetails = $pdo-&gt;prepare($qadddetails);\n $adddetails-&gt;execute([$OrderID,$ProductID,$Quantity,$Description,$Count,$Unit,$UnitPrice,$ExtendedPrice]);\n if ($adddetails) { $success = &quot;true&quot;; }\n } \n //changes don't refresh grid\n elseif($oper == &quot;edit&quot;) {\n $Quantity = $_POST['Quantity'];\n $ProductID = $_POST['ProductID'];\n $UnitPrice = $_POST['UnitPrice'];\n $ExtendedPrice = $UnitPrice*$Quantity;\n $qeditdetails = &quot;UPDATE tblorderdetails SET quantity = ?, price = ?, extended_price = ? WHERE product_id = ? AND order_id = ?&quot;;\n $editdetails = $pdo-&gt;prepare($qeditdetails);\n $editdetails-&gt;execute([$Quantity,$UnitPrice,$ExtendedPrice,$ProductID,$OrderID]);\n if ($editdetails) { $success = &quot;true&quot;; }\n } \n //this works\n elseif($oper == &quot;del&quot;) {\n $ProductID = $_POST['id'];\n $qdeletedetails = &quot;DELETE FROM tblorderdetails WHERE product_id = ? AND order_id = ?&quot;;\n $deletedetails = $pdo-&gt;prepare($qdeletedetails);\n $deletedetails-&gt;execute([$ProductID,$OrderID]);\n if ($deletedetails) { $success = &quot;true&quot;; }\n }\n header('HTTP/1.1 200 OK');\n $response = $success;\n echo json_encode($response);\n return;\n?&gt;\n</code></pre>\n"^^ . + . + "1"^^ . + "base64"^^ . + "5"^^ . + . + "0"^^ . + . + . + "exe"^^ . + . + . + . + . + . + "design-patterns"^^ . + . + . + . + . + . + "0"^^ . + . + "<h2>Solved - Unable to load dynamic library 'openssl'</h2>\n<p>This refers to OpenSSL with Apache2.4 on a Windows11 dev laptop.</p>\n<p>I have seen many people trying to resolve this issue and so will leave the original post and its <em>many</em> tests and results as they may help others working through this issue...</p>\n<p>My problem was that I was able to add OpenSSL to php8 versions, but with every php7 version I tried, Apache kept reporting <code>dynamic library 'openssl' ... could not be found</code>:</p>\n<pre><code>PHP Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: c:\\\\php\\\\php7-4-33\\\\ext\\\\openssl (The specified module could not be found.), c:\\\\php\\\\php7-4-33\\\\ext\\\\php_openssl.dll (The specified module could not be found.)) in Unknown on line 0\n</code></pre>\n<p>Note I have a number of php versions installed, hence the directory structure and additional 'layer' to the php directory.</p>\n<p>Other modules <em>would</em> load without issue, but OpenSSL always reported this &quot;could not be found&quot; error. Confusingly, php via the CLI, (<code>php -r</code>) would report OpenSSL <em>was</em> loaded, meaning the CLI was giving different results to loading php under Apache.</p>\n<p>I had seen advice about adding php to the PATH variable and done this, but to no effect. The solution to this problem is that php has to be defined under the <strong>System variables</strong> and not the User variables, i.e.</p>\n<p><code>Control Panel &gt; System &gt; View advanced system settings &gt; Environment variables...</code> and define in the lower <code>System variables</code> window:</p>\n<pre><code>c:\\php\\php7-4-33\n</code></pre>\n<p>... or <em>your</em> php root directory, likely <code>c:\\php\\</code>. Adding the ext directory, i.e. <code>c:\\php\\php7-4-33\\ext</code> in this case, did <strong>not</strong> work</p>\n<p>I now believe the issue lies within <code>php_openssl.dll</code> itself which appears to go looking for something, fails to find it without the path defined (in System variables!) and so fails to load. Apache then erroneously reports this as the <code>php_openssl.dll</code> itself cannot be found which I believe is a mis-report of the DLL not loading (as it can't find something) as opposed to the DDL being missing. This 'going looking for something feature' appears resolved in php8 versions.</p>\n<p>So that's the solution: define php in the <strong>system</strong> path variable, and things work. But <em>so many</em> tests and trials to finally get to this conclusion. Read on if you want to enjoy the 'fun' in getting to this solution!</p>\n<h2>Original full post, tests, results and inconsistencies</h2>\n<p>I am trying to get my php dev environment on my laptop supporting fsockopen() with an ssl:// (or tls://) socket connection, so this is my end goal. Currently I get:</p>\n<pre><code>fsockopen(): unable to connect to ssl://example.com:443 (Unable to find the socket transport &quot;ssl&quot; - did you forget to enable it when you configured PHP?) \n</code></pre>\n<p>Support for a TLS connection lead me to getting OpenSSL working with php and the 'Registered Stream Socket Transports' reported by phpinfo() to expand from only 'tcp, udp' to 'tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3'. I have also needed to get GD and sockets working, so that's 3 extensions to add into php:</p>\n<ol>\n<li>OpenSSL</li>\n<li>GD</li>\n<li>Sockets</li>\n</ol>\n<p>I have a number of php versions for different projects and so my php directory structure is\nc:\\php\\php-ver, i.e.</p>\n<ul>\n<li>C:\\php\\php7-4-33\\</li>\n<li>C:\\php\\php8-3-3\\</li>\n<li>C:\\php\\php8-4-4\\</li>\n</ul>\n<p>I am not using multiple version (at this point), so the above is simply to explain the directory structure and why everything isn't simply under c:\\php. Everything here is focused on 7.4.33 only and so the php root is c:\\php\\php7-4-33, excepcting php.ini lives in c:\\php rather than the 7-4-44 version subdirectory. This was 'supposed' to be to help switching versions...</p>\n<p>php was downloaded from <a href="https://windows.php.net/downloads/releases/php-7.4.33-Win32-vc15-x64.zip" rel="nofollow noreferrer">https://windows.php.net/downloads/releases/php-7.4.33-Win32-vc15-x64.zip</a> so not built locally. It's all from official source provided as a single pre-built zip.</p>\n<p>Environment is</p>\n<ul>\n<li>Win 11 Pro 24H2</li>\n<li>Apache/2.4.63 (Win64) OpenSSL/3.3.2 PHP/7.4.33</li>\n</ul>\n<p>Interestingly, phpinfo() reports the system as: &quot;build 26100 (Windows 10) AMD64&quot;. The OS build is indeed 26100.3476, but that's Win11, not Win10, and it's on Intel i7-1165G7, not AMD. Presumably 'a feature' of phpinfo()!</p>\n<p>c:\\php\\php.ini is configured with:</p>\n<ul>\n<li>extension_dir = &quot;c:\\php\\php7-4-33\\ext&quot;</li>\n<li>extension=gd2</li>\n<li>extension=openssl</li>\n<li>extension=sockets</li>\n</ul>\n<p>httpd.conf defines:</p>\n<pre><code>PHPIniDir &quot;c:\\php&quot;\nLoadModule php7_module &quot;c:\\php\\php7apache2_4.dll&quot;\n</code></pre>\n<p>And phpinfo() reports/confirms:</p>\n<ul>\n<li>Configuration File (php.ini) Path - no value</li>\n<li>Loaded Configuration File - C:\\php\\php.ini</li>\n<li>extension_dir - c:\\php\\php7-4-33\\ext</li>\n<li>GD Support - enabled</li>\n<li>Sockets Support - enabled</li>\n</ul>\n<p>What this tells me is that...</p>\n<ul>\n<li>Apache is loading the correct php.ini ... I'm not 'playing' with the wrong file</li>\n<li>The extensions directory is configued properly</li>\n<li>Both GD and sockets from that \\ext directory are being loaded and enabled properly</li>\n<li>But note no OpenSSL</li>\n</ul>\n<p>On restart, the Apache error log reports:</p>\n<pre><code>PHP Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: c:\\\\php\\\\php7-4-33\\\\ext\\\\openssl (The specified module could not be found.), c:\\\\php\\\\php7-4-33\\\\ext\\\\php_openssl.dll (The specified module could not be found.)) in Unknown on line 0\n</code></pre>\n<p>So the path <strong>is correct</strong> and to the same \\ext directory as GD and sockets which both load and are enabled.</p>\n<p>Apache itself is supporting TLS and so I can make https calls to the local httpd.</p>\n<p>Looking from within php itself...</p>\n<ul>\n<li>php_ini_loaded_file() reports C:\\php\\php.ini (correct)</li>\n<li>extension_loaded('openssl') reports OpenSSL is <strong>not</strong> loaded</li>\n<li>extension_loaded('sockets') reports sockets <strong>is</strong> loaded</li>\n<li>get_loaded_extensions() reconfirms gd and sockets are both loaded, while OpenSSL is missing</li>\n</ul>\n<p>All 3 extensions are in the same directory:</p>\n<pre><code> Directory of c:\\php\\php7-4-33\\ext\n\n18/03/2025 11:47 &lt;DIR&gt; .\n07/03/2025 13:49 &lt;DIR&gt; ..\n07/03/2025 13:48 86,016 php_bz2.dll\n07/03/2025 13:48 89,600 php_com_dotnet.dll\n07/03/2025 13:48 559,616 php_curl.dll\n07/03/2025 13:48 148,992 php_dba.dll\n07/03/2025 13:48 24,064 php_enchant.dll\n07/03/2025 13:48 72,704 php_exif.dll\n07/03/2025 13:48 159,744 php_ffi.dll\n07/03/2025 13:48 5,710,336 php_fileinfo.dll\n07/03/2025 13:48 53,760 php_ftp.dll\n07/03/2025 13:48 1,691,648 php_gd2.dll &lt;-- this loads\n07/03/2025 13:48 54,272 php_gettext.dll\n07/03/2025 13:48 343,040 php_gmp.dll\n07/03/2025 13:48 958,464 php_imap.dll\n07/03/2025 13:48 390,144 php_intl.dll\n07/03/2025 13:48 258,048 php_ldap.dll\n07/03/2025 13:48 1,447,936 php_mbstring.dll\n07/03/2025 13:48 112,640 php_mysqli.dll\n07/03/2025 13:48 153,600 php_oci8_12c.dll\n07/03/2025 13:48 64,000 php_odbc.dll\n07/03/2025 13:48 493,568 php_opcache.dll\n07/03/2025 13:48 125,952 php_openssl.dll &lt;-- this claims to be not found\n07/03/2025 13:48 29,696 php_pdo_firebird.dll\n07/03/2025 13:48 31,232 php_pdo_mysql.dll\n07/03/2025 13:48 36,352 php_pdo_oci.dll\n07/03/2025 13:48 27,136 php_pdo_odbc.dll\n07/03/2025 13:48 39,424 php_pdo_pgsql.dll\n07/03/2025 13:48 27,648 php_pdo_sqlite.dll\n07/03/2025 13:48 101,376 php_pgsql.dll\n07/03/2025 13:48 17,408 php_phpdbg_webhelper.dll\n07/03/2025 13:48 16,896 php_shmop.dll\n07/03/2025 13:48 421,888 php_snmp.dll\n07/03/2025 13:48 248,832 php_soap.dll\n07/03/2025 13:48 76,800 php_sockets.dll &lt;-- this loads\n07/03/2025 13:48 73,728 php_sodium.dll\n07/03/2025 13:48 46,080 php_sqlite3.dll\n07/03/2025 13:48 17,408 php_sysvshm.dll\n07/03/2025 13:48 571,392 php_tidy.dll\n07/03/2025 13:48 83,456 php_xmlrpc.dll\n07/03/2025 13:48 288,256 php_xsl.dll\n07/03/2025 13:48 17,920 php_zend_test.dll\n 41 File(s) 15,297,024 bytes\n 2 Dir(s) 1,333,138,780,160 bytes free\n</code></pre>\n<p>I have been through <em>a lot</em> of SO and other articles with various &quot;This will fix it&quot; advice, all of which has got me no further forward. I should have taken notes of <strong>all</strong> the ideas tried, but they include:</p>\n<ol>\n<li>Defining the OpenSSL DLL by absolute path, e.g. Swapping extension=openssl for extension=C:\\php\\php7-4-33\\ext\\php_openssl.dll ... doesn't work ... same error</li>\n<li>Copying openssl.dll to openssl2.dll and defining that as the extension ... doesn't work ... same error, just to openssl2.dll cannot be found (but again correct path)</li>\n<li>Adding 'c:\\php;C:\\php\\php7-4-33;C:\\php\\php7-4-33\\ext;' to the PATH env variable</li>\n<li>Checking the permissions on openssl.dll v sockets.dll ... they're identical</li>\n<li>Taking the reported bad path from the Apache error log (c:\\php\\php7-4-33\\ext\\php_openssl.dll), stripping the escaped backslashes and loading c:\\php\\php7-4-33\\ext\\php_openssl.dll into (say) Notepad, just to prove the file is there and readable</li>\n<li>Defined the OPENSSL_CONF env variable as C:\\Program Files\\Common Files\\SSL (which is where OpenSSL is installed)</li>\n<li>Confirmed that both libcrypto-1_1-x64.dll and libssl-1_1-x64.dll are included in C:\\php\\php7-4-33\\</li>\n</ol>\n<p>The obvious thing is: You don't have your extensions directory properly defined, but...</p>\n<ul>\n<li>The reported not found path <strong>is correct</strong> and <strong>can</strong> be opened</li>\n<li>GD and sockets in the same extensions directory <strong>do load</strong> and are enabled</li>\n</ul>\n<p>I have wondered about removing the php-version directory layer so that the active php version is under c:\\php, but, as mentioned, GD and sockets correctly load from the php version ext directory (c:\\php\\php7-4-33\\ext), so it's hard to see how that could work unless there's something specific about the OpenSSL extension which is ignoring the extension_dir setting, while GD and sockets follow it? Seems unlikely, but I'm running out of options at this stage!</p>\n<p>Finally, before someone tells me this is a duplicate of question x, yes it is, and believe me, <strong>I have been through all of them</strong> and scoured SO and all other places, and so far none of the &quot;This will fix it&quot; fixes have done anything. I have spent countless hours on trying every possible 'fix', and as explained, all have failed, so please, this is not as simple as &quot;Just look at this&quot;, as believe me, to the best of my ability I have been there, tried that, and it didn't work, hence this 'last resort' question</p>\n<h2>Addition</h2>\n<p>Just to eliminate this, I've moved the php7-4-33 directory up to c:\\php and updated php.ini extention_dir and httpd.conf LoadModule php7_module &quot;c:\\php\\php7apache2_4.dll&quot;, but exactly the same error report, just quoting the 'standard' c:\\php\\ext path</p>\n<pre><code>PHP Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: c:\\\\php\\\\ext\\\\openssl (The specified module could not be found.), c:\\\\php\\\\ext\\\\php_openssl.dll (The specified module could not be found.)) in Unknown on line 0\nPHP Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0\n</code></pre>\n<p>php -i reports:</p>\n<pre><code>openssl\n\nOpenSSL support =&gt; enabled\nOpenSSL Library Version =&gt; OpenSSL 1.1.1s 1 Nov 2022\nOpenSSL Header Version =&gt; OpenSSL 1.1.1s 1 Nov 2022\nOpenssl default config =&gt; C:\\Program Files\\Common Files\\SSL\n</code></pre>\n<p>php --ini reports</p>\n<pre><code>PHP Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0\n\nDeprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0\nConfiguration File (php.ini) Path:\nLoaded Configuration File: C:\\php\\php.ini\nScan for additional .ini files in: (none)\nAdditional .ini files parsed: (none)\n</code></pre>\n<p>Adding</p>\n<pre><code>allow_url_include = On\n</code></pre>\n<p>was another 'This will fit it' piece of advice ... but how it could relate to OpenSSL is beyond me. It didn't work and indeed seems deprecated, so that can go.\nphp.ini defines</p>\n<pre><code>extension=openssl\n</code></pre>\n<p>But then</p>\n<pre><code>c:\\php&gt;php --ini\nConfiguration File (php.ini) Path:\nLoaded Configuration File: (none)\nScan for additional .ini files in: (none)\nAdditional .ini files parsed: (none)\n\nc:\\php&gt;php -r &quot;var_dump(extension_loaded('openssl'));&quot;\nbool(false)\n</code></pre>\n<p>This aligns with the Apache load error, the output of <code>phpinfo()</code>, the result of <code>extension_loaded('openssl')</code> and output of <code>get_loaded_extensions()</code></p>\n<p>Apache error log reports</p>\n<pre><code>PHP Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: c:\\\\php\\\\php7-4-33\\\\ext\\\\openssl (The specified module could not be found.), c:\\\\php\\\\php7-4-33\\\\ext\\\\php_openssl.dll (The specified module could not be found.)) in Unknown on line 0\n</code></pre>\n<p>But that <strong>is</strong> the correct path to openssl.dll!</p>\n<p>Decided to try a different php build and switched from 7.3.44 to 8.3.3 and OpenSSL suddenly loads. Maybe it is the php impage that is bad?</p>\n<p>As there was a comment about using a single <code>php.ini</code> and switching between php versions being &quot;completely unworkable&quot;, to effect the change in php version, I...</p>\n<p>In php.ini changed:</p>\n<ul>\n<li>extension=gd2 to</li>\n<li>extension=gd (as php8 simply renames the extension)</li>\n<li>extension_dir = &quot;C:\\php\\php7-4-33\\ext&quot; to</li>\n<li>extension_dir = &quot;C:\\php\\php8-3-3\\ext&quot;</li>\n</ul>\n<p>In httpd.conf changed:</p>\n<ul>\n<li>LoadModule php7_module &quot;c:\\php\\php7apache2_4.dll&quot; to...</li>\n<li>LoadModule php_module &quot;C:\\php\\php8-3-3\\php8apache2_4.dll&quot; (note: not php8_module)</li>\n</ul>\n<p>And restarted Apache. 7.4.33 now 8.3.3 and OpenSSL working and Registered Stream Socket Transports now &quot;tcp, udp, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3&quot;. This doesn't help me get a working php7, but it points toward the php download being the issue. Next thing to try...</p>\n<h2>php version experiments</h2>\n<p>Having found I have no issue with OpenSSL under php 8.3.3 I've been doing further version experiments...</p>\n<div class="s-table-container"><table class="s-table">\n<thead>\n<tr>\n<th style="text-align: center;">Version</th>\n<th style="text-align: center;">OpenSSL</th>\n<th style="text-align: left;">Result</th>\n<th>Source</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style="text-align: center;">7.2.9</td>\n<td style="text-align: center;">No</td>\n<td style="text-align: left;">Cannot find openssl.dll</td>\n<td>[1] <a href="https://windows.php.net/downloads/releases/archives/php-7.2.9-Win32-VC15-x64.zip" rel="nofollow noreferrer">https://windows.php.net/downloads/releases/archives/php-7.2.9-Win32-VC15-x64.zip</a></td>\n</tr>\n<tr>\n<td style="text-align: center;">7.3.4</td>\n<td style="text-align: center;">No</td>\n<td style="text-align: left;">Cannot find openssl.dll</td>\n<td>[1] <a href="https://windows.php.net/downloads/releases/archives/php-7.3.4-Win32-VC15-x64.zip" rel="nofollow noreferrer">https://windows.php.net/downloads/releases/archives/php-7.3.4-Win32-VC15-x64.zip</a></td>\n</tr>\n<tr>\n<td style="text-align: center;">7.4.9</td>\n<td style="text-align: center;">No</td>\n<td style="text-align: left;">Cannot find openssl.dll</td>\n<td>[3] windows.php.net/downloads/releases/archives/</td>\n</tr>\n<tr>\n<td style="text-align: center;">7.4.30</td>\n<td style="text-align: center;">No</td>\n<td style="text-align: left;">Cannot find openssl.dll</td>\n<td>[3] windows.php.net/downloads/releases/archives/</td>\n</tr>\n<tr>\n<td style="text-align: center;">7.4.32</td>\n<td style="text-align: center;"></td>\n<td style="text-align: left;">Cannot find openssl.dll</td>\n<td>[3] windows.php.net/downloads/releases/archives/</td>\n</tr>\n<tr>\n<td style="text-align: center;">7.4.33</td>\n<td style="text-align: center;">No</td>\n<td style="text-align: left;">Cannot find openssl.dll</td>\n<td>https://windows.php.net/downloads/releases/php-7.4.33-Win32-vc15-x64.zip</td>\n</tr>\n<tr>\n<td style="text-align: center;">8.3.3</td>\n<td style="text-align: center;">Yes</td>\n<td style="text-align: left;">All working</td>\n<td>https://windows.php.net/downloads/releases/archives/php-8.3.3-Win32-vs16-x64.zip</td>\n</tr>\n<tr>\n<td style="text-align: center;">8.3.19</td>\n<td style="text-align: center;">Yes</td>\n<td style="text-align: left;">All working</td>\n<td>https://windows.php.net/downloads/releases/php-8.3.19-Win32-vs16-x64.zip</td>\n</tr>\n<tr>\n<td style="text-align: center;">8.4.4</td>\n<td style="text-align: center;">n/a</td>\n<td style="text-align: left;">Endless restart cycle [2]</td>\n<td>[1] <a href="https://windows.php.net/downloads/releases/archives/php-8.4.4-Win32-vs17-x64.zip" rel="nofollow noreferrer">https://windows.php.net/downloads/releases/archives/php-8.4.4-Win32-vs17-x64.zip</a></td>\n</tr>\n<tr>\n<td style="text-align: center;">8.4.5</td>\n<td style="text-align: center;">Yes</td>\n<td style="text-align: left;">All working</td>\n<td>https://windows.php.net/downloads/releases/php-8.4.5-Win32-vs17-x64.zip</td>\n</tr>\n</tbody>\n</table></div>\n<p>[1] Note I've had these downloads a while and so 'believe' this must be the copy used</p>\n<p>[2] See: <a href="https://stackoverflow.com/questions/1138269/apache-error-notice-parent-child-process-exited-with-status-3221225477-res">Apache error [notice] Parent: child process exited with status 3221225477 -- Restarting</a> ... but I had no luck with this fix. Apache still cycled! This further article <a href="https://stackoverflow.com/questions/10306272/apache-crashing-parent-child-process-exited-with-status-3221225477-restarti">APACHE Crashing: Parent: child process exited with status 3221225477 -- Restarting</a> explains 3221225477 is 0xC0000005 in hex, which translates to memory access violation and likely a php bug!</p>\n<p>[3] SO won't let me post every URL, but all downloaded from the official php site</p>\n<p>php images have been taken from windows.php.net/downloads/releases/ and windows.php.net/downloads/releases/archives/ and I've tried both thread-safe, and non-thread-safe, but same result. Maybe the x86 builds will work. All very odd!</p>\n<h2>Running from the CLI v with Apache</h2>\n<p>Following some great advice...</p>\n<blockquote>\n<p>cp php.ini-development php.ini to get a default config file. Lastly I uncommented (with no additional changes) the extension_dir = &quot;ext&quot; and extension=openssl lines. After these steps I ran php -r &quot;var_dump(extension_loaded('openssl'));&quot; and received bool(true)</p>\n</blockquote>\n<p>I went to my c:\\php\\php7-4-33 directory (where this all started), copied php.ini-development to php.ini, and uncommented the extension_dir and extension=openssl lines as suggested.</p>\n<pre><code>c:\\php\\php7-4-33&gt;php -r &quot;var_dump(extension_loaded('openssl'));&quot;\nbool(true)\n</code></pre>\n<p>Conclusion ... it must be the php.ini I have been using, but before we think we're done I then updated httpd.conf...</p>\n<pre><code>PHPIniDir &quot;c:\\php\\php7-4-33&quot;\nLoadModule php7_module &quot;c:\\php\\php7-4-33\\php7apache2_4.dll&quot;\n</code></pre>\n<p>i.e. start Apache pointing at the same php.ini that gave us <code>bool(true)</code> just above, and run the same copy of php under Apache. On restarting Apache and checking phpinfo()</p>\n<ol>\n<li><code>Loaded Configuration File C:\\php\\php7-4-33\\php.ini</code> ... the same php.ini as above</li>\n<li><code>php_ini_loaded_file()</code> also confirms <code>C:\\php\\php7-4-33\\php.ini</code> ... the same php.ini as above</li>\n<li><code>extension_loaded('openssl')</code> gives us <code>FALSE</code></li>\n<li><code>get_loaded_extensions();</code> does not list OpenSSL</li>\n<li><code>phpinfo()</code> does not list an OpenSSL module</li>\n<li><code>phpinfo()</code> shows <code>Registered Stream Socket Transports tcp, udp</code> and not &quot;tcp, udp, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3&quot; as it would with OpenSSL loaded</li>\n<li>The Apache error log shows <code>PHP Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: ext\\\\openssl (The specified module could not be found.), ext\\\\php_openssl.dll (The specified module could not be found.)) in Unknown on line 0</code></li>\n</ol>\n<p>So the same php.ini and the same binaries give different results via the CLI (<code>php -r</code>) and when loaded under Apache 2.4. I really thought I was down to finding 'the magic' php.ini setting that was causing the OpenSSL load issue, but same binaries, same php.ini, just different result.</p>\n<p>This led to up uncomment</p>\n<pre><code>extension=gd2\nextension=sockets\n</code></pre>\n<p>Just to try these other extensions I had working with 7.4.33. The Apache error log then shows...</p>\n<pre><code>PHP Warning: PHP Startup: Unable to load dynamic library 'gd2' (tried: ext\\\\gd2 (The specified module could not be found.), ext\\\\php_gd2.dll (The specified module could not be found.)) in Unknown on line 0\nPHP Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: ext\\\\openssl (The specified module could not be found.), ext\\\\php_openssl.dll (The specified module could not be found.)) in Unknown on line 0\nPHP Warning: PHP Startup: Unable to load dynamic library 'sockets' (tried: ext\\\\sockets (The specified module could not be found.), ext\\\\php_sockets.dll (The specified module could not be found.)) in Unknown on line 0\n</code></pre>\n<p>I then tried</p>\n<pre><code>extension_dir = &quot;\\ext&quot;\n</code></pre>\n<p>Same result, so I then tried</p>\n<pre><code>extension_dir = &quot;c:\\php\\php7-4-33\\ext&quot;\n</code></pre>\n<p>This removed the gd2 and sockets load errors, but retained the OpenSSL load error as above. <code>phpinfo()</code> and <code>get_loaded_extensions()</code> both show GD and sockets being loaded, but OpenSSL is not loaded, so the full extensions directory path worked for gd2 and sockets, but not openssl.</p>\n<p>I then changed <code>extension=openssl</code> to <code>extension=c:\\php\\php7-4-33\\ext\\openssl.dll</code> (another 'This will fix it' piece of advice ... but no different. The Apache error log just varies slightly to</p>\n<pre><code>PHP Warning: PHP Startup: Unable to load dynamic library 'c:\\\\php\\\\php7-4-33\\\\ext\\\\openssl.dll' (tried: c:\\\\php\\\\php7-4-33\\\\ext\\\\openssl.dll (The specified module could not be found.), c:\\\\php\\\\php7-4-33\\\\ext\\\\php_c:\\\\php\\\\php7-4-33\\\\ext\\\\openssl.dll.dll (The specified module could not be found.)) in Unknown on line 0\n</code></pre>\n<p>So my conclusion...</p>\n<ul>\n<li><code>php -r</code> does not always reflect how an extension will load under Apache</li>\n<li>The <code>extension_dir</code> directive seems to need to be absolute for Apache on Windows. <code>'ext'</code> works with <code>php -r</code>, but fails with Apache, while an absolute path works</li>\n<li>I've still not worked out why I can't load OpenSSL with any php7 builds while I can load OpenSSL with php8 builds and I can load other extensions under php7. 'The search continues...'</li>\n</ul>\n<h2>Further thought...</h2>\n<p>Just to evidence the apparent madness I seem to be saying...</p>\n<p>php.ini:</p>\n<pre><code>extension_dir = &quot;c:\\php\\php7-4-33\\ext&quot;\n\nextension=gd2\nextension=openssl\nextension=sockets\n;extension=imap\n</code></pre>\n<p>And <code>phpinfo()</code> reports:</p>\n<pre><code>Configuration File (php.ini) Path no value\nLoaded Configuration File C:\\php\\php7-4-33\\php.ini\nScan this dir for additional .ini files (none)\nAdditional .ini files parsed (none) \n\nDirective Local Value Master Value\nextension_dir c:\\php\\php7-4-33\\ext c:\\php\\php7-4-33\\ext\n\nGD Support enabled \nSockets Support enabled \n</code></pre>\n<p>So, the correct <code>php.ini</code> and extensions directory defined, no additional <code>.ini</code> files being read, and both GD2 and sockets are loaded as per the config. IMAP or OpenSSL are not included in <code>phpinfo()</code> output as neither is loaded. IMAP is configured not to load (so correct), OpenSSL is configured to load (and so incorrect).</p>\n<p>Checking from the CLI</p>\n<pre><code>c:\\php\\php7-4-33&gt;php -r &quot;var_dump(php_ini_loaded_file());&quot;\nstring(24) &quot;C:\\php\\php7-4-33\\php.ini&quot;\n\nc:\\php\\php7-4-33&gt;php -r &quot;var_dump(php_ini_scanned_files());&quot;\nbool(false)\n\nc:\\php\\php7-4-33&gt;php -r &quot;var_dump(extension_loaded('openssl'));&quot;\nbool(true)\n\nc:\\php\\php7-4-33&gt;php -r &quot;var_dump(extension_loaded('gd'));&quot;\nbool(true)\n\nc:\\php\\php7-4-33&gt;php -r &quot;var_dump(extension_loaded('sockets'));&quot;\nbool(true)\n\nc:\\php\\php7-4-33&gt;php -r &quot;var_dump(extension_loaded('imap'));&quot;\nbool(false)\n\nc:\\php\\php7-4-33&gt;php -r &quot;var_dump(phpinfo());&quot; | findstr -i openssl\nopenssl\nOpenSSL support =&gt; enabled\nOpenSSL Library Version =&gt; OpenSSL 1.1.1s 1 Nov 2022\nOpenSSL Header Version =&gt; OpenSSL 1.1.1s 1 Nov 2022\nOpenssl default config =&gt; C:\\Program Files\\Common Files\\SSL\nopenssl.cafile =&gt; no value =&gt; no value\nopenssl.capath =&gt; no value =&gt; no value\nOpenSSL support =&gt; enabled\nOPENSSL_CONF =&gt; C:\\Program Files\\Common Files\\SSL\n$_SERVER['OPENSSL_CONF'] =&gt; C:\\Program Files\\Common Files\\SSL\nOpenSSL =&gt; Stig Venaas, Wez Furlong, Sascha Kettler, Scott MacVicar\n</code></pre>\n<p>So these results correspond with the output of phpinfo(), <strong>except</strong> OpenSSL reports as loaded!</p>\n<p>Checking <code>php_ini_loaded_file()</code>, <code>php_ini_scanned_files()</code> and <code>extension_loaded('ext-name')</code> via script reports:</p>\n<pre><code>Loaded php.ini is C:\\php\\php7-4-33\\php.ini\nAdditional scanned ini files []\n\nOpenSSL is NOT loaded\nGD is loaded\nSockets is loaded\nIMAP is NOT loaded\n</code></pre>\n<p>GD and sockets configured to be loaded. IMAP not configured. OpenSSL configured to load ... only isn't loading (<code>PHP Warning: PHP Startup: Unable to load dynamic library 'c:\\\\php\\\\php7-4-33\\\\ext\\\\openssl.dll' (tried: c:\\\\php\\\\php7-4-33\\\\ext\\\\openssl.dll (The specified module could not be found.), c:\\\\php\\\\php7-4-33\\\\ext\\\\php_c:\\\\php\\\\php7-4-33\\\\ext\\\\openssl.dll.dll (The specified module could not be found.)) in Unknown on line 0 </code>).</p>\n<p>So, at the same time with the same binaries and the same phi.ini, OpenSSL reports as loaded via the CLI (<code>php -r</code>) but <strong>not</strong> loaded under Apache, with the error that the extension cannot be found, all the while reporting the correct file location for the claimed missing openssl.dll. Permissions on extensions that load (GD and sockets) are the same as OpenSSL (which cannot be found). Copying openssl.dll to openssl2.dll and trying to load that gives the same 'not found' error. None of this makes any sense.</p>\n<h2>A cunning plan</h2>\n<p>On the basis other modules <strong>will</strong> load, but OpenSSL will not, I renamed <code>php_imap.dll</code> (which will load) to <code>php_imap-real.dll</code> and copied <code>php_openssl.dll</code> as <code>php_imap.dll</code>, then restarted. The Apache log reports:</p>\n<pre><code>PHP Warning: PHP Startup: Unable to load dynamic library 'imap' (tried: c:\\\\php\\\\php7-4-33\\\\ext\\\\imap (The specified module could not be found.), c:\\\\php\\\\php7-4-33\\\\ext\\\\php_imap.dll (The specified module could not be found.)) in Unknown on line 0\nPHP Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: c:\\\\php\\\\php7-4-33\\\\ext\\\\openssl (The specified module could not be found.), c:\\\\php\\\\php7-4-33\\\\ext\\\\php_openssl.dll (The specified module could not be found.)) in Unknown on line 0\n</code></pre>\n<p>Which suggests this is something to do with the <code>php_openssl.dll</code> file itself, as with the real IMAP module, <code>php_imap.dll</code> <em>will</em> load, but when that file is a renamed copy of <code>phpopenssl.dll</code>, it cannot be found. This makes me think the 'could not be found' error is a mis-report and there is some other error on attempting to load this module which is being incorrectly reported as 'not found', as whatever the issue, it is clearly <strong>not</strong> that the module cannot be found!</p>\n<p>Interestingly, running <code>php -r &quot;var_dump(phpinfo());&quot; | findstr -i openssl</code> with <code>php_openssl.dll</code> copied to <code>php_imap.dll</code> and with both IMAP and OpenSSL configured to load, reports:</p>\n<pre><code>PHP Warning: Module 'openssl' already loaded in Unknown on line 0\nWarning: Module 'openssl' already loaded in Unknown on line 0\n</code></pre>\n<p>In other words, the 'reused' <code>extension=imap</code> with <code>php_imap.dll</code> being a copy of <code>php_openssl.dll</code>, there was a dual attempt to load OpenSSL, once under the <code>extension=imap</code> and then again under <code>extension=openssl</code>, <em>and this</em> means <code>php -r</code> is not encountring the same load error as Apache. Humm... Memory? Is there some other Apache setting needed to have Apache load <code>php_openssl.dll</code>???</p>\n"^^ . + "There are often 2 `php.ini` files. One for the website PHP and one for the CLI PHP.\nFrom the command prompt do `php --ini` this will show you `Loaded Configuration File: C:\\wamp64\\bin\\php\\php8.4.3\\php.ini` for example. Edit that version of the `php.ini` to Mod the PHP CLI configuration"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "<p>A series of multiple-choice survey questions (say total 20q) are shown on a PHP site, one question per page.\nUser keeps selecting answer option for each q (shown 1 question per page).\nResponses are locally stored (like in a PHP text string), and are recorded in a db once they finally hit submit on last question. This part is working fine if the user completes it within the 20 minutes timeline.</p>\n<p>The issue is that the survey is timed, means user must complete it within 20 minutes. If they remain stuck on a question (say q no. 15) and 20 minutes are over, the survey form is expected to record the locally stored answers (till whatever question completed - q no. 15 in this example) at the end of 20 minutes.</p>\n<p>Time left is captured in <code>$_SESSION['remainingtime']</code> php session variable.\nApproach I'm trying is to redirect the user to submitted page, if remaining time is less than equal to 1 sec.</p>\n<pre><code>&lt;?php\necho '&lt;meta http-equiv=&quot;refresh&quot; content=&quot;'.$_SESSION['remainingtime'].';URL=submitted.php&quot; /&gt;'; // The time in seconds to wait before redirect.\n if ($_SESSION['remainingtime'] &lt;= 1)\n {\n //Write the local stored answer string to database\n }\n?&gt;\n</code></pre>\n<p>The above will work only when the user reaches a question page only with l sec or less remaining on the timer. If the user leaves the questionnaire with more than 1 second remaining, nothing will get to the db.\nThe key idea is to record whatever was submitted by the user till the stipulated timeline, even if the user remains stuck at an intermediate question.</p>\n<p>I guess Javascript can be used to redirect to new page based on a running timer, but I am looking to avoid any scripts, and want to achieve it in PHP.\nPossible, or not?</p>\n"^^ . + "You'd probably have to flatten the collection one level in order to be able to group it.\nTry `collect($linedata)->flatten()->groupBy('id')`"^^ . + "0"^^ . + "1"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + . + "2"^^ . + . + . + . + . + . + "<p>I have a learnpress course on a wordpress site. The 'complete' button wasn't working (it would 404), so I have removed it and instead want the 'next' button/link to both mark the current lesson as complete and then progress to the next page. I have added custom JS to make an AJAX call when the next button is clicked on a page and that works fine. The problem I have is that server-side (PHP), I'm unable to mark the lesson as complete. I am passing the user id and lesson id to PHP, but then server side I'm not able to locate the course id from the lesson id. I've taken a look at the wp_post_meta table and none of the lessons have a property referring to the course id. Additionally, running the below code in PHP returns 'undefined':</p>\n<pre><code>$course_id = get_post_meta($lesson_id, '_lp_course', true);\n</code></pre>\n<p>I am wondering how I can mark a lesson as complete using PHP using the user id and lesson id.</p>\n<p>Using learnpress 4.2.8</p>\n"^^ . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + "<p>The issue was resolved by changing how the script was executed. Previously, it was run directly through Steam. Now, the script is written to a temporary file, made executable, and then executed with sudo bash. This change, using the following code, fixed the problem:</p>\n<pre><code>const command = `\n cat &gt; /tmp/temp_script.sh &lt;&lt; 'EOFSCRIPT'\n${escapedScript}\nEOFSCRIPT\n chmod +x /tmp/temp_script.sh\n sudo bash /tmp/temp_script.sh\n rm /tmp/temp_script.sh\n `;\n\n</code></pre>\n<p>solved the problem.</p>\n"^^ . + . + "1"^^ . + "0"^^ . + "Therefore there is a sort of indirection: the symbol table's entry for `$p` points to the memory location (i.e. `$p`'s value) that actually stores a _reference_ to the instantiated object in memory."^^ . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + "angular"^^ . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + "2"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + "Please edit your post and provide the htaccess file there."^^ . + . + . + "cart item can't update between categories navigation"^^ . + . + "<p>There are a number of points that should be able to help you, and different ways of proceeding depending on your needs.</p>\n<ol>\n<li><p>If the number of resources you want to check is not too high you might use some <strong>monitoring services</strong> Tools like <a href="https://uptimerobot.com/" rel="nofollow noreferrer">UptimeRobot</a>, <a href="https://www.pingdom.com/" rel="nofollow noreferrer">Pingdom</a>.</p>\n</li>\n<li><p>For the most realistic approach, you may consider using a <strong>headless browser</strong> through PHP libraries like chrome-php, php-webdriver or Symfony Panther, which would interact with sites just like a real browser. It takes a bit of work at first, but it will be very effective.</p>\n</li>\n<li><p>Your script can be improved:</p>\n<ol>\n<li><p><strong>Use GET instead of HEAD requests</strong><br />\nMany security systems are more suspicious of HEAD requests since they're commonly used by automated tools but rarely by real users. Switching to GET requests might help:<br />\n<code>$request = $client-&gt;get($encoded_link);</code></p>\n</li>\n<li><p><strong>Improve your user agent string</strong></p>\n<p>Your current user agent is somewhat outdated (Chrome 61). Use a more recent browser signature:</p>\n<pre><code>$options = [\n 'headers' =&gt; [\n 'User-Agent' =&gt; 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'\n ]\n];\n$request = $client-&gt;get($encoded_link, $options);\n</code></pre>\n</li>\n<li><p><strong>Add realistic headers</strong></p>\n<p>Include headers that typical browsers would send:</p>\n<pre><code>$options = [\n 'headers' =&gt; [\n 'User-Agent' =&gt; 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',\n 'Accept' =&gt; 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',\n 'Accept-Language' =&gt; 'en-US,en;q=0.9',\n 'Accept-Encoding' =&gt; 'gzip, deflate, br',\n 'Connection' =&gt; 'keep-alive',\n 'Upgrade-Insecure-Requests' =&gt; '1',\n 'Sec-Fetch-Dest' =&gt; 'document',\n 'Sec-Fetch-Mode' =&gt; 'navigate',\n 'Sec-Fetch-Site' =&gt; 'none',\n 'Sec-Fetch-User' =&gt; '?1'\n ]\n];\n</code></pre>\n</li>\n</ol>\n</li>\n</ol>\n"^^ . + "Sorry, it's sql server 2012"^^ . + "0"^^ . + "<p>I have a web app in PHP, and JS for front-end. I am connecting to Dcusign through the JWT and exchanging it for an access token, but I keep getting this error:</p>\n<blockquote>\n<p>Decoding JWT did not work</p>\n<p>UnexpectedValueException: &quot;kid&quot; invalid,\nunable to lookup correct key in\n/html/htdocs/mrt_dgheorghe/vendor/firebase/php-jwt/src/JWT.php:477</p>\n</blockquote>\n<p>The code for JWT looks like this:</p>\n<pre><code>$now = time();\n$payload = [\n 'iss' =&gt; $clientId,\n 'sub' =&gt; $apiUserId,\n 'aud' =&gt; 'account-d.docusign.com',\n 'scope' =&gt; 'signature impersonation',\n 'iat' =&gt; $now,\n 'exp' =&gt; $now + 3600 // 1 hour expiration\n];\n$privateKey = file_get_contents($privateKeyFilePath);\n$jwt = JWT::encode($payload, $privateKey, 'RS256', $keypairID); //kid\n$publicKey = file_get_contents('publicKey.key');\n\ntry\n{\n $decodedJWT = JWT::decode($jwt,$publicKey);\n print_r($decodedJWT);\n echo &quot;This is the decoded JWT&quot;;\n}\ncatch(Exception $e)\n{\n echo &quot;Decoding JWT did not work&quot;;\n print($e);\n</code></pre>\n<p>Is the <code>kid</code> the equivalent of the Docusign Keypair ID? I am manually transmitting it when encoding the JWT but I do not even know if it's the right approach.</p>\n"^^ . + . + "0"^^ . + "2"^^ . + . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + "1"^^ . + . + . + . + . + . + "Livewire Upload File Endpoint Security Issuee"^^ . + . + "phpunit"^^ . + . + ""*Even after killing the process that appears to be using port 2053 [...]*" - Just use another port which is actually open?"^^ . + "<p>You can use a stub file for the migration file creation and then run <code>php artisan migrate</code>.</p>\n<p>Here is a package that makes stub customization easy: <a href="https://laravel-news.com/laravel-stub" rel="nofollow noreferrer">https://laravel-news.com/laravel-stub</a></p>\n<p>I will not judge if letting the user trigger a table creation is a good practice or not... it is not.</p>\n"^^ . + "mamp"^^ . + . + . + "Search duplicate items with the function morphToMany in Laravel"^^ . + "2"^^ . + "TCPDF: textarea overlapping Footer"^^ . + . + "1"^^ . + . + "0"^^ . + . + . + . + "-2"^^ . + . + . + . + "<p>You have an extra div, and you might want to switch up the <code>&lt;/article&gt;</code> and the <code>&lt;/div&gt;</code> above it.</p>\n<pre class="lang-html prettyprint-override"><code>echo &quot;&lt;div class='job-container'&gt;&quot;;\nwhile ($row = mysqli_fetch_assoc($result)) {\n echo &quot;&lt;div class='job-box'&gt;&quot;;\n echo &quot; &lt;article class='job-card'&gt;&quot;;\n echo &quot; &lt;div class='job-items'&gt;&quot;;\n echo &quot; &lt;div class='company-logo'&gt;&quot;;\n if (!empty($row['company_logo'])) {\n echo &quot; &lt;img src='../../Employer/User/logos/&quot; . htmlspecialchars($row['company_logo']) . &quot;' alt='&quot; . htmlspecialchars($row['company_name']) . &quot; Logo'&gt;&quot;;\n } else {\n echo &quot; &lt;img src='../assets/img/default-logo.png' alt='Default Logo'&gt;&quot;;\n }\n echo &quot; &lt;/div&gt;&quot;;\n echo &quot; &lt;div class='job-details'&gt;&quot;;\n echo ' &lt;h4 class=&quot;job-title&quot;&gt;';\n echo ' &lt;a href=&quot;#?vacancyID=' . htmlspecialchars($row['job_name']) . '&quot;&gt;' . htmlspecialchars($row['job_name']) . '&lt;/a&gt;';\n echo ' &lt;/h4&gt;';\n echo ' &lt;ul class=&quot;job-info&quot;&gt; ';\n echo ' &lt;li class=&quot;company-name&quot;&gt;'. htmlspecialchars($row['company_name']) .'&lt;/li&gt;';\n echo ' &lt;li class=&quot;location&quot;&gt;&lt;i class=&quot;fas fa-map-marker-alt&quot;&gt;&lt;/i&gt; ' . htmlspecialchars($row['job_location']) . '&lt;/li&gt;';\n echo ' &lt;li class=&quot;salary&quot;&gt;₱' . htmlspecialchars($row['min_salary']) . ' - ₱' . htmlspecialchars($row['max_salary']) . '&lt;/li&gt;';\n echo ' &lt;/ul&gt;';\n echo ' &lt;/div&gt;';\n echo ' &lt;div class=&quot;items-link items-link2 f-right&quot;&gt;';\n echo ' &lt;a href=&quot;job_details.html&quot; class=&quot;job-type&quot;&gt;' . htmlspecialchars($row['job_type']) . '&lt;/a&gt;';\n echo ' &lt;/div&gt;';\n echo &quot; &lt;/div&gt;&quot;;\n echo &quot; &lt;/div&gt;&quot;; // Switch to &lt;/article&gt;\n echo &quot; &lt;/article&gt;&quot;; // Move up\n echo &quot;&lt;/div&gt;&quot;; // remove\n}\necho &quot;&lt;/div&gt;&quot;;\n</code></pre>\n\n"^^ . + . + . + . + . + "0"^^ . + "-3"^^ . + . + "session-cookies"^^ . + "0"^^ . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + "<p>You must update existing steps, create new ones, and remove unnecessary ones. Since your <code>guide_steps</code> table does not have a unique constraint on <code>recipe_id</code> and <code>step_number</code>. You can't use <code>upsert()</code>. Instead, you can try the following approach:</p>\n<ul>\n<li><p><strong>Fetch existing steps</strong> for the given <code>recipe_id</code>.</p>\n</li>\n<li><p><strong>Determine which steps need to be updated, inserted, or deleted.</strong></p>\n</li>\n<li><p><strong>Perform batch updates, inserts, and deletions efficiently.</strong></p>\n</li>\n</ul>\n<p>Code Example:</p>\n<pre><code>use App\\Models\\GuideStep;\nuse Illuminate\\Support\\Facades\\DB;\n\nfunction updateGuideSteps($recipeId, $groupedSteps) {\n // Fetch existing steps\n $existingSteps = GuideStep::where('recipe_id', $recipeId)\n -&gt;pluck('id', 'step_number') \n -&gt;toArray();\n\n $newStepNumbers = [];\n $insertData = [];\n $updateData = [];\n\n foreach ($groupedSteps as $step) {\n $stepNumber = $step['step_number'];\n $newStepNumbers[] = $stepNumber;\n\n if (isset($existingSteps[$stepNumber])) {\n // Prepare update data\n $updateData[] = [\n 'id' =&gt; $existingSteps[$stepNumber],\n 'step_text' =&gt; $step['step_text'],\n 'step_image' =&gt; $step['step_image'],\n 'updated_at' =&gt; now(),\n ];\n } else {\n // Prepare insert data\n $insertData[] = [\n 'recipe_id' =&gt; $recipeId,\n 'step_number' =&gt; $stepNumber,\n 'step_text' =&gt; $step['step_text'],\n 'step_image' =&gt; $step['step_image'],\n 'created_at' =&gt; now(),\n 'updated_at' =&gt; now(),\n ];\n }\n }\n\n // Perform batch insert\n if (!empty($insertData)) {\n GuideStep::insert($insertData);\n }\n\n // Perform batch update\n if (!empty($updateData)) {\n $table = (new GuideStep)-&gt;getTable();\n $cases = [];\n $ids = [];\n $bindings = [];\n\n foreach ($updateData as $data) {\n $id = (int) $data['id'];\n $ids[] = $id;\n $cases[] = &quot;WHEN id = ? THEN ?&quot;;\n $bindings[] = $id;\n $bindings[] = $data['step_text'];\n }\n\n $sql = &quot;UPDATE {$table} SET step_text = CASE &quot; . implode(&quot; &quot;, $cases) . &quot; END WHERE id IN (&quot; . implode(',', $ids) . &quot;)&quot;;\n DB::update($sql, $bindings);\n }\n\n // Delete steps that are not in the new set\n GuideStep::where('recipe_id', $recipeId)\n -&gt;whereNotIn('step_number', $newStepNumbers)\n -&gt;delete();\n}\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + "<p>I have a container that is running a PHP application. I also have a dotnet core application running locally on my mac to handle OIDC/Identity. I am looking to integrate the two but am having trouble mapping the IPs.</p>\n<p>My PHP site is myphpsite.com and my other application is locally running on <a href="https://login.mywebsite.com:5001" rel="nofollow noreferrer">https://login.mywebsite.com:5001</a></p>\n<p>These two run just fine independently of each other. The OIDC redirect in the browser is good. The oidc POST call to /connect/token occurs through <a href="https://github.com/jumbojett/OpenID-Connect-PHP" rel="nofollow noreferrer">the PHP library</a> I'm getting connected refused errors. So I tried simply using cURL commands in terminal. I can hardcode all the commands in the library to host.docker.internal but that's not ideal</p>\n<p>from inside my container</p>\n<pre><code>curl -k -v https://host.docker.internal:5001\n</code></pre>\n<p>this works fine, I get connected to .... along with the location of my identity provider login</p>\n<pre><code>curl -k -v https://login.mywebsite.com:5001\n</code></pre>\n<p>this fails with &quot;trying 127.0.0.1 port 5001.... then connection refused&quot;</p>\n<p>I'm wondering if this has to do with the mapping in my mac's hosts which is in place for other parts of the applications.</p>\n<pre><code>127.0.0.1 login.mywebsite.com\n</code></pre>\n<p>The PHP docker container is built with my docker-compose-env.yml file. I've tried adjusting the hosts file in the PHP container but no luck so far. I did try network_mode: host in the yml file but didn't help either.</p>\n"^^ . + . + . + . + . + "<p>I don’t fully understand your question, but since your frontend and backend are separate, I suggest using token-based authentication (JWT, Sanctum, or Passport) instead of session-based authentication.</p>\n<p>If you’re using a token-based approach, you don’t need CSRF protection, because CSRF attacks rely on cookies, and tokens are sent via headers.</p>\n<p>However, if you still want to disable CSRF checks for specific routes in Laravel, you can exclude them in <code>bootstrap/app.php</code>:</p>\n<pre class="lang-php prettyprint-override"><code>...\n-&gt;withMiddleware(function (Middleware $middleware) {\n $middleware-&gt;validateCsrfTokens(except: [\n 'register',\n ]);\n })\n</code></pre>\n<p><strong>Note</strong>: Only disable CSRF checks for specific API routes that do not rely on cookies. Disabling it globally can be a security risk.</p>\n"^^ . + "0"^^ . + "How can I display only the query string witch is john and not any of the extra stuff like demo="^^ . + "lockbox-2"^^ . + "<p>Split by 2, if the input is an odd length, merge the last two chunks.</p>\n<pre class="lang-php prettyprint-override"><code>\nfunction toChunks($input)\n{\n $result = str_split($input, 2);\n if(strlen($input) % 2 === 1){\n $length = sizeof($result);\n if($length &gt; 1){\n $result[$length - 2] .= $result[$length - 1]; // add last to previous\n unset($result[$length - 1]);\n }\n }\n return $result;\n}\n\necho '&lt;br&gt;&lt;br&gt;';\necho 'toChunks()';\necho '&lt;br&gt;';\nforeach(array('112233', '1122333', '11223333', '1122233', '123', '12345', '1234567') as $string){\n echo 'Input: '.$string;\n echo '&lt;br&gt;';\n echo 'Output: '.print_r(toChunks($string), true);\n echo '&lt;br&gt;&lt;br&gt;';\n}\n</code></pre>\n<p>Produces:</p>\n<pre class="lang-html prettyprint-override"><code>\ntoChunks()\nInput: 112233\nOutput: Array ( [0] =&gt; 11 [1] =&gt; 22 [2] =&gt; 33 )\n\nInput: 1122333\nOutput: Array ( [0] =&gt; 11 [1] =&gt; 22 [2] =&gt; 333 )\n\nInput: 11223333\nOutput: Array ( [0] =&gt; 11 [1] =&gt; 22 [2] =&gt; 33 [3] =&gt; 33 )\n\nInput: 1122233\nOutput: Array ( [0] =&gt; 11 [1] =&gt; 22 [2] =&gt; 233 )\n\nInput: 123\nOutput: Array ( [0] =&gt; 123 ) \n\nInput: 12345\nOutput: Array ( [0] =&gt; 12 [1] =&gt; 345 )\n\nInput: 1234567\nOutput: Array ( [0] =&gt; 12 [1] =&gt; 34 [2] =&gt; 567 )\n\n</code></pre>\n"^^ . + . + . + . + . + "1"^^ . + . + . + . + "Issue with increase in CPU load from PHP-FPM Master Process"^^ . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + "<p>In your ProductResource.php form() method, update the FileUpload field like this</p>\n<pre><code>FileUpload::make('image')\n -&gt;label('Imagen')\n -&gt;avatar()\n -&gt;required()\n -&gt;afterStateHydrated(function (FileUpload $component, $state, $record) {\n if ($record &amp;&amp; $record-&gt;mainImage()) {\n $mainImage = $record-&gt;mainImage()-&gt;path;\n $component-&gt;state($mainImage); // Set the existing image path as the field value\n }\n })\n -&gt;getUploadedFileNameForStorageUsing(function ($file) {\n return $file-&gt;store('products', 'public'); // Save the file to the public storage\n })\n -&gt;directory('products') // Optional, for organized storage\n -&gt;deleteUploadedFileUsing(function ($file) {\n \\Storage::disk('public')-&gt;delete($file); // Delete the image from storage if replaced\n }),\n</code></pre>\n<p>how it would work</p>\n<ul>\n<li>The -&gt;afterStateHydrated() method checks if there is a record and a\nprimary image.</li>\n<li>If the mainImage() exists, it sets the path as the state of the field\nusing $component-&gt;state($mainImage).</li>\n<li>This will automatically bind the uploaded file to the field state and\ndisplay it as if the user had uploaded it.</li>\n<li>The getUploadedFileNameForStorageUsing() method makes sure the file\nis stored correctly under the public/products folder.</li>\n<li>The deleteUploadedFileUsing() method will delete the file when the\nuser replaces it.</li>\n</ul>\n<p><strong>Optional: Validation</strong>\nIf you want the field not to be required when editing, only when creating, you can add</p>\n<pre><code>-&gt;required(fn ($record) =&gt; $record === null)\n</code></pre>\n<p>Now,</p>\n<ul>\n<li>The image will display in both Create and Edit forms.</li>\n<li>The image will be correctly bound as the field's state.</li>\n<li>Users can update other fields without having to re-upload the image.</li>\n</ul>\n<p>let me know if it works for you?</p>\n"^^ . + . + . + "I think so, yes: as far as I can see, the name is generated while transforming the [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) into opcodes, and it's the opcodes which are cached by OpCache. So the generated class name will be stored in the cache and reused when you `require` the same file a second time. I believe it will also cache/share the "executor_globals" structure which holds the incrementing suffix, so that when it _does_ need a new name, it won't reuse one that's been cached."^^ . + . + "0"^^ . + . + "0"^^ . + . + "<p>I'm building an application which has a public facing &quot;landing page&quot; that is rendered using data from the database.</p>\n<p>To do so I'd like to use Laravel Folio (running on Laravel 12). I noticed that even though it's not needed, Laravel will set session and XSRF cookies in responses from the public part of the application. I would like to remove these.</p>\n<p>My <code>FolioServiceProvider</code> does not define any middleware:</p>\n<pre class="lang-php prettyprint-override"><code>public function boot(): void\n{\n Folio::path(resource_path('views/pages'))-&gt;middleware([\n '*' =&gt; [\n //\n ],\n ])-&gt;uri('/');\n}\n</code></pre>\n<p>and I don't edit anything in <code>bootstrap/app.php</code>:</p>\n<pre class="lang-php prettyprint-override"><code>return Application::configure(basePath: dirname(__DIR__))\n -&gt;withRouting(\n commands: __DIR__.'/../routes/console.php',\n web: __DIR__.'/../routes/web.php',\n health: '/up',\n )\n -&gt;withMiddleware(function (Middleware $middleware) {\n //\n })\n -&gt;withExceptions(function (Exceptions $exceptions) {\n //\n })-&gt;create();\n</code></pre>\n<p>Searching the web, I found advice on removing <code>StartSession</code> middleware from the middleware stack, however when I do that:</p>\n<pre class="lang-php prettyprint-override"><code>$middleware-&gt;remove([\n \\Illuminate\\View\\Middleware\\ShareErrorsFromSession::class,\n \\Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken::class,\n \\Illuminate\\Session\\Middleware\\StartSession::class,\n]);\n</code></pre>\n<p>a 500 error complaining about how there is no session is raised:</p>\n<pre><code>Session store not set on request.\n</code></pre>\n<p>which seems to originate in the (previously removed?) <code>VerifyCsrfToken</code> middleware trying to access the request's session.</p>\n<p>I have a hard time understanding how middleware is being stacked in this combo, especially since this is my first time using Folio and Laravel version 12 (middleware defintion worked differently before).</p>\n<p>Ideally, I'd like to come to a point where everything routed through Folio <strong>does not pass any middleware</strong>, but removing sessions would be a good start also.</p>\n"^^ . + . + . + "1"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + . + "0"^^ . + . + "The array declaration is misleading. The array will be received by the OP from the user input, and in the case of an actual array, rather than one built from variables, the difference becomes negligible, and it could even result in a faster outcome than adding up 24 different variables. [PHP Playground](https://onlinephp.io/c/9246a) (`1.3964440822601` vs `1.3562970161438`)"^^ . + "1"^^ . + "If you divide the quantity by 10 (quantity * 0.1), the order item price will be also divided by 10, unless the price of the related product is based on 1 gram."^^ . + . + "1"^^ . + . + "<p>I got a task to update specific parts of HTML elements across all pages of a web project. Given the size and complexity of the project, I prefer using DOM manipulation over methods like regex to ensure more structured changes. However, as I'm a beginner in DOM manipulation and am handling real data, I have some concerns.</p>\n<p>My main concern is ensuring that only the intended parts of the HTML are modified, while other parts of the document remain unchanged. I want to verify and prevent if any unintended changes are made implicitly by the DOM parser during manipulation. This is crucial for data integrity and preventing accidental modifications in the rest of the document.</p>\n<p>So far, I've also noticed that PHP's DOMDocument class converts all HTML tag names to lowercase by default when parsing HTML, which is fine.</p>\n<pre><code>$html = '\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n &lt;title&gt;My Web Page&lt;/title&gt;\n&lt;/head&gt;\n&lt;body&gt;\n &quot;This Line Non Tag TextNode Before header&quot;\n &lt;h1 id=&quot;main-header&quot; class=&quot;header&quot;&gt;Main Header&lt;/h1&gt;\n &lt;div class=&quot;content&quot;&gt;\n &lt;h1 class=&quot;nested-header&quot;&gt;Nested Header 1&lt;/h1&gt;\n &lt;p&gt;Some content under nested header.&lt;/p&gt;\n &lt;a href=&quot;https://example.com&quot;&gt;Example Link&lt;/a&gt;\n &lt;/div&gt;\n &lt;h2 id=&quot;sub-header-1&quot;&gt;Sub Header 1&lt;/h2&gt;\n &lt;h3&gt;Sub Header 2&lt;/h3&gt;\n &lt;h1&gt;Another Main Header&lt;/h1&gt;\n &lt;p&gt;This is a paragraph outside the header tags.&lt;/p&gt;\n &lt;footer&gt;Some footer text with &lt;span&gt;inline text&lt;/span&gt;.&lt;/footer&gt;\n&lt;/body&gt;\n&lt;/html&gt;';\n\n// Load HTML content\n$doc = new DOMDocument();\n@$doc-&gt;loadHTML($html);\n\n// Create a TextNode to be inserted before the first &lt;h1&gt;\n$textNode = $doc-&gt;createTextNode('This Line Non Tag TextNode Before header');\n\n// Insert the TextNode before the first &lt;h1&gt; element\n$firstHeader = $doc-&gt;getElementsByTagName('h1')-&gt;item(0);\nif ($firstHeader) {\n $firstHeader-&gt;parentNode-&gt;insertBefore($textNode, $firstHeader);\n}\n\n// Remove the first &lt;h1&gt; element\nif ($firstHeader) {\n $firstHeader-&gt;parentNode-&gt;removeChild($firstHeader);\n}\n\n// Check if other headers or elements are modified unintentionally\n$modifiedHtml = $doc-&gt;saveHTML();\necho $modifiedHtml;\n</code></pre>\n"^^ . + "0"^^ . + "0"^^ . + . + . + "advanced-custom-fields"^^ . + "2"^^ . + "0"^^ . + "<p>Try disabling opcache by</p>\n<pre><code>opcache.enable=0\n</code></pre>\n<p>And if not working then,</p>\n<pre><code>codesign -v /opt/homebrew/Cellar/php/8.4.5_1/lib/php/20240924/opcache.so\n</code></pre>\n<p>Run this to verify signature of the <code>opcache</code> extension.</p>\n<p>If not working clear safari cache.</p>\n<p>If still not working try <strong>php 7.4</strong> I hope it will be fine. And these should resolve the problem.</p>\n"^^ . + "maatwebsite-excel"^^ . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + "Thank you so much. Worked the first option, I changed nginx to redirect to non-www."^^ . + . + . + . + "0"^^ . + "How to fix av_interleaved_write_frame() broken pipe error in php"^^ . + . + . + . + . + . + . + . + "@AndrewMorton They are user input from a form on a website. The users select twentyfour numbers."^^ . + "1"^^ . + . + . + "2"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + "Is this a problem with the deployment, with any framework, or with Composer? Did you check whether `vendor/autoload.php` exists?"^^ . + "woocommerce-rest-api"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + "A factory usually creates random data (that is valid), if you want to have control over it, then you want a [seeder](https://laravel.com/docs/12.x/seeding#writing-seeders) with factories inside"^^ . + "<p>I am trying to create the option where users can select the multiple items using select 2 dropdown option in shopify. when i submit the form it shown only one product in email rather i had selected multiple.\n<a href="https://i.sstatic.net/XIhKbfSc.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XIhKbfSc.png" alt="enter image description here" /></a></p>\n<p><strong>Current code:</strong></p>\n<pre><code>&lt;select class=&quot;contact-menu-lists contact-form-caption city_lists&quot; name=&quot;contact[item_name]&quot; multiple=&quot;multiple&quot; data-placeholder=&quot;Select item name&quot;&gt;\n</code></pre>\n<p>if i am trying to send using name array like below:</p>\n<p><strong>Tried but not working:</strong></p>\n<pre><code>&lt;select class=&quot;contact-menu-lists contact-form-caption city_lists&quot; name=&quot;contact[item_name][]&quot; multiple=&quot;multiple&quot; data-placeholder=&quot;Select item name&quot;&gt;\n</code></pre>\n<p>then exception throw that item_name is not valid.</p>\n<p><strong>Current result:</strong> Only one item name showing in email.</p>\n<p><strong>Expected Result:</strong> Show multiple item name if selected more than 1</p>\n<p>Any suggestion?</p>\n"^^ . + "2"^^ . + "Do you mean that this Makefile also built `zlib` and installed the static version in `/usr/local/lib` where the linker is looking for it? Is there also\na shared version `libz.so` in the same place?"^^ . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + . + "Why do you use `JSON_UNESCAPED_UNICODE` in `json_encode()`? You also haven't specified the response data type in your AJAX call. Why not add `dataType: "json"`? It means you can skip the `JSON.parse(data)`. It's just better to tell AJAX what kind of response to expect. Anyway, as to your error, I assume you have an error message in the output of your PHP script which invalidates your JSON. Time to start using your [browser developer tools](https://developer.mozilla.org/en-US/docs/Learn_web_development/Howto/Tools_and_setup/What_are_browser_developer_tools), see network tab."^^ . + "Custom select disappears after filtering on WooCommerce admin orders page"^^ . + "1"^^ . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + "0"^^ . + "0"^^ . + "Did you try the above code? Let me know if you have any issues. It is full working code according to the question. It will calculate the tax for every item in your cart."^^ . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + . + "Thank you for your help. I have a /usr/bin/php as possible path but the command return /usr/bin/php has not yet been configuréed as alternative to php"^^ . + . + . + . + "0"^^ . + "@hakre Apologies for the delay, weekend hit. Checking the logs, the master process hit our resource limit check from monit and was restarted twice. Friday night, and then Saturday night. This was after the change to 64 max children. May be something running on our prod days (including Sat.) that causes FPM to go wild...but we have a timeout for scripts."^^ . + . + . + . + "1"^^ . + "<p>I start Apache and MySQL from xamp control pannel then save my project in the htdocs folder and then when i open that file with live server on my browser the php file starts to download instead of running , plz tell me what to do ?</p>\n<p>I tried to put the php path to my envirenment variables but it still doesn't work</p>\n"^^ . + . + . + . + . + . + . + . + "<p>I am having trouble accessing Pinecone via PHP. I tried to follow the <a href="https://github.com/probots-io/pinecone-php" rel="nofollow noreferrer">examples from the documentation</a>, but it does not seem to work.</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\nini_set('display_errors', '1');\nini_set('display_startup_errors', '1');\nerror_reporting(E_ALL);\n\nrequire 'vendor/autoload.php';\nrequire 'config.php';\nrequire 'embeddings.php';\n\nuse \\Probots\\Pinecone\\Client as Pinecone;\n\n$pineconeApiKey = PINECONE_API_KEY;\n$pineconeIndex = 'my-index';\n\n// Initialize clients\n$pinecone = new Pinecone($pineconeApiKey);\n\n$respons = $pinecone-&gt;index()-&gt;list();\nif($response-&gt;successful()) {\n var_dump($response);\n}\n</code></pre>\n<p>I am getting:</p>\n<blockquote>\n<p>_Fatal error: Uncaught ArgumentCountError: Too few arguments to function Probots\\Pinecone\\Client::_<em>construct(), 1 passed in /home/.../pinecone.php on line 16 and exactly 2 expected in /home/.../probots-io/pinecone-php/src/Client.php:24</em></p>\n</blockquote>\n<hr />\n<p>Then, I tried to pass the environment, because I saw that in the code: <code>new Pinecone($key, &quot;my-index&quot;);</code> and I had to change to remove <code>control()</code> from the call (<code>$response = $pinecone-&gt;control()-&gt;index()-&gt;list()</code>).</p>\n<p>And now I am getting:</p>\n<blockquote>\n<p><em>Fatal error: Uncaught GuzzleHttp\\Exception\\ConnectException: cURL error 6: Could not resolve host: controller.my-index.pinecone.io (see <a href="https://curl.haxx.se/libcurl/c/libcurl-errors.html" rel="nofollow noreferrer">https://curl.haxx.se/libcurl/c/libcurl-errors.html</a>) for <a href="https://controller.my-index.pinecone.io/databases" rel="nofollow noreferrer">https://controller.my-index.pinecone.io/databases</a></em></p>\n</blockquote>\n<p>How can I adjust the code so that it will work?</p>\n"^^ . + "<p>I finally figure it out.</p>\n<p>Problem is with database connection, just set the database connection to default.</p>\n<p><code>$itemSchemaId = db()-&gt;use('default')-&gt;lastInsertId();</code></p>\n"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + "I tried it again, there is no error code however the calendar stops displaying data, I changed the code as below:"^^ . + . + "<p>i'm looking for a way to extract a page number (for example <strong>site.com/match/2/</strong>), in this case the 2 but can be any number, and extract it to be used in shortcodes.</p>\n<p>I added a custom permalink which looks like this <strong>/match/%match_id%/</strong>.</p>\n<p>And below are 2 functions i made to have my own shortcode <strong>[match_id]</strong> which works, but i cannot add it to an existing shortcode as number (for example [fp-predictions text=&quot;No data&quot; match=[match_id]].</p>\n<pre><code>function get_match_id_from_url() {\n global $wp;\n $current_url = home_url(add_query_arg(array(), $wp-&gt;request));\n $parts = explode('/', $current_url);\n $match_id = end($parts);\n return $match_id;\n}\nfunction display_match_id_shortcode() {\n $match_id = get_match_id_from_url();\n return $match_id;\n}\nadd_shortcode('match_id', 'display_match_id_shortcode');\n</code></pre>\n<p>Is there any way i can import the number from my url after /match/ into shortcodes?</p>\n"^^ . + "0"^^ . + . + . + "1"^^ . + . + . + . + "When Looking at `WC_Booking_Cart_Manager` class source code, `$product_data` is normally the cart item data array… Can you check it with `echo '<pre>'. print_r( $product_data, true ) . '</pre>';`, to see what you get?"^^ . + . + "Thanks, but I still have a question: in the thread you posted, the question was whether someone should convert a character to an html entity, and the answer was no. I have the opposite question: when someone posts a comment with an emoji and submits, it would get stored in the mysql database as an html entity. Should I write extra code to first convert it from an html entity to the special character? The other post said that special characters are preferred, but to the extent that I should go to the extra trouble of converting from html entity to special character?"^^ . + . + . + . + "3"^^ . + "i added but this part is useless... I solved it by replacing get_posts with a mysql query"^^ . + . + "3"^^ . + . + "1"^^ . + "0"^^ . + "you're absolutely right it's being interpreted as html/text. I see that now."^^ . + . + "<p>The &quot;internal array pointer&quot; is the pointer that's used by functions like <a href="https://www.php.net/manual/en/function.reset.php" rel="nofollow noreferrer"><code>reset()</code></a>, <a href="https://www.php.net/manual/en/function.each.php" rel="nofollow noreferrer"><code>each()</code></a>, and <a href="https://www.php.net/manual/en/function.next.php" rel="nofollow noreferrer"><code>next()</code></a>. Since all these functions use the same pointer, and there's only one pointer per array, this can be stored in the array itself.</p>\n<p><code>foreach</code> maintains its own pointer into the array that's independent of this internal pointer. You can have nested <code>foreach</code> loops over the same array, which wouldn't work if the pointer were internal to the array.</p>\n"^^ . + . + "<p>I want to use IlovePDF (iloveapi) function to compress pdf from php. I have downloaded the <a href="https://github.com/ilovepdf/ilovepdf-php/archive/refs/tags/v1.2.6.zip" rel="nofollow noreferrer">ilovepdf-php-1.2.6.zip</a> from <a href="https://github.com/ilovepdf/ilovepdf-php" rel="nofollow noreferrer">github</a> and unzipped in my working directory on the php server. Then I want to try to launch a sample, let's say samples\\compress_basic.php, as below:</p>\n<pre><code>&lt;?php\n//include the autoloader\n //require_once('../vendor/autoload.php');\n//if manual installation has been used comment line that requires the autoload and uncomment this line:\nrequire_once('../init.php'); // &lt;&lt;&lt; this init.php don't exist\n\nuse Ilovepdf\\CompressTask;\n\n\n// you can call task class directly\n// to get your key pair, please visit https://developer.ilovepdf.com/user/projects\n$myTask = new CompressTask('project_public_id','project_secret_key');\n\n// file var keeps info about server file id, name...\n// it can be used latter to cancel file\n$file = $myTask-&gt;addFile('/path/to/file/document.pdf');\n\n// process files\n$myTask-&gt;execute();\n\n// and finally download file. If no path is set, it will be downloaded on current folder\n$myTask-&gt;download();\n\n?&gt;\n</code></pre>\n<p>Because I can not use Composer to load lib, I'm searching for some tips on how to install it manually. So I have to comment on the autoloader line and uncomment the line for manual installation. But I don't find any init.php in my extracted folder. Which file do I have to load with require_once(), or what do I have to do to make php library work? I think if it can be loaded by composer it can also be loaded manually, or I'm missing something?</p>\n"^^ . + "2"^^ . + "<p>I'm working with Laravel migrations and need to define a money column type in SQL Server. However, Laravel's schema builder does not provide a direct money type.</p>\n<p>I’ve considered two approaches:</p>\n<p>Using raw SQL:</p>\n<pre><code>Schema::table('your_table', function (Blueprint $table) {\n DB::statement(&quot;ALTER TABLE your_table ADD price MONEY&quot;);\n});\n</code></pre>\n<p>Using decimal as an alternative:</p>\n<pre><code>Schema::table('your_table', function (Blueprint $table) {\n $table-&gt;decimal('price', 19, 4);\n});\n</code></pre>\n<p>I prefer a solution that works natively with Laravel’s schema builder. Is there a way to register a custom column type for money, or is raw SQL the only option?</p>\n<p>Any recommendations for best practices in Laravel with SQL Server are appreciated!</p>\n"^^ . + . + "It seems `Route::view('/klanten/{email}', 'beheer.klanten.zien')->name('beheer.klanten.zien');` is directly connected in blade, not in class *KlantInzien*, so even you `dd()` there it seems not gonna work."^^ . + "0"^^ . + . + . + . + . + "<p>I have developed a PHP web application for my thesis using XAMPP. Currently, I can only access it by starting XAMPP (Apache and MySQL) and typing localhost/myapp in the browser. However, I want to make it accessible from anywhere using a domain name with my firstname and secure HTTPS connection—without having to pay for hosting or a domain to be accessible by the teachers.What are the steps to deploy my PHP application to a public domain for free?</p>\n"^^ . + "filepond"^^ . + . + "<p>I'm having trouble understanding the Webklex/PHPIMAP documentation.</p>\n<p>The connection, folder search and message return inside the loop are working, but the search for a specific message without returning the folders first doesn't.</p>\n<hr />\n<p>According to the documentation, the search for a specific message should be done like this:</p>\n<pre><code> /** @var \\Webklex\\PHPIMAP\\Query\\WhereQuery $query */\n /** @var \\Webklex\\PHPIMAP\\Message $message */\n\n $message = $query-&gt;getMessageByUid($uid = 1);\n\n</code></pre>\n<p>Documentation: <a href="https://www.php-imap.com/api/query" rel="nofollow noreferrer">https://www.php-imap.com/api/query</a></p>\n<p>However, I can't instantiate $query and $message.</p>\n<hr />\n<p>Follow my code below:</p>\n<pre class="lang-php prettyprint-override"><code>use Webklex\\PHPIMAP\\ClientManager;\nuse Webklex\\PHPIMAP\\Client;\nuse Webklex\\PHPIMAP\\Message;\nuse Webklex\\PHPIMAP\\Query\\WhereQuery;\n\n$cm = new ClientManager($options = []); \n$client = $cm-&gt;make([\n 'host' =&gt; '--------------',\n 'port' =&gt; 993,\n 'encryption' =&gt; 'ssl',\n 'validate_cert' =&gt; true,\n 'username' =&gt; ------------,\n 'password' =&gt; ------------,\n 'protocol' =&gt; 'imap',\n]);\n$client-&gt;connect(); \n\n$message = Message();\n$query = WhereQuery();\n\n$message = $query-&gt;getMessageByUid($uid = $request-&gt;id_msg);\n</code></pre>\n<p>I've already tried to instantiate using new Message(); new WhereQuery(). I put the use directly inside the variable but I got no results.</p>\n"^^ . + . + . + . + "1"^^ . + . + "How to track Facebook MetaPixel event in laravel /php?"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + "1"^^ . + . + . + "1"^^ . + . + "1. What HTTP response you are receiving when trying to login?\n2. Since you encountered this problem after you started using nginx can you show `conf` file for nginx?"^^ . + . + "@grawity_u1686 Because I already have a Laravel project for 2 years and for this I have to do SSo for already registered users."^^ . + . + . + "1"^^ . + . + "1"^^ . + "2"^^ . + . + . + . + . + . + . + . + "How do I convert a string variable into a float / double variable in PHP"^^ . + "iframe"^^ . + "<p>The solution turned out to be quite straightforward, and I'm a bit embarrassed that I didn't realize it earlier. I needed to access the <code>protected connection</code> property of the parent class and execute a query to conditionally handle my migration. (Thanks to @iainn for the suggestion.)</p>\n<p>For the specific case where <code>id = 0</code>, @AymDev was correct in pointing out that it was a SQL mode issue. The solution involved setting the SQL mode to include <code>NO_AUTO_VALUE_ON_ZERO</code> before the insertion and then resetting it afterward.</p>\n<pre><code>public function up(Schema $schema): void\n{\n\n $r = $this-&gt;connection-&gt;prepare('SELECT COUNT(*) FROM meal_moment WHERE id = 0')\n -&gt;executeQuery()\n -&gt;fetchOne();\n\n if ($r == 0) {\n $modes = $this-&gt;connection-&gt;prepare(&quot;SELECT @@sql_mode;&quot;)\n -&gt;executeQuery()\n -&gt;fetchOne();\n\n $this-&gt;addSql(&quot;\n SET sql_mode = CONCAT(@@sql_mode, ',NO_AUTO_VALUE_ON_ZERO');\n INSERT INTO `meal_moment` (`id`, `name`, `code`, `ordre`, `customer_id`) VALUES (0, 'Aucun', 'Aucun', 0, 0);\n SET sql_mode = :modes\n &quot;, ['modes' =&gt; $modes]);\n\n }\n $this-&gt;addSql(&quot;UPDATE `order` SET mealmoment_id = 0 WHERE mealmoment_id IS NULL&quot;);\n\n}\n\npublic function down(Schema $schema): void\n{\n $this-&gt;addSql('UPDATE `order` SET mealmoment_id = NULL WHERE mealmoment_id = 0');\n $this-&gt;addSql('DELETE FROM meal_moment WHERE id = 0');\n\n}\n</code></pre>\n"^^ . + . + . + "Count And Grouping with PHP and MongoDB with PHP"^^ . + . + "<ol>\n<li><p>I created a new Symfony app using <code>symfony new . --version=&quot;7.2.*&quot;</code></p>\n</li>\n<li><p>I installed the jwt-authentication-bundle using <code>composer require lexik/jwt-authentication-bundle</code></p>\n</li>\n<li><p>I created a <code>jwt</code> folder inside <code>config</code></p>\n</li>\n<li><p>I ran <code>openssl genrsa -out config/jwt/private.pem</code> in the console</p>\n</li>\n<li><p>Then I ran <code>openssl rsa -in config/jwt/private.pem -pubout &gt; config/jwt/public.pem</code></p>\n</li>\n<li><p>Note: I did not go with <code>php bin/console lexik:jwt:generate-keypair</code> because it generates the error <code>[critical] Error thrown while running command &quot;lexik:jwt:generate-keypair&quot;. Message: &quot;error:80000003:system library::No such process&quot;</code> which I believe is a Windows problem</p>\n</li>\n<li><p>In the security.yaml file under <code>firewalls</code> I added</p>\n</li>\n</ol>\n<pre class="lang-yaml prettyprint-override"><code>login:\n pattern: ^/api/login\n stateless: true\n json_login:\n check_path: /api/login_check\n success_handler: lexik_jwt_authentication.handler.authentication_success\n failure_handler: lexik_jwt_authentication.handler.authentication_failure\n\napi:\n pattern: ^/api\n stateless: true\n jwt: ~\n</code></pre>\n<p>And under <code>access_control</code>, I added:</p>\n<pre class="lang-yaml prettyprint-override"><code>- { path: ^/api/login, roles: PUBLIC_ACCESS }\n- { path: ^/api, roles: IS_AUTHENTICATED_FULLY }\n</code></pre>\n<ol start="8">\n<li>In the <code>routes.yaml</code> file I added</li>\n</ol>\n<pre class="lang-yaml prettyprint-override"><code>api_login_check:\n path: /api/login_check\n</code></pre>\n<ol start="9">\n<li>After starting the server, when I make a post request to the endpoint <code>/api/login_check</code>, I get an error message</li>\n</ol>\n<pre><code>Unable to find the controller for path &amp;quot;/api/login_check&amp;quot;. The route is wrongly configured. (404\n Not Found)\n</code></pre>\n<ol start="10">\n<li>Here is the content of my <code>config/routes.yaml</code> file</li>\n</ol>\n<pre class="lang-yaml prettyprint-override"><code>controllers:\n resource:\n path: ../src/Controller/\n namespace: App\\Controller\n type: attribute\n\napi_login_check:\n path: /api/login_check\n</code></pre>\n"^^ . + "Unrelated but why does your function catch and return an exception if you aren't even checking for that kind of return value?"^^ . + "1"^^ . + . + . + . + "0"^^ . + "2"^^ . + "0"^^ . + . + . + "@IłyaBursov You are right, I agree."^^ . + "i did as adviced and placed it in the D:\\AppName. \ncan you share exactly what i should put in the index.php?\n\nif (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {\n require $maintenance;\n}\n\nrequire __DIR__.'/../vendor/autoload.php';\n\n$app = require_once __DIR__.'/../bootstrap/app.php';"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "-1"^^ . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + "0"^^ . + . + "`// This rule should be placed *after* the CPT single post rule to avoid conflicts` - that makes no sense, because you used the exact same pattern here, as in the previous rule - so of course the first one always "wins." Using the same pattern *is* what creates the "conflict" here."^^ . + "Show output of `env PKG_CONFIG_PATH=/usr/local/lib/pkgconfig pkg-config --modversion libjpeg`"^^ . + "<p>This was solved by spark support - the issue was that in PADDLE, product catalog, you should not specify a number for trial days.</p>\n"^^ . + . + . + "<p>I am trying to load the stripe iframe so a customer can checkout with stripe but I cant get it to load because of a 404 not found error</p>\n<p>I added the route to web.php</p>\n<pre class="lang-php prettyprint-override"><code>Route::post('admin/checkout/checkoutStripeCredit', ['as' =&gt; 'admin.checkout.checkoutStripeCredit', 'uses' =&gt; 'CheckoutController@loadStripeCreditForm']);\n\n</code></pre>\n<p>Heres the code to the CheckoutController</p>\n<pre class="lang-php prettyprint-override"><code>public function loadStripeCreditForm(Request $request) {\n if(!Session::has('credit_details')) {\n return redirect()\n -&gt;route('admin.checkout.show')\n -&gt;with('flash_error', 'Your session has expired, please try again.');\n }\n\n try {\n\n $credit_details = Session::get('credit_details');\n\n header('Content-Type: application/json');\n\n $stripe = new \\Stripe\\StripeClient(env('STRIPE_SECRETKEY'));\n\n $product = $stripe-&gt;products-&gt;create([\n 'name' =&gt; 'Editor World Credit'\n ]);\n\n $price = $stripe-&gt;prices-&gt;create([\n 'product' =&gt; $product-&gt;id,\n 'unit_amount' =&gt; $credit_details['credit_amount'] * 100,\n 'currency' =&gt; 'usd'\n ]);\n\n $callback_url = route('admin.checkout.successStripeCredit');\n\n $checkout_session = $stripe-&gt;checkout-&gt;sessions-&gt;create([\n 'mode' =&gt; 'payment',\n 'ui_mode' =&gt; 'embed',\n 'line_items' =&gt; [\n [\n 'price' =&gt; $price-&gt;id,\n 'quantity' =&gt; 1\n ]\n ],\n 'metadata' =&gt; [\n 'user_id' =&gt; json_encode(Auth::user()-&gt;id)\n ],\n 'success_url' =&gt; $callback_url . '?session_id={CHECKOUT_SESSION_ID}',\n 'cancel_url' =&gt; route('admin.checkout.cancel'),\n 'invoice_creation' =&gt; ['enabled' =&gt; true]\n ]);\n\n session(['checkout_session_id' =&gt; $checkout_session-&gt;id]);\n\n echo json_encode(array('clientSecret' =&gt; $checkout_session-&gt;client_secret));\n }\n catch (Exception $x) {\n EWLogHelper::create('STRIPE_SUBMIT_ERROR', ['msg' =&gt; $x-&gt;getMessage(), 'trace' =&gt; $x-&gt;getTrace()]);\n return redirect()-&gt;back()-&gt;with('flash_error', $x-&gt;getMessage());\n }\n }\n</code></pre>\n<p>when I make post request to /admin/checkout/checkoutStripeCredit it gives me a 404 error. What am I doing wrong.</p>\n"^^ . + "How to resolve module version mismatch for pecl extension?"^^ . + . + "@IMSoP thanks for pointing that out, edited my answer accordingly."^^ . + . + "0"^^ . + "1"^^ . + "<p>To be clear, I am not trying to actually download the contents of the torrent. I just want to find out what files are IN the torrent (from its magnet link) so I can make sure it doesn't contain bogus spyware or such.</p>\n<p>I need a bit of PHP code that takes in a magnet link (ie, &quot;magnet:?xt=urn:btih:12cb31ae6fd4624fe6be48.....&quot;)</p>\n<p>And what I'm looking to do is get back the list of files (or all the metadata) that are in that torrent. But I can't even get as far as <em>downloading</em> the contents of the torrent file from the magnet link.</p>\n<p>I have code that converts a full magnet URI into something like this:</p>\n<pre><code>Array\n(\n [xt] =&gt; urn:btih:12cb31ae6fd4624fe6be485c...\n [dn] =&gt; Son.of.a.Critch.S0...\n [tr] =&gt; Array\n (\n [0] =&gt; udp://example.com:80/announce\n [1] =&gt; udp://example2.com:6969/announce\n [2] =&gt; udp://example3.com.is:6969/announce \n )\n\n)\n</code></pre>\n<p>But from here, how do I actually retrieve the torrent's file list and/or metadata?</p>\n<hr />\n<p>EDIT: It was suggested this q/a might help: <a href="https://stackoverflow.com/questions/35895997/how-to-pull-the-torrent-file-from-dht">How to pull the torrent file from DHT?</a> but that does not address what I am asking in this question, nor does it take into account PHP in any way. The accepted answer is just &quot;you'll need to implement all the technical details.&quot; I am hoping to find out exactly HOW to do that, preferably in PHP, and preferably with something which has already been written.</p>\n"^^ . + . + "<p>Using Advanced custom fields plugin ACF, I added an image field to the product category and can't get it to display after the main content (below products) using the code below:</p>\n<pre class="lang-php prettyprint-override"><code>add_action( 'woocommerce_after_main_content', 'wc_add_lower', 100 );\nfunction wc_add_lower() { \n \n ?&gt;\n &lt;?php the_field('lower'); ?&gt;\n &lt;?php\n}\n</code></pre>\n<p>How to display the image (from ACF field) in WooCommerce product category archive pages?</p>\n"^^ . + . + . + . + "0"^^ . + "<p>I need to insert multiple rows that pull from some tables in GUI (CRUD application). One header data into a header table and a detail table in the database. Here is a screenshot of the form (GUI): <a href="https://paste.pics/T2PBO" rel="nofollow noreferrer">https://paste.pics/T2PBO</a></p>\n<p>The header data id will be used when inserting multiple rows of different data to the detail table. I am using one-to-many from this link as reference: <a href="https://www.myphptutorials.com/tutorials/print-154" rel="nofollow noreferrer">https://www.myphptutorials.com/tutorials/print-154</a></p>\n<p>I get an error when saving the data:</p>\n<blockquote>\n<p>Notice: Undefined offset: 1 in C:\\xampp5\\htdocs\\triples\\pagination.php on line 104</p>\n</blockquote>\n<p>all rows, etc.</p>\n<pre><code>// header\n$resultExec1 = mysqli_query($db, &quot;insert into header &quot; . \n &quot;(user_id,\n buyer, \n test1,\n trxid,\n total\n ) &quot; .\n &quot;VALUES ('&quot; . $_SESSION['id'] . &quot;', &quot; .\n &quot;'&quot; . $_POST['buyer'] . &quot;', &quot; .\n &quot;'&quot; . $_POST['test1'] . &quot;', &quot; .\n &quot;'&quot; . $_POST['trxid'] . &quot;', &quot; .\n &quot;'&quot; . $_POST['total1'] . &quot;')&quot;);\n $query1 = mysqli_query($db, &quot;SELECT max(Alt_Id) AS id_header FROM detail limit 1&quot;);\n$data = mysqli_fetch_array($query1); \n$id_agens = $data['id_header'];\n foreach($_POST['country1'] as $key =&gt; $ctry){\n$country1 = $ctry;\n $resultExec2 = mysqli_query($db,\n&quot;insert into detail &quot; . \n &quot;(user_id,\n test1,\n id_header, \n test2,\n test21,\n test22,\n test3,\n test31,\n test32,\n test4,\n test41,\n test42) &quot; .\n &quot;VALUES ('&quot; . $_SESSION['id'] . &quot;', &quot; . \n &quot;'&quot; . $ctry . &quot;', &quot; . \n &quot;'&quot; . $id_header. &quot;', &quot; .\n &quot;'&quot; . $_POST['test2'][$key] . &quot;', &quot; . \n &quot;'&quot; . $_POST['test21'][$key] . &quot;', &quot; .\n &quot;'&quot; . $_POST['test22'][$key] . &quot;', &quot; . \n &quot;'&quot; . $_POST['test3'][$key] . &quot;', &quot; .\n &quot;'&quot; . $_POST['test31'][$key] . &quot;', &quot; . \n &quot;'&quot; . $_POST['test32'][$key] . &quot;', &quot; .\n &quot;'&quot; . $_POST['test4'][$key] . &quot;', &quot; . \n &quot;'&quot; . $_POST['test41'][$key] . &quot;', &quot; .\n &quot;'&quot; . $_POST['test42'][$key] . &quot;')&quot;);}\n</code></pre>\n<p>Can someone please explain with an example how to construct a query to insert multiple line items from different row names, i.e., test2 until test41 and the appropriate query without error undefined index?</p>\n"^^ . + . + "<p>You can dynamically map column positions by using the header row. First, get the header positions, then use those positions to access values in each row.</p>\n<pre class="lang-php prettyprint-override"><code>if (($handle = fopen(&quot;file.csv&quot;, &quot;r&quot;)) !== FALSE) {\n $headers = fgetcsv($handle); // Read header row\n $map = array_flip($headers); // Map column names to indexes\n\n while (($data = fgetcsv($handle)) !== FALSE) {\n $symbol = $data[$map['Symbol']] ?? null;\n $price = $data[$map['Price']] ?? null;\n echo &quot;Symbol: $symbol, Price: $price\\n&quot;;\n }\n fclose($handle);\n}\n</code></pre>\n"^^ . + . + . + . + . + . + . + "4"^^ . + . + "The error simply means the variable doesn't exist, which is true. To get the property you first need to instantiate an object of class `Component`, like so: `$myComponent = new Component();`. Then you might want to use one of its methods before you access the property like so: `if ($myComponent->showConfirmationModal)`"^^ . + "1"^^ . + "preg-replace"^^ . + . + . + . + "<p>I have managed to make php read angular routes and update meta tags and title on each request.</p>\n<p>After some time I uploaded a new build , this time it was cleaned , but now the angular it doesn't change the title of the document, in Google Chrome for ex, but if I hit view source, i can see all meta tags and title set correctly. This means the meta tags are applied correctly using a <code>curl</code> in php to grab meta informations.</p>\n<p>I am trying to understand why my index.php doesn't want to change the title of the document and what I am missing.</p>\n<p><strong>.htaccess</strong></p>\n<pre><code>DirectoryIndex index.php index.html\n\n&lt;IfModule mod_rewrite.c&gt;\n RewriteEngine On\n RewriteBase /\n\n # Serve files and directories directly if they exist\n RewriteCond %{REQUEST_FILENAME} -f [OR]\n RewriteCond %{REQUEST_FILENAME} -d\n RewriteRule ^ - [L]\n\n # Redirect all other requests to index.php\n RewriteRule ^ index.php [L]\n&lt;/IfModule&gt;\n\n# Prevent directory listing\nOptions -Indexes\n\n# Allow access to static assets\n&lt;FilesMatch &quot;\\.(js|css|png|jpg|jpeg|gif|svg|ico|woff|woff2|ttf|eot)$&quot;&gt;\n Header set Cache-Control &quot;max-age=31536000, public&quot;\n&lt;/FilesMatch&gt;\n</code></pre>\n<p>And this is my index.php that results from the angular build:</p>\n<p><strong>index.php</strong></p>\n<pre><code>&lt;?php\n\n$slug = strtok($_SERVER['REQUEST_URI'], '?');\n$slug = rtrim($slug, '/');\n\n// Make the API request using cURL\n$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, $apiUrl);\ncurl_setopt($ch, CURLOPT_POST, 1);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['slug' =&gt; $slug]));\n\n$response = curl_exec($ch);\ncurl_close($ch);\n\n// Parse the API response\n$meta = json_decode($response, true);\n$metaTitle = $meta['title'];\n$metaDescription = $meta['description'];\n$metaKeywords = $meta['keywords'];\n$metaImage = $meta['main_image'];\n$metaUrl = $meta['og_url'];\n?&gt;\n\n&lt;html lang=&quot;en&quot;&gt;\n\n&lt;head&gt;\n &lt;title&gt;&lt;?php echo htmlspecialchars($metaTitle); ?&gt;&lt;/title&gt;\n &lt;meta charset=&quot;UTF-8&quot;&gt;\n &lt;link rel=&quot;icon&quot; type=&quot;image/png&quot; href=&quot;./assets/icons/favicon-96x96.png&quot; sizes=&quot;96x96&quot;&gt;\n &lt;link rel=&quot;icon&quot; type=&quot;image/svg+xml&quot; href=&quot;./assets/icons/favicon.svg&quot;&gt;\n &lt;link rel=&quot;shortcut icon&quot; href=&quot;./assets/icons/favicon.ico&quot;&gt;\n &lt;link rel=&quot;apple-touch-icon&quot; sizes=&quot;180x180&quot; href=&quot;./assets/icons/apple-touch-icon.png&quot;&gt;\n\n &lt;link rel=&quot;manifest&quot; href=&quot;./assets/icons/site.webmanifest&quot;&gt;\n &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;\n &lt;meta name=&quot;robots&quot; content=&quot;index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1&quot;&gt;\n\n &lt;meta name=&quot;description&quot; content=&quot;&lt;?php echo htmlspecialchars($metaDescription); ?&gt;&quot;&gt;\n &lt;meta name=&quot;keywords&quot; content=&quot;&lt;?php echo htmlspecialchars($metaKeywords); ?&gt;&quot;&gt;\n &lt;link rel=&quot;canonical&quot; href=&quot;&lt;?php echo htmlspecialchars($metaUrl); ?&gt;&quot;&gt;\n &lt;meta property=&quot;og:locale&quot; content=&quot;en_GB&quot;&gt;\n &lt;meta property=&quot;og:type&quot; content=&quot;website&quot;&gt;\n &lt;meta property=&quot;og:title&quot; content=&quot;&lt;?php echo htmlspecialchars($metaTitle); ?&gt;&quot;&gt;\n &lt;meta property=&quot;og:description&quot; content=&quot;&lt;?php echo htmlspecialchars($metaDescription); ?&gt;&quot;&gt;\n &lt;meta property=&quot;og:url&quot; content=&quot;&lt;?php echo htmlspecialchars($metaUrl); ?&gt;&quot;&gt;\n &lt;meta property=&quot;og:image&quot; content=&quot;&lt;?php echo htmlspecialchars($metaImage); ?&gt;&quot;&gt;\n &lt;meta property=&quot;og:image:alt&quot; content=&quot;&lt;?php echo htmlspecialchars($metaTitle); ?&gt;&quot;&gt;\n &lt;meta property=&quot;og:image:width&quot; content=&quot;1200&quot;&gt;\n &lt;meta property=&quot;og:image:height&quot; content=&quot;675&quot;&gt;\n &lt;!--&lt;meta property=&quot;og:image:type&quot; content=&quot;image/webp&quot; /&gt;--&gt;\n &lt;meta name=&quot;twitter:description&quot; content=&quot;&lt;?php echo htmlspecialchars($metaDescription); ?&gt;&quot;&gt;\n &lt;meta name=&quot;twitter:card&quot; content=&quot;summary_large_image&quot;&gt;\n &lt;meta name=&quot;twitter:title&quot; content=&quot;&lt;?php echo htmlspecialchars($metaTitle); ?&gt;&quot;&gt;\n &lt;meta name=&quot;twitter:image&quot; content=&quot;&lt;?php echo htmlspecialchars($metaImage); ?&gt;&quot;&gt;\n\n &lt;link rel=&quot;preconnect&quot; href=&quot;https://fonts.gstatic.com&quot; crossorigin=&quot;&quot;&gt;\n &lt;link rel=&quot;preconnect&quot; href=&quot;https://fonts.googleapis.com&quot;&gt;\n &lt;base href=&quot;/&quot;&gt;\n &lt;link rel=&quot;stylesheet&quot; href=&quot;styles.543ae2227a562180.css&quot;&gt;\n&lt;/head&gt;\n\n&lt;body&gt;\n &lt;app-root&gt;&lt;/app-root&gt;\n &lt;script src=&quot;runtime.bf3051b90593455e.js&quot; type=&quot;module&quot;&gt;&lt;/script&gt;\n &lt;script src=&quot;polyfills.c88ce8d8e8ff1349.js&quot; type=&quot;module&quot;&gt;&lt;/script&gt;\n &lt;script src=&quot;scripts.91e58680bebedc85.js&quot; defer&gt;&lt;/script&gt;\n &lt;script src=&quot;main.be934ab3482f7d6c.js&quot; type=&quot;module&quot;&gt;&lt;/script&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n"^^ . + . + . + "2"^^ . + . + . + . + . + "0"^^ . + . + "cookie jar not saving cookies"^^ . + . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "If you also add the content of the php script located at https://www.justbringingtheraw.com/hof/wweonly.php we might be able to spot whats wrong"^^ . + . + . + . + "1"^^ . + . + "0"^^ . + . + "You've removed too much... you've also removed the closing `</FilesMatch>` directive, which would effectively disable the remainder of your `.htaccess` file (if not an error). But did that resolve the issue of still being able to access `.json` files or not? Do you have any other `.htaccess` files (in subfolders)? "I have found that /page.php/123 works as intended" - But that's routing the request to a PHP script, I thought `/page/123` was supposed to be handled by JS?"^^ . + "<p>While investigating the semantic difference between quantifiers based on length and count, I noticed that Python 3 regular expression gave different result for the following 2 regular expressions (notice the quantifiers <code>+</code> and <code>*</code>:</p>\n<pre><code>Python 3.10.16 (main, Dec 7 2024, 13:31:33) [Clang 16.0.0 (clang-1600.0.26.6)] on darwin\nType &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.\n&gt;&gt;&gt; import re\n&gt;&gt;&gt; re.sub('(.{4,5})+', '-', '1234123412341234')\n'-4'\n&gt;&gt;&gt; re.sub('(.{4,5})*', '-', '1234123412341234')\n'--4-'\n&gt;&gt;&gt;\n</code></pre>\n<p>And I was able to reproduce this in PHP, presumably because they both use PCRE behind the back:</p>\n<pre><code>$ php -a\nInteractive shell\n\nphp &gt; echo preg_replace('/(.{4,5})+/', '-', '1234123412341234');\n-4\nphp &gt; echo preg_replace('/(.{4,5})*/', '-', '1234123412341234');\n--4-\nphp &gt;\n</code></pre>\n<p>How come?</p>\n"^^ . + . + "<p>Color distance based on euclidean distance in the <strong>RGB</strong> space is not the best choice, in fact it is possible to use the distance defined in other color spaces that are more appropriate to model human vision, e.g <strong>HSL</strong> or <strong>HSB</strong> or <a href="https://en.wikipedia.org/wiki/YCbCr" rel="nofollow noreferrer">YCbCr</a>.</p>\n<p>The following code estimates distance based on a simplified <strong>YCbCr</strong>, just replace your distance function with the following two functions:</p>\n<pre><code>function colour_distance($colour_1, $colour_2) {\n if(!is_array($colour_1))\n $colour_1 = colour_hex_to_dec($colour_1);\n if(!is_array($colour_2))\n $colour_2 = colour_hex_to_dec($colour_2);\n\n $colour_1 = array_values($colour_1);\n $colour_2 = array_values($colour_2);\n\n list($luminance1, $Cb1, $Cr1) = chrominance_luminance($colour_1);\n list($luminance2, $Cb2, $Cr2) = chrominance_luminance($colour_2);\n\n $delta_luminance = $luminance1 - $luminance2;\n $delta_Cb = $Cb1 - $Cb2;\n $delta_Cr = $Cr1 - $Cr2;\n\n $distance = sqrt($delta_luminance * $delta_luminance + $delta_Cb * $delta_Cb + $delta_Cr * $delta_Cr);\n return $distance;\n}\n\nfunction chrominance_luminance($rgb) {\n $luminance = 0.299 * $rgb[0] + 0.587 * $rgb[1] + 0.114 * $rgb[2];\n $Cb = 0.564 * ($rgb[2] - $luminance);\n $Cr = 0.713 * ($rgb[0] - $luminance);\n return array($luminance, $Cb, $Cr);\n}\n</code></pre>\n<p>With this distance function the result for the test image is the following:</p>\n<p><a href="https://i.sstatic.net/AAVqHQ8J.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/AAVqHQ8J.png" alt="transformed test image" /></a></p>\n"^^ . + . + . + "Automatic increment of array's internal pointer and foreach loop in PHP; where to find the implementation"^^ . + . + . + ""I ask the client to upload all the images in his wp-content/uploads" - FWIW, if you are going to be statically referencing images in your templates, I would strongly recommend putting these files in a dedicated location such as the theme. I don't know if you had the client upload using FTP or the admin interface, but if they latter, it is very easy for these to be deleted eventually by someone."^^ . + "0"^^ . + "@Barmar's solution of using `escapeshellarg` is exactly what's needed and works perfectly for what I'm trying to do."^^ . + "2"^^ . + . + "2"^^ . + . + . + . + . + "<p>On my local machine, launching the application with <code>php artisan serve</code>, everything works.</p>\n<p>On the production server, using apache, it gives that error when the blade view is not cached.</p>\n<p>If I run <code>php artisan view:cache</code>, the cached views work as expected, but the views that requires some parameter cannot be cached and thus continue to give that error.</p>\n<p>The error is reported at an apparently random line. If I delete that line, it's reported somewhere else.</p>\n<p>It seems to me like the view compilation works when executing the artisan command, but not during the normal execution of the application.</p>\n<p>Example:\n<a href="https://i.sstatic.net/bTSsNhUr.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bTSsNhUr.png" alt="Laravel error page" /></a></p>\n"^^ . + . + "Please 1) show us the actual code you wrote, rather than just describing it. Then it'll be a lot easier to tell you if there's another way to do it. 2) provide the sample data in code format (you can use `var_export()` to get it out of your application if necessary) so it can easily be re-used in answers and experiments without tedious re-keying being needed by those who might want to help you, and 3) define what exactly you mean by "efficient". What's your metric? Less code? Runs faster? Fewer function calls? Is your current method causing a specific problem? Please [edit] your post. Thanks."^^ . + . + . + "bhow use for to re-propose data entered in input"^^ . + . + . + . + . + . + "1"^^ . + "You need to find a free (to a point) hosting service. There are plenty out there, but not all are completely free with domain purchase included and quite a few probably try to get you to pay by mistake"^^ . + . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + . + "Which issue? You mean the "headers already sent" error?"^^ . + . + . + . + "<p>I've used the 'cash on delivery/cod' payment method as a 'credit account' payment method. I've setup a custom user role for customers who will have a credit account. Those customers can then see the cod payment method if logged in.</p>\n<p>But I'm having trouble setting a credit limit on these accounts.</p>\n<p>I've added a custom meta field in the user editor to set a credit limit (e.g. $500). But I keep getting errors when I use the below code.</p>\n<pre><code>add_action('show_user_profile', 'custom_user_profile_fields');\n\nadd_action('edit_user_profile', 'custom_user_profile_fields');\n\nfunction custom_user_profile_fields( $user ) {\n?&gt;\n &lt;table class=&quot;form-table&quot;&gt;\n &lt;tr&gt;\n &lt;th&gt;\n &lt;label for=&quot;code&quot;&gt;&lt;?php _e( 'Credit Limit' ); ?&gt;&lt;/label&gt;\n &lt;/th&gt;\n &lt;td&gt;\n &lt;input type=&quot;text&quot; name=&quot;code&quot; id=&quot;credit_limit&quot; value=&quot;&lt;?php echo esc_attr( get_the_author_meta( 'credit_limit', $user-&gt;ID ) ); ?&gt;&quot; class=&quot;regular-text&quot; /&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;/table&gt;\n&lt;?php\n}\n\nadd_action( 'personal_options_update', 'update_extra_profile_fields' );\n\nadd_action( 'edit_user_profile_update', 'update_extra_profile_fields' );\n\nfunction update_extra_profile_fields( $user_id ) {\n if ( current_user_can( 'edit_user', $user_id ) )\n update_user_meta( $user_id, 'credit_limit', $_POST['credit_limit'] );\n}\n\nfunction payment_gateway_disable_on_account( $available_gateways ) {\n global $woocommerce;\n \n $user = wp_get_current_user();\n $user_id = $user-&gt;ID;\n $credit_limit = get_user_meta( $user_id, 'credit_limit', true );\n\n $amount = floatval( preg_replace( '#[^\\d.]#', '', $woocommerce-&gt;cart-&gt;get_cart_subtotal() ) );\n\n if ( empty( $credit_limit ) ) {\n $credit_limit = 500;\n }\n \n $credit_remaining = $credit_limit - $amount;\n \n if ( isset( $available_gateways['cod'] ) &amp;&amp; !in_array( 'credit_account', $user-&gt;roles ) || $credit_remaining &lt; 0 ) {\n unset( $available_gateways['cod'] );\n }\n \n return $available_gateways;\n}\n\nadd_filter( 'woocommerce_available_payment_gateways', 'payment_gateway_disable_on_account' );\n</code></pre>\n<p>Here is the error messages I'm getting:</p>\n<pre><code> Your PHP code changes were not applied due to an error on line 765 of file wp-content/themes/shoptimizer-child-theme/functions.php. Please fix and try saving again.\n\nUncaught Error: Call to a member function get_cart_subtotal() on null in wp-content/themes/shoptimizer-child-theme/functions.php:765\nStack trace:\n#0 wp-includes/class-wp-hook.php(324): payment_gateway_disable_on_account()\n#1 wp-includes/plugin.php(205): WP_Hook-&gt;apply_filters()\n#2 wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php(336): apply_filters()\n#3 wp-content/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/AdditionalPayments.php(185): WC_Payment_Gateways-&gt;get_available_payment_gateways()\n#4 wp-content/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/AdditionalPayments.php(157): Automattic\\WooCommerce\\Admin\\Features\\OnboardingTasks\\Tasks\\AdditionalPayments::has_enabled_gateways()\n#5 wp-content/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/AdditionalPayments.php(115): Automattic\\WooCommerce\\Admin\\Features\\OnboardingTasks\\Tasks\\AdditionalPayments::has_enabled_other_category_gateways()\n#6 wp-content/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskList.php(305): Automattic\\WooCommerce\\Admin\\Features\\OnboardingTasks\\Tasks\\AdditionalPayments-&gt;can_view()\n#7 [internal function]: Automattic\\WooCommerce\\Admin\\Features\\OnboardingTasks\\TaskList-&gt;Automattic\\WooCommerce\\Admin\\Features\\OnboardingTasks\\{closure}()\n#8 wp-content/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskList.php(306): array_filter()\n#9 wp-content/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskList.php(171): Automattic\\WooCommerce\\Admin\\Features\\OnboardingTasks\\TaskList-&gt;get_viewable_tasks()\n#10 wp-content/plugins/woocommerce/src/Internal/Admin/WcPayWelcomePage.php(364): Automattic\\WooCommerce\\Admin\\Features\\OnboardingTasks\\TaskList-&gt;is_visible()\n#11 wp-content/plugins/woocommerce/src/Internal/Admin/WcPayWelcomePage.php(151): Automattic\\WooCommerce\\Internal\\Admin\\WcPayWelcomePage-&gt;get_active_payments_task_slug()\n#12 wp-includes/class-wp-hook.php(324): Automattic\\WooCommerce\\Internal\\Admin\\WcPayWelcomePage-&gt;register_menu_and_page()\n#13 wp-includes/class-wp-hook.php(348): WP_Hook-&gt;apply_filters()\n#14 wp-includes/plugin.php(517): WP_Hook-&gt;do_action()\n#15 wp-admin/includes/menu.php(161): do_action()\n#16 wp-admin/menu.php(412): require_once('...')\n#17 wp-admin/admin.php(158): require('...')\n#18 wp-admin/theme-editor.php(10): require_once('...')\n#19 {main}\n thrown\n</code></pre>\n<p>This is line 765:</p>\n<pre><code> $amount = floatval( preg_replace( '#[^\\d.]#', '', $woocommerce-&gt;cart-&gt;get_cart_subtotal() ) );\n</code></pre>\n"^^ . + "0"^^ . + . + "Sorry, I should have been more clear - I was referring to two entirely different directories; `bootstrap/` *and* `storage/` (not `bootsrap/storage`) and their contents should have their permissions set for apache to have ownership. Also, never use 777. You're giving rwx access to anybody and everybody... unless that's really what you want. I would run the command `chown -R apache:apache storage/* bootstrap/*` and see if that helps"^^ . + . + "1"^^ . + . + . + "git"^^ . + "1"^^ . + . + "-1"^^ . + . + . + "1) If you do not want to handle this on database level, then why did you tag your question with both mysql and database tags? 2) I don't think you can get around race conditions just on application level because http requests and their processing are independent of each other. Laravel may have developed features that hides this complexity from you, but then again, we are back to the first point of this comment."^^ . + "0"^^ . + . + "0"^^ . + "<p>I want to verify that facebook pixel 'track' event is actually firing when user perform signup ,</p>\n<p>is there a way ?\nusing Laravel dusk.</p>\n<p>&lt;&lt;User successfully register's and then , pixel code is executed on the front side in the js.&gt;&gt;</p>\n"^^ . + . + "2"^^ . + . + "<p>This is my first time trying to use Docker. I am trying to set up a PHP project that uses the <code>mysqli</code> PHP extension, but for some reason, it is not installed when I build my Docker container. I've been running <code>php -m</code> to see a list of all extensions each time a rebuild, and <code>mysqli</code> has never been in this list.</p>\n<p>Dockerfile:</p>\n<pre class="lang-none prettyprint-override"><code># Use the official PHP with Apache image\nFROM php:8.1-apache\n\n# Install mysqli extension\nRUN docker-php-ext-install mysqli\n\n# Enable mysqli extension\nRUN docker-php-ext-enable mysqli\n\n# Copy the source code and other necessary files into the container\nCOPY src/ /var/www/src/ # Copy the src folder to /var/www/src/\nCOPY public/ /var/www/html/ # Copy the public folder to /var/www/html (web server document root)/\nCOPY vendor/ /var/www/vendor/ # Copy the vendor folder to /var/www/vendor (Composer dependencies)/\n\n# Set the proper permissions for Apache to access the files\nRUN chown -R www-data:www-data /var/www/html /var/www/src /var/www/vendor \\\n &amp;&amp; chmod -R 755 /var/www/html /var/www/src /var/www/vendor\n\n# Set the working directory\nWORKDIR /var/www/html\n\n# Expose port 80 for web traffic\nEXPOSE 80\n</code></pre>\n<p>docker-compose.yml:</p>\n<pre class="lang-yaml prettyprint-override"><code>version: '3.8'\n\nservices:\n php-apache:\n image: php:8.1-apache\n container_name: wishlist-php-app\n ports:\n - &quot;8082:80&quot; # Map container port 80 to local 8080\n volumes:\n - ./public:/var/www/html # Maps your public folder to the container's document root\n - ./src:/var/www/src # If you have source code outside the public folder\n - ./vendor:/var/www/vendor # Map the vendor folder\n environment:\n - MYSQL_HOST=host.docker.internal # Connects to MySQL on your local machine (if running outside Docker)\n - MYSQL_PORT=3306\n\n # Optional: Use existing phpMyAdmin instance\n phpmyadmin:\n image: phpmyadmin/phpmyadmin\n container_name: phpmyadmin\n ports:\n - &quot;8083:80&quot; # Access phpMyAdmin at http://localhost:8081\n environment:\n PMA_HOST: host.docker.internal # Connects to MySQL on local machine\n MYSQL_ROOT_PASSWORD: root # Replace with your root password\n depends_on:\n - php-apache\n</code></pre>\n"^^ . + . + "0"^^ . + "<p>I'm using my index.php file to handle all requests to my domain (except of course, css, js etc and files that actually exist). That works perfectly. What I want now is remove all trailing slashes so that mydomain.com/folder/file/ goes to mydomain.com/folder/file. I came across this solution</p>\n<pre><code>RewriteCond %{REQUEST_URI} /(.*)/$\nRewriteRule ^ /%1 [R=301,L]\n</code></pre>\n<p>here: <a href="https://stackoverflow.com/questions/21417263/htaccess-add-remove-trailing-slash-from-url/27264788#27264788">Htaccess: add/remove trailing slash from URL</a>\nI see it as a very elegant solution, it actually works but here's is what I find strange:</p>\n<ul>\n<li>On live domain it works perfectly</li>\n<li>On localhost, localhost/mydomain.com/folder/file/ redirects fine, localhost/mydomain.com/folder/ too but localhost/mydomain.com/ simply says 'localhost redirected you too many times'.\nHow do I get the redirect to work fine both on a live server and localhost? Or should I just forget about this and use htaccess only on the live server?</li>\n</ul>\n<p>Here's the rest of my htaccess file. Pasting everything just incase one of the commands is affecting or overriding the other, I'm not a htaccess expert please. Thanks.</p>\n<pre><code>RewriteEngine On\nRewriteCond %{REQUEST_URI} /(.*)/$\nRewriteRule ^ /%1 [R=301,L] #added slash here too, don't forget it\n\nRewriteCond %{SERVER_PORT} 80\nRewriteCond %{HTTP_HOST} ^example\\.net$ [OR]\nRewriteCond %{HTTP_HOST} ^www\\.example\\.net$\nRewriteRule ^(.*)$ https://example.net/$1 [R=301,L]\n\nRewriteCond %{HTTP_HOST} www.example.net\nRewriteRule (.*) https://example.net/$1 [R=301,L]\n\n#RewriteRule ^(.*)index\\.(php|html?)$ /$1 [R=301,NC,L]\n\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^(.*)$ index.php?url=$1 [L,QSA]\n\n#Header set X-Frame-Options &quot;ALLOW-FROM https://whatismyscreenresolution.net/&quot;\n\nRedirect 301 &quot;/brand&quot; &quot;/brands&quot;\n\nErrorDocument 404 /404.php\nErrorDocument 502 /502.shtml\nErrorDocument 504 /504.shtml\nErrorDocument 508 /508.shtml\n\n&lt;Files ~ &quot;\\.env$&quot;&gt; \nOrder Allow,Deny\nDeny from All\n&lt;/Files&gt;\n\n&lt;Files .htaccess&gt;\nOrder allow,deny\nDeny from All\n&lt;/Files&gt;\n\nOptions -Indexes\n\n&lt;filesMatch &quot;.(jpg|jpeg|png|gif|ico|webp|js)$&quot;&gt;\nHeader set Cache-Control &quot;max-age=2592000, public&quot;\n&lt;/filesMatch&gt;\n\n&lt;filesMatch &quot;.(css|js)$&quot;&gt;\nHeader set Cache-Control &quot;max-age=60, public&quot;\n&lt;/filesMatch&gt;\n</code></pre>\n"^^ . + . + . + "0"^^ . + "1"^^ . + "<p>I would consider another solution:</p>\n<p>First make the <code>published_year</code> an integer type, like this:</p>\n<pre class="lang-php prettyprint-override"><code>$table-&gt;integer('publish_year');\n</code></pre>\n<p>Then for some i would have tried to add both <code>created_at </code>and <code>updated_at</code> manually in the seeder:</p>\n<pre class="lang-php prettyprint-override"><code>'created_at' =&gt; now(),\n'updated_at' =&gt; now(),\n</code></pre>\n"^^ . + . + . + . + "I did 1:1 what is in the tutorial still doesnt work @hakre. Also edited the question with new code"^^ . + . + . + . + . + "1"^^ . + "0"^^ . + "<p>I'm just trying to follow the bootcamp for Laravel using Livewire : <a href="https://bootcamp.laravel.com/livewire/showing-chirps" rel="nofollow noreferrer">https://bootcamp.laravel.com/livewire/showing-chirps</a>, so it have a note saying:</p>\n<blockquote>\n<p>Returning all Chirps at once won't scale in production. Take a look at\nLaravel's powerful pagination to improve performance.</p>\n</blockquote>\n<p>The original code in the functional version looks like:</p>\n<pre><code>&lt;?php \n\nuse App\\Models\\Chirp; \n\nuse function Livewire\\Volt\\{state};\n\nstate(['chirps' =&gt; fn () =&gt; Chirp::with('user')-&gt;latest()-&gt;get()]); \n\n?&gt;\n</code></pre>\n<pre><code>&lt;div class=&quot;mt-6 bg-white shadow-sm rounded-lg divide-y&quot;&gt;\n\n@foreach ($chirps as $chirp)\n\n &lt;div class=&quot;p-6 flex space-x-2&quot; wire:key=&quot;{{ $chirp-&gt;id }}&quot;&gt;\n ...\n &lt;/div&gt;\n\n@endforeach \n\n&lt;/div&gt;\n\n</code></pre>\n<p>Reading the documentation it only include examples for the &quot;class version&quot; <a href="https://livewire.laravel.com/docs/pagination#basic-usage" rel="nofollow noreferrer">https://livewire.laravel.com/docs/pagination#basic-usage</a> like:</p>\n<pre><code>use Livewire\\WithPagination;\nuse Livewire\\Volt\\Component;\nuse App\\Models\\Post;\n \nnew class extends Component {\n use WithPagination;\n \n public function with(): array\n {\n return [\n 'posts' =&gt; Post::paginate(10),\n ];\n }\n}\n</code></pre>\n<p>So I already tried importing the trait in the view like:</p>\n<pre><code>use Livewire\\WithPagination;\n\n$getChirps = fn () =&gt; $this-&gt;chirps = Chirp::paginate(10);\n</code></pre>\n<p>or</p>\n<pre><code>$getChirps = function () { \n return $this-&gt;chirps = Chirp::with('user')-&gt;paginate(15);\n};\n</code></pre>\n<p>And I'm getting the next error:</p>\n<blockquote>\n<p>Property type not supported in Livewire for property:\n[{&quot;current_page&quot;:1,&quot;data&quot;:[{&quot;id&quot;:1,&quot;user_id&quot;:1,&quot;message&quot;:&quot;This chirp\nis a\ntest&quot;,&quot;created_at&quot;:&quot;2025-02-14T03:24:24.000000Z&quot;,&quot;updated_at&quot;:&quot;2025-02-14T03:24:24.000000Z&quot;,&quot;user&quot;:{&quot;id&quot;:1,&quot;name&quot;:&quot;Roberto&quot;,&quot;email&quot;:&quot;robertohdll@gmail.com&quot;,&quot;email_verified_at&quot;:null,&quot;created_at&quot;:&quot;2025-02-09T14:10:52.000000Z&quot;,&quot;updated_at&quot;:&quot;2025-02-09T14:10:52.000000Z&quot;}}],&quot;first_page_url&quot;:&quot;http://127.0.0.1:8000/chirps?page=1&quot;,&quot;from&quot;:1,&quot;last_page&quot;:1,&quot;last_page_url&quot;:&quot;http://127.0.0.1:8000/chirps?page=1&quot;,&quot;links&quot;:[{&quot;url&quot;:null,&quot;label&quot;:&quot;«\nPrevious&quot;,&quot;active&quot;:false},{&quot;url&quot;:&quot;http://127.0.0.1:8000/chirps?page=1&quot;,&quot;label&quot;:&quot;1&quot;,&quot;active&quot;:true},{&quot;url&quot;:null,&quot;label&quot;:&quot;Next\n»&quot;,&quot;active&quot;:false}],&quot;next_page_url&quot;:null,&quot;path&quot;:&quot;http://127.0.0.1:8000/chirps&quot;,&quot;per_page&quot;:15,&quot;prev_page_url&quot;:null,&quot;to&quot;:1,&quot;total&quot;:1}]</p>\n</blockquote>\n<p>So the query to the DB is working and is getting the pages, but the error is something else, I already tried to find any specific example for the pagination in the functional version but don't have any luck.</p>\n<p>Could be great if somebody can help me to understand how to fix this <em>Property type not supported</em> message, or understand if is not possible to use the pagination with the <strong>Functional version</strong>.</p>\n"^^ . + . + "1"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + "Ill edit the initial question, include files I have and their installation docs. But will proceed how you advice as it seems they use obselete method"^^ . + "<p>I want to remove [ ] before data collect</p>\n<p>This is the data output</p>\n<pre><code>&quot;data&quot;: [\n [\n {\n &quot;id&quot;: 2,\n &quot;runtime_batch&quot;: 24528,\n &quot;smallstoptime_batch&quot;: 250,\n &quot;downtime_batch&quot;: 200,\n },\n {\n &quot;id&quot;: 2,\n &quot;runtime_batch&quot;: 2074,\n &quot;smallstoptime_batch&quot;: 0,\n &quot;downtime_batch&quot;: 1,\n }\n ],\n [\n {\n &quot;id&quot;: 3,\n &quot;runtime_batch&quot;: 185,\n &quot;smallstoptime_batch&quot;: 252,\n &quot;downtime_batch&quot;: 1409,\n },\n {\n &quot;id&quot;: 3,\n &quot;runtime_batch&quot;: 2127,\n &quot;smallstoptime_batch&quot;: 377,\n &quot;downtime_batch&quot;: 22452,\n }\n ]\n ]\n</code></pre>\n<p>and this is the script using collection</p>\n<pre><code>$linedata = GetMyData::select('id', 'runtime_batch', 'smallstoptime_batch', 'downtime_batch', 'output', 'output_final')-&gt;get();\n\nforeach($linedata as $ld) {\n\n$ld-&gt;runtime_batch = round(($ld-&gt;runtime_batch+$ld-&gt;smallstoptime_batch)/($ld-&gt;runtime_batch+$ld-&gt;smallstoptime_batch+$ld-&gt;downtime_batch)*100, 2);\n$ld-&gt;downtime_batch = round($ld-&gt;output/$ld-&gt;output_final*100, 2);\n$ld-&gt;smallstoptime_batch = round($ld-&gt;output_final/($ld-&gt;runtime_batch+$ld-&gt;smallstoptime_batch)*100, 2);\n}\n\n$groupingline = collect($linedata)-&gt;groupBy('id')-&gt;values()-&gt;all();\n</code></pre>\n<p>I want to group by after, because the data its not result after get and i want to calculate on foreach, after it i want grouping by id. But the result its not i wanted.</p>\n<blockquote>\n<p>get();</p>\n</blockquote>\n<p>Or do you have a another script? its very help me..\nThanks for your help, because i stuck in this script :(</p>\n"^^ . + . + . + . + . + . + . + . + . + "What code did you tried already? You will receive more help if you share your solution that you are trying."^^ . + . + "<p>Thanks to Chris's invaluable help (see comments, above), the underlying issue was that `which php` was returning different PHP paths when executed in Terminal as compared to when executed on my web page.</p>\n<p>With the Terminal PHP version working as required, the solution was to use Terminal's PHP path in my web script code. So...</p>\n<pre><code>$cmd = 'php tasks/simple.php'; // Loops forever\n</code></pre>\n<p>...became...</p>\n<pre><code>$cmd = '/usr/local/bin/php tasks/simple.php'; // Works!\n</code></pre>\n"^^ . + "<p>I was able to solve the problem after many attempts, and I would like to share the solution with you so that everyone can benefit from it</p>\n<p>What I did was omit the <code>Mcamara laravel-localization</code> library</p>\n<p>Then I did this thing inside the <code>store</code> function:</p>\n<pre><code> public function store(Request $request , $lang=''){\n if(in_array($lang,['en','ar'])){\n App::setLocale($lang);\n Session::put('lang',$lang);\n }else{\n App::setLocale(Session::get('lang'));\n Session::put('lang',App::getLocale());\n }\n //.............\n }\n \n</code></pre>\n<p>What was added inside the function <code>store</code> is a variable named <code>lang</code> whose value is sent when entering the <code>route</code> of the function <code>store</code>.\nThe variable values ​​are checked and the value is added inside <code>App::getLocale()</code> and also inside <code>Session::put()</code>. If the value of the variable <code>lang</code> is null, <code>App::setLoale()</code> is made to take the value from <code>Session</code>.</p>\n<p>This is the <code>Route</code> of the <code>store</code> function:</p>\n<pre><code>Route::post('insert_offer/{lang?}',[OfferController::class,'store'])-&gt;name('store_offer');\n</code></pre>\n<p>The same thing was done inside the function <code>create</code></p>\n<pre><code>public function create($lang=''){\n if(in_array($lang,['en','ar'])){\n App::setLocale($lang);\n Session::put('lang',$lang);\n }else{\n App::setLocale(Session::get('lang'));\n Session::put('lang',App::getLocale());\n }\n return view('offers.create',['language'=&gt;['العربية'=&gt;'ar','English'=&gt;'en']]);\n }\n</code></pre>\n<p>This is the <code>Route</code> of the <code>create</code> function:</p>\n<pre><code>Route::get('create_offer/{lang?}',[OfferController::class,'create']);\n</code></pre>\n<p>The value of the variable <code>lang</code> is sent to the function <code>store</code> via <code>form</code>.</p>\n<p>Like this:</p>\n<pre><code>&lt;form method=&quot;post&quot; action=&quot;{{ route('store_offer',App::getLocale()) }}&quot;&gt;\n</code></pre>\n<p>I hope everyone benefits from this and bye</p>\n<p>I want to add some modifications just for those who want to use the <code>Request Validation</code> files:</p>\n<p>Inside the <code>roles</code> function we will place the same verification code as before, but with a slight difference:</p>\n<pre><code>public function rules(): array\n {\n $lang = request()-&gt;input('lang');\n if(in_array($lang,['en','ar'])){\n App::setLocale($lang);\n Session::put('lang',$lang);\n }else{\n App::setLocale(Session::get('lang'));\n Session::put('lang',App::getLocale());\n }\n //.............\n \n\n\n</code></pre>\n<p>Here the value of <code>lang</code> is taken from the sent <code>request</code></p>\n<p>The value of <code>lang</code> is sent with <code>request</code> through <code>input hidden</code></p>\n<p><code>&lt;input type=&quot;hidden&quot; name=&quot;lang&quot; value=&quot;{{ App::getLocale() }}&quot;&gt;</code></p>\n"^^ . + "1"^^ . + . + "0"^^ . + . + "Impossible to install composer on windows 11"^^ . + "What does this "-- Extracts '2030'" mean?"^^ . + . + "You are using a PHP session on the server side already, so why are you going through so much fiddly stuff with trying to store the product ID on the client side in sessionStorage? Put it into the PHP session, when you process the step that initially submits it, and then take it from there when you need it in the following steps."^^ . + . + . + . + "Adding leafletjs map and marker to a laravel project"^^ . + . + "0"^^ . + . + . + . + "(It's also at least worth noting that users are *probably* able to circumvent a great deal of what you're trying to restrict, if they really want to. Functionality and security are two very different conversations, and currently we're only really focusing on the former.)"^^ . + . + "<p>The exposed behaviour is available since PHP v8.3.0. It is demonstrated in <a href="https://www.php.net/manual/en/language.oop5.constants.php#example-244" rel="nofollow noreferrer">Example #6: Fetch class constant syntax</a>, in the documentation page of <a href="https://www.php.net/manual/en/language.oop5.constants.php" rel="nofollow noreferrer">Class Constants</a>.</p>\n"^^ . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + "1"^^ . + . + "after that in my model public function libraries(){return $this->morphToMany(Library::class,'alllibraryable');}\n i don't know what should i write in my function."^^ . + . + "The issue was with processing.allowTags. Thank you for your help!"^^ . + . + . + "You do have a `.htaccess` file at the root of the site, don't you?"^^ . + "1"^^ . + . + "0"^^ . + . + . + . + "@krisgjika becouse i have to checkBid if there is one or more numbers in the list"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "2"^^ . + "1"^^ . + "Set credit limit for account customers"^^ . + . + . + "Getting error "Cannot redeclare class __TwigTemplate""^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "3"^^ . + . + . + . + "People vote funny here. My working answer has received a dv, but Tim's answer (which provably does not work) has 4 up and 0 down. I guess it is more about who you are friends with."^^ . + . + "0"^^ . + "<h3>1. <strong>Install the Elasticsearch PHP Client</strong></h3>\n<ul>\n<li><p>Use Composer to install the official Elasticsearch PHP client:</p>\n<pre><code>composer require elasticsearch/elasticsearch\n\n</code></pre>\n</li>\n<li><p>This library allows your Laravel application to communicate with Elasticsearch.</p>\n</li>\n</ul>\n<h3>2. <strong>Configure Elasticsearch in Laravel</strong></h3>\n<ul>\n<li><p>Create a configuration file for Elasticsearch. You can add it in <code>config/elasticsearch.php</code>:</p>\n<pre><code>return [\n 'hosts' =&gt; [\n env('ELASTICSEARCH_HOST', 'http://localhost:9200'),\n ],\n];\n\n</code></pre>\n</li>\n<li><p>Add the <code>ELASTICSEARCH_HOST</code> variable to your <code>.env</code> file:</p>\n<pre><code>ELASTICSEARCH_HOST=http://your-docker-host:9200\n\n</code></pre>\n</li>\n</ul>\n<h3>3. <strong>Create a Service Provider</strong></h3>\n<ul>\n<li><p>Generate a service provider to bind Elasticsearch to the Laravel service container:</p>\n<pre><code>php artisan make:provider ElasticsearchServiceProvider\n\n</code></pre>\n</li>\n<li><p>In the <code>register</code> method of the provider, bind the Elasticsearch client:</p>\n<pre><code>use Elasticsearch\\ClientBuilder;\n\npublic function register()\n{\n $this-&gt;app-&gt;singleton('Elasticsearch', function () {\n return ClientBuilder::create()\n -&gt;setHosts(config('elasticsearch.hosts'))\n -&gt;build();\n });\n}\n\n</code></pre>\n</li>\n</ul>\n<h3>4. <strong>Use Elasticsearch in Your Application</strong></h3>\n<ul>\n<li><p>Inject the Elasticsearch client wherever needed:</p>\n<pre><code>use Elasticsearch\\Client;\n\npublic function __construct(Client $elasticsearch)\n{\n $this-&gt;elasticsearch = $elasticsearch;\n}\n\npublic function search($query)\n{\n return $this-&gt;elasticsearch-&gt;search([\n 'index' =&gt; 'your_index_name',\n 'body' =&gt; [\n 'query' =&gt; [\n 'match' =&gt; [\n 'field_name' =&gt; $query,\n ],\n ],\n ],\n ]);\n}\n\n</code></pre>\n</li>\n</ul>\n<h3>5. <strong>Index Your Data</strong></h3>\n<ul>\n<li><p>Before searching, you need to index your data. Create a command or a job to index your database records into Elasticsearch:</p>\n<pre><code>$params = [\n 'index' =&gt; 'your_index_name',\n 'body' =&gt; [\n 'field_name' =&gt; 'value',\n ],\n];\n\n$this-&gt;elasticsearch-&gt;index($params);\n\n</code></pre>\n</li>\n</ul>\n<h3>6. <strong>Optimize Search Queries</strong></h3>\n<ul>\n<li>Use Elasticsearch's powerful query DSL to build complex and efficient search queries. You can also implement pagination and filtering to handle large result sets.</li>\n</ul>\n<h3>7. <strong>Test and Debug</strong></h3>\n<ul>\n<li><p>Use tools like Kibana or Postman to test your Elasticsearch queries directly.</p>\n</li>\n<li><p>Check Laravel logs for any errors during integration.</p>\n</li>\n</ul>\n"^^ . + "0"^^ . + "1"^^ . + . + "0"^^ . + "2"^^ . + "Hello @AymDev, thank you for your time. I have started exactly like u suggested making everything into a separate bundle. The issue arise when one of those bundle need to have different version for the main app installation. I don't even know if i could explain myself correctly"^^ . + . + . + . + "encryption"^^ . + . + . + . + "Hey there. you say in your post that the behaviour changes between logged in and logged out states, yet you don't include any code that involves user sessions. You want to check the whole process for a variable or otherwise which is only retrieved when logged in, but from what you've sent us, I doubt anyone can help"^^ . + "slack-api"^^ . + . + . + . + "2"^^ . + . + . + . + . + "We can't really tell what these scripts are doing, without any relevant context. `toggleSidebar` doesn't even occur anywhere in what you have shown us so far. You need to provide a [mre] of your issue."^^ . + "0"^^ . + . + . + "<p>I recently started learning Symfony, and I've been passing integer values ​​to foreign keys in other projects before, but this is different with Doctrine, as the foreign key methods accept an object, not a number. I understand that I can rewrite the methods, but I don't want to break the Doctrine mapping, and I want to understand how it works.</p>\n<p>Example: I have two entities, <code>Institute</code> and <code>Department</code>, with a Many-to-One relationship (an &quot;Institute&quot; has many &quot;departments&quot;). <code>Department</code> has a foreign key &quot;institute_id&quot;. How exactly do I need to pass the data so that I can fill the Departments table?</p>\n<p><strong>Institute:</strong></p>\n<ul>\n<li>id</li>\n<li>name</li>\n</ul>\n<p><strong>Department:</strong></p>\n<ul>\n<li>id</li>\n<li>name</li>\n<li>institute_id</li>\n</ul>\n<p><strong>Fixture file:</strong></p>\n<pre><code>namespace App\\DataFixtures;\n\n// ...\nuse App\\Entity\\Department;\n// ...\nuse App\\Entity\\Institute;\n// ...\nuse Doctrine\\Bundle\\FixturesBundle\\Fixture;\nuse Doctrine\\Persistence\\ObjectManager;\nuse function Zenstruck\\Foundry\\faker;\n\n\nclass AppFixtures extends Fixture\n{\n public function load(ObjectManager $manager): void\n {\n $instituteList = [\n 'Институт информационных технологий и кибербезопасности',\n 'Институт телекоммуникаций и радиотехники',\n 'Институт бизнеса и социальных коммуникаций',\n 'Институт электроники, автоматизации и метрологии'\n ];\n\n $departmentList = [\n 'Кафедра инженерии программного обеспечения',\n 'Кафедра компьютерных наук',\n 'Кафедра кибербезопасности и технических наук',\n 'Кафедра компьютерной инженерии и информационных систем',\n 'Кафедра национальной безопасности и управление общественным развитием',\n\n 'Кафедра радиоэлектронных систем и технологий',\n 'Кафедра коммутационных систем электронных коммуникаций',\n 'Кафедра систем электронных коммуникаций',\n 'Кафедра автоматизации и компьютерно-интегрированных технологий',\n\n 'Кафедра менеджмента и маркетинга',\n 'Кафедра социально-гуманитарных наук',\n 'Кафедра лингводидактики и иностранных языков',\n 'Кафедра журналистики, социальных коммуникаций и IT-права',\n 'Кафедра общественного управления и цифровой экономики',\n 'Кафедра психологии и реабилитации',\n\n 'Кафедра электроники, транспортных технологий и логистики',\n 'Кафедра метрологии, качества и стандартизации',\n 'Кафедра физико-математических наук'\n ];\n\n\n for ($i = 0; $i &lt; count($instituteList); $i++) {\n $institute = new Institute();\n $institute-&gt;setName($instituteList[$i]);\n $manager-&gt;persist($institute);\n }\n\n for ($i = 0; $i &lt; count($departmentList); $i++) {\n $department = new Department();\n $department-&gt;setName($departmentList[$i]);\n $department-&gt;setInstitute(rand(1,4));\n $manager-&gt;persist($department);\n }\n\n ...\n\n $manager-&gt;flush();\n }\n}```\n</code></pre>\n"^^ . + "key"^^ . + "www-data is not a full user, e.g. has no HOME directory, therefore perhaps the environment is different? You can show it with `env` command."^^ . + . + . + . + . + "0"^^ . + . + . + "<p>I have two domains, a.com and b.com, both with reCAPTCHA enabled. I'm using the same codebase for both websites, but the reCAPTCHA implementation works on a.com but not on b.com. Here's the setup:</p>\n<p>a.com: The reCAPTCHA keys were created by a friend 2 years ago. The keys are for reCAPTCHA v3, as the site uses grecaptcha.execute.</p>\n<p>b.com: The reCAPTCHA keys were created today, and I used reCAPTCHA v3 for this domain as well.</p>\n<p>On b.com, I get an error:</p>\n<pre><code>contact.php:37 Uncaught (in promise) TypeError: Cannot set properties of null (setting 'value')\n at contact.php:37:71\n(anonymous) @ contact.php:37\nPromise.then \nthen @ recaptcha__en.js:591\n(anonymous) @ contact.php:36\nPromise.then \n(anonymous) @ recaptcha__en.js:138\n(anonymous) @ recaptcha__en.js:195\n(anonymous) @ recaptcha__en.js:196\n(anonymous) @ recaptcha__en.js:472\n(anonymous) @ recaptcha__en.js:196\n(anonymous) @ recaptcha__en.js:1132\n(anonymous) @ recaptcha__en.js:1142\n</code></pre>\n<p>Here's the client-side code I’m using:</p>\n<pre><code>&lt;script src=&quot;https://www.google.com/recaptcha/api.js?render=mysitekey&quot;&gt;&lt;/script&gt;\n&lt;script&gt;\n grecaptcha.ready(function() {\n grecaptcha.execute('mysitekey', {action: 'contact_form'})\n .then(function(token) {\n document.getElementById('g-recaptcha-response').value = token;\n });\n });\n&lt;/script&gt;\n\n</code></pre>\n<p>Also I noticed that the reCAPTCHA tokens generated for the two domains have different lengths:</p>\n<p>For a.com, the token is about 1100 characters.</p>\n<p>For b.com, the token is around 2400 characters.</p>\n<p>Can someone tell me what is wrong with this code?</p>\n"^^ . + "How to customize logout redirection url in filament from adminpanel?"^^ . + . + "0"^^ . + . + "directory"^^ . + "0"^^ . + "0"^^ . + . + "5"^^ . + . + . + . + "0"^^ . + "also https://api.slack.com/events/url_verification says to respond in plain text not in json"^^ . + "1"^^ . + . + . + "I already changed it to file and set the session_driver=value but still the issue persist"^^ . + . + . + . + . + . + "webhooks"^^ . + "<p>There are few errors in this (optimizations too)</p>\n<ol>\n<li><p>Remove this line</p>\n<pre><code>$article-&gt;tags[] = $request-&gt;get('tags[]'); // $article-&gt;tags()-&gt;sync will do the job\n</code></pre>\n</li>\n<li><p>Change this</p>\n<pre><code> if ($request-&gt;has('tags')) { # changed\n $article-&gt;tags()-&gt;sync($request-&gt;tags);\n } else {\n $article-&gt;tags()-&gt;sync([]);\n }\n</code></pre>\n</li>\n<li><p>In view</p>\n<pre><code>@php\n // Use old input if present, otherwise use the attached tags from the article.\n $selectedTags = old('tags', $attached_tags);\n@endphp\n\n&lt;div class=&quot;row mb-2&quot;&gt;\n &lt;label for=&quot;tags&quot; class=&quot;col-md-12&quot;&gt;{{ __('Tags') }}&lt;/label&gt;\n &lt;select name=&quot;tags[]&quot; id=&quot;tags&quot; class=&quot;form-control&quot; multiple=&quot;multiple&quot;&gt;\n @foreach ($tags as $tag)\n &lt;option value=&quot;{{ $tag-&gt;id }}&quot; {{ in_array($tag-&gt;id, $selectedTags) ? 'selected' : '' }}&gt;\n {{ $tag-&gt;name }}\n &lt;/option&gt;\n @endforeach\n &lt;/select&gt;\n&lt;/div&gt;\n</code></pre>\n</li>\n</ol>\n"^^ . + "Yes, the user has te offline_access."^^ . + . + . + . + . + . + "1"^^ . + "config"^^ . + . + "The pages.dev way of handling form submissions would be with [Functions](https://developers.cloudflare.com/pages/functions/). Those won't be written in PHP though. If this is all too much for you, consider using some external 3rd party to embed a contact form. Those exist specifically for this kind of use case, and don't require any backend coding."^^ . + "0"^^ . + "1"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + "Also, FWIW, here's some [links](https://externals.io/message/122028) to [discussions](https://externals.io/message/119267) in core about changes to cookies, including partitioned."^^ . + . + . + . + "1"^^ . + . + "3"^^ . + "<p><strong>Where is my mistake?</strong></p>\n<p>Your issue is with this this line --&gt;</p>\n<pre><code>$articles = Article::where('id', $tag-&gt;id)-&gt;orderBy('id', 'desc')-&gt;paginate($this-&gt;per_page);\n</code></pre>\n<p>Here you are retrieving the articles where <strong>article id</strong> is same as <strong>tag id</strong>.</p>\n<p><strong>Solution:</strong></p>\n<p>Use the <a href="https://laravel.com/docs/11.x/eloquent-relationships#many-to-many-defining-the-inverse-of-the-relationship" rel="nofollow noreferrer">many-to-many relationship</a> that you have defined on the <code>Tag</code> model. You can retrieve the articles using the relationship like this like this: <code>$tag-&gt;article</code>.</p>\n<p>So your full code for the tag method in the ArticleController:</p>\n<pre><code>public function tag($tag_id)\n{\n $tag = Tag::firstWhere('id', $tag_id);\n $articles = $tag-&gt;article-&gt;orderBy('id', 'desc')-&gt;paginate($this-&gt;per_page);\n\n return view(\n 'themes/' . $this-&gt;theme_directory . '/templates/index',\n array_merge($this-&gt;data, [\n 'tag' =&gt; $tag,\n 'articles' =&gt; $articles\n ])\n );\n}\n</code></pre>\n"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "Visual Studio Code (PHP) tooltip transforms to real characters and the code crashes"^^ . + . + "Well, that was a surprise, as the script I was trying to run was complaining about being root, but when I changed my example above to run "id -u" it did indeed indicate the expected user. Apparently I have a different problem than the one I thought I had. Thanks!"^^ . + . + . + "<p>doing it that way would expose ur backend.\nif u doing something like this anyways.</p>\n<pre><code>const echo = new Echo({\n broadcaster: 'pusher',\n key: 'your-pusher-key',\n cluster: 'your-cluster',\n encrypted: true\n});\n</code></pre>\n"^^ . + "error-handling"^^ . + . + . + "How to Create a Table via Laravel Console Command and Save Schema to a Text File"^^ . + "0"^^ . + "0"^^ . + "1"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "As usual: add all clarification **to your question** by editing it"^^ . + . + "0"^^ . + . + . + . + . + . + . + "1"^^ . + . + "0"^^ . + "typoscript"^^ . + "Why is that not an option, just to check where this is going wrong?"^^ . + "Is `massage` in your JS a typo, should that be the `message` var used later?"^^ . + . + "0"^^ . + "_"to replace the iframe with embed tag"_ - `iframe` and `embed` are not fully replaceable with each other in the first place, so _that_ was not a good idea to begin with."^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "Carbon::parse will correct your date , but if you don't want to insert wrong date data in database , then you can create custom validation."^^ . + . + . + . + "P.S. The latest release of PHPMailer is 6.9.3. You're a long way behind and the 5.x branch isn't even supported anymore. Upgrade to a newer version - https://github.com/phpmailer/phpmailer/releases. See also https://github.com/PHPMailer/PHPMailer?tab=readme-ov-file#legacy-versions for upgrade info"^^ . + "0"^^ . + . + . + "<h3>Context</h3>\n<p>I am building an custom api to receive data from a salesforce platform in order to synchronise job openings on our moodle platform.</p>\n<p>The idea is simply: salesforce has a manual request that will send the job data to moodle, which will handle the data.</p>\n<h3>The issue</h3>\n<p>When I try to test the request (using Postman) I am getting an error that seems to come from the parameter validation.\n<img src="https://i.ibb.co/sd2vyhzf/image-6.png" alt="Postman Screenshot" />\nAccording to the message, my data is not having the property &quot;data&quot; that has a single structure (associative array) as value.</p>\n<h3>My custom plugin:</h3>\n<p><code>db/services.php</code></p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\n/**\n * ...\n */\n\n$functions = [\n 'local_jobboard_receive_salesforce_data' =&gt; [\n 'classname' =&gt; 'local_jobboard_external',\n 'methodname' =&gt; 'receive_salesforce_data',\n 'classpath' =&gt; 'local/jobboard/externallib.php',\n 'description' =&gt; 'Receives job data from Salesforce and saves it in the database.',\n 'type' =&gt; 'write',\n 'ajax' =&gt; false,\n 'capabilities' =&gt; '',\n ]\n];\n\n$services = [\n 'JobBoard API' =&gt; [\n 'functions' =&gt; ['local_jobboard_receive_salesforce_data'],\n 'restrictedusers' =&gt; 1,\n 'enabled' =&gt; 1,\n 'shortname' =&gt; 'jobboardapi'\n ]\n];\n</code></pre>\n<p><code>externallib.php</code></p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\n/**\n * ...\n */\n\nuse core\\exception\\invalid_parameter_exception;\nuse stdClass;\n\ndefined('MOODLE_INTERNAL') || die();\nrequire_once(&quot;$CFG-&gt;libdir/externallib.php&quot;);\n\nclass local_jobboard_external extends external_api\n{\n public static function receive_salesforce_data_parameters()\n {\n return new external_function_parameters(\n array(\n 'data' =&gt; new external_single_structure(\n array(\n 'title' =&gt; new external_value(PARAM_TEXT, 'Job title'),\n 'description' =&gt; new external_value(PARAM_RAW, 'Job description in markdown or HTML'),\n 'company' =&gt; new external_value(PARAM_TEXT, 'Company name'),\n 'location' =&gt; new external_value(PARAM_TEXT, 'Work location (Hybrid, Online, Office)', VALUE_OPTIONAL),\n 'deadline' =&gt; new external_value(PARAM_INT, 'Application deadline (Unix timestamp)'),\n 'type' =&gt; new external_value(PARAM_ALPHANUMEXT, 'Type (job or internship)'),\n 'note' =&gt; new external_value(PARAM_TEXT, 'HR or Account manager notes', VALUE_OPTIONAL),\n 'tags' =&gt; new external_value(PARAM_TEXT, 'Comma-separated skill tags'),\n 'targets' =&gt; new external_multiple_structure(new external_value(PARAM_TEXT, 'Target categories'))\n )\n )\n )\n );\n }\n\n public static function receive_salesforce_data($data)\n {\n global $DB;\n\n $rawInput = $data;\n error_log(&quot;[Salesforce API] Raw Input: &quot; . $rawInput);\n\n $decoded_data = json_decode($rawInput, true);\n\n if (json_last_error() !== JSON_ERROR_NONE || !is_array($decoded_data)) {\n error_log(&quot;[Salesforce API] Invalid JSON format.&quot;);\n throw new invalid_parameter_exception('Invalid JSON format.');\n }\n\n if (!isset($decoded_data['data'])) {\n $decoded_data = ['data' =&gt; $decoded_data];\n }\n\n $params = self::validate_parameters(self::receive_salesforce_data_parameters(), $decoded_data);\n\n error_log(&quot;[Salesforce API] Parsed Params: &quot; . json_encode($params));\n\n // .. rest of the logic\n }\n\n public static function receive_salesforce_data_returns()\n {\n return new external_single_structure(\n array(\n 'status' =&gt; new external_value(PARAM_TEXT, 'Success status'),\n 'message' =&gt; new external_value(PARAM_TEXT, 'Response message')\n )\n );\n }\n\n // other methods\n}\n</code></pre>\n<p>My request header also has the <strong>content-type</strong> set to <strong>application/json</strong>.</p>\n<p>Is there any reason for my request to fail? I am a bit at a loss here.</p>\n<p>Thanks in advance!</p>\n"^^ . + . + . + . + "2"^^ . + . + . + . + "How do I set up PHP so that users can fill out the contact form and send me messages?"^^ . + "0"^^ . + "1"^^ . + . + . + . + "1"^^ . + "0"^^ . + "Amending @TimLewis 's comment, the dereference should be `$obj->data->name->nameText->text`. (Extra field at end)."^^ . + . + . + . + . + . + "<p>In Laravel 12, we define global middleware for web requests using the withMiddleware method in bootstrap/app.php, which makes it super easy to apply middleware to all HTTP requests automatically. I’m looking to do something similar for queued jobs: I want a specific middleware to run for all ShouldQueue entities—custom jobs, notifications, queued events, queued mailables, etc.—without having to attach it to each class individually.</p>\n<p>Here’s the context: I’m building a multi-tenant app where every Notifiable (like a User) has a tenant_id. I’ve created a middleware (ConfigureJobTenantMiddleware) that sets tenant-specific configurations (e.g., mail settings, app URL) based on this tenant_id. Right now, I can apply it to custom jobs by defining a middleware() method, but I want it to work universally, including for Laravel’s built-in queueables like SendQueuedNotifications, without modifying every class.</p>\n<p>Any insights or best practices for Laravel 12 would be awesome—especially if there’s a cleaner way to do this without hacking too deep into the framework!</p>\n<p>I know there are many Tenancy packages but I want to implement mine to learn and understand Laravel as a beginner.</p>\n<p>Thanks!</p>\n"^^ . + . + . + "0"^^ . + . + "You cannot change the definition of an already defined class. The solution would be to prevent the original definition from existing, and load your own. Since you are not using composer, that would be up to whatever file/class loading system you are using."^^ . + . + "Thank you so much! I got it working then I got the error "Base table or view not found" which I solved by changing SESSION_DRIVER=database to SESSION_DRIVER=file. Hope this helps someone."^^ . + "1"^^ . + . + . + . + "<p>My team is using PHP-FPM, configured statically with a max of 32 processes, in a Kubernetes cluster. We're autoscaling based on PHP-FPM metrics, and there are many replicas. I'm frequently (i.e. on all replicas) seeing the PHP-FPM status show queued connections, even though the max active processes is below total processes. For example:</p>\n<pre><code>pool: www\nprocess manager: static\nstart time: 06/Feb/2025:17:37:07 +0000\nstart since: 80556\naccepted conn: 265772\nlisten queue: 0\nmax listen queue: 2\nlisten queue len: 511\nidle processes: 27\nactive processes: 5\ntotal processes: 32\nmax active processes: 21\nmax children reached: 0\nslow requests: 0\n</code></pre>\n<p>Note that the max active processes is 21 of the 32 available, but that the listen queue has reached 2. Why are connections being queued when there are idle processes?</p>\n"^^ . + . + . + "dd(Auth::user()->can('view_permission_categories')); gives false"^^ . + "0"^^ . + . + . + . + . + . + . + . + "1"^^ . + "5"^^ . + . + "Favicon Not Showing in Google Search (Using Netcup Hosting)"^^ . + "2"^^ . + "1"^^ . + "<p>I'm having a problem with my Wordpress hosting on a Hostinger VPS with CloudPanel and NGINX. I've tried reinstalling it, it worked for 10 minutes (which is strange) and then it stopped working.</p>\n<p>Basically, I try to access the site and I get the following response:\n&quot;ERR_TOO_MANY_REDIRECTS&quot;\nHowever, when I access wp-login, I can fill in the username and password, but it just reloads the page.</p>\n<p>NGINX Error Log - Nothing\nPHP-FPM Error Log - Nothing\nWP_LOG - Nothing</p>\n<p>This is the default configuration file:</p>\n<pre><code>server {\n listen 80;\n listen [::]:80;\n listen 443 quic;\n listen 443 ssl;\n listen [::]:443 quic;\n listen [::]:443 ssl;\n http2 on;\n http3 off;\n ssl_certificate_key /etc/nginx/ssl-certificates/www.casamarx.com.br.key;\n ssl_certificate /etc/nginx/ssl-certificates/www.casamarx.com.br.crt;\n server_name casamarx.com.br;\n return 301 https://www.casamarx.com.br$request_uri;\n}\n\nserver {\n listen 80;\n listen [::]:80;\n listen 443 quic;\n listen 443 ssl;\n listen [::]:443 quic;\n listen [::]:443 ssl;\n http2 on;\n http3 off;\n ssl_certificate_key /etc/nginx/ssl-certificates/www.casamarx.com.br.key;\n ssl_certificate /etc/nginx/ssl-certificates/www.casamarx.com.br.crt;\n server_name www.casamarx.com.br www1.casamarx.com.br;\n root /home/casamarx/htdocs/www.casamarx.com.br;\n\n access_log /home/casamarx/logs/nginx/access.log main;\n error_log /home/casamarx/logs/nginx/error.log;\n\n if ($scheme != &quot;https&quot;) {\n rewrite ^ https://$host$request_uri permanent;\n }\n\n location ~ /.well-known {\n auth_basic off;\n allow all;\n }\n\n location ~/\\.git {\n deny all;\n }\n\n location = /xmlrpc.php {\n deny all;\n }\n\n location ~/(wp-admin/|wp-login.php) {\n #auth_basic &quot;Restricted Area&quot;;\n #auth_basic_user_file /home/site-user/.htpasswd;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $remote_addr;\n proxy_set_header X-Forwarded-Host $host;\n proxy_set_header Host $host;\n proxy_pass http://127.0.0.1:8080;\n proxy_max_temp_file_size 0;\n proxy_connect_timeout 7200;\n proxy_send_timeout 7200;\n proxy_read_timeout 7200;\n proxy_buffer_size 128k;\n proxy_buffers 4 256k;\n proxy_busy_buffers_size 256k;\n proxy_temp_file_write_size 256k;\n }\n\n location / {\n proxy_pass http://127.0.0.1:8080;\n proxy_set_header Host $host;\n proxy_set_header X-Forwarded-Host $host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_hide_header X-Varnish;\n proxy_redirect off;\n proxy_max_temp_file_size 0;\n proxy_connect_timeout 720;\n proxy_send_timeout 720;\n proxy_read_timeout 720;\n proxy_buffer_size 128k;\n proxy_buffers 4 256k;\n proxy_busy_buffers_size 256k;\n proxy_temp_file_write_size 256k;\n }\n\n location ~* ^.+\\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map)$ {\n # WordPress Multisite Subdirectory\n rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 break;\n rewrite ^/[_0-9a-zA-Z-]+(/.*\\.php)$ $1 break;\n add_header Access-Control-Allow-Origin &quot;*&quot;;\n add_header alt-svc 'h3=&quot;:443&quot;; ma=86400';\n expires max;\n access_log off;\n }\n\n if (-f $request_filename) {\n break;\n }\n}\n\nserver {\n listen 8080;\n listen [::]:8080;\n server_name www.casamarx.com.br www1.casamarx.com.br;\n root /home/casamarx/htdocs/www.casamarx.com.br;\n\n include /etc/nginx/global_settings;\n\n try_files $uri $uri/ /index.php?$args;\n index index.php index.html;\n\n location ~ \\.php$ {\n include fastcgi_params;\n fastcgi_intercept_errors on;\n fastcgi_index index.php;\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n try_files $uri =404;\n fastcgi_read_timeout 3600;\n fastcgi_send_timeout 3600;\n fastcgi_param HTTPS &quot;on&quot;;\n fastcgi_param SERVER_PORT 443;\n fastcgi_pass 127.0.0.1:15001;\n fastcgi_param PHP_VALUE &quot;\n error_log=/home/casamarx/logs/php/error.log;\n memory_limit=512M;\n max_execution_time=60;\n max_input_time=60;\n max_input_vars=10000;\n post_max_size=64M;\n upload_max_filesize=64M;\n date.timezone=UTC;\n display_errors=off;&quot;;\n }\n\n # WordPress Multisite Subdirectory\n if (!-e $request_filename) {\n rewrite /wp-admin$ https://$host$uri permanent;\n rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;\n rewrite ^/[_0-9a-zA-Z-]+(/.*\\.php)$ $1 last;\n }\n\n if (-f $request_filename) {\n break;\n }\n}\n\n</code></pre>\n<p>Portuguese:</p>\n<p>Estou passando por um problema com minha hospedagem Wordpress em uma VPS do Hostinger com CloudPanel e NGINX. Já tentei reinstalar, funcionou por um tempo de 10 minutos (o que é estranho) e logo em seguida passou a não funcionar.</p>\n<p>Basicamente tento entrar no site e meu retorno é:\n&quot;ERR_TOO_MANY_REDIRECTS&quot;\nPorém, quando entro no wp-login, consigo preencher usuário e senha, mas ele somente recarrega a página.</p>\n<p>NGINX Error Log - Não tem nada\nPHP-FPM Error Log - Não tem nada\nWP_LOG - Não tem nada</p>\n<p>I tried to modify the permissions, I tried to disable plugins (at the first occurrence), but nothing. I don't understand too much about nginx. But, I know when the VPS had the srv....hostinger.cloud (original domain) from Hostinger, don't currency anything like this error.</p>\n"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "Defefinly struggling with the javascript part. I thought respose would send the code to ddms to parse the needed folders for the 2nd down menu. I'm still learning javascript"^^ . + ""check" could mean a couple of things. You could use a back reference in RegEx to require that the second line will only match if it has the same value from the first line. The danger of this is that if it doesn't, the entire match will be skipped, which is why I was asking about any possibility of another line being injected. The alternative is to only look for the first line, and then perform a second pass looking more specifically for the second version. Less efficient, but you could optimize by only looking forward at the next _n_ lines maybe."^^ . + . + . + . + . + . + . + . + . + . + "-1"^^ . + . + "@mmm Good point. I meant that widgets for theme sidebars have been replaced with blocks. There's still dashboard widgets though."^^ . + . + . + . + . + . + "Thank you Bhargav. It looks like the == at the end of the client secret was the issue. Somehow this was getting removed when generating the post fields."^^ . + "0"^^ . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + . + . + "2"^^ . + . + . + . + "Some thing like http://localhost. Try to change it also at `LOG_VIEWER_API_STATEFUL_DOMAINS`. You should also add your middleware to the config `api_middleware` and check the api request to see the token is being send or not"^^ . + "Laravel Cloud Error: Call to undefined function Illuminate\\Foundation\\laravel_cloud()"^^ . + . + . + "Additionally, although this is not related to your question, you don't need the `fastcgi_split_path_info` directive. It does nothing within the locations you've defined, and you don't make use of the `$fastcgi_path_info` variable evaluated by this directive anyway."^^ . + . + . + . + . + "@KeyboardCorporation Returning anything other than `$query->execute()` gives error `must implement interface TYPO3\\CMS\\Extbase\\Persistence\\QueryResultInterface, array returned`"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + "Can you try to use **static** JS code first, to check whether this is a problem of PHP / Livewire or JS itself?"^^ . + . + . + "Laravel Eloquent actions for soft delete"^^ . + . + . + . + . + . + "0"^^ . + "Prevent exceptions from being displayed on the terminal in Symfony 4.4"^^ . + "Looks like your question is more about string manipulation, to fix that invalid json string, than on actual json parsing. Besides, decpite using true parameter for json_decode, you are trying to access values as object properties"^^ . + . + . + . + "fortify"^^ . + . + "1"^^ . + . + . + . + "However, Laravel with the artisan file launches an entire console manager, where the serve command starts it for you. So, by using `php artisan`, you run the `artisan` file with PHP, and then with the `serve` command, you instruct it to open a locally hosted port. See more: https://laravel.com/docs/12.x/artisan"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + "1"^^ . + . + . + "0"^^ . + "-1"^^ . + "-2"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + "@LazyOne: Thanks a lot. I installed netbeans too and currently I succeeded with debuggin via dbgpClient (I needed to enable its executable property checkbox first). \nYou are totally right I need to configure different ports for Xdebug and php-server. I thought of Xdebug to be "connected in between" and therefore triggered at the same port. But I have no clue what is the meaning of port routing for this setup. No matter what it is: It works with different ports and it will work with netbeans and CodeLite too now"^^ . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + "shuffle"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + "Does it look safe? For me, it doesn't. Whenever I see _real_escape_string()_, I get the feeling of scorched earth. And your code looks especially fishy as it is being blindly applied on superglobals. This is often an unsafe practice as a certain usergroup tends to think it's the correct way to fall asleep for sweet dreams. My recommendation: First continue with your experiments to understand what is going on, then use the right tools, e.g. PHP input validation and database parameters."^^ . + . + . + . + "2"^^ . + . + . + "No, it's sorting product variations by the variation attribute term slug… Yes there is a way to run a script… find this as an addition in my answer. The script will run only once by variable product, when browsing each variable product."^^ . + "0"^^ . + . + "Since you can correctly access it via `public ip/backend/api.php`, I would say that suggests your Alias and Directory directive are doing their job correctly, when it comes to configuring the PHP integration on the Apache side. Looks to me, like your proxy setup was passing this request on to svelte though, when you access it via the frontend domain."^^ . + "0"^^ . + . + . + "0"^^ . + . + . + "magento"^^ . + "Updating failed. The response is not a valid JSON response when adding a style property to a block in wordpress on hostinger"^^ . + . + "Is it safe to use email address itself for the unsubscribe link?"^^ . + . + . + . + "1"^^ . + . + . + "0"^^ . + . + "It might also be possible configure your `search_path` in [connection string `options`](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-OPTIONS). PHP connection string doc [seems to support it](https://www.php.net/manual/en/function.pg-pconnect.php). You should also be able to `alter system`, `alter database` or `alter role user_name set search_path=...` so that you don't need to override the default each time your connect. As a stop-gap workaround you can switch to `pg_query_params()` whenever you need to target an object in a schema that's not in your `search_path`."^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "<p><strong>I found a solution:</strong></p>\n<p>Just modify the form call to disable data-turbo in template:</p>\n<pre><code>{{ form_start(form, { 'attr': {'data-turbo': 'false'} } ) }}\n</code></pre>\n<p>This time the redirection goes normally</p>\n"^^ . + "<p>I am using PHP preg_replace where the search part is taking the first match of the regexp expresion. I would like to achieve the following (avoid non word in word inclusion):</p>\n<pre><code>[^\\w]atlan[^\\w]\n\nhere should match without &quot;&lt;&quot;, &quot;&gt;&quot;&lt;strong&gt;atlan&lt;strong&gt;\nhere should match without &quot;space&quot; Text AtlaN continue\nthis transATLANtic should not match\n</code></pre>\n<p>Here is a link with my approach: <a href="https://regex101.com/r/Id7qjX/1" rel="nofollow noreferrer">https://regex101.com/r/Id7qjX/1</a></p>\n<p>With my approach, the previous and following character is also included. In case of wrapping HTML it breaks the structure. As soon as I use () - grouping, the correct match is ignored by preg_replace. I would like to stay with preg_replace and attempt to find a clever solution for the regexp rule.</p>\n"^^ . + . + . + . + "Multilingualism in Laravel 11"^^ . + "<p>I try to upgrade Prestashop from 1.7.8.8 to 8.1.7. I decided to use autoupgrade via cli option. I got an error (I have many more but finally resolved them but stuck here):</p>\n<pre><code>INFO - 506 files left to upgrade.\nINFO - === Step upgradeFiles\nINFO - 106 files left to upgrade.\nINFO - === Step upgradeFiles\nINFO - All files upgraded. Now upgrading database...\nINFO - Restart requested. Please run the following command to continue your upgrade:\nINFO - $ modules/autoupgrade/cli-upgrade.php --dir=admin9254z9q7u --action=upgradeDb --data=eyJlcnJvciI6bnVsbCwic3RlcERvbmUiOmZhbHNlLCJuZXh0IjoidXBncmFkZUZpbGVzIiwic3RhdHVzIjoib2siLCJuZXh0X2Rlc2MiOiJJTkZPIC0gUmVzdGFydCByZXF1ZXN0ZWQuIFBsZWFzZSBydW4gdGhlIGZvbGxvd2luZyBjb21tYW5kIHRvIGNvbnRpbnVlIHlvdXIgdXBncmFkZTpcbiIsIm5leHRRdWlja0luZm8iOltdLCJuZXh0RXJyb3JzIjpbXSwibmV4dFBhcmFtcyI6eyJvcmlnaW5WZXJzaW9uIjoiMS43LjguOCIsIml [..]\nINFO - === Step upgradeDb\nINFO - Cleaning file cache\nINFO - Running opcache_reset\nPrestaShopException in /var/www/presta_us_klon/classes/db/Db.php line 303\n#0 /var/www/presta_us_klon/classes/db/Db.php(236): DbCore::getClass()\n#1 /var/www/presta_us_klon/config/alias.php(47): DbCore::getInstance()\n#2 /var/www/presta_us_klon/classes/shop/Shop.php(1351): pSQL()\n#3 /var/www/presta_us_klon/classes/shop/Shop.php(351): ShopCore::findShopByHost()\n#4 /var/www/presta_us_klon/config/config.inc.php(117): ShopCore::initialize()\n#5 /var/www/presta_us_klon/modules/autoupgrade/classes/UpgradeContainer.php(665): require_once('...')\n#6 /var/www/presta_us_klon/modules/autoupgrade/classes/Task/AbstractTask.php(165): PrestaShop\\Module\\AutoUpgrade\\UpgradeContainer-&gt;initPrestaShopCore()\n#7 /var/www/presta_us_klon/modules/autoupgrade/classes/Task/Upgrade/UpgradeDb.php(90): PrestaShop\\Module\\AutoUpgrade\\Task\\AbstractTask-&gt;init()\n#8 /var/www/presta_us_klon/modules/autoupgrade/classes/Task/Runner/ChainedTasks.php(59): PrestaShop\\Module\\AutoUpgrade\\Task\\Upgrade\\UpgradeDb-&gt;init()\n#9 /var/www/presta_us_klon/modules/autoupgrade/cli-upgrade.php(50): PrestaShop\\Module\\AutoUpgrade\\Task\\Runner\\ChainedTasks-&gt;run()\n#10 {main}\n</code></pre>\n<p>which is related with this class</p>\n<pre><code> public static function getClass()\n {\n $class = '';\n if (PHP_VERSION_ID &gt;= 50200 &amp;&amp; extension_loaded('pdo_mysql')) {\n $class = 'DbPDO';\n } elseif (extension_loaded('mysqli')) {\n $class = 'DbMySQLi';\n }\n\n if (empty($class)) {\n throw new PrestaShopException('Cannot select any valid SQL engine.');\n }\n\n return $class;\n }\n</code></pre>\n<p>but as you can see I have both php7.4 extensions:</p>\n<pre><code>root@joffrey:/var/www# php7.4 -m | grep pdo_mysql\npdo_mysql\nroot@joffrey:/var/www# php7.4 -m | grep mysqli\nmysqli\nroot@joffrey:/var/www/presta_us_klon# cat testy.php\n&lt;?php\nprint_r(get_loaded_extensions());\n?&gt;\nroot@joffrey:/var/www/presta_us_klon# php7.4 testy.php | grep -i 'mysqli\\|pdo_mysql'\n [33] =&gt; mysqli\n [34] =&gt; pdo_mysql\n</code></pre>\n"^^ . + "3"^^ . + . + "1"^^ . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + "1"^^ . + "0"^^ . + . + . + . + . + . + "Why you're making each value an array like this array($row[$v])?"^^ . + "codeigniter-3"^^ . + "1"^^ . + "0"^^ . + "1"^^ . + "If you're reading a CSV, why not just use raw SQL to import it?"^^ . + . + . + . + . + . + "Shos us the code"^^ . + "0"^^ . + "1"^^ . + . + . + . + . + "dropdown"^^ . + "1"^^ . + . + . + "<p>You can calculate the fee dynamically. Here's a more clean and organized version of your code:</p>\n<pre><code>/*\n * Add cart fees by cart total weight Add_pedane\n */\n\nadd_action('woocommerce_cart_calculate_fees', 'a_man_ltd_wc_add_cart_fees');\nif (!function_exists('a_man_ltd_wc_add_cart_fees')) {\n function a_man_ltd_wc_add_cart_fees($cart) {\n $weight = $cart-&gt;get_cart_contents_weight();\n \n if ($weight &gt; 0) {\n $fee_per_unit = 2; // 2 Euros per unit\n $fee_amount = ceil($weight) * $fee_per_unit; // Calculate the fee based on the weight\n \n $name = 'Contributo costo pedane';\n $taxable = true;\n $tax_class = '';\n \n $cart-&gt;add_fee($name, $fee_amount, $taxable, $tax_class);\n }\n }\n}\n</code></pre>\n<p>In this case only validated the weight is positive, because in real life not exist a product with negative weight, but you can validate before if the weight is negative re-writte it to value 1.</p>\n<p><strong>Dynamic Fee Calculation</strong>: Instead of manually mapping each weight range, the fee is calculated dynamically using the formula <code>ceil($weight) * $fee_per_unit</code>. This ensures that the fee is calculated for any weight value, not just up to 33 units.</p>\n<p><strong><code>ceil($weight)</code></strong>: This function rounds up the weight to the nearest whole number.</p>\n<p>Some recommendations: The $cart should have if is taxable or not, but it depends of your logic business.</p>\n"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + "php-openssl"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + "Hmm, what does qualify as a correct class here? When you're just extending from a class you don't know (or you're not sure about), that is normally not a good strategy for problem solving. Consider to add some more information, like references, the Joomla / Virtuemart version you're using and the documentation you're using to build upon."^^ . + . + "<p>Classes are not of the same class if they have a different name.</p>\n<p>Anonymous classes are no exception to this rule.</p>\n<p>Their name as <a href="https://stackoverflow.com/a/79452592/367456">we demonstrated for your previous question</a>:</p>\n<pre><code>string(42) &quot;class@anonymous /path/to/script.php:4$0&quot;\n</code></pre>\n<p>You may remember, we have demonstrated obtaining the class name of an anonymous class recently in <a href="https://stackoverflow.com/a/79452592/367456">https://stackoverflow.com/a/79452592/367456</a> to create another class extending from it.</p>\n<p>As the class-name is per PHP script compilation, this perhaps was not that visible despite we <em>var_dump()ed</em> it.</p>\n<p>Therefore, here an example with a concrete classname that should be more accessible:</p>\n<pre><code>function test_class_def($test)\n{\n static $local = 0;\n\n $name = __FUNCTION__ . $local++;\n eval(&quot;class $name extends proto {}&quot;);\n $new = new $name($test);\n\n return $new;\n}\n\ncompare(test_class_def(...), 1 ,1); // false, false, false,\n</code></pre>\n<p>Comparing it against the anonymous class variant, makes this very visible:</p>\n<pre><code>function test_class_anon($test)\n{\n eval('$new = new class ($test) extends proto {};');\n\n return $new;\n}\n\ncompare(test_class_anon(...), 1 ,1); // false, false, false,\n</code></pre>\n<p>Exactly like in this example PHP script, a new class including its own name is only generated if the code is evaluated and by that compiled. Otherwise there would be no new class definition.</p>\n<p>When you use <em>require()</em>, you will find parts in action that also can be seen in the two functions above:</p>\n<ul>\n<li>PHP has a counter similar to <em>$local</em> that ensures the classname is unique</li>\n<li>The code is re-evaluated (not _*<em>once()</em>) like in the <em>eval()</em>.</li>\n</ul>\n<p>You can also always very quickly check this with <em>get_class()</em> and inspecting the name, the number is part of the name at the very end after the dollar-sign ($):</p>\n<pre><code>var_dump(get_class_number(test_class_anon(1))); # int(3)\nvar_dump(get_class_number(test_class_anon(1))); # int(4)\nvar_dump(get_class_number(test_class_anon(1))); # int(5)\n\nfunction get_class_number(object $obj): ?int\n{\n $buffer = get_class($obj);\n [$n1, $n2] = explode(&quot;\\0&quot;, $buffer);\n return sscanf($n2, '%*[^$]$%d')[0] ?? null;\n}\n</code></pre>\n<p>When we compare this to a couple of hours ago: <em>(<a href="https://stackoverflow.com/a/79452592/367456">ref</a>)</em></p>\n<pre><code>string(42) &quot;class@anonymous /path/to/script.php:4$0&quot;\n</code></pre>\n<p>We can see that the number starts with zero.</p>\n"^^ . + . + . + . + . + "<p>My website runs with the following virtual host configuration:</p>\n<pre><code>&lt;IfModule mod_ssl.c&gt;\n&lt;VirtualHost *:443&gt;\n DocumentRoot /home/myuser/MyDomain/src\n ServerName MyDomain.com\n ServerAlias www.MyDomain.com\n ErrorLog /home/myuser/logs/apache/MyDomain-error_log\n CustomLog /home/myuser/logs/apache/MyDomain-access_log common\n DirectoryIndex index.php\n\n &lt;Directory /home/myuser/MyDomain/src&gt;\n Options -Indexes +FollowSymLinks\n AllowOverride None\n Require all granted\n AddOutputFilterByType DEFLATE text/html text/plain text/xml\n &lt;/Directory&gt;\n\n #LogLevel alert rewrite:trace6\n RewriteEngine on\n\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteCond %{REQUEST_FILENAME} !-f [OR]\n\n RewriteRule ^/api/media/(.*) /data/$1 [L]\n RewriteRule ^/api/v1/* /api/v1/index.php [L]\n RewriteRule ^/api/cdn/v1/* /api/cdn/v1/index.php [L]\n RewriteRule ^/assets/(.*) /website/v1/content/assets/$1 [L]\n RewriteRule ^/css/(.*) /website/v1/content/css/$1 [L]\n RewriteRule ^/js/(.*) /website/v1/content/js/$1 [L]\n RewriteRule ^/fonts/(.*) /website/v1/content/fonts/$1 [L]\n RewriteRule ^/\\.well-known/acme-challenge/(.*)$ /.well-known/acme-challenge/$1 [L]\n RewriteRule ^/* /website/v1/index.php [L]\n #sslstuff\n&lt;/VirtualHost&gt;\n&lt;/IfModule&gt;\n</code></pre>\n<p>I am migrating to Laravel and would like to deploy Laravel alongside live website on <code>/v2</code> path. Laravel app is in the <code>/website/v2/p2</code> folder, so I added another rewrite for all urls that start with <code>/v2</code>. This is my current conf file (I only added a single rewrite):</p>\n<pre><code>&lt;IfModule mod_ssl.c&gt;\n&lt;VirtualHost *:443&gt;\n DocumentRoot /home/myuser/MyDomain/src\n ServerName MyDomain.com\n ServerAlias www.MyDomain.com\n ErrorLog /home/myuser/logs/apache/MyDomain-error_log\n CustomLog /home/myuser/logs/apache/MyDomain-access_log common\n DirectoryIndex index.php\n\n &lt;Directory /home/myuser/MyDomain/src&gt;\n Options -Indexes +FollowSymLinks\n AllowOverride None\n Require all granted\n AddOutputFilterByType DEFLATE text/html text/plain text/xml\n &lt;/Directory&gt;\n\n #LogLevel alert rewrite:trace6\n RewriteEngine on\n\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteCond %{REQUEST_FILENAME} !-f [OR]\n\n RewriteRule ^/v2/(.*) /website/v2/p2/public/index.php [L] # this is new\n\n RewriteRule ^/api/media/(.*) /data/$1 [L]\n RewriteRule ^/api/v1/* /api/v1/index.php [L]\n RewriteRule ^/api/cdn/v1/* /api/cdn/v1/index.php [L]\n RewriteRule ^/assets/(.*) /website/v1/content/assets/$1 [L]\n RewriteRule ^/css/(.*) /website/v1/content/css/$1 [L]\n RewriteRule ^/js/(.*) /website/v1/content/js/$1 [L]\n RewriteRule ^/fonts/(.*) /website/v1/content/fonts/$1 [L]\n RewriteRule ^/\\.well-known/acme-challenge/(.*)$ /.well-known/acme-challenge/$1 [L]\n RewriteRule ^/* /website/v1/index.php [L]\n #sslstuff\n&lt;/VirtualHost&gt;\n&lt;/IfModule&gt;\n</code></pre>\n<p>Visiting <code>/v2/index.php</code> now works. Unfortunately visiting <code>/v2</code> alone returns 404. Defining a new route in <code>routes/web.php</code></p>\n<pre><code>Route::get('/newroute', function () {\n return &quot;It works, lol&quot;;\n});\n</code></pre>\n<p>and visiting it also returns 404 error.</p>\n<p>What is the correct way of deploying Laravel alongside live app?</p>\n<p>UPDATE:</p>\n<p>Rewrite log correctly resolves to Laravels <code>index.php</code> as shown here:</p>\n<pre><code>init rewrite engine with requested uri /v2\napplying pattern '^/v2(/.*)?$' to uri '/v2'\nRewriteCond: input='/v2' pattern='!-d' =&gt; matched\nRewriteCond: input='/v2' pattern='!-f' =&gt; matched\nrewrite '/v2' -&gt; '/website/v2/p2/public/index.php'\nsetting lastsub to rule with output /website/v2/p2/public/index.php\nlocal path result: /website/v2/p2/public/index.php\nprefixed with document_root to /home/myuser/MyDomain/src/website/v2/p2/public/index.php\ngo-ahead with /home/myuser/MyDomain/src/website/v2/p2/public/index.php [OK]\n</code></pre>\n<p>It seems that 404 issue stems from how Laravel is handling paths</p>\n"^^ . + "0"^^ . + "Another option is that your JS editor converts it. In this case you are either to disable this feature or decode on input, the former preferable."^^ . + . + "while-loop"^^ . + "1"^^ . + "model-view-controller"^^ . + "<p>I've a shopware storefront where customer can add products to their cart.</p>\n<p>I want to fetch the cart-content with an ajax-request with the api endpoint: /checkout/cart. In the header i sent:</p>\n<pre><code> { \n &quot;Accept&quot;: &quot;application/json&quot;\n &quot;sw-context-token&quot;: &quot;1234567890&quot;,\n &quot;sw-access-key&quot;: &quot;ENKJDSKFDNSJKFNEJ0815&quot; \n }\n</code></pre>\n<p>In my response-body stay the 'lineItems' still empty.</p>\n<pre><code>&quot;lineItems&quot;: [],\n \n</code></pre>\n<p>Maybe it depends on fetching the correct 'sw-context-token' first, but how ?\nBackground: i want to check, if the cart contains a product of a specified category.\nAny better/other solution is very welcome.</p>\n"^^ . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + "authentication issue with php script running composer with private repos"^^ . + "Thank you for your help! After further testing, I realized that WebP Express is actually working fine even without the <picture> tag. The plugin handles the conversion at the server level, so even though the HTML still shows .jpg, the browser is actually loading .webp files correctly.\n\nSince everything is working as expected, I don’t need to make any further changes. Thanks again for your time!"^^ . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + "1"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + "I don't understand the downvotes and close vote - the code shown is not a good idea, but it is a [mre], and the question can be answered based on it."^^ . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + . + . + "While the PHP _symlink()_ function might be disabled, some resources suggest that ln(1) is available via SSH. As this is a one-time setup for the initial deployment of the application, I'd suggest to try ln(1) as an alternative. Consult your servers documentation how to make use of it."^^ . + "1"^^ . + . + "Laravel project with apache localhost server, vite or php artisan serve - getting 404s in vite and artisan"^^ . + "4"^^ . + "2"^^ . + "1"^^ . + "1"^^ . + "2"^^ . + . + . + . + . + . + "<p>Is it possible to connect system.data.sqlite database using PHP?</p>\n"^^ . + "make sure you update the php.ini that apache is using, not the one used by cli. After that restart both php and apache"^^ . + "1"^^ . + . + . + "5"^^ . + "How to prevent blank parameters from being inserted into table"^^ . + "0"^^ . + . + . + . + "And by that I don't know if what I want to achieve is okay. What I meant was that the removal of method `getObjectForTrait` was motivated by the words: "Having to use getObjectForTrait() to test something is almost always a code smell: something is not quite right with the software design of the system-under-test.". I don't even know what I don't know."^^ . + . + . + . + . + "3"^^ . + "<p>First thing first, I need to get the DOMAIN login of my laptop. Once I login to the windows laptop, I can already catch the DOMAIN\\username.</p>\n<p>I can access my project url thru my browser but when I use different laptop different domain to check if other domain can access too, they were asked to input Windows user name and password which is not supposed to happen.</p>\n<p>My project is located in different server 192.168.1.122, I changed the url to <a href="http://employee.proj:8070/" rel="nofollow noreferrer">http://employee.proj:8070/</a>, to access this url from my laptop,</p>\n<p>I setup the Internet Options &gt; Security &gt; Local Intranet &gt; Sites &gt; Advanced and I added:</p>\n<p><a href="http://employee.proj:8070/" rel="nofollow noreferrer">http://employee.proj:8070/</a></p>\n<p>192.168.1.122</p>\n<p>Then I added it on my hosts. Windows &gt; System32 &gt; drivers &gt; etc &gt; hosts</p>\n<p>For the IIS settings</p>\n<p>Authentication &gt; Windows Authentication - enabled; Anonymous Authentication - disabled;</p>\n<p>Authentication &gt; Windows Authentication &gt; Providers - NTLM, Negotiate</p>\n<p>Authentication &gt; Windows Authentication &gt; Advanced Setting - Protection OFF, Kernel ENABLED;</p>\n<p>While my laravel web.config is</p>\n<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;configuration&gt;\n &lt;system.webServer&gt;\n &lt;security&gt;\n &lt;authentication&gt;\n &lt;anonymousAuthentication enabled=&quot;false&quot; /&gt;\n &lt;windowsAuthentication enabled=&quot;true&quot; /&gt;\n &lt;/authentication&gt;\n &lt;requestFiltering&gt;\n &lt;requestLimits maxQueryString=&quot;5000&quot; /&gt;\n &lt;verbs applyToWebDAV=&quot;false&quot;&gt;\n &lt;add verb=&quot;TRACE&quot; allowed=&quot;false&quot; /&gt;\n &lt;!-- &lt;add verb=&quot;OPTIONS&quot; allowed=&quot;false&quot; /&gt; --&gt;\n &lt;/verbs&gt;\n &lt;/requestFiltering&gt;\n &lt;/security&gt;\n &lt;httpProtocol&gt;\n &lt;customHeaders&gt;\n &lt;add name=&quot;Access-Control-Allow-Headers&quot; value=&quot;Origin, Content-Type, Authorization,X-Requested-With&quot; /&gt;\n &lt;add name=&quot;Access-Control-Allow-Methods&quot; value=&quot;GET&quot; /&gt;\n &lt;add name=&quot;X-Download-Options&quot; value=&quot;noopen&quot; /&gt;\n &lt;add name=&quot;X-Frame-Options&quot; value=&quot;DENY&quot; /&gt;\n &lt;!-- if you need to allow same origin, comment above line and uncomment below line --&gt;\n &lt;!-- &lt;add name=&quot;X-Frame-Options&quot; value=&quot;SAMEORIGIN&quot; /&gt; --&gt;\n &lt;add name=&quot;Strict-Transport-Security&quot; value=&quot;max-age=31536000; includeSubDomains&quot; /&gt;\n &lt;add name=&quot;X-XSS-Protection&quot; value=&quot;1; mode=block&quot; /&gt;\n &lt;add name=&quot;X-Content-Type-Options&quot; value=&quot;nosniff&quot; /&gt;\n &lt;add name=&quot;Referrer-Policy&quot; value=&quot;origin-when-cross-origin&quot; /&gt;\n &lt;remove name=&quot;X-Powered-By&quot; /&gt;\n &lt;/customHeaders&gt;\n &lt;/httpProtocol&gt;\n &lt;rewrite&gt;\n &lt;rules&gt;\n &lt;rule name=&quot;Imported Rule 1&quot; stopProcessing=&quot;true&quot;&gt;\n &lt;match url=&quot;^&quot; ignoreCase=&quot;false&quot; /&gt;\n &lt;conditions logicalGrouping=&quot;MatchAll&quot;&gt;\n &lt;!-- &lt;add input=&quot;{HTTP_AUTHORIZATION}&quot; ignoreCase=&quot;false&quot; /&gt; --&gt;\n &lt;add input=&quot;{REQUEST_FILENAME}&quot; matchType=&quot;IsDirectory&quot; ignoreCase=&quot;false&quot; negate=&quot;true&quot; /&gt;\n &lt;add input=&quot;{URL}&quot; pattern=&quot;(.+)/$&quot; ignoreCase=&quot;false&quot; /&gt;\n &lt;/conditions&gt;\n &lt;action type=&quot;Redirect&quot; url=&quot;{C:1}&quot; redirectType=&quot;Permanent&quot; /&gt;\n &lt;/rule&gt;\n &lt;rule name=&quot;Imported Rule 2&quot; stopProcessing=&quot;true&quot;&gt;\n &lt;match url=&quot;^&quot; ignoreCase=&quot;false&quot; /&gt;\n &lt;conditions logicalGrouping=&quot;MatchAll&quot;&gt;\n &lt;add input=&quot;{REQUEST_FILENAME}&quot; matchType=&quot;IsDirectory&quot; ignoreCase=&quot;false&quot; negate=&quot;true&quot; /&gt;\n &lt;add input=&quot;{REQUEST_FILENAME}&quot; matchType=&quot;IsFile&quot; ignoreCase=&quot;false&quot; negate=&quot;true&quot; /&gt;\n &lt;/conditions&gt;\n &lt;action type=&quot;Rewrite&quot; url=&quot;index.php&quot; /&gt;\n &lt;/rule&gt;\n &lt;/rules&gt;\n &lt;/rewrite&gt;\n &lt;defaultDocument&gt;\n &lt;files&gt;\n &lt;clear /&gt;\n &lt;add value=&quot;index.php&quot; /&gt;\n &lt;add value=&quot;Default.htm&quot; /&gt;\n &lt;add value=&quot;Default.asp&quot; /&gt;\n &lt;add value=&quot;index.htm&quot; /&gt;\n &lt;add value=&quot;index.html&quot; /&gt;\n &lt;add value=&quot;iisstart.htm&quot; /&gt;\n &lt;/files&gt;\n &lt;/defaultDocument&gt;\n &lt;/system.webServer&gt;\n&lt;/configuration&gt;\n</code></pre>\n<p>Is there any setup that I missed? I am very curious why other domain can't access my url without asking username password.</p>\n"^^ . + . + . + . + . + . + "<p>I've been experimenting (from the CLI) with the encryption examples at <a href="https://www.php.net/manual/en/function.openssl-encrypt.php" rel="nofollow noreferrer">https://www.php.net/manual/en/function.openssl-encrypt.php</a>\nand would like to know how to handle a larger file, such as a SQLite database file of a few GB. I was getting a memory allocation error before following <a href="https://www.php.net/manual/en/function.openssl-encrypt.php#120141" rel="nofollow noreferrer">this example</a> on that same PHP page.</p>\n<p>I was slow to catch on; but finally got it to work on a 3 GB SQLite database. I think it was that base64 is the default if set options=0 and I was trying to use the newest example provided for the simple case along with the old example for a large file that uses options of OPENSSL_RAW_DATA.</p>\n<p>My question is, Is this approach given in that eight-year-old post still the proper approach. Some of the examples give a before and after version 7.1.</p>\n<p>Is it okay to use the first 16 bytes of an encrypted block as the next initialization vector?</p>\n<p>Is the number of blocks per encryption/decryption important? Should one use the largest size that will fit in the maximum memory allocation or something else?</p>\n<pre><code>&lt;?php\n//$key should have been previously generated in a cryptographically safe way, like openssl_random_pseudo_bytes\n$key = &quot;abcd1234dcba4321&quot;;\n$cipher = &quot;aes-256-cbc&quot;;\n$feBlocks = 10000;\n$fpPlain = fopen(&quot;../Database/filename.db&quot;,'rb');\n$fpEncrypt = fopen(&quot;encrypted.enc&quot;, 'wb');\nif (in_array($cipher, openssl_get_cipher_methods()))\n{\n $ivlen = openssl_cipher_iv_length($cipher);\n $iv = openssl_random_pseudo_bytes($ivlen);\n // Put the initialzation vector to the beginning of the file\n fwrite($fpEncrypt, $iv);\n while (!feof($fpPlain)) {\n $plaintext = fread($fpPlain, $ivlen * $feBlocks);\n $ciphertext = openssl_encrypt($plaintext, $cipher, $key, $options=OPENSSL_RAW_DATA, $iv);\n // Use the first 16 bytes of the ciphertext as the next initialization vector\n $iv = substr($ciphertext, 0, $ivlen);\n fwrite($fpEncrypt, $ciphertext);\n }\n fclose($fpPlain);\n fclose($fpEncrypt);\n}\n\n $fpEncrypt = fopen(&quot;encrypted.enc&quot;, 'rb');\n $fpPlain = fopen(&quot;decrypted.db&quot;,'wb');\n $ivlen = openssl_cipher_iv_length($cipher);\n // Get the initialzation vector from the beginning of the file\n $iv = fread($fpEncrypt, $ivlen);\n while (!feof($fpEncrypt)) {\n // we have to read one block more for decrypting than for encrypting\n $ciphertext = fread($fpEncrypt, $ivlen * ($feBlocks+1));\n $plaintext = openssl_decrypt($ciphertext, $cipher, $key, $options=OPENSSL_RAW_DATA, $iv);\n // Use the first 16 bytes of the ciphertext as the next initialization vector\n $iv = substr($ciphertext, 0, $ivlen);\n fwrite($fpPlain, $plaintext);\n }\n fclose($fpEncrypt);\n fclose($fpPlain);\n</code></pre>\n"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + "3"^^ . + . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + "my route looks like this:\n```Route::get('/counter', function () {\n return view('stepcounter');\n});\n```\nwhen i use `{{$slot}}` instead of `<livewire:stepcounter></livewire:stepcounter>` (if i understood your answer right) -> I get this error ` Undefined variable $slot `"^^ . + "uggg. That sounds very unpleasant :(. Perhaps there is some linux CLI program I could just run (and capture the output) from PHP instead?"^^ . + . + "2"^^ . + "3"^^ . + . + "0"^^ . + "It should be like this: https://dbfiddle.uk/oKDut6VE"^^ . + "If that's possible, it will be a serious security threat"^^ . + . + . + "0"^^ . + . + . + "1"^^ . + "2"^^ . + . + . + . + "yes, tested using $100 as the purchase price on a product price of $200, margin = $100. Tax = 420 but should be $10 because tax is 10% of the margin NOT 10% of the product price."^^ . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + . + "npm"^^ . + . + . + . + . + . + . + "2"^^ . + . + . + "0"^^ . + . + . + "Your example also doesn't make much sense - `dd($user->forForm($form)->permissions);` and `dd($user->forForm($form)->roles);` both call exactly the same `forForm` method, which anyway you've written out in both traits with identical code. You can separate out `$test = $user->forForm($form);` and then `dd($test->permissions)` and `dd($test->roles)`, PHP isn't going to go back and choose a different value for `$test` based on what you do with it."^^ . + "0"^^ . + . + . + "phpbb3"^^ . + . + . + "Finally we get to the real point of your question. Before your last two comments you simply had not mentioned password protection at all, and nobody had any reason to suspect you needed anything more than just how to connect to a SQLite database in PHP. Please edit your question to make it clear you are dealing with a SQLite database that has been encrypted by `System.Data.SQLite`."^^ . + "<p>First things first, there are many ressources online that helps with learning math in PHP and i would recommend you look through <a href="https://www.w3schools.com/php/php_ref_math.asp" rel="nofollow noreferrer">w3schools math functions</a> as each comes with math examples.</p>\n<p>For your specific problem, I think you are over complicating this for yourself.<br />\nEssentially you can boil the math down to a coefficient using regular arithmetic so <code> x + 0.25x + 0.05(0.25x)</code> becomes <code>1 + 0.25 + (0.05 * 0.25)</code> (about 1.2625).</p>\n<p>Then you just divide the incoming value by the coefficient to get X.<br />\nSee rough code example below:</p>\n<pre><code>function FindXOfN(int|float $N): int|float\n{\n // Base formular: Total Invoice Amount ($N) = $X amount + 25 percent of $X + 5 percent of (25 percent of $X)\n // Derive coefficient based on above formular\n $coefficient = 1 + 0.25 + (0.05 * 0.25);\n\n // Calculate X\n $X = $N / $coefficient;\n\n // Return the result, rounded to 2 decimal places\n return round($X, 2);\n}\n\n// Test\necho FindXOfN(5600);\n</code></pre>\n"^^ . + "1"^^ . + . + "Have you inspected the content of `$commandOutput` ? does `shell_exec(...)` include `stderr` in the returned output, or is `stderr` thrown away ?"^^ . + "`serverSide : true`: When you use [server-side processing](https://datatables.net/manual/server-side), client-side searching **is not used** so `search: { ... }` is ignored. That is the point of server-side processing (for searching, sorting and pagination)."^^ . + . + "symfony-http-client"^^ . + "This [question](https://stackoverflow.com/q/8309731/231316) is similar, however the accepted answer doesn't appear to be working for me. They also recommend a more complex class-based one but I did not give that a try."^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + "2"^^ . + "0"^^ . + . + . + . + "@Denny. Try whitelisting the [Telegram IP address](https://core.telegram.org/bots/webhooks#the-short-version)."^^ . + . + . + . + "otel"^^ . + . + "1"^^ . + "redhat"^^ . + "<p>I would like to validate the following json in CI4:</p>\n<pre><code>{\n &quot;field1&quot;: &quot;some value&quot;,\n &quot;array1&quot;: {\n &quot;2876&quot;: &quot;4358&quot;,\n &quot;9904&quot;: &quot;17&quot;\n }\n}\n</code></pre>\n<p>Array 1 can reasonably contain up to 50 key value pairs.</p>\n<p>I have validation rules for both the keys and values in array1, for the purposes of this question lets require them both to be numeric.</p>\n<p>The code I have so far is:</p>\n<pre><code> $validation = \\Config\\Services::validation();\n\n $validation-&gt;setRules([\n 'field1' =&gt; 'required|max_length[20]',\n 'array1.*' =&gt; 'required|numeric',\n ]);\n\n if (! $validation-&gt;withRequest($this-&gt;request)-&gt;run()) {\n return $this-&gt;failValidationErrors($validation-&gt;getErrors());\n }\n</code></pre>\n<p>Alternatively based on an answer I've seen elsewhere:</p>\n<pre><code> $validation = \\Config\\Services::validation();\n\n $validation-&gt;setRules([\n 'field1' =&gt; 'required|max_length[20]'\n ]);\n\n $to_validate = $this-&gt;request-&gt;getPost();\n foreach ($to_validate['array1'] as $key =&gt; $value) {\n $validation-&gt;setRule('array1.' . $key , null, 'required|numeric');\n }\n\n if (! $validation-&gt;withRequest($this-&gt;request)-&gt;run()) {\n return $this-&gt;failValidationErrors($validation-&gt;getErrors());\n }\n</code></pre>\n<p>This code successfully rejects a value of &quot;abcd&quot; but how do I reject a string key?</p>\n<p>I could pre-process by putting the keys into their own array which can be validated with an array2.* rule but this seems like a simple use case which should work out of the box.</p>\n<p>Also how should I implement the array size limit check?</p>\n"^^ . + . + . + "Thanks for your answer. I have changed it from static to const.\nJit was already enabled."^^ . + . + . + . + . + . + . + . + "Thank you for your reply, when I remove the word "exit", then the error "Oh No. The info has not been found. Please try again." does not show and still have the same issue where the footer and supporting links do not show. Yes, I am aware that the code is vulnerable, but not used on a public setting."^^ . + "By the way, you should obviously remove all `$md2 = is_null($mood_2) ? NULL : $mood_2;` stuff which, honestly, makes no sense at all."^^ . + "1"^^ . + . + . + "1"^^ . + . + . + . + . + . + "<p>You should execute <code>id -u</code> or <code>whoami</code> command to inspect the current user. <code>$USER</code> is an environment variable which is initialized by the <code>login</code> command (see <a href="https://unix.stackexchange.com/questions/76354/who-sets-user-and-username-environment-variables">Who sets $USER and $USERNAME environment variables?</a>). <code>setuid</code> or <code>seteuid</code> only changes the uid of the process.</p>\n"^^ . + . + "0"^^ . + . + "I'm not sure it's the final answer but I read an old support post about the codeChallenge not being encoded correctly in the docs. A poster added that they used https://example-app.com/pkce to manually create the verifier and challenge so I tried that in place of the generated version and got a result"^^ . + . + . + . + . + "@admcfajn the block themes are not completely usable yet then old style themes are still useful."^^ . + "0"^^ . + "First thing is to never have such output intermingled with your response. Then, fix the code causing the warnings. You can for a package and apply patches, too, and then file merge requests. Open Source after all lives from contributors!"^^ . + . + . + . + . + "google-cloud-speech"^^ . + "How to detect if Edge is running on a mobile device?"^^ . + "-1"^^ . + . + "0"^^ . + . + . + "2"^^ . + . + . + . + "0"^^ . + "0"^^ . + "<p>I have created the command <code>php artisan make:command expiration</code> in Laravel 11 and I want to activate the file as it was in previous versions of Laravel.</p>\n<p>Initially the <code>command</code> file was activated by adding it inside the kernel file, but the kernel file is not present in newer versions of Laravel. How do I activate the <code>command</code> file and specify a period to run it as it was in previous versions of Laravel?</p>\n<p>The <code>command</code> file I created:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nnamespace App\\Console\\Commands;\n\nuse App\\Models\\User;\nuse Illuminate\\Console\\Command;\n\nclass expiration extends Command\n{\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected $signature = 'user:expiration';\n\n /**\n * The console command description.\n *\n * @var string\n */\n protected $description = 'expir user every 5 minute automatically';\n\n /**\n * Execute the console command.\n */\n public function handle()\n {\n $users_expir = User::where('expiration',0)\n -&gt;update('expiration',1);\n \n \n }\n}\n</code></pre>\n"^^ . + . + "Trying to limit access to wp-admin by IP address, nginx downloads file"^^ . + . + "0"^^ . + . + "Svg icons displaying in upload section but not working in preview and front"^^ . + . + "1"^^ . + . + "1"^^ . + "0"^^ . + . + "1"^^ . + . + . + "<p>I suspect the issue is when you call <code>$request-&gt;user()-&gt;fill($request-&gt;validated());</code> before handle the avatar file, it will overwrite the user's existing <code>avatar</code> attribute.</p>\n<p>Try this</p>\n<pre><code>public function update(ProfileUpdateRequest $request): RedirectResponse\n{\n # Capture the current avatar filename\n $oldAvatar = $request-&gt;user()-&gt;avatar;\n\n # Update user attributes except the avatar file\n $request-&gt;user()-&gt;fill($request-&gt;validated());\n\n # ...\n\n if ($request-&gt;hasFile('avatar')) {\n # Delete the old avatar using the stored filename\n Storage::disk('public')-&gt;delete('avatars/' . $oldAvatar);\n \n # ...\n }\n\n $request-&gt;user()-&gt;save();\n\n return Redirect::route('profile.edit');\n}\n</code></pre>\n"^^ . + . + . + "3"^^ . + "0"^^ . + . + . + . + . + . + "4"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + "What exactly are you searching for, and what is the replacement?"^^ . + "0"^^ . + . + . + "0"^^ . + . + "<p>Okay, I'm working on a social network with Laravel, and it turns out that from one moment to the next it sends me the error:</p>\n<p>&quot;Attempt to read property &quot;user&quot; on null&quot;</p>\n<p>Marking specifically the following line:</p>\n<p><code>@if ($image-&gt;user-&gt;image)</code></p>\n<p>This being in the following file:</p>\n<p>`</p>\n<pre><code>@if ($image-&gt;user-&gt;image)\n &lt;div class=&quot;container-avatar&quot;&gt;\n &lt;img src=&quot;{{ route('user.avatar', ['filename' =&gt; $image-&gt;user-&gt;image]) }}&quot; class=&quot;avatar&quot;&gt;\n &lt;/div&gt;\n@endif\n&lt;div class=&quot;data-user&quot;&gt;\n &lt;a href=&quot;&quot;&gt;\n {{ $image-&gt;user-&gt;name . ' ' . $image-&gt;user-&gt;surname }}\n &lt;span class=&quot;nickname&quot;&gt;\n {{ ' | @' . $image-&gt;user-&gt;nick }}\n &lt;/span&gt;\n &lt;/a&gt;\n&lt;/div&gt;\n&lt;div class=&quot;image-container&quot;&gt;\n &lt;img src=&quot;{{ route('image.file', ['filename' =&gt; $image-&gt;image_path]) }}&quot;&gt;\n&lt;/div&gt;\n\n&lt;div class=&quot;description&quot;&gt;\n &lt;span class=&quot;nickname&quot;&gt;{{ '@' . $image-&gt;user-&gt;nick }}&lt;/span&gt;\n &lt;span class=&quot;nickname date&quot;&gt;{{ ' | ' . FormatTime::LongTimeFilter($image-&gt;created_at) }}&lt;/span&gt;\n &lt;p&gt;{{ $image-&gt;description }}&lt;/p&gt;\n&lt;/div&gt;\n\n&lt;div class=&quot;likes&quot;&gt;\n &lt;?php\n $user_like = false; ?&gt;\n @foreach ($image-&gt;likes as $like)\n @if ($like-&gt;user_id == Auth::user()-&gt;id)\n &lt;?php $user_like = true; ?&gt;\n @endif\n @endforeach\n @if ($user_like)\n &lt;img src=&quot;{{ asset('img/heart-red.png') }}&quot; data-id=&quot;{{ $image-&gt;id }}&quot; class=&quot;btn-dislike&quot;&gt;\n @else\n &lt;img src=&quot;{{ asset('img/heart-black.png') }}&quot; data-id=&quot;{{ $image-&gt;id }}&quot; class=&quot;btn-like&quot;&gt;\n @endif\n &lt;span class=&quot;number_likes&quot;&gt;{{ count($image-&gt;likes) }}&lt;/span&gt;\n&lt;/div&gt;\n</code></pre>\n`\n<p>And I don't understand why it happens, if a couple of minutes ago it was working correctly, in the database the user_id id can't be null, and the other data has an associated id</p>\n<p>Fix the error so I can continue moving forward with my project</p>\n"^^ . + . + . + "Search a PHP array for number of characters"^^ . + . + . + . + . + "<p>I'm trying to modify the password reset URL, but adding the change described in the Laravel docs does not work. The URL stays the same in the email. Is there anything else I need to do?</p>\n<p><a href="https://laravel.com/docs/11.x/passwords#reset-link-customization" rel="nofollow noreferrer">https://laravel.com/docs/11.x/passwords#reset-link-customization</a></p>\n<pre><code> /**\n * Bootstrap any application services.\n *\n * @return void\n */\npublic function boot()\n{\n ResetPassword::createUrlUsing(function (User $user, string $token) {\n return config('app.frontend_url').'auth/reset-password?token='.$token.'&amp;email='.$user-&gt;email;\n });\n}\n</code></pre>\n"^^ . + "Combine row number in a multi-dimensional array and value from subordinate array into a new array faster than with a loop"^^ . + . + "2"^^ . + "It may require adjusting buffer settings in Nginx to handle large responses:\n\n` server {`\n` client_max_body_size 10G;` \n` # Increase buffer sizes` \n` client_body_buffer_size 10M;` \n` proxy_buffer_size 16k;` \n` proxy_buffers 4 16k;` \n` proxy_busy_buffers_size 32k;` \n` sendfile on;` \n`}` \n\nAND Have you also restarted nginx and fpm?\n\n ` sudo service php8.3-fpm restart `\n ` sudo service nginx restart `"^^ . + . + . + . + . + "0"^^ . + . + "You will need to check the log on the server to see why it's getting an error."^^ . + "sh"^^ . + "1"^^ . + . + . + . + . + "@krisgjika Probably all. I didn't try all of them but I did try some of them"^^ . + . + . + "at the minute its insert $dir/$job_id/counter.webp I want to stop it adding $dir/ but cant seem to work out how to do it thanks"^^ . + "laravel-reverb"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "I agree with @ADyson here. Can you provide more information to what you are actually trying to achieve to the question - give us more context to the actual thing you want the end user to do? That might help us answer the question a bit better."^^ . + . + . + . + . + "ios"^^ . + "0"^^ . + . + "Is your Excel 32-bit too?"^^ . + . + . + "1"^^ . + . + . + . + "-4"^^ . + . + . + "0"^^ . + . + "-2"^^ . + . + . + "laravel-request"^^ . + . + . + . + "2"^^ . + "Your first step is to debug your code and figure out why it’s not working. [How to debug JS](https://developer.chrome.com/docs/devtools/javascript)"^^ . + . + . + . + . + "<p>Livewire assets are not included by default when using <code>&lt;livewire:stepcounter&gt;&lt;/livewire:stepcounter&gt;</code> to fix this use\n(@livewireStyles and @livewireScripts)</p>\n<pre><code>&lt;head&gt;\n &lt;meta charset=&quot;UTF-8&quot; /&gt;\n &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;\n &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js&quot;&gt;&lt;/script&gt;\n &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css&quot; /&gt;\n @vite(['resources/js/app.js','resources/css/app.css'])\n @livewireStyles\n&lt;/head&gt;\n\n&lt;body&gt;\n@livewireScripts\n &lt;livewire:stepcounter&gt;&lt;/livewire:stepcounter&gt;\n&lt;/body&gt;\n</code></pre>\n<p><a href="https://i.sstatic.net/p8kU35fg.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/p8kU35fg.png" alt="enter image description here" /></a></p>\n"^^ . + . + "This is not a well-asked question in 2025. We have no [mcve] and a poorly expressed set of expectations. I'm very comfortable with regex questions, but have no idea what `0-multiple dots` means."^^ . + . + "@PaulWilliams: I'd suggest you answer your own question before it is getting closed with the reason for a typo, so that it at least has a correct answer even if the format remains limited. The close reason then would reflect that, albeit I think it's good after you invested so much (and others) in the question to keep it documented _what_ the actual outcome was in the sites Q&A format."^^ . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + "<p>In <strong>Laravel 11</strong>, exception handling with custom classes registration has changed. To use your custom handler:</p>\n<ol>\n<li><strong>Create your custom handler:</strong></li>\n</ol>\n<pre><code>namespace App\\Exceptions;\n\nuse Illuminate\\Foundation\\Exceptions\\Handler as ExceptionHandler;\nuse Throwable;\n\nclass CustomHandler extends ExceptionHandler\n{\n public function render($request, Throwable $e)\n {\n // Custom logic\n return response()-&gt;json(['error' =&gt; $e-&gt;getMessage()], 500);\n }\n}\n</code></pre>\n<ol start="2">\n<li><strong>Register it in <code>bootstrap/app.php</code>:</strong></li>\n</ol>\n<pre><code>$app-&gt;singleton( Illuminate\\Contracts\\Debug\\ExceptionHandler::class, App\\Exceptions\\CustomHandler::class );\n</code></pre>\n<p>You can inject external classes into <code>CustomHandler</code> for additional processing.</p>\n<hr />\n<p><strong>More details:</strong></p>\n<ul>\n<li><p><a href="https://laravel.com/docs/11.x/releases#laravel-11" rel="nofollow noreferrer">Laravel 11 - Application Configuration</a></p>\n</li>\n<li><p><a href="https://laravel.com/docs/11.x/errors" rel="nofollow noreferrer">Laravel Exception Handling</a></p>\n</li>\n</ul>\n<hr />\n"^^ . + "1"^^ . + . + . + "0"^^ . + "2"^^ . + "0"^^ . + "1"^^ . + . + "0"^^ . + "Are you suggesting that I use html_entity_decode? Because you then write it would be a double job. How is it a double job?"^^ . + . + "<p>I've got various instances of code, building options for a dropdown dynamically with a preceding empty field:</p>\n<pre class="lang-php prettyprint-override"><code> return State::all()\n -&gt;map(fn (State $state) =&gt; (object) [\n 'value' =&gt; $state-&gt;id,\n 'label' =&gt; $state-&gt;name,\n ])\n -&gt;sortBy('label')\n -&gt;prepend((object) [\n 'value' =&gt; null,\n 'label' =&gt; '',\n ])\n ;\n</code></pre>\n<p>And it consistently results in this PHPStan error:</p>\n<pre><code>Parameter #1 $value of method\n Illuminate\\Support\\Collection&lt;int,object{\n value: int, label: string}&amp;stdClass&gt;::prepend()\n expects \n object{value: int, label: string}&amp;stdClass,\n object{value: null, label: string}&amp;stdClass given. \n Property ($value) type int does not accept type null.\n</code></pre>\n<p>I assume that PHPStan is analyzing it this way, because an int is assigned to that property in the stdClass first that subsequently only integers are considered valid values.</p>\n<p>What would be the appropriate way to remedy this? I know it's possible to declare object shapes but I'm unsure of how to apply that in this situation.</p>\n<ul>\n<li>Laravel v10.48.8</li>\n<li>Larastan v2.9.5</li>\n<li>PHPStan v1.10.67</li>\n</ul>\n<p><strong>Additional Findings:</strong></p>\n<ol>\n<li>I've found this isn't limited to objects; PHPStan is making the same shape assumption when dealing with arrays.</li>\n<li>Using a function instead of an anonymous function (per @shingo's attempts) sidesteps the problem but doesn't even require a doctype to define the shape; it's as though PHPStan just doesn't care to assume the shape when returned from a real function.</li>\n<li>Again per @shingo's attempts, setting <code>@property ?int $id</code> on the <code>State</code> class does indeed solve the problem but why would PHPStan be assuming <code>$id</code>, which is a magic property, is an <code>int</code> to begin with? (and the powers-that-be discourage excess doctypes on our Model classes so I'd prefer a solution closer to my business logic)</li>\n</ol>\n"^^ . + . + . + "Can you explain what "the image cannot be saved perfectly" means?"^^ . + "<p>Sorry if this is a repeat, I've search all over and just can't find the magic code I need to get this working (and I've tried just about everything I can find).</p>\n<p>I'm trying to get array items out of a json_decode string in PHP, and I just can't find what it wants.\nI've tried the json_decode as an array (option true) and object (option false) - but keep running in the same circle.</p>\n<p>Here's what I get (usint print_r of the variable):</p>\n<pre><code>Array\n(\n [response] =&gt; Array\n (\n [cErrorMessage] =&gt; \n [tProd_avl] =&gt; Array\n (\n [t-prod_avl] =&gt; Array\n (\n [0] =&gt; Array\n (\n [prod] =&gt; WP-341241\n [descrip1] =&gt; BELT\n [descrip2] =&gt; NON-WISE O\n [whse] =&gt; BAK\n [netAvail] =&gt; 112\n )\n\n [1] =&gt; Array\n (\n [prod] =&gt; WP-341241\n [descrip1] =&gt; BELT\n [descrip2] =&gt; NON-WISE O\n [whse] =&gt; CC\n [netAvail] =&gt; 0\n )\n\n [2] =&gt; Array\n (\n [prod] =&gt; WP-341241\n [descrip1] =&gt; BELT\n [descrip2] =&gt; NON-WISE O\n [whse] =&gt; COL\n [netAvail] =&gt; 76\n )\n</code></pre>\n<p>It's stores in a variable called $xx.\nI've tried to get an array count, any item from the array - anything.\nCan someone please let me know how to pull any of this out in a foreach loop.\nI tried something like this, but it didn't work either....</p>\n<pre><code>foreach($xx-&gt;response-&gt;tProd_avl-&gt;t-prod_avl as $key =&gt; $value) {\n echo &quot;The value of key '$key' is '$value'&quot;, PHP_EOL;\n}\n</code></pre>\n<p>Thanks</p>\n"^^ . + . + "@Luuk Okay, thank you. I like this. Now I need to figure out how to benchmark mySQL versus PHP..."^^ . + . + "0"^^ . + "System.data.sqlite is a special kind of sqlite database and I just want to know if there is any possible way available in php to connect this database. I know that .Net has the ability to connect with this sqlite database. @LukeWoodward you should know about system.data.sqlite and then comment on my question."^^ . + . + . + "laravel-cashier"^^ . + "Yeah, I didn't see anything related to this specific use though."^^ . + . + . + . + . + "localization"^^ . + . + . + . + . + . + . + "0"^^ . + "Also, by way of a question edit, show the permission error you get. Is this an Apache error that you can see in `http://localhost:port`?"^^ . + "0"^^ . + . + "2"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + . + "group"^^ . + "0"^^ . + . + "3"^^ . + "<p>I have a <code>dynamic form fields</code> logic in my Livewire 3 class:</p>\n<p><strong>public properties:</strong></p>\n<pre><code>public $steps = [\n ['image' =&gt; null, 'text' =&gt; null],\n];\n\npublic $step = ['image' =&gt; null, 'text' =&gt; null];\n</code></pre>\n<hr />\n<p><strong>Add/Remove step logic:</strong></p>\n<pre><code>public function removeStep($index): void\n{\n unset($this-&gt;steps[$index]);// unset step\n $this-&gt;steps = array_values($this-&gt;steps); // reshuffle indexes after deleting\n}\n\npublic function addStep(): void\n{\n $this-&gt;steps[] = $this-&gt;step;\n}\n</code></pre>\n<hr />\n<p>After adding all the necessary steps, they should be saved in the <code>guide_steps</code> table:</p>\n<p><strong>guide_steps:</strong></p>\n<pre><code>Schema::create('guide_steps', function (Blueprint $table) {\n $table-&gt;id();\n $table-&gt;foreignId('recipe_id')-&gt;constrained()-&gt;cascadeOnDelete();\n $table-&gt;integer('step_number');\n $table-&gt;text('step_text');\n $table-&gt;string('step_image')-&gt;default('recipes-images/default/default_photo.png');\n $table-&gt;timestamps();\n\n $table-&gt;unique(['recipe_id', 'step_number']); // required for upsert()\n});\n</code></pre>\n<hr />\n<p>Here is my approach for upserting new and updated steps, as well as removing steps that no longer exist in the new request:</p>\n<p><strong>upsertGroupedSteps:</strong></p>\n<pre><code>public function upsertGroupedSteps($recipeId): void\n {\n $groupedSteps = collect($this-&gt;steps)-&gt;map(function ($step, $index) use ($recipeId){\n return [\n 'recipe_id' =&gt; $recipeId,\n 'step_number' =&gt; $index + 1,\n 'step_text' =&gt; trim($step['text']),\n 'step_image' =&gt; $step['image']\n ? $step['image']-&gt;store('guides-images', 'public')\n : 'recipes-images/default/default_photo.png',\n 'created_at' =&gt; now(),\n 'updated_at' =&gt; now(),\n ];\n })-&gt;toArray();\n\n // if recipeId != 0 it means we are updating existing steps\n if ($this-&gt;recipeId != 0){\n $newStepsNumbers = collect($groupedSteps)-&gt;pluck('step_number')-&gt;toArray();\n\n GuideStep::where('recipe_id', $recipeId)\n -&gt;whereNotIn('step_number', $newStepsNumbers)\n -&gt;delete();\n }\n\n GuideStep::upsert(\n $groupedSteps, ['recipe_id', 'step_number'], ['step_text', 'step_image']\n );\n }\n</code></pre>\n<hr />\n<p>Let’s say there are three steps with <code>id</code> 1, 2, and 3 in the guide_steps table. When I delete the step with <code>id</code> 2, logically, steps with <code>id</code> 1 and 3 should remain. However, the step with <code>id</code> 3 gets deleted, and its data is overwritten into the step with <code>id</code> 2. I didn’t expect this behavior and am not sure if it’s correct.</p>\n<p><strong>Here's what's happening:</strong></p>\n<ul>\n<li>There were three steps numbered 1, 2, and 3.</li>\n<li>I am removing step 2 using <code>unset($this-&gt;steps[$index])</code>, and then\n<code>array_values()</code>, which re-indexes the array.</li>\n<li>As a result, step 3 becomes the second element of the array.</li>\n<li>When I am calling <code>upsertGroupedSteps()</code>, the <code>step_number</code> now goes from 1 to N again (without gaps).</li>\n<li>The query <code>whereNotIn('step_number',$newStepsNumbers)-&gt;delete()</code> deletes all steps whose <code>step_number</code>doesn't match.</li>\n<li>Consequently, only the first and the new second steps remain in the table, and the third step is lost.</li>\n</ul>\n"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + "for your options : downlgrade PHP , not recommended as this will not be a long term logic solution. ... for Astra DB, quite challenging as we need to use our VPS. then only option will be using another data access layer. So, what do you recommend in term of performance , to handle 100k concurrent connections ? .. Thanks..."^^ . + "Composer is not install in Windows 11 and PHP 8.2.12"^^ . + "0"^^ . + . + . + . + . + "openssh"^^ . + . + "<p>I’m working on a PHP project where I’m using PHP-DI for dependency injection, but I’m struggling to configure a hierarchical structure of classes cleanly and scalably. I have interfaces like <code>ParentLoader</code> and <code>ChildLoader</code>, with concrete implementations for different types: XML (e.g., <code>XmlParentLoader</code>, <code>XmlChildLoader</code>) that depend on a <code>DOMDocument</code>, and SQL (e.g., <code>SqlParentLoader</code>, <code>SqlChildLoader</code>) that depend on a <code>PDO</code>. These loaders are hierarchical (<code>ParentLoader</code> depends on <code>ChildLoader</code>), and I need to inject them conditionally based on a configuration (e.g., <code>&quot;type&quot; =&gt; &quot;xml&quot;</code> or <code>&quot;type&quot; =&gt; &quot;sql&quot;</code> from a settings file) into a service that uses two <code>ParentLoader</code> instances.</p>\n<p>Here’s a simplified example of my classes:</p>\n<pre class="lang-php prettyprint-override"><code>interface ParentLoader\n{\n public function load(): array; // Just an example\n}\n\ninterface ChildLoader\n{\n public function load(): array; // Just an example\n}\n\nclass XmlParentLoader implements ParentLoader\n{\n public function __construct(private XmlChildLoader $childs, private DOMDocument $source)\n {\n }\n\n public function load(): array\n {\n // Logic using $source and $childs\n return [];\n }\n}\n\nclass XmlChildLoader implements ChildLoader\n{\n public function __construct(private DOMDocument $source)\n {\n }\n\n public function load(): array\n {\n // Logic using $source\n return [];\n }\n}\n\nclass SqlParentLoader implements ParentLoader\n{\n public function __construct(private SqlChildLoader $childs, private PDO $source)\n {\n }\n\n public function load(): array\n {\n // Logic using $source and $childs\n return [];\n }\n}\n\nclass SqlChildLoader implements ChildLoader\n{\n public function __construct(private PDO $source)\n {\n }\n\n public function load(): array\n {\n // Logic using $source\n return [];\n }\n}\n\nclass MyService\n{\n public function __construct(\n private ParentLoader $model, // Based on &quot;model&quot; from settings\n private ParentLoader $target // Based on &quot;target&quot; from settings\n ) {\n }\n\n public function execute(): array\n {\n $dataModel = $this-&gt;model-&gt;load();\n $dataTarget = $this-&gt;target-&gt;load();\n // Combine or process data\n return array_merge($dataModel, $dataTarget);\n }\n}\n</code></pre>\n<p>I’m using PHP-DI to conditionally inject these dependencies based on a configuration. For example, if the config specifies <code>&quot;model&quot; =&gt; [&quot;type&quot; =&gt; &quot;xml&quot;]</code>, <code>$model</code> should use <code>XmlParentLoader</code> and <code>XmlChildLoader</code> with a <code>DOMDocument</code>; if <code>&quot;target&quot; =&gt; [&quot;type&quot; =&gt; &quot;sql&quot;]</code>, <code>$target</code> should use <code>SqlParentLoader</code> and <code>SqlChildLoader</code> with a <code>PDO</code>. Here’s what I tried in my <code>ContainerBuilder</code>:</p>\n<pre class="lang-php prettyprint-override"><code>use DI\\ContainerBuilder;\nuse Psr\\Container\\ContainerInterface;\n\n$builder = new ContainerBuilder();\n$builder-&gt;addDefinitions([\n 'xml.source' =&gt; function () {\n $dom = new DOMDocument();\n $dom-&gt;load('some/path.xml'); // Simplified for example\n return $dom;\n },\n 'sql.source' =&gt; function () {\n return new PDO('mysql:host=localhost;dbname=test', 'user', 'pass'); // Simplified\n },\n 'parent.model' =&gt; function (ContainerInterface $container) {\n $settings = $container-&gt;get('settings'); // Assume settings has &quot;model&quot; and &quot;target&quot;\n $type = $settings['model']['type'];\n if ($type === 'xml') {\n return $container-&gt;get('xml.parent.loader.model');\n } elseif ($type === 'sql') {\n return $container-&gt;get('sql.parent.loader.model');\n }\n throw new \\Exception('Invalid type in model configuration');\n },\n 'parent.target' =&gt; function (ContainerInterface $container) {\n $settings = $container-&gt;get('settings');\n $type = $settings['target']['type'];\n if ($type === 'xml') {\n return $container-&gt;get('xml.parent.loader.target');\n } elseif ($type === 'sql') {\n return $container-&gt;get('sql.parent.loader.target');\n }\n throw new \\Exception('Invalid type in target configuration');\n },\n 'xml.parent.loader.model' =&gt; \\DI\\create(XmlParentLoader::class)\n -&gt;constructor(\\DI\\get('xml.child.loader.model'), \\DI\\get('xml.source')),\n 'xml.child.loader.model' =&gt; \\DI\\create(XmlChildLoader::class)\n -&gt;constructor(\\DI\\get('xml.source')),\n 'sql.parent.loader.model' =&gt; \\DI\\create(SqlParentLoader::class)\n -&gt;constructor(\\DI\\get('sql.child.loader.model'), \\DI\\get('sql.source')),\n 'sql.child.loader.model' =&gt; \\DI\\create(SqlChildLoader::class)\n -&gt;constructor(\\DI\\get('sql.source')),\n 'xml.parent.loader.target' =&gt; \\DI\\create(XmlParentLoader::class)\n -&gt;constructor(\\DI\\get('xml.child.loader.target'), \\DI\\get('xml.source')),\n 'xml.child.loader.target' =&gt; \\DI\\create(XmlChildLoader::class)\n -&gt;constructor(\\DI\\get('xml.source')),\n 'sql.parent.loader.target' =&gt; \\DI\\create(SqlParentLoader::class)\n -&gt;constructor(\\DI\\get('sql.child.loader.target'), \\DI\\get('sql.source')),\n 'sql.child.loader.target' =&gt; \\DI\\create(SqlChildLoader::class)\n -&gt;constructor(\\DI\\get('sql.source')),\n MyService::class =&gt; \\DI\\create()\n -&gt;constructor(\\DI\\get('parent.model'), \\DI\\get('parent.target'));\n]);\n</code></pre>\n<p>This works, but it’s a mess. I have to manually define every loader in the hierarchy (e.g., <code>xml.parent.loader.model</code>, <code>xml.child.loader.model</code>, etc.) and their dependencies (<code>DOMDocument</code> or <code>PDO</code>) for each source (<code>model</code> and <code>target</code>). It gets worse when the hierarchy grows (e.g., adding a <code>GrandChildLoader</code>). My goal is a solution where I don’t need to manually define every loader and its dependencies in the DI container for each source and type combination, making use of autowire for example, which currently I can't because of the &quot;conditional injection&quot;. If wasn't for the &quot;source&quot; parameter, I would be able to use autowire, but I need the source.</p>\n<p>Is there a better way to structure this with or without PHP-DI? Maybe a factory pattern or some trick to avoid these repetitive definitions? I’d love to leverage autowiring more, but the specific sources (<code>DOMDocument</code> and <code>PDO</code>) make it tricky. Any ideas would be awesome!</p>\n<p>Thanks!</p>\n"^^ . + "4"^^ . + "1"^^ . + "0"^^ . + . + . + "Now can you see the absurdity of your proposal? What possible harm can it do to have others' code in your app? It's there to _help_ you get things done faster and leave you time to work on the unique features that make what you're doing useful beyond what already exists. If you think you can make a _better_ push notification library then by all means, go for it and try to improve it, but your goal seems to be only to re-write what's already possible, due to a self-imposed, arbitrary and ultimately futile policy."^^ . + "2"^^ . + . + . + . + . + . + "```namespace App\\Http\\Controllers;```"^^ . + "_"I'm just getting a database connection failed issue, and then a dump of my php code."_ - sounds to me as if this wasn't interpreted as PHP at all. The fact that you are getting `Database connection failed2', 'details' => $e->getMessage() ]); exit; } // Determine ...` shown, probably means that the code was returned as-is, and then got interpreted as HTML by your browser."^^ . + . + . + . + "What's the point of capturing the output buffer content, in your first snippet? You are only calling `add_action` in between, which should not produce any output."^^ . + "2"^^ . + "As others have mentioned, the most likely culprit is wrongly ordering the firewalls on security.yaml (and you haven't added the relevant bits to this question)."^^ . + "<p><strong>_lp_course</strong> was used in the older version of LearnPress. In LearnPress 4.x the relationship between lessons and courses is stored in a different way.</p>\n<p>To find the course ID from a lesson ID, use :\n<strong>learn_press_get_course_id_by_lesson_id($lesson_id)</strong></p>\n<pre><code>$course_id = learn_press_get_course_id_by_lesson_id($lesson_id);\n</code></pre>\n<p>after getting course ID you can mark the lesson completed using following code :</p>\n<pre><code>$user = learn_press_get_user($user_id);\nif ($user) {\n $user-&gt;finish_lesson($lesson_id);\n}\n</code></pre>\n"^^ . + . + . + . + "0"^^ . + . + . + "1"^^ . + . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + . + "1"^^ . + "yii2"^^ . + . + . + "How to translate the header in Wordpress using Polylang and Editor"^^ . + "This can also be from the form `<input type="hidden" name="MAX_FILE_SIZE" value="30000" />` compare Example #1 on https://www.php.net/manual/en/features.file-upload.post-method.php#example-484 and _" 2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',"_ from a note on [_Error Messages Explained_](https://www.php.net/manual/en/features.file-upload.errors.php#115746)"^^ . + . + . + . + "<p>To download the latest composer, just visit <a href="https://getcomposer.org/download/2.8.6/composer.phar" rel="nofollow noreferrer">https://getcomposer.org/download/2.8.6/composer.phar</a>.</p>\n<p>You can also visit <a href="https://getcomposer.org/versions" rel="nofollow noreferrer">https://getcomposer.org/versions</a> first to choose another version.</p>\n<p>For this &quot;certificate verify failed&quot; error, considering that you can download from <code>https://getcomposer.org/installer</code> but not <code>https://getcomposer.org/versions</code>, since both should return the same certificate, I guess it is likely that one local service (such as firewall, antivirus) is preventing you from accessing the later URL.</p>\n"^^ . + . + "2"^^ . + "0"^^ . + . + . + . + "1"^^ . + "Also note this comment on the duplicate: https://stackoverflow.com/questions/2461762/force-freeing-memory-in-php#comment22100275_2461777"^^ . + "So you see, we cannot reproduce the problem you're describing, at all. So maybe that's because my demo makes some assumptions about your code (I had to provide most of it myself, after all!). Perhaps in fact, in the real code, your first UPDATE query never runs or something. It's possible...we don't have a [mre] of that though. Either that or your observations of the the behaviour are mistaken in some way - perhaps you missed that the field had been updated by an earlier command already (maybe in fact your code tries to update the field twice, once before you're expecting!)."^^ . + . + "And before I forget it: It's also good to have the text of the screenshot instead of the screenshot alone so it can be searched and also read. As it shows from a terminal this should be easy to copy and paste (in general text is preferred over images even albeit OCR gets better every day)."^^ . + . + . + "2"^^ . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + "Keycloak logout"^^ . + . + . + . + . + "Replace specific currency symbol on all WooCommerce HTML formatted prices?"^^ . + "@C3roe i change the max file size upload and max post size and also increase the time"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "it does not help"^^ . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + "0"^^ . + "<p>I try to send an email notification when a user which asked for &quot;pro&quot; role is validated by the admin.</p>\n<p>Note that the user has already received a pending email notification from another plugin.</p>\n<p>Here is my code:</p>\n<pre class="lang-php prettyprint-override"><code>add_action('profile_update','role_change_notify',10,3);\nfunction role_change_notify($user_id,$old_user_data,$userdata) {\n foreach($old_user_data-&gt;roles as $role):\n $old_role = $role; //get the registered role. Should be 1 role since the user is newly registered.\n endforeach;\n\n $role_check = array('pro');//the roles you wish to send notification. This will check the role of 'pro' \n\n //this if statement is to make sure it the following runs only the user is change from 'pending' role to 'pro'. So it prevent resend the notification whenever the user profile is updated.\n if( $old_role == 'pending' &amp;&amp; in_array($userdata['role'],$role_check ) ):\n $user_info = get_userdata( $user_id );\n $to = $user_info-&gt;user_email; \n $subject = &quot;Votre nouveau compte Professionel&quot;;\n $message = 'Bonjour, Félicitation. Votre compte professionnel est désormais accessible.\n \n {customer_details}\n \n L équipe';\n\n wp_mail($to, $subject, $message);\n endif;\n}\n</code></pre>\n<p>But the user doesn't receive any confirmation email notification. Any clue?</p>\n"^^ . + . + . + "1"^^ . + . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + "<p>How to get Referrer value from cURL URL? I am trying something like this but not working.</p>\n<pre><code>$curldomain = &quot;https://www.example.com/&quot;;\n\n$ch = curl_init($curldomain);\n\n// Set cURL options\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\ncurl_setopt($ch, CURLOPT_HEADER, true);\ncurl_setopt($ch, CURLOPT_NOBODY, true);\n\n$referrerValue = curl_getinfo($ch, CURLINFO_REFERER);\n</code></pre>\n"^^ . + . + . + . + . + "3"^^ . + . + "2"^^ . + . + "1"^^ . + . + "@NicoHaase - basically, I am inclined to use the simpler HTML (meta http-equiv="refresh" content=) tag, and keep it script free (as mentioned in the last part of my question), so looking for any viable options to implement."^^ . + . + "0"^^ . + "Your `datetime` value looks to be in an ambiguous format for `datetime`; I suspect it is being read as a `yyyy-dd-MM` value. Considering the value as well (end with `.722`) I would suggest that `datetime` is the wrong data type for several reasons, including it's not accurate enough (`datetime` cannot stored the value `2025-03-17 14:01:33.722` and would round it to the nearest 1/300th of a second). Have you considered using a `datetime2` with an appropriate precision?"^^ . + . + . + . + . + "1"^^ . + . + . + . + "<p>Here is a solution based on <a href="https://www.php.net/manual/en/function.preg-replace.php" rel="nofollow noreferrer"><code>preg_replace()</code></a>. The number or replacements is set by the <code>$limit</code> parameter:</p>\n<pre><code>function process(string $str): string\n{\n if(strlen($str) &gt; 3)\n $str = preg_replace('/(..)/', '\\\\1 ', $str, intdiv(strlen($str) - 2, 2));\n return $str;\n}\n\necho process('22334455'), PHP_EOL;\necho process('2233444'), PHP_EOL;\n</code></pre>\n<p>Output:</p>\n<pre class="lang-none prettyprint-override"><code>22 33 44 55\n22 33 444\n</code></pre>\n<p>(<a href="https://3v4l.org/X4PIn" rel="nofollow noreferrer">demo</a>)</p>\n"^^ . + . + "I added more demo links that allow for outdated versions of PHP."^^ . + . + . + . + "0"^^ . + . + . + "1"^^ . + "0"^^ . + . + "<p>The above usually occur due maximum upload size limit in php, you can try below step to fix it.</p>\n<p><strong>Increase PHP Upload Limits</strong>\nUpdate the following values in your php.ini file:</p>\n<pre><code>upload_max_filesize = 100M\npost_max_size = 100M\nmax_execution_time = 300\nmax_input_time = 300\n</code></pre>\n<p><strong>Update Apache Configuration (If Using Apache)</strong>\nIn your .htaccess or apache2.conf:</p>\n<pre><code>php_value upload_max_filesize 100M\nphp_value post_max_size 100M\n</code></pre>\n<p><strong>Check File Validation in Laravel</strong></p>\n<pre><code>$request-&gt;validate([\n 'file' =&gt; 'required|file|max:102400', // 100MB\n]);\n</code></pre>\n<p>Just give a try, if the above help</p>\n"^^ . + . + . + . + . + . + "check your logs for more information on the error, follow the stack trace. maybe your problem is in another file"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + "2"^^ . + . + "0"^^ . + . + "Your form submits data with `POST`. `POST` data is not recorded in logs. It's gone."^^ . + . + . + . + . + "0"^^ . + "There is no way you will get tax = 420 with the above code, unless you have item quantity = 42. Could you please check if other parts of your custom code is modifying the final tax? Thanks!"^^ . + . + "<p>CPanel and WordPress Not Working – API 500 Error &amp; No Website Access</p>\n<p>I am experiencing an issue with my cPanel. It was working fine, but sometimes it stopped due to an IP block. However, this time, the issue is different.</p>\n<p>None of my websites are loading.</p>\n<p>When I try to access WordPress via cPanel, it does not respond.</p>\n<p>I am getting an API 500 error.</p>\n<p>I cannot create new subdomains.</p>\n<p>I have 15 websites on the same hosting, and all of them are down.</p>\n<p>Additional Details:</p>\n<p>Hosting plan: Premium</p>\n<p>Storage: Sufficient available</p>\n<p>What could be the possible reason for this issue, and how can I resolve it? Any guidance would be appreciated</p>\n"^^ . + . + . + "<p>I tried downloading and setting up <strong>Hubleto</strong>, and I have two questions about it:</p>\n<ol>\n<li><code>ConfigEnv.dbName (database will be created) (press Enter for 'my_hubleto'): -&gt; my_hubleto</code></li>\n</ol>\n<p>It says that the database will be created automatically, but when I didn't create it manually, I got an error. Once I created it myself, everything worked fine, and the tables were populated correctly. Is this the expected behavior, or should it have been created automatically?</p>\n<ol start="2">\n<li>I used the default settings from the CLI agent, and everything seemed to run smoothly. However, I encountered an error when trying to load the page. This led me to check the index.php file, where I noticed that all paths were written like this:</li>\n</ol>\n<p><code>require(&quot;C:\\xampp\\htdocs\\hubleto-0.5-ce/vendor/autoload.php&quot;);</code></p>\n<p>After changing it to:</p>\n<p><code>require(&quot;C:/xampp/htdocs/hubleto-0.5-ce/vendor/autoload.php&quot;);</code></p>\n<p>everything started working as expected. Do you think I messed something up? I didn’t notice an option to set accountFolder separately in the agent.</p>\n<p><em>Thanks for your response!</em></p>\n"^^ . + . + . + "What exactly do you mean by "keep failing to declare a variable"? Are you getting a specific error when you run your code? If so please tell us exactly what it says and which line of code it came from."^^ . + "<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nnamespace App\\Jobs;\n\nuse App\\Models\\GeneratedEmail;\nuse App\\Notifications\\TestMailNotification;\nuse App\\Services\\EmailVerification\\EmailVerificationServiceInterface;\nuse App\\Services\\GeneratedEmail\\GeneratedEmailServiceInterface;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Foundation\\Queue\\Queueable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Illuminate\\Support\\Facades\\Notification;\n\nclass ProcessEmailVerification implements ShouldQueue\n{\n use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;\n\n private $searchId;\n private $emails;\n\n /**\n * Create a new job instance.\n */\n public function __construct(\n int $searchId,\n array $emails,\n ) {\n $this-&gt;searchId = $searchId;\n $this-&gt;emails = $emails;\n }\n\n /**\n * Execute the job.\n */\n public function handle(): void\n {\n $emailVerificationService = app(EmailVerificationServiceInterface::class);\n $emailVerification = [];\n\n foreach ($this-&gt;emails as $email) {\n $domain = explode('@', $email)[1];\n $mxServer = $this-&gt;getMXRecord($domain);\n\n $isValidMX = !empty($mxServer);\n $isSMTPValid = $this-&gt;validateEmailSMTP($email);\n $isSpamTrap = $this-&gt;isSpamTrap($email);\n\n $isDeliverable = $isValidMX &amp;&amp; $isSMTPValid &amp;&amp; !$isSpamTrap;\n\n $emailVerification[] = [\n 'search_id' =&gt; $this-&gt;searchId,\n 'email' =&gt; $email,\n 'is_deliverable' =&gt; $isDeliverable\n ? config('data.email_verification.status.deliverable')\n : config('data.email_verification.status.undeliverable'),\n ];\n }\n\n if (!empty($emailVerification)) {\n $emailVerificationService-&gt;createEmailVerification($emailVerification);\n }\n }\n\n /**\n * Get MX record for a given domain.\n *\n * @param string $domain Email domain (e.g., example.com)\n * @return string|null Returns the mail server address if found, otherwise null\n */\n private function getMXRecord($domain): string|null\n {\n $mxRecords = dns_get_record($domain, DNS_MX);\n return $mxRecords ? $mxRecords[0]['target'] : null;\n }\n\n /**\n * Validate an email address via SMTP handshake.\n *\n * @param string $email Email address to validate\n * @return bool Returns true if the email is valid, otherwise false\n */\n private function validateEmailSMTP($email): bool\n {\n $domain = explode('@', $email)[1];\n $mxServer = $this-&gt;getMXRecord($domain);\n\n if (!$mxServer) {\n return false; // No mail server found\n }\n\n $from = config('mail.from.address');\n $mailServerDomain = config('mail.mailers.smtp.mail_server_domain');\n $sock = fsockopen($mxServer, 25, $errno, $errstr, 5);\n\n if (!$sock) {\n return false;\n }\n\n stream_set_timeout($sock, 5);\n\n $this-&gt;getSMTPResponse($sock); // Read initial 220 response\n fwrite($sock, &quot;HELO $mailServerDomain\\r\\n&quot;);\n $this-&gt;getSMTPResponse($sock); // Read HELO response\n\n fwrite($sock, &quot;MAIL FROM:&lt;$from&gt;\\r\\n&quot;);\n $this-&gt;getSMTPResponse($sock); // Read MAIL FROM response\n\n fwrite($sock, &quot;RCPT TO:&lt;$email&gt;\\r\\n&quot;);\n $response = $this-&gt;getSMTPResponse($sock); // Read RCPT TO response\n\n fwrite($sock, &quot;QUIT\\r\\n&quot;);\n fclose($sock);\n\n// Check for &quot;250 2.1.5 OK&quot; (Valid email)\n// Check for &quot;450-4.2.1&quot; (Rate limit or temporary failure) - Consider email valid\n if (\n strpos($response, &quot;250 2.1.5 OK&quot;) !== false\n ||\n strpos($response, &quot;450 4.2.1&quot;) !== false\n ) {\n return true;\n }\n\n// If the response contains errors like 550 or NoSuchUser, return false\n if (\n strpos($response, &quot;550&quot;) !== false ||\n strpos($response, &quot;NoSuchUser&quot;) !== false ||\n strpos($response, &quot;5.1.1&quot;) !== false\n ) {\n return false;\n }\n\n return false; // Default to false for unknown cases\n }\n\n /**\n * Read and return SMTP server response.\n *\n * @param resource $sock Socket resource for SMTP connection\n * @return string Returns SMTP response string\n */\n private function getSMTPResponse($sock): string\n {\n $response = '';\n while ($line = fgets($sock, 1024)) {\n $response .= $line;\n if (substr($line, 3, 1) == &quot; &quot;) { // End of response\n break;\n }\n }\n return $response;\n }\n\n /**\n * Check if an email belongs to a spam trap or role-based address.\n */\n private function isSpamTrap(string $email): bool\n {\n $spamTraps = ['abuse', 'postmaster', 'noreply', 'admin', 'support', 'info'];\n $emailPrefix = explode('@', $email)[0];\n\n return in_array($emailPrefix, $spamTraps);\n }\n}\n</code></pre>\n<p>This is my Laravel job which takes a <code>searchId</code> and some emails and checks if the emails exist in the real world. For some emails it is working and for others it is not. Here we're storing the email's deliverability status in a table. There is a table named <code>email_verifications</code> which is used to store the email and deliverability status. For some emails, it says it is deliverable, but actually I've got bounce emails. For other emails, it says undeliverable, but actually the mail was sent and I've not got any bounce email.</p>\n"^^ . + "<p>I get the latest channel message from the history and try to get all the photos of this message.But I only get one last photo. Please tell me how to get all the photos from the message?</p>\n<pre><code>foreach($channels as $channel){\n $messs[$channel] = $this-&gt;MadelineProto-&gt;messages-&gt;getHistory(['peer' =&gt; $channel, 'limit' =&gt; 1]);\n}\nforeach ($messs as $key =&gt; $messages) {\n\n foreach ($messages['messages'] as $message) {\n $text = $message['message'];\n $files = null;\n\n if (isset($message['media']) &amp;&amp; $text['media']['_'] === 'messageMediaPhoto') {\n $file = $this-&gt;MadelineProto-&gt;downloadToDir($message['media'], '../../img');\n $files[] = $file;\n }\n \n if($text !== ''){\n $posts[] = ['media' =&gt; [$key =&gt; $files] ];\n }\n }\n}\n</code></pre>\n"^^ . + . + "I edited my question-- the suggested link doesn't really help at all."^^ . + . + . + . + "@Olivier I see efficiency mentioned nowhere in the question, but I do see: `How can I return the area code without looping?` ... my answer provides one option."^^ . + "0"^^ . + "<p>I'm trying to configure Nginx with PHP 7.4 NTS in Laragon and I'm encountering an issue with making (probably concurrent?) API requests.</p>\n<p><strong>My Setup:</strong></p>\n<ul>\n<li>Operating System: Windows (using Laragon)</li>\n<li>Web Server: Nginx</li>\n<li>PHP Version: PHP 7.4 NTS</li>\n<li>Framework: Laravel</li>\n</ul>\n<p><strong>Behavior:</strong></p>\n<ul>\n<li>Single Laravel API request via Postman → Works ✅</li>\n<li>One Laravel API request via cURL → Works ✅</li>\n<li>Two concurrent Laravel API requests via cURL → Stuck ❌</li>\n<li>One Laravel API request and one Fake API request → Works ✅</li>\n</ul>\n<p><strong>Example Code (Two Requests via cURL):</strong></p>\n<pre><code>&lt;?php\nclass CurlRequest {\n public function sendGetRequest($url) {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, [&quot;Content-Type: application/json&quot;]);\n \n $response = curl_exec($ch);\n \n if (curl_errno($ch)) {\n $error = 'Curl error: ' . curl_error($ch);\n curl_close($ch);\n return $error;\n }\n \n curl_close($ch);\n return json_decode($response, true);\n }\n}\n\n// Example usage\n$api = new CurlRequest();\n\n$response1 = $api-&gt;sendGetRequest('http://localhost/crm-api/api/v1/users');\nif (is_array($response1)) {\n echo &quot;&lt;pre&gt;Users API Response:\\n&quot;;\n print_r($response1);\n echo &quot;&lt;/pre&gt;&quot;;\n} else {\n echo &quot;&lt;pre&gt;Error fetching Users API: $response1&lt;/pre&gt;&quot;;\n}\n\n$response2 = $api-&gt;sendGetRequest('http://localhost/crm-api/api/v1/products');\nif (is_array($response2)) {\n echo &quot;&lt;pre&gt;Products API Response:\\n&quot;;\n print_r($response2);\n echo &quot;&lt;/pre&gt;&quot;;\n} else {\n echo &quot;&lt;pre&gt;Error fetching Products API: $response2&lt;/pre&gt;&quot;;\n}\n?&gt;\n</code></pre>\n<hr />\n<ul>\n<li><p><strong>Problem:</strong> When I send <strong>two Laravel API requests at once</strong> via cURL, the second request doesn't seem to get processed and just hangs or times out. However, if I send requests separately (one after another), both work fine. Similarly, if I mix a real Laravel API request with a fake one, they work fine concurrently.</p>\n</li>\n<li><p><strong>What I've Tried:</strong> Tested with Postman and it works fine for both single and multiple requests.<br/>\nOne request at a time works fine via cURL.<br/>\nUsing Fake APIs concurrently also works, indicating the issue is specific to Laravel API calls.</p>\n</li>\n<li><p><strong>Questions:</strong></p>\n<ul>\n<li>What could be causing multiple concurrent requests to get stuck when\nusing cURL with Nginx and Laravel API?</li>\n<li>Is there something I need\nto configure in my Nginx or PHP setup to allow multiple concurrent\nrequests to work?</li>\n</ul>\n</li>\n</ul>\n<hr />\n<p><strong>Images:</strong></p>\n<p><a href="https://i.sstatic.net/pztSuPrf.png" rel="nofollow noreferrer">This is sample of testing concurrent request in cURL using Laravel API (Loading not stop until we stopped the NGINX in Laragon or it will be 504 (Gateway Timed-Out)</a></p>\n<p><a href="https://i.sstatic.net/mL8osPTD.png" rel="nofollow noreferrer">This is the result when one of my request is from Fake API</a></p>\n"^^ . + . + . + . + . + . + "what tool or script you used to test?"^^ . + . + . + . + . + "0"^^ . + "thanks for reply, If you want i can share console log or script"^^ . + . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + "For the sake of testing, let's focus solely on one PHP version, which I guess is (the dead) version 7.4, as you can't share extensions across versions. I can't tell from your question, but was "php_openssl.dl" compiled with 7.4, and also the same threading model and bit-ness? I've seen PHP say that it can't find an extension that obviously exists, but it is really complaining about a mismatch."^^ . + "@KIKOSoftware you absolutely _can_ use anything without Composer. But generally you have to replicate most of the things composer does - either by hand or by writing your own scripts. That makes it potentially difficult or complex for a lot of packages, but I don't believe you can state that someone _cannot_ use it without Composer. I do agree though that the situations where it would be impossible to use Composer should be extremely few and far between."^^ . + . + "Your issue may relate to this: https://github.com/opcodesio/log-viewer/issues/362"^^ . + . + . + . + "Rather, you *don't* perform user input sanitization anyway"^^ . + . + . + "Accessing Pinecone via PHP"^^ . + . + "Typo3 bootstrap_HTML Tag changes my video tag to entity"^^ . + . + . + . + "Composer how to create selectable package"^^ . + "@ChrisHaas My problem is with the content being entered in wordpress . I am fetching the data from an API and after that I create a user on the website that will add the posts in the wordpress DB. A user has to be created for the posts to be added on the website. The user can be 'editor' or 'author', I can't create an admin user as it is not advised."^^ . + . + . + . + . + . + . + "<p>The form is working fine. All the selects and other form elements are works fine when I submit. The only problem is the community_id which is dependent on the district. Its always given <code>The input was not found in the haystack</code>. In the browser console the form sends the community_id but I don't why I keep getting the haystack problem:\ndistrict_id: 9c72f59e-f733-11ef-89e9-00155d016f00\ncommunity_id: 4acc72cb-fc61-11ef-8c90-00155d016f00</p>\n<p>Form:</p>\n<pre><code>\n Elements\n // Add district selection\n $this-&gt;add([\n 'name' =&gt; 'district_id',\n 'type' =&gt; Element\\Select::class,\n 'options' =&gt; [\n 'label' =&gt; 'District',\n 'empty_option' =&gt; 'Select District',\n 'value_options' =&gt; $this-&gt;getDistrictOptions(),\n 'label_attributes' =&gt; [\n 'class' =&gt; 'required-field'\n ],\n ],\n 'attributes' =&gt; [\n 'id' =&gt; 'district_id',\n 'class' =&gt; 'form-control form-select',\n 'required' =&gt; true,\n 'data-dependent-url' =&gt; '/community/list'\n ],\n ]);\n \n // Add community selection\n $this-&gt;add([\n 'name' =&gt; 'community_id',\n 'type' =&gt; Element\\Select::class,\n 'options' =&gt; [\n 'label' =&gt; 'Community',\n 'empty_option' =&gt; 'Select Community',\n 'value_options' =&gt; $this-&gt;getCommunityOptions(),\n 'label_attributes' =&gt; [\n 'class' =&gt; 'required-field'\n ],\n ],\n 'attributes' =&gt; [\n 'id' =&gt; 'community_id',\n 'class' =&gt; 'form-control form-select',\n 'required' =&gt; true,\n 'disabled' =&gt; true,\n 'data-dependent' =&gt; 'district_id',\n 'value' =&gt; ''\n ],\n ]);\n\n\n *Inputfilters*\n 'district_id' =&gt; [\n 'required' =&gt; true,\n 'filters' =&gt; [\n ['name' =&gt; 'StringTrim'],\n ],\n 'validators' =&gt; [\n [\n 'name' =&gt; 'NotEmpty',\n 'options' =&gt; [\n 'messages' =&gt; [\n 'isEmpty' =&gt; 'Please select a district'\n ],\n ],\n ],\n [\n 'name' =&gt; 'Callback',\n 'options' =&gt; [\n 'callback' =&gt; [$this, 'validateDistrict'],\n 'messages' =&gt; [\n 'callbackValue' =&gt; 'Invalid district selected'\n ],\n ],\n ],\n ],\n ],\n 'community_id' =&gt; [\n 'required' =&gt; true,\n 'filters' =&gt; [\n ['name' =&gt; 'StringTrim'],\n ],\n 'validators' =&gt; [\n [\n 'name' =&gt; 'NotEmpty',\n 'options' =&gt; [\n 'messages' =&gt; [\n 'isEmpty' =&gt; 'Please select a community or choose Other and specify a new community name'\n ],\n ],\n ],\n [\n 'name' =&gt; 'Callback',\n 'options' =&gt; [\n 'callback' =&gt; [$this, 'validateCommunity'],\n 'messages' =&gt; [\n 'callbackValue' =&gt; 'Please select a valid community from the list or choose Other and specify a new community name'\n ],\n ],\n ],\n ],\n ],\n\n *Validators*\n public function validateDistrict($value)\n {\n $district = $this-&gt;entityManager-&gt;getRepository(\\Grm\\Entity\\District::class)\n -&gt;find($value);\n \n return $district !== null;\n }\n \n public function validateCommunity($value)\n {\n // Log the submitted value\n error_log(&quot;Submitted community_id: &quot; . $value);\n\n // Get the district ID\n $districtId = $this-&gt;get('district_id')-&gt;getValue();\n error_log(&quot;Selected district_id: &quot; . $districtId);\n\n if (empty($districtId)) {\n error_log(&quot;District ID is empty.&quot;);\n return false;\n }\n\n // Handle 'other' option\n if ($value === 'other') {\n $otherCommunity = $this-&gt;get('other_community')-&gt;getValue();\n if (empty($otherCommunity)) {\n error_log(&quot;Other community name is empty.&quot;);\n return false;\n }\n return true;\n }\n\n // For numeric IDs, verify the community exists in the selected district\n if (is_numeric($value)) {\n try {\n $community = $this-&gt;entityManager-&gt;getRepository(\\Grm\\Entity\\Community::class)\n -&gt;findOneBy([\n 'id' =&gt; $value,\n 'district' =&gt; $districtId\n ]);\n\n if ($community === null) {\n error_log(&quot;Community not found in the selected district.&quot;);\n } else {\n error_log(&quot;Community found: &quot; . $community-&gt;getName());\n }\n\n return $community !== null;\n } catch (\\Exception $e) {\n error_log(&quot;Error validating community: &quot; . $e-&gt;getMessage());\n return false;\n }\n }\n\n error_log(&quot;Invalid community_id value: &quot; . $value);\n return false;\n }\n</code></pre>\n<pre><code>Index.phtml:\n</code></pre>\n<pre><code> &lt;!-- District and Community --&gt;\n &lt;div class=&quot;grid grid-cols-1 md:grid-cols-2 gap-6&quot;&gt;\n &lt;div class=&quot;flex items-center space-x-2&quot;&gt;\n &lt;?= $this-&gt;formLabel($form-&gt;get('district_id')) ?&gt;\n &lt;div class=&quot;flex-1&quot;&gt;\n &lt;?= $this-&gt;formElement($form-&gt;get('district_id')) ?&gt;\n &lt;?= $this-&gt;formElementErrors($form-&gt;get('district_id')) ?&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n\n &lt;div class=&quot;flex items-center space-x-2&quot;&gt;\n &lt;?= $this-&gt;formLabel($form-&gt;get('community_id')) ?&gt;\n &lt;div class=&quot;flex-1&quot;&gt;\n &lt;?= $this-&gt;formElement($form-&gt;get('community_id')) ?&gt;\n &lt;?= $this-&gt;formElementErrors($form-&gt;get('community_id')) ?&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n</code></pre>\n<pre><code>*Scripts*\n`// Handle dependent dropdowns and form fields\n$(document).ready(function() {\n// District -&gt; Community dependency\n $('#district_id').change(function() {\n const districtId = $(this).val();\n const communitySelect = $('#community_id');\n const otherCommunityContainer = $('.other-community-container');\n const otherCommunityField = $('#other_community');\n \n // Reset and hide other community field\n otherCommunityContainer.addClass('hidden');\n otherCommunityField.val('').prop('required', false);\n \n if (districtId) {\n // Show loading indicator\n communitySelect.prop('disabled', true).empty()\n .append('&lt;option value=&quot;&quot;&gt;Select Community&lt;/option&gt;');\n \n $.ajax({\n url: '/community/list/' + districtId,\n method: 'GET',\n dataType: 'json',\n success: function(response) {\n communitySelect.empty();\n \n // Add empty option\n communitySelect.append('&lt;option value=&quot;&quot;&gt;Select Community&lt;/option&gt;');\n \n if (response &amp;&amp; response.length &gt; 0) {\n response.forEach(function(community) {\n communitySelect.append(\n $('&lt;option&gt;&lt;/option&gt;')\n .val(community.id)\n .text(community.name)\n );\n });\n }\n \n // Add &quot;Other&quot; option\n communitySelect.append('&lt;option value=&quot;other&quot;&gt;Other (Specify)&lt;/option&gt;');\n communitySelect.prop('disabled', false);\n },\n error: function() {\n communitySelect.empty()\n .append('&lt;option value=&quot;&quot;&gt;Error loading communities&lt;/option&gt;')\n .append('&lt;option value=&quot;other&quot;&gt;Other (Specify)&lt;/option&gt;')\n .prop('disabled', false);\n }\n });\n } else {\n communitySelect.empty()\n .append('&lt;option value=&quot;&quot;&gt;Select Community&lt;/option&gt;')\n .append('&lt;option value=&quot;other&quot;&gt;Other (Specify)&lt;/option&gt;')\n .prop('disabled', true);\n \n // Reset other community field\n otherCommunityContainer.addClass('hidden');\n otherCommunityField.val('').prop('required', false);\n }\n });\n\n // Handle Other Community selection\n $('#community_id').on('change', function() {\n const selectedValue = $(this).val();\n const otherCommunityContainer = $('.other-community-container');\n const otherCommunityField = $('#other_community');\n \n if (selectedValue === 'other') {\n otherCommunityContainer.removeClass('hidden');\n otherCommunityField.prop('required', true).val('');\n } else {\n otherCommunityContainer.addClass('hidden');\n otherCommunityField.prop('required', false).val('');\n }\n });\n\n});`\n</code></pre>\n"^^ . + . + . + "In the 2nd function from [this answer](https://stackoverflow.com/a/47219447/4214743), first note that `get_product()` function is obsolete and replaced by `wc_get_product()`. To make it work for simple product and **product variation** shipping class, simply replace `$product = get_product( $values['product_id'] );` with `$product = $values['data'];`."^^ . + . + "Yes, I understand you are Windows, I am too. (As an aside, take the dive into WSL and your life will get much easier.) Your DLLs are compiled. The fact that you didn't do it doesn't matter. My point is that you need to make sure that they were compiled against what I said, or to flip it, to make sure you have downloaded the correct ones for version, bit-ness and threading. The reason I mentioned focusing on one version only is to avoid people getting lost in the weeds. Whatever you tell us in the question is a possible bug for us to solve. If you don't want the version solved, don't mention it"^^ . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "Obviously, your code example has many more problems: https://phpstan.org/r/34184deb-8ef3-44a3-a83c-a489258e2fd9"^^ . + "observers"^^ . + . + "Where are you calling `env()`? If it's anywhere outside of a `config/*.php` file, you shouldn't do that, since if you're running `php artisan cache:config`, `env()` will **only** work in `config/*.php` files."^^ . + "The headers are on the third line of the file, not the first."^^ . + "1"^^ . + . + . + "`=(.+?)=` - the `=` match the "outer" of the double `==` here, but then `.+` still allows `=` in that position as well. [`(?<!=)=([^=]+)=(?!=)`](https://regex101.com/r/B2xjxj/1) should do the trick."^^ . + . + "0"^^ . + . + . + "Contact Form Not Sending Email"^^ . + . + . + ""This is the wordpress provided function that I am using to allow user to add iframe" and "I'm building a WordPress plugin that fetches blog data via API", I'm confused about these two. Are you pulling from an API or allowing someone to enter content?"^^ . + . + . + . + . + "2"^^ . + "0"^^ . + "I tried to [compute a simple 3D distance](https://3v4l.org/JEGk4), which is exactly what you seem to be doing, but I get a better matching color. I think you must have made a mistake somewhere? Can I be sure of that? No. Why? Because your question doesn't contain [a minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). You could add one to your question, to prove me wrong... "^^ . + . + "0"^^ . + . + . + "0"^^ . + "opencart and journal user can help me i think, thanks"^^ . + "1"^^ . + . + "Most of the text in your question reads as nonsense. What specifically are you asking? What specific problem are you trying to solve in this code? It sounds like you're just trying to find matching curly braces. Simply doing a Ctrl-F on this page and looking for "{" and then "}" finds the same number of both. Can you clarify which pair you think is un-matched? (As an aside... Your code is inconsistently formatted, which may be making it more difficult for you to read it. Check the indentation at and after your first `if` statement.)"^^ . + "0"^^ . + "I want to make the file run automatically after five minutes"^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + "Small detail. Your regular expression would be slightly easier to read when you use single quotes instead of double quotes: `'/\\b(xxg|xxl|xxs)\\b|\\b(([^0-9])\\3+)\\b|([^0-9])\\4+/'`."^^ . + "0"^^ . + . + . + . + "2"^^ . + "0"^^ . + . + . + . + "You should run that code on a specific route, so you set the locale if the user selects one that is not the default, then run code in a middleware to always load the session's lang and set it on the `setLocale`"^^ . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + "Using `PHP_EOL` as a substitute for `\\n` in concatenation is a bad idea. This constant should only be used when parsing text in a machine-dependant way."^^ . + "0"^^ . + . + "1"^^ . + . + "2"^^ . + . + "0"^^ . + "1"^^ . + "1"^^ . + "0"^^ . + . + . + . + . + . + "1"^^ . + "Not clear why would you want to mess with this. The idea of these cache files is that they are used as needed if you use the API to access the file, and as with any cache, one shouldn't rely on them being there. What's exactly your use case? I fear this may be a case where you are asking about X, but you actually need Y."^^ . + "@ADyson From the comments and the duplicate question I assume that there is absolutely no security risk involved if I do not escape or sanitize user input in this case: `$orange = "Orange"; if($_GET['fruit'] == $orange) { shell_exec("script.sh $orange"); }`."^^ . + "The person i'm making this website for would like for all the possible different playlists to be available as soon as you open the website instead of having to find the select interface within the player itself. This project won't scale to any more than maybe 10+ categories max."^^ . + "0"^^ . + "0"^^ . + . + "laravel-dompdf"^^ . + . + . + . + . + . + "<p>Here is what I've finally ended up getting to work. Again, the shop is setup with HPOS only with no compatibility mode or syncing.</p>\n<pre><code>\n\n add_action( 'woocommerce_before_account_orders', 'add_order_search_form' );\n function add_order_search_form() {\n $allowed_roles = array('administrator', 'shop_manager');\n $user = wp_get_current_user();\n $user_roles = (array) $user->roles;\n \n if (array_intersect($allowed_roles, $user_roles)) {\n $show_clear_link = isset($_GET['order_search']) && !empty($_GET['order_search']);\n echo '\n \n Search';\n if ($show_clear_link) {\n echo 'Reset Search';\n }\n echo '';\n }\n }\n \n function custom_order_search( $search_term, $customer_id ) {\n global $wpdb;\n \n $search_term = '%' . $wpdb->esc_like( $search_term ) . '%';\n \n $query = $wpdb->prepare(\n "SELECT DISTINCT o.id \n FROM {$wpdb->prefix}wc_orders o\n LEFT JOIN {$wpdb->prefix}wc_order_addresses a \n ON o.id = a.order_id AND a.address_type = 'shipping'\n LEFT JOIN {$wpdb->prefix}wc_orders_meta m \n ON o.id = m.order_id AND m.meta_key = 'po_number'\n WHERE o.customer_id = %d\n AND (\n o.id LIKE %s \n OR a.first_name LIKE %s \n OR a.last_name LIKE %s\n OR a.company LIKE %s \n OR a.address_1 LIKE %s \n OR a.address_2 LIKE %s \n OR a.city LIKE %s \n OR a.state LIKE %s \n OR a.postcode LIKE %s\n OR m.meta_value LIKE %s\n )",\n $customer_id,\n $search_term,\n $search_term,\n $search_term,\n $search_term,\n $search_term,\n $search_term,\n $search_term,\n $search_term,\n $search_term,\n $search_term\n );\n \n return $wpdb->get_col( $query );\n }\n \n add_filter( 'woocommerce_my_account_my_orders_query', 'filter_orders_by_search', 10, 1 );\n function filter_orders_by_search( $args ) {\n if ( isset( $_GET['order_search'] ) && ! empty( $_GET['order_search'] ) ) {\n $search_term = sanitize_text_field( $_GET['order_search'] );\n $customer_id = get_current_user_id();\n \n // Get matching order IDs from the custom search\n $order_ids = custom_order_search( $search_term, $customer_id );\n \n if ( ! empty( $order_ids ) ) {\n // Filter orders by the matching IDs\n $args['id'] = $order_ids;\n } else {\n // If no matches, return no orders\n $args['id'] = array( 0 );\n }\n }\n \n return $args;\n }\n\n</pre></code>\n"^^ . + "1"^^ . + "0"^^ . + "laravel-folio"^^ . + . + . + . + . + . + . + . + . + . + "<p>TLDR: <code>pcntl_exec('.../php', ['-S', ...]);</code></p>\n<hr />\n<p>You describe</p>\n<blockquote>\n<p>the $path parameter (the first parameter of pcntl_exec)</p>\n</blockquote>\n<p>and you write you are pretty sure that the following is an executable path:</p>\n<pre><code>/usr/local/bin/php -S localhost:1234\n</code></pre>\n<p>As the error message diagnoses, this is ultimately <em>not</em> the case.</p>\n<blockquote>\n<p>(errno 2) No such file or directory</p>\n</blockquote>\n<p>And indeed, according to the common php(1) invocation, the executable path is:</p>\n<pre><code>/usr/local/bin/php\n</code></pre>\n<p>Therefore, remove the arguments from the $path parameter, they do not belong there and put them on the appropriate $args parameter.</p>\n<pre><code>pcntl_exec('/usr/local/bin/php', ['-S', 'localhost:1234']);\n</code></pre>\n<hr />\n<p>Bonus:</p>\n<p>To test in the shell if (the wrong) path &quot;/usr/local/bin/php -S localhost:1234&quot; is an executable path, use the command special built-in:</p>\n<pre><code>$ command -v /usr/local/bin/php -S localhost:1234\n$ echo $?\n1\n</code></pre>\n<p><em>(non-zero exit status code (1), a.k.a. failure)</em></p>\n<p>For the happy path, it shows the commands' pathname and exits in success:</p>\n<pre><code>$ command -v /usr/bin/php \n/usr/bin/php\n$ echo $?\n0\n</code></pre>\n<p><em>(exit status code of zero (0), a.k.a. success)</em></p>\n"^^ . + "What namespace does `DiscussionController` appear in?"^^ . + . + "1"^^ . + "0"^^ . + "1"^^ . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + "3"^^ . + . + "Codeigniter 4 validation of keys within an associative array"^^ . + . + . + . + "2"^^ . + . + "0"^^ . + "<pre><code>&lt;?php\n\n$data1 = file_get_contents(&quot;php://filter/convert.base64-encode/resource=data://text/plain,111111111&quot;);\n$data2 = file_get_contents(&quot;php://filter/convert.base64-encode/resource=data://text/plain,11111111111&quot;);\n\necho $data1.&quot;\\n&quot;;\necho $data2.&quot;\\n&quot;;\n\n\necho ($data1 === $data2) ? &quot;Same output&quot; : &quot;Different output&quot;;\n</code></pre>\n<p>We can see that the streams of &quot;data://&quot; is different,<code>$data1</code> is nine '1',<code>$data1</code> is eleven '1'.</p>\n<p>In the PHP8,the result is &quot;Different output&quot;,but up to php7,it will output &quot;Same output&quot;.</p>\n<p>Why their results are different,is it a bug?I couldn't find ang information about this on the web.</p>\n<p>This situation always occurs when the input length is a multiple of 3.</p>\n<pre><code>$data1 = file_get_contents(&quot;php://filter/convert.base64-encode/resource=data://text/plain,111111111&quot;);\n$data2 = file_get_contents(&quot;php://filter/convert.base64-encode/resource=data://text/plain,1111111111&quot;);\n$data3 = file_get_contents(&quot;php://filter/convert.base64-encode/resource=data://text/plain,11111111111&quot;);\necho $data1.&quot;\\n&quot;;\necho $data2.&quot;\\n&quot;;\necho $data3.&quot;\\n&quot;;\n</code></pre>\n<p>In PHP7 output:</p>\n<pre><code>MTExMTExMTEx\nMTExMTExMTEx\nMTExMTExMTEx\n</code></pre>\n<p>Sorry if you don't understand because my english.</p>\n"^^ . + "Are you sure this problem is in any way related to PHP, [tag:google-cloud-platform], or [tag:namecheap]? If yes, please share more details. If not, please remove these tags. Also, if both sites use the **same** code, how can you be unsure which ReCaptcha version it uses?"^^ . + "0"^^ . + . + . + . + . + . + "varchar"^^ . + "Do we have to set headers in AJAX requests for CSRF Protection?"^^ . + . + . + "1"^^ . + . + . + "facebook-pixel"^^ . + . + "Custom built Laravel 11 package can't find layout"^^ . + . + "0"^^ . + . + "What @krisgjika wrote and thinking: Getting a cURL error(28) is a valid result of calling Http::post($url, $params);, getting it should not cause any question. Maybe the question is how to handle the error? Please clarify by [edit]ing and providing all the relevant information."^^ . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + "3"^^ . + "0"^^ . + . + "As mcrypt is solely the bridge to an external library, why not use another one, like phpseclib? https://packagist.org/packages/phpseclib/mcrypt_compat should provide a proper polyfill"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "subscription"^^ . + . + . + . + "1"^^ . + "0"^^ . + "Laravel - Too few arguments 0 passed"^^ . + . + . + . + "0"^^ . + "` I did add "echo json_encode($arr);" at the end of the script but it does not help at all.`...well no, it wouldn't. You're already echoing the JSON. No need to do it again. The problem, as we said before, is when the PHP script is outputting HTML instead of JSON. Did you do as suggested yet and check the raw output from the PHP script via your browser's developer tools? Seeing that output should point you better towards the root cause of the problem."^^ . + "yes the output is not found when i click register button. I don't even know what do i do"^^ . + . + "<p>I manually downloaded mpdf 8 files to the application\\third-party<br />\n..Also Psr\\log downloaded in application\\psr\\log .</p>\n<p>I modified the path in Mpdf.php and i got this.</p>\n<blockquote>\n<p>An uncaught Exception was encountered\nType: TypeError</p>\n<p>Message: Mpdf\\ServiceFactory::getServices(): Argument #2 ($logger)\nmust be of type psr\\log\\Psr\\Log\\LoggerInterface, Psr\\Log\\NullLogger\ngiven, called in\nD:\\wamp\\www\\test\\application\\third_party\\Mpdf\\Mpdf.php on line 1092</p>\n<p>Filename:\nD:\\wamp\\www\\test\\application\\third_party\\Mpdf\\ServiceFactory.php</p>\n<p>Line Number: 44</p>\n</blockquote>\n<p>Mpdf.php file\nportion i got error</p>\n<pre><code>$this-&gt;logger = new NullLogger();\n \n$originalConfig = $config;\n$config = $this-&gt;initConfig($originalConfig);\n\n$serviceFactory = new ServiceFactory($container);\n$services = $serviceFactory-&gt;getServices(\n $this,\n $this-&gt;logger,\n $config,\n $this-&gt;languageToFont,\n $this-&gt;scriptToLanguage,\n $this-&gt;fontDescriptor,\n $this-&gt;bmp,\n $this-&gt;directWrite,\n $this-&gt;wmf\n);\n</code></pre>\n<p>NullLogger.php</p>\n<pre><code>&lt;?php\n\nnamespace Psr\\Log;\n\n/**\n * This Logger can be used to avoid conditional log calls.\n *\n * Logging should always be optional, and if no logger is provided to your\n * library creating a NullLogger instance to have something to throw logs at\n * is a good way to avoid littering your code with `if ($this-&gt;logger) { }`\n * blocks.\n */\nrequire_once APPPATH . 'third_party/psr/log/src/Psr/Log/AbstractLogger.php';\nclass NullLogger extends AbstractLogger\n{\n /**\n * Logs with an arbitrary level.\n *\n * @param mixed[] $context\n *\n * @throws \\Psr\\Log\\InvalidArgumentException\n */\n public function log($level, string|\\Stringable $message, array $context = []): void\n {\n // noop\n }\n}\n</code></pre>\n<p>Please help me to proceed. Currently I use mpdf 6. I want to upgrade this to php 8.</p>\n"^^ . + "1"^^ . + "1"^^ . + . + . + . + "1"^^ . + . + "Where is `ACCESS_PERMISSION_ADMIN` defined?"^^ . + . + . + . + . + "2"^^ . + "elfinder"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + . + "<p>If you collect these many numbers from somewhere into an array instead of separate variables, there is an array function for it: <a href="https://www.php.net/manual/en/function.array-sum.php" rel="nofollow noreferrer"><code>array_sum</code></a>.</p>\n<pre class="lang-php prettyprint-override"><code>$sum = array_sum([\n $t1, $t2, $t3, $t4, $t5, $t6, $t7, $t8, $t9, $t10, $t11, $t12,\n $t13, $t14, $t15, $t16, $t17, $t18, $t19, $t20, $t21, $t22, $t23, $t24\n]);\n\nif ($sum == 0) { \n /* do stuff */ \n}\n</code></pre>\n"^^ . + . + "4"^^ . + . + . + "0"^^ . + . + . + "<p>This is an addition to <a href="https://stackoverflow.com/a/79421433/367456">Markus Zellers' answer</a>, as it is relevant for Atlassian Bitbucket Webhooks and <em>may</em> be relevant for the individual use-case.</p>\n<p>Marcus shows how to use <em>hash_hmac()</em> for the known <em>X-Hub-Signature</em> header value for the case of one signature only:</p>\n<pre class="lang-php prettyprint-override"><code>enum BitbucketSignature\n{\n case sha256;\n}\n</code></pre>\n<p>This is fine <em>right now</em>, but the algorithm may change. <em>(<a href="https://support.atlassian.com/bitbucket-cloud/docs/manage-webhooks/#Validating-webhook-deliveries" rel="nofollow noreferrer" title="Manage webhooks - Validating webhook deliveries | Bitbucket Cloud | Atlassian Support (atlassian.com)">ref</a>)</em></p>\n<pre class="lang-php prettyprint-override"><code>enum BitbucketSignature\n{\n case sha256;\n case sha384;\n case sha512;\n}\n</code></pre>\n<p>PHP would handle it regardlessly, if supported via <em>hash_hmac_algos()</em>:</p>\n<pre class="lang-php prettyprint-override"><code>in_array($algo?-&gt;name, hash_hmac_algos())\n</code></pre>\n<hr />\n<p>Originally, the enum was only descriptive; it would also allow putting the moving parts into it for convenience:</p>\n<pre class="lang-php prettyprint-override"><code>enum BitbucketSignature\n{\n case sha256;\n case sha384;\n case sha512;\n \n public static function authContents(...) : ?string{...}\n}\n\n...\n\n$contents = BitbucketSignature::authContents(\n signature: @$_SERVER['HTTP_X_HUB_SIGNATURE'],\n payload: file_get_contents(filename: 'php://input'),\n secret: $secret, \n);\n</code></pre>\n<p>The <em>$contents</em> is authenticated, <code>null</code> otherwise.</p>\n<p>Try: <a href="https://phpstan.org/r/5e1f4c87-78e5-42aa-9976-a650e3663fca" rel="nofollow noreferrer">https://phpstan.org/r/5e1f4c87-78e5-42aa-9976-a650e3663fca</a></p>\n<p>Demo: <a href="https://3v4l.org/kbSg5" rel="nofollow noreferrer">https://3v4l.org/kbSg5</a></p>\n<p>Options:</p>\n<ul>\n<li><p>Given <code>null</code>, respond with HTTP 2xx quickly to confirm the delivery (not the authenticity).</p>\n</li>\n<li><p>Given authentic, you <em>may</em> want to check if the content matches your expectation of the payloads <em>Content-Type</em>.</p>\n</li>\n</ul>\n"^^ . + . + "2"^^ . + . + . + . + . + . + . + "learndash"^^ . + . + . + "<p>I was asked to make this code SQL Injection proof:</p>\n<pre><code>&lt;?php\n$connection = mysqli_connect(&quot;localhost&quot;, &quot;root&quot;, &quot;password&quot;, &quot;users_db&quot;);\n\n$query = &quot;SELECT * FROM users&quot;;\n$result = mysqli_query($connection, $query);\n\necho &quot;&lt;table border='1'&gt;&quot;;\necho &quot;&lt;tr&gt;&lt;th&gt;ID&lt;/th&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Email&lt;/th&gt;&lt;/tr&gt;&quot;;\n\nwhile ($row = mysqli_fetch_assoc($result)) {\n echo &quot;&lt;tr&gt;&quot;;\n echo &quot;&lt;td&gt;&quot; . $row['id'] . &quot;&lt;/td&gt;&quot;;\n echo &quot;&lt;td&gt;&quot; . $row['name'] . &quot;&lt;/td&gt;&quot;;\n echo &quot;&lt;td&gt;&quot; . $row['email'] . &quot;&lt;/td&gt;&quot;;\n echo &quot;&lt;/tr&gt;&quot;;\n}\n\necho &quot;&lt;/table&gt;&quot;;\nmysqli_close($connection);\n?&gt;\n</code></pre>\n<p>It is a part of a recruitment task I got and I am scratching my head because from my understanding of SQL injections this code is already injection proof as we don't pass any user input as a variable to the database. Am I right or am I missing something?</p>\n<p>If I am right and the code is already injection proof I wonder if it is a tricky question or just an oversight from the person that prepared this task. Is it a good practice to still use prepared statements in a case like this? If you were in my place would you just use prepared statement and call it a day or would you point it out to the recrutier and show usage of prepared statements on more suitable example?</p>\n"^^ . + . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + "doctrine"^^ . + "cacerts"^^ . + "1"^^ . + . + "1"^^ . + . + "1"^^ . + . + "proxy"^^ . + . + "1"^^ . + . + "0"^^ . + "1"^^ . + . + "1"^^ . + . + "0"^^ . + "That looks like you have literal backslashes in your db then. Do you know what was used to convert the data in the first place? Is it just `\\x` escape sequences you need to handle? Maybe simply `stripcslashes()` will work in your case (`var_dump(stripcslashes($iso_string_from_db));` outputs `string(6) "André"`)"^^ . + . + . + . + . + . + . + "If there are no cookies, the file will not be created, compare: https://curl.se/libcurl/c/CURLOPT_COOKIEJAR.html"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + "Are you sure you were editing the right INI file? Did you restart the server after changing the file?"^^ . + . + "<p>I finally found the issue</p>\n<p>in the app.php you have the description of the default database:</p>\n<pre><code>'className' =&gt; Connection::class,\n</code></pre>\n<p>in the app_local.php i had to redeclare for extra datasources:</p>\n<pre><code>'className' =&gt; 'Cake\\Database\\Connection',\n</code></pre>\n<p>i have no idea why, but this is what worked for me</p>\n"^^ . + . + "<p>This docs seems to be outdated. The code above seems to have moved to AuthServericeProvider and there is already the original code that returns the URL in the email. That can be modified to get the desired URL.</p>\n"^^ . + . + . + "0"^^ . + . + . + . + "for destroying a JWT token the jwt package doesn't provide it for the solution check the response in this link\nhttps://stackoverflow.com/questions/37959945/how-to-destroy-jwt-tokens-on-logout"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + "1"^^ . + "0"^^ . + . + . + "[`default` doesn't need a `break`.](https://stackoverflow.com/q/12047999/2943403) There is no benefit to repeating `rgar($entry, (string)$field->id)` in each case. Instead of using separate variables, declare a whitelist array of expected field labels, iterate that, populate a row/array of populated values from the function call, remove empty elements, pass that filtered payload to `overwrite_action()`. If you don't want to change the function signature of `overwrite_action()` to receive an associative array or object, then you'll need to perform the filtering inside that function."^^ . + "<p>I have an Employee and a Salary Model.</p>\n<p>An Employee has many Salaries and one Salary which is defined like this:</p>\n<pre><code> public function salary(): HasOne\n {\n return $this-&gt;hasOne(Salary::class)-&gt;ofMany([\n 'start_date' =&gt; 'max',\n 'id' =&gt; 'max',\n ], fn ($query) =&gt; $query-&gt;whereDate('start_date', '&lt;=', now()));\n }\n</code></pre>\n<p>Now the tricky part - if no Salary in the past exists it should return this</p>\n<pre><code>return $this-&gt;hasOne(Salary::class)-&gt;ofMany('start_date', 'min');\n</code></pre>\n<p>I tried to combine them with an check</p>\n<pre><code> public function salary(): HasOne\n {\n if (\n $this-&gt;salaries()\n -&gt;where('employee_id', $this-&gt;id)\n -&gt;whereNowOrPast('start_date')-&gt;count() == 0\n ) {\n return $this-&gt;hasOne(Salary::class)-&gt;ofMany('start_date', 'min');\n }\n\n return $this-&gt;hasOne(Salary::class)-&gt;ofMany([\n 'start_date' =&gt; 'max',\n 'id' =&gt; 'max',\n ], fn ($query) =&gt; $query-&gt;whereDate('start_date', '&lt;=', now()));\n }\n</code></pre>\n<p>The first unexpected thing was that I needed to add the employee_id to the query. This works for a single <code>$employee-&gt;salary</code>, but when I query all Employee <code>with('salary')</code>, I receive wrong data.</p>\n<p>Any ideas? Thanks in advance!</p>\n<p><strong>Edit</strong></p>\n<p>After about 10 non working solutions Copilot came with this <strike>(in my case) working solution</strike>.</p>\n<pre><code>return $this-&gt;hasOne(Salary::class)\n -&gt;ofMany([], function (Builder $query) {\n $query-&gt;where(function (Builder $query) {\n $query-&gt;whereNowOrPast('start_date')\n -&gt;orderBy('start_date', 'desc')\n -&gt;limit(1);\n })-&gt;orWhere(function (Builder $query) {\n $query-&gt;whereFuture('start_date')\n -&gt;orderBy('start_date', 'asc')\n -&gt;limit(1);\n });\n }); \n</code></pre>\n<p>Any thoughts? Are there any drawbacks?</p>\n<p><strong>edit 2</strong></p>\n<p>above solution worked for current sate - if a Salary is added this get's the most recent one - do not know why atm</p>\n"^^ . + . + "0"^^ . + . + "0"^^ . + . + "prefix"^^ . + . + . + . + . + . + "1"^^ . + "What version of chart.js are you using? Your scale options are a combination that can't work: `xAxes: [...]` and `yAxes: [...]` are valid for chart.js versions 2, while `y: {...}` works for newer versions, including the latest 4.4.8 version"^^ . + "1"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + . + "Thank you for the answer! I've finally understood how it works. By **$department->setInstitute(rand(1,4));** I tried to insert IDs directly having 4 institutes in array. My mistake that I've not described those arrays.\n\nYes, setInstitute() is default. \n\n**$department->setInstitute(array_rand($instituteEntitites);** does not return an object, so I've edited it a little and pinned to my question as the answer."^^ . + "backend"^^ . + . + . + . + . + "That's because those variables do not contain what you think they do. `$STR_phpwidth is a string variable, and has a value of 1920` - that `1920` is _not_ the value of your PHP variable. The PHP variable contains the literal text `<script>document.writeln(w);</script>`. Once you send this to the browser, the browser will execute this JavaScript, and write `1920` in its place. But your PHP variable _never_ contained the value `1920`."^^ . + . + . + . + "_"Windows 11 .. NTS for x64"_ OK, [the APCu cache is per-process on Windows](https://www.php.net/manual/en/intro.apcu.php), so this seems to be as expected."^^ . + "0"^^ . + "3"^^ . + . + "1"^^ . + . + "0"^^ . + . + . + . + "There is even other solution, moving into other file. I don't know why it works, but intuition said me to check it. If someone be nice to explain that i will be pleased."^^ . + "There are long-existing answers for your new/remaining questions :). [what is the difference between LENGTH vs CHAR_LENGTH](https://stackoverflow.com/q/1734334/761202) + [should I store html entities in the db](https://stackoverflow.com/q/9299152/761202)."^^ . + "linux"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "Thanks @ArkadiuszDrabczyk just tried it, but same result, I updated the question at the end with the details."^^ . + . + "<p>This kind of issue is usually not about the route definition itself but rather about middleware or guard configuration intercepting the request before your controller method is hit. Try temporarily remove any middleware (or create a test route without auth middleware) to see if your backToCustomer method is hit. For example, define a test route that calls your method and has no middleware applied. If this works, then the issue is with one of your middlewares intercepting the route.</p>\n<p>infact, remove them one by one using</p>\n<pre><code>Route::get('back-to-customer', [\\App\\core\\auth\\LoginController::class, 'backToCustomer'])\n -&gt;withoutMiddleware([YourSuspectMiddleware::class])\n -&gt;name('back-to-customer');\n</code></pre>\n<p>this will help you identify which one is responsible.</p>\n"^^ . + . + . + . + . + . + . + . + "Can you try PHP on the CLI to see if you get any extended debugging information?"^^ . + . + "3"^^ . + . + "<p>I think when you set <code>%resource-type%</code> as the slug for your custom post type, it interferes with other built-in WordPress routes (like the blog or author archives), causing them to 404.</p>\n<p>you should adjust how you define the rewrite rules to prevent conflict with other parts of WordPress.</p>\n<p>Avoid using <code>%resource-type%</code> in the post type slug AND Rewrite the taxonomy and custom post type URLs.</p>\n<p>Change this line:</p>\n<pre><code>'slug' =&gt; '%resource-type%',\n</code></pre>\n<p>To:</p>\n<pre><code>'slug' =&gt; 'resources/%resource-type%'\n</code></pre>\n<p>Change <code>wpd_post_link</code> function to the following codes to rewrite the permalink:</p>\n<pre><code>function wpd_post_link( $post_link, $id = 0 ) {\n $post = get_post($id); \n if ( is_object( $post ) &amp;&amp; $post-&gt;post_type == 'resource' ) {\n $terms = wp_get_object_terms( $post-&gt;ID, 'resource-type' );\n if( $terms ) {\n foreach( $terms as $term ) {\n if( 0 == $term-&gt;parent ) {\n return str_replace( '%resource-type%' , $term-&gt;slug , $post_link );\n }\n }\n } else {\n return str_replace( '%resource-type%' , 'uncategorized', $post_link );\n }\n }\n return $post_link;\n}\n</code></pre>\n<p>Then add this line:</p>\n<pre><code>add_filter( 'post_type_link', 'wpd_post_link', 1, 3 );\n</code></pre>\n<p>Also you should remove <code>wpd_taxonomy_pagination_rewrites</code> function and <code>add_action( 'init', 'wpd_taxonomy_pagination_rewrites' );</code> line.</p>\n<p>Now your custom post URLs should be like: <code>site-url/resources/resource-type/post-title</code> and your other archives should work correctly</p>\n"^^ . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + "<p>Try this:</p>\n<pre><code> public function renderCustomNumericField()\n {\n \n $numericField = new Numeric('customfield', [\n 'class' =&gt; 'custom-input',\n 'placeholder' =&gt; 'Optional text'\n ]);\n\n return '&lt;div class=&quot;custom-group&quot;&gt;\n &lt;span class=&quot;gv-tip&quot; title=&quot;Lorem&quot;&gt;' . \n $numericField-&gt;render() .\n '&lt;i class=&quot;fas fa-info-circle&quot;&gt;&lt;/i&gt;\n &lt;/span&gt;\n &lt;/div&gt;';\n }\n</code></pre>\n"^^ . + . + . + "2"^^ . + "slug"^^ . + . + . + "Remove ~/.config/herd-lite directory ;)\n(but of course, you need to understand why it is there, which app use it)"^^ . + "0"^^ . + . + "But for AES/CBC, your approach is OK. For a *simple* AEAD you could add a MAC (but to make the AEAD really secure, more would be needed, see [libsodium, Encrypted streams and file encryption](https://libsodium.gitbook.io/doc/secret-key_cryptography/secretstream), listing of properties in the 1st section, which is why a reliable library like libsodium would be the more recommendable approach for an AEAD)."^^ . + "Yajra Datatables changes datetimes incorrectly"^^ . + "-2"^^ . + . + . + "<p>Currently I am using following code to export mysql data to csv file</p>\n<pre><code>&lt;?php\n include(&quot;db.php&quot;);\n $query = &quot;SELECT * FROM my_table&quot;;\n\n $delimiter = &quot;,&quot;; \n $filename = &quot;MY-LIST-&quot; . date('d-F-Y-H-i-s') . &quot;.csv&quot;;\n \n $f = fopen('php://memory', 'w'); \n\n $fields = array('ID', 'FIRST NAME', 'LAST NAME', 'EMAIL', 'GENDER', 'COUNTRY', 'CREATED', 'STATUS');\n fputcsv($f, $fields, $delimiter); \n \n $result = $database-&gt;get_results($query);\n foreach($result as $row){ \n $lineData = array($row['id'], $row['first_name'], $row['last_name'], $row['email'], $row['gender'],$row['country'], $row['date_created'], $row['member_status']);\n fputcsv($f, $lineData, $delimiter); \n } \n\n fseek($f, 0);\n\n header('Content-Type: text/csv'); \n header('Content-Disposition: attachment; filename=&quot;' . $filename . '&quot;;'); \n \n //output all remaining data on a file pointer \n fpassthru($f); \n\n?&gt;\n</code></pre>\n<p>Above Code is working ok ! and creating csv as expected.</p>\n<p><strong>Now I have another mysql table with around 89 columns and I want to export it to csv.</strong></p>\n<p>To reduce time consuming typing work, I need to fetch column names and put their values in array.</p>\n<p>Current code I am trying is as follows :</p>\n<pre><code>&lt;?php\n include(&quot;db.php&quot;);\n\n $result1 = $database-&gt;list_fields_name_serially('my_table'); \n // Getting all column names as comma separated list as id, first_name, last_name, email, gender, country, date_created, member_status, column_1, column_2, ......, column_89... (there is space after comma and before each column name)\n\n $result2 = strtoupper(str_replace(&quot;_&quot;, &quot; &quot;, $result1)); // removing underscore\n $result = strtoupper(str_replace(&quot;,&quot;, &quot;' , ' &quot;, $result2)); // replacing comaa with comma nad single quotes\n\n $delimiter = &quot;,&quot;; \n\n $filename = &quot;MY-LIST-&quot; . date('d-F-Y-H-i-s') . &quot;.csv&quot;;\n \n $f = fopen('php://memory', 'w'); \n\n $fields = array($result); // output = array('ID', 'FIRST NAME', 'LAST NAME', 'EMAIL', 'GENDER', 'COUNTRY', 'CREATED', 'STATUS');\n\n fputcsv($f, $fields, $delimiter); \n\n $field_name = explode(&quot;,&quot;, str_replace(&quot; &quot;, &quot;&quot;, $result1));\n\n $resultdata = $database-&gt;get_results(&quot;select * from my_table&quot;);\n foreach($resultdata as $row){\n foreach($field_name as $k =&gt; $v){ \n $lineData[$k] = array($row[$v]);\n }\n \n fputcsv($f, $lineData, $delimiter); \n }\n\n fseek($f, 0); \n \n// Set headers to download file rather than displayed \nheader('Content-Type: text/csv'); \nheader('Content-Disposition: attachment; filename=&quot;' . $filename . '&quot;;'); \n \n//output all remaining data on a file pointer \nfpassthru($f); \n?&gt;\n</code></pre>\n<p>BUT IT IS NOT WORKING..... SCRIPT RUNS FOR FEW MINUTES AND THEN CREATES A CSV WITH ERRORS IN IT - Warnig : Array to string conversion on line 54 i.e. fputcsv($f, $lineData, $delimiter);</p>\n"^^ . + . + "1"^^ . + . + "<p>it looks your code is fine i change little bit try this</p>\n<pre><code>add_action( 'elementor/element/call-to-action/section_content/before_section_end', function( $widget ) {\n $widget-&gt;update_control(\n 'description',\n [\n 'type' =&gt; \\Elementor\\Controls_Manager::WYSIWYG,\n ]\n );\n}, 10, 1 );\n</code></pre>\n"^^ . + . + . + "0"^^ . + . + . + "3"^^ . + . + . + "1"^^ . + "woocommerce-blocks"^^ . + . + . + "1"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + "2"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + "1"^^ . + . + . + "<p>I am trying to figure out what is the best approach to a reusable symfony application which has this key feature:</p>\n<ul>\n<li>It uses a company shared private bundle which is being used in different projects (not just copies of the main app)</li>\n<li>It has the main app which is the reusable one with optional feature that can be enabled via database</li>\n<li>Each main app installation can have one or more extra feature bundle (which are extra private GIT repository). The key point here is that it may happen that for one installation i may want FeatureA to be in &quot;beta mode&quot; (so let's say like a develop branch) while some other installation may still want the feature in &quot;stable mode&quot;. This would bring incoherence in my composer.json file and i can't find any good solution to this issue.</li>\n</ul>\n<p>For example let's say my company shared private bundle is just a set of services that can handle some common utility tasks. The main app can be something like &quot;stock management&quot; then for some reason one installation may be needed to be used as a base for a book store, the other one for a shop center where each one has their own special needs to add extra feature around the base stock management layer</p>\n<p>My question are:</p>\n<ol>\n<li>Has this approach have any sense at all? If not, what are the alternatives?</li>\n<li>If keeping everything separated as i said is doable, how should i handle different composer.json, assets (css/js), templates and more important symfony routes?</li>\n</ol>\n<p>I would accept any answer that leads me to a solid, robust and maintainable long-term solution</p>\n<p>I tried approaching the issue by creating 3 different repository: the shared private bundle, the main app and the feature bundle but i can't seem to find the will to continue before i know if the decision made is solid enough to be used as base structure for the project</p>\n"^^ . + . + . + . + . + "3"^^ . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + "How do I flag all of the correct replies as there are a few and how do I provide the finished code for others to see the results. Thank you all."^^ . + . + . + "1"^^ . + . + "<p>the issue was in my nginx.conf that i was declaring wrongly, basiclaly i missed a line\ninclude /etc/nginx/mime.types;</p>\n<p>thing is nginx can't interpret(i belive) css js etc files differently so it needs config commands to tell what files are what,\nmy updated nginx.conf is</p>\n<pre><code>events {}\nhttp {\n include /etc/nginx/mime.types; # i missed this line here\n default_type application/octet-stream;\n\n server {\n listen 80;\n server_name localhost;\n root /var/www/html;\n index index.php index.html index.htm;\n location / {\n try_files $uri $uri/ /index.php?$args;\n }\n location ~ \\.php$ {\n include fastcgi_params;\n fastcgi_pass wordpress-main:9000; # Connect to WordPress FPM container\n fastcgi_index index.php;\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n }\n location ~* \\.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|otf|eot|mp4|webm|ogv|zip|gz|tar|rar|bz2|7z|xml|rss|json|atom|webp)$ {\n expires max;\n log_not_found off;\n }\n }\n}\n\n</code></pre>\n"^^ . + "0"^^ . + . + . + "<p>I didn't check your code. If you want to redirect to a custom IP, you can use htaccess.The code negatively impacts site performance.\nsample code in htaccess:</p>\n<pre><code>RewriteEngine On\nRewriteCond %{REMOTE_ADDR} ^123\\.456\\.789\\.000$\nRewriteRule ^(.*)$ /custom-page [R=301,L]\n</code></pre>\n"^^ . + "0"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + . + "6"^^ . + . + "https://github.com/phpstan/phpstan/issues/2683"^^ . + . + . + "0"^^ . + "PHP exec() - unzip large file - how to check if the process is finished?"^^ . + "0"^^ . + . + . + "0"^^ . + "@C3roe I think that's what this question is about: How to use the `$slug` in the URL of the API endpoint to get the wanted result. It requires a bit of digging in the Magento (or should I say: Adobe) documentation for the API endpoint. It's unclear if Lydia Kirubai S has done this, but couldn't work it out, or just didn't bother."^^ . + . + "Why isAdmin method in User model does not work?"^^ . + . + . + . + . + "One thing is that to look at how a human would approach a problem is not usually as clear cut as you think it is. People will approach it in various ways. Something which does help though is having a simple and clear solution which makes it easier to maintain."^^ . + "1"^^ . + . + . + . + "@AlexHowansky: That's true, but also true is: In case it is a SimpleXMLElement, it has a string value."^^ . + "0"^^ . + "ActiveITzone Active eCommerce CMS disables the browser console"^^ . + "3"^^ . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + "journal"^^ . + "0"^^ . + "<p>I am very new to Linux, ODBC and php in general but most of the times I manage to resolve the issues I run into. Until now.</p>\n<p>We run a Linux/Ubuntu server and I have a php script that should talk to an external (readonly) SQL anywhere 17 database via ODBC.\nI managed to get this working once, but then managed to crash it all and now even after restoring to a working snapshot I can't get it working again.</p>\n<pre><code>lrwxrwxrwx 1 root root 18 Feb 28 10:13 libdbodbc17_r.so -&gt; libdbodbc17_r.so.1\n-rwxr-xr-x 1 www-data www-data 1804560 Feb 28 10:13 libdbodbc17_r.so.1\n</code></pre>\n<p>Running isql from terminal:</p>\n<pre><code>sudo -u www-data isql -v DSN UID PASSWORD\n[01000][unixODBC][Driver Manager]Can't open lib '/opt/sqlanywhere17/lib64/libdbodbc17_r.so' : file not found\n[ISQL]ERROR: Could not SQLConnect\n</code></pre>\n<p>I added the line export <code>LD_LIBRARY_PATH=/opt/sqlanywhere17/lib64</code> into <code>/etc/apache2/envvars</code> to make sure apache is looking in the right library.</p>\n<p>It seems to partially resolve the issue, but introduces me to a new issue:</p>\n<blockquote>\n<p>[IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed [ISQL]ERROR: Could not SQLConnect</p>\n</blockquote>\n<p>This, I can not wrap my head around why or where its coming from.</p>\n<p>Running ISQL as logged on terminal user (not root):\n<a href="https://i.sstatic.net/cwDJX2bg.png" rel="nofollow noreferrer">logged on user</a></p>\n<p><a href="https://limewire.com/d/54376539-bb4e-4c94-a181-89917e08aa84#PGdJhv2tiVVm4gbRITy98aDuZI9tjEHHtBGXKV81k3w" rel="nofollow noreferrer">Strace trying connection as www-data</a></p>\n<p><a href="https://limewire.com/d/77857cf4-bea2-4884-bca5-2921b2439292#HhGInc2RWmIfJqe0iwSf443EXRor4hPmjiQAharSGEg" rel="nofollow noreferrer">Strace as logged on user</a></p>\n"^^ . + . + "I'm obviously pretty poor sat explaining my issue.\nUPDATE users SET password = '$2y$10$LMVq3s0VNdVlgFPEE5XBE.eFlgo47N2GpoEoojg40up6T8rrfPwuG' WHERE id = '156'\nRuns succesfully but does no update.\nUPDATE users SET password = '$2y$10$LMVq3s0VNdVlgFPEEsXBE.eFlgo47N2GpoEoojg40up6T8rrfPwuG' WHERE id = '156'\nRuns and updates the DB. I changed a 5 to an s from the output of the password_hash\nThe script on the linked page does the same thing. No updates from a valid statement.\nLets call it a day though so I'm not wasting your time. I appreciate the help you have provided. I'll work it out."^^ . + "0"^^ . + "opencart2.3"^^ . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + "<p>The key issue here is operator precedence. In PHP, both the cast operator <code>(int)</code> and the comparison operator <code>&lt;</code> have a higher precedence than the null coalescing operator <code>??</code>. This means that in your first example</p>\n<pre><code>((int)$var['x']??0 &lt; 1 )\n</code></pre>\n<p>PHP interprets the expression as if you had written:</p>\n<pre><code>(((int)$var['x']) ?? (0 &lt; 1))\n</code></pre>\n<p>Here’s what happens step-by-step:</p>\n<ol>\n<li><p><strong>Casting:</strong> <code>(int)$var['x']</code> is evaluated first, converting the string <code>&quot;5&quot;</code> to the integer <code>5</code>.</p>\n</li>\n<li><p><strong>Comparison:</strong> The <code>&lt;</code> operator is evaluated next. Since <code>&lt;</code> has a higher precedence than <code>??</code>, the expression <code>0 &lt; 1</code> is computed, yielding <code>true</code>.</p>\n</li>\n<li><p><strong>Null Coalescing:</strong> Now PHP evaluates <code>5 ?? true</code>. Because <code>5</code> is not <code>null</code>, the result of the null coalescing operator is <code>5</code>.</p>\n</li>\n<li><p><strong>Condition Check:</strong> In an <code>if</code> statement, a non-zero number is truthy, so the condition evaluates as <code>true</code>, and &quot;less than 1&quot; is printed.</p>\n</li>\n</ol>\n<p>In Example 2, a similar misinterpretation occurs:</p>\n<pre><code>($var['x']??5 &lt; 1 )\n</code></pre>\n<p>This is interpreted as:</p>\n<pre><code>($var['x'] ?? (5 &lt; 1))\n</code></pre>\n<p>Since <code>$var['x']</code> is <code>&quot;5&quot;</code> (a non-null value), the null coalescing operator returns <code>&quot;5&quot;</code>. In PHP, a non-empty string (other than <code>&quot;0&quot;</code>) is truthy, so the condition is true, and &quot;less&quot; is printed.</p>\n<p>In Example 3, you force the intended order by adding parentheses.</p>\n<pre><code>((int)($var['x']??0) &lt; 1 )\n</code></pre>\n<p>Here, the expression inside the parentheses <code>$var['x']??0</code> is evaluated first. Since <code>$var['x']</code> exists, it returns <code>&quot;5&quot;</code>, which is then cast to <code>5</code>. The comparison <code>5 &lt; 1</code> correctly evaluates to <code>false</code>, so &quot;more than 1&quot; is printed.</p>\n<p>The unexpected behavior arises because without the proper grouping, PHP evaluates the cast and the comparison before applying the null coalescing operator. Adding explicit parentheses clarifies the order of operations and ensures the expression evaluates as intended.</p>\n"^^ . + . + . + . + . + "I'm asking how to inform PHPStan of what's what in this specific series of chained methods. I don't know of an online resource that would enable me to share a "minimal" working example with the same chaining structure of Collection methods."^^ . + . + "0"^^ . + . + . + "<p>Check meta_value (<code>a:1:{s:25:&quot;skills&quot;;s:1:&quot;4&quot;;}</code>) accordance to pattern</p>\n<pre><code>'a:[0-9]:{s:[0-9]{1,3}:&quot;skills&quot;;s:[0-9]:&quot;[0-9]{1,3}&quot;;}'\n</code></pre>\n<p>Then take part (<code>{s:25:&quot;skills&quot;;s:1:&quot;4&quot;;}</code>) with pattern</p>\n<pre><code>'{s:[0-9]{1,3}:&quot;skills&quot;;s:[0-9]:&quot;[0-9]{1,3}&quot;;}'\n</code></pre>\n<p>Then part (<code>:&quot;4&quot;;</code>) with pattern</p>\n<pre><code>':&quot;[0-9]{1,3}&quot;;'\n</code></pre>\n<p>Then part(<code>4</code>) with pattern</p>\n<pre><code>'[0-9]{1,3}'\n</code></pre>\n<p>See example</p>\n<div class="s-table-container"><table class="s-table">\n<thead>\n<tr>\n<th style="text-align: right;">id</th>\n<th style="text-align: left;">meta_key</th>\n<th style="text-align: left;">meta_value</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style="text-align: right;">1</td>\n<td style="text-align: left;">rating</td>\n<td style="text-align: left;">a:1:{s:25:&quot;skills&quot;;s:1:&quot;4&quot;;}</td>\n</tr>\n<tr>\n<td style="text-align: right;">2</td>\n<td style="text-align: left;">rating</td>\n<td style="text-align: left;">a:1:{s:25:&quot;skills&quot;;s:1:&quot;3&quot;;}</td>\n</tr>\n<tr>\n<td style="text-align: right;">3</td>\n<td style="text-align: left;">rating</td>\n<td style="text-align: left;">a:1:{s:9:&quot;skills&quot;;s:1:&quot;123&quot;;}</td>\n</tr>\n<tr>\n<td style="text-align: right;">4</td>\n<td style="text-align: left;">rating</td>\n<td style="text-align: left;">a:1:{s:9:&quot;weight&quot;;s:1:&quot;70&quot;;}</td>\n</tr>\n<tr>\n<td style="text-align: right;">5</td>\n<td style="text-align: left;">hobby</td>\n<td style="text-align: left;">a:1:{s:9:&quot;skills&quot;;s:1:&quot;100&quot;;}</td>\n</tr>\n<tr>\n<td style="text-align: right;">6</td>\n<td style="text-align: left;">rating</td>\n<td style="text-align: left;">a:1:{s:9:&quot;skills&quot;;s:13:&quot;200&quot;;}</td>\n</tr>\n</tbody>\n</table></div>\n<pre><code>select meta_key\n ,sum(\n regexp_substr(\n regexp_substr(\n regexp_substr(meta_value\n ,'{s:[0-9]{1,3}:&quot;skills&quot;;s:[0-9]:&quot;[0-9]{1,3}&quot;;}')\n ,':&quot;[0-9]{1,3}&quot;;')\n ,'[0-9]{1,3}'\n ) -- s_skill_value\n )totSum\n ,count(*) as cnt\nfrom test\nwhere meta_key='rating' \n and length(regexp_substr(meta_value,'a:[0-9]:{s:[0-9]{1,3}:&quot;skills&quot;;s:[0-9]:&quot;[0-9]{1,3}&quot;;}'))&gt;0\n</code></pre>\n<div class="s-table-container"><table class="s-table">\n<thead>\n<tr>\n<th style="text-align: left;">meta_key</th>\n<th style="text-align: right;">totSum</th>\n<th style="text-align: right;">cnt</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style="text-align: left;">rating</td>\n<td style="text-align: right;">130</td>\n<td style="text-align: right;">3</td>\n</tr>\n</tbody>\n</table></div>\n<p>Last row <code>a:1:{s:9:&quot;skills&quot;;s:13:&quot;200&quot;;}</code> do not match pattern with <code>s:13</code>. There should be 1 digit.</p>\n<p><a href="https://dbfiddle.uk/ephNIl-G" rel="nofollow noreferrer">fiddle</a></p>\n"^^ . + . + . + . + . + "1"^^ . + "<p>My website use oauth from google and facebook.</p>\n<p>It works fine, but when users come from google, the login is transparent: they are redirected to a page from google which auto redirect after on my website.</p>\n<p>But with Facebook, it always open a window asking permissions, even if I accepted them before, so it's an useless step for my customers when they log into my website.</p>\n<p>Here is where my users are redirected when they clic &quot;login with facebook&quot; when they already created an account using facebook oauth: <a href="https://i.imgur.com/ap5h8ku.png" rel="nofollow noreferrer">https://i.imgur.com/ap5h8ku.png</a></p>\n<p>This is the code I use</p>\n<pre><code>$app_id = &quot;123456789&quot;;\n$app_secret = &quot;8zpsuzj6d5z4xxxxxx&quot;;\n$redirectURL = 'https://www.my-website.com/controller/oauthController.php?auth=facebook';\n\n\nrequire_once ROOT.'/files/lib/Facebook/autoload.php';\n\n$provider = new \\League\\OAuth2\\Client\\Provider\\Facebook([\n 'clientId' =&gt; $app_id,\n 'clientSecret' =&gt; $app_secret,\n 'redirectUri' =&gt; $redirectURL,\n 'graphApiVersion' =&gt; 'v2.10',\n]);\n\n\n\n// If we don't have an authorization code then get one\n$authUrl = $provider-&gt;getAuthorizationUrl([\n 'scope' =&gt; ['email', 'public_profile'],\n]);\n\n \nheader(&quot;Location: &quot;.$authUrl);\nexit;\n</code></pre>\n<p>Thanks for help. I tested some sites using facebook and when the first prompt asking authorisazion is accepted, we can login/logout without being redirected to facebook modal ...</p>\n"^^ . + . + . + "0"^^ . + "Which file? Name it! Additionally show how you did that with that file previously. Add all those relevant details to your question by **editing it**."^^ . + . + "<p>I dont know why it's not working because I try to log it and this is the result</p>\n<blockquote>\n<p>Updating message: 68\nchat:1641 test edit 54\nchat:1642 test edit 53\nchat:1644 test edit 54</p>\n</blockquote>\n<p>and this is the actual code</p>\n<pre><code>function updateMessageRow(messageRow, message) {\n console.log('Updating message:', message.message_id);\n if (messageRow.length) {\n \n const bubble = messageRow.find('.bubble'); \n const timestamp = messageRow.find('span');\n\n // Update the content\n console.log(message.message);\n console.log(bubble.find('p').html());\n bubble.find('p').html(message.message);\n console.log(bubble.find('p').html());\n if (timestamp.length &gt; 0) {\n timestamp.text(message.created_at);\n }\n\n messageRow.hide().show();\n }\n scrollToBottom();\n}\n</code></pre>\n<p><a href="https://i.sstatic.net/cXOhdjgY.png" rel="nofollow noreferrer">This is the image for UI</a></p>\n<p>I also tried append the message to the bubble and still not work, I don't think that the message value is incorrect because in my console.log I'm getting the correct value</p>\n<p>This is where the updateMessageRow function is called</p>\n<pre><code>function reloadChatMessage() {\n $.ajax({\n url: &quot;{{ route('reloadobs.chat.message') }}&quot;,\n type: &quot;POST&quot;,\n data: {\n _token: &quot;{{ csrf_token() }}&quot;, // CSRF token for Laravel\n chatUpdate: JSON.stringify(chatUpdate) // Send the last update data\n },\n success: function(response) {\n if (response.status === 'initial_load') {\n // Initial load: Update the entire chat list\n chatUpdate = response.chatUpdate;\n if (response.messages &amp;&amp; response.messages.length &gt; 0) {\n response.messages.forEach(message =&gt; {\n appendMessage(message);\n });\n scrollToBottom();\n }\n } else if (response.status === 'count_changed') {\n // Handle new chats and deleted chats\n chatUpdate = response.chatUpdate;\n // Add new chats to the list\n if (response.newMessages &amp;&amp; response.newMessages.length &gt; 0) {\n response.newMessages.forEach(message =&gt; {\n appendMessage(message);\n });\n scrollToBottom();\n }\n\n // Remove deleted chats from the list\n if (response.deletedMessageIds &amp;&amp; response.deletedMessageIds.length &gt; 0) {\n response.deletedMessageIds.forEach(messageId =&gt; {\n $(`#messageRow_${messageId}`).remove(); // Remove the chat by ID\n });\n }\n } else if (response.status === 'chat_updated') {\n chatUpdate = response.chatUpdate;\n if (response.messages) {\n const message = response.messages;\n console.log(message);\n const messageRow = $(`#messageRow_${message.message_id}`);\n if (messageRow.length) {\n updateMessageRow(messageRow, message);\n } else {\n appendMessage(message);\n }\n scrollToBottom();\n }\n } else if (response.status === 'no_changes') {\n // No changes detected\n chatUpdate = response.chatUpdate;\n } else {\n console.log('Error:', response.message);\n }\n },\n error: function(xhr, status, error) {\n console.error('Error occurred:', xhr.responseText);\n console.error('Error occurred:', status);\n console.error('Error occurred:', error);\n }\n });\n}\n</code></pre>\n<p>The purpose of updateMessageRow is to change the value of row that edited using messageRow and the message new value</p>\n<p>and for the php controller is here:</p>\n<pre><code>public function reloadChatMessage(Request $request){\n // Retrieve all tasks from the database.\n $userId = Auth::id();\n\n // Fetch the chats where the user is a participant, sorted by the last message time\n $chatParticipant = ChatParticipant::where('chat_participants.user_id', $userId)-&gt;where('is_here', 1)-&gt;first();\n\n $messagesResult = [];\n if (!$chatParticipant) {\n return response()-&gt;json([\n 'status' =&gt; 'no_changes',\n 'chatUpdate' =&gt; $request-&gt;chatUpdate,\n 'messages' =&gt; $messagesResult\n ]);\n }\n\n $chatId = $chatParticipant-&gt;chat_id;\n $messages = Message::where('chat_id', $chatId)-&gt;get();\n foreach ($messages as $message) {\n $formattedTime = Carbon::parse($message-&gt;created_at);\n $formattedTime = $formattedTime-&gt;isToday()\n ? $formattedTime-&gt;format('h:i A')\n : $formattedTime-&gt;format('h:i A, M d');\n\n $messagesResult[] = [\n 'message_id' =&gt; $message-&gt;id,\n 'chat_id' =&gt; $chatId,\n 'user_id' =&gt; $message-&gt;user_id,\n 'message' =&gt; $message-&gt;message,\n 'status' =&gt; $message-&gt;status,\n 'last_seen' =&gt; $message-&gt;last_seen,\n 'created_at' =&gt; $formattedTime,\n 'photo' =&gt; $message-&gt;user-&gt;photo,\n 'my_id' =&gt; $userId,\n 'updated_at' =&gt; $message-&gt;updated_at-&gt;toIso8601String()\n ];\n }\n\n\n // Get client's last snapshot\n $currentSnapshot = [];\n foreach ($messagesResult as $message) {\n $currentSnapshot[$message['message_id']] = $message['updated_at'];\n }\n\n $clientSnapshot = json_decode($request-&gt;chatUpdate, true);\n\n // If no client data was provided, treat this as the initial load.\n if (!$clientSnapshot || !is_array($clientSnapshot)) {\n return response()-&gt;json([\n 'status' =&gt; 'initial_load',\n 'chatUpdate' =&gt; $currentSnapshot,\n 'messages' =&gt; $messagesResult\n ]);\n }\n\n if (count($currentSnapshot) !== count($clientSnapshot)) {\n // Find new chats (chats in $currentSnapshot but not in $clientSnapshot)\n $newMessages = [];\n foreach ($currentSnapshot as $messageId =&gt; $updatedAt) {\n if (!isset($clientSnapshot[$messageId])) {\n $newMessage = collect($messagesResult)-&gt;firstWhere('message_id', $messageId);\n if ($newMessage) {\n $newMessages[] = $newMessage;\n }\n }\n }\n\n // Find deleted chats (chats in $clientSnapshot but not in $currentSnapshot)\n $deletedMessageIds = [];\n foreach ($clientSnapshot as $messageId =&gt; $updatedAt) {\n if (!isset($currentSnapshot[$messageId])) {\n $deletedMessageIds[] = $messageId;\n }\n }\n\n return response()-&gt;json([\n 'status' =&gt; 'count_changed',\n 'chatUpdate' =&gt; $currentSnapshot,\n 'newMessages' =&gt; $newMessages, // New chats to add\n 'deletedMessageIds' =&gt; $deletedMessageIds // Chat IDs to remove\n ]);\n }\n\n foreach ($currentSnapshot as $messageId =&gt; $serverUpdatedAt) {\n if (!isset($clientSnapshot[$messageId]) || $clientSnapshot[$messageId] !== $serverUpdatedAt) {\n $updateMessage = collect($messagesResult)-&gt;firstWhere('message_id', $messageId);\n if ($updateMessage) {\n return response()-&gt;json([\n 'status' =&gt; 'chat_updated',\n 'chatUpdate' =&gt; $currentSnapshot,\n 'messages' =&gt; $updateMessage // Return only the updated chat\n ]);\n }\n }\n }\n\n\n // No changes detected.\n return response()-&gt;json([\n 'status' =&gt; 'no_changes',\n 'chatUpdate' =&gt; $currentSnapshot,\n 'messages' =&gt; $messagesResult\n ]);\n}\n</code></pre>\n<p>I don't see any problem in the controller and where the function updateMessage() is call because the only problem is the .text() or .html() is not overriding the text inside.</p>\n<p>and also this is the updateMessageRow before:</p>\n<pre><code>function updateMessageRow(messageRow, message) {\n console.log('Updating message:', message.message_id);\n const $lastGroup = $('#messagesContainer li:last');\n const lastGroupUserId = $lastGroup.data('user-id');\n\n if ($lastGroup.length &gt; 0 &amp;&amp; lastGroupUserId === message.user_id) {\n // Append to existing group\n const $content = $lastGroup.find('.content');\n console.log('Updating message in if statements:', message.message_id);\n // Remove timestamp from previous last message\n const $lastMessage = $content.find('.message:last');\n $lastMessage.find('span').remove();\n\n messageRow.html(`\n &lt;div class=&quot;bubble nopoint&quot;&gt;\n &lt;p&gt;${message.message}&lt;/p&gt;\n &lt;/div&gt;\n &lt;span&gt;${message.created_at}&lt;/span&gt;\n `);\n } else {\n console.log('Updating message in else statements:', message.message_id);\n messageRow.html(`\n &lt;div class=&quot;bubble&quot;&gt;\n &lt;p&gt;${message.message}&lt;/p&gt;\n &lt;/div&gt;\n &lt;span&gt;${message.created_at}&lt;/span&gt;\n `);\n }\n scrollToBottom();\n}\n</code></pre>\n<p>one time this messageRow.html() work in else but when the code goes to if the messageRow.html is not working there.</p>\n"^^ . + "Having one .ini file for all your PHP versions sounds totally unworkable."^^ . + . + . + "0"^^ . + "1"^^ . + . + "Turn the description input field of Elementor's Call-To-Action Widget into a WYSIWYG-field"^^ . + . + . + . + . + . + "<p>the new widget editor doesn't load the javascript code inserted in the html code. then you can load the code with a separate file in the constructor of <code>OpenAI_Widget</code> like that :</p>\n<pre><code>if (is_admin()) {\n \n wp_enqueue_script(\n &quot;MY_PLUGIN__custom_js&quot; // id of the javascript file\n , plugins_url(&quot;widget/custom.js&quot;, __FILE__)\n , [] // no dependencies\n , &quot;3&quot; // put your plugin version here\n );\n \n // for passing data to the javascript code\n wp_localize_script(\n &quot;MY_PLUGIN__custom_js&quot; // id of the javascript file\n , &quot;my_plugin__data&quot; // javascript variable name\n ,\n [\n &quot;api_url&quot; =&gt; rest_url(&quot;my_plugin/openai_generate_text&quot;),\n ]\n );\n \n}\n</code></pre>\n<p>this javascript code is loaded with the widgets editor and the button doesn't exist at this moment. then you can manage the click like that :</p>\n<pre><code>document.addEventListener(&quot;DOMContentLoaded&quot;, e =&gt; {\n \n // hook the event listener to a higher node\n document.getElementById(&quot;widgets-editor&quot;).addEventListener(&quot;click&quot;, e =&gt; {\n \n if (&quot;generate_openai_backend_text&quot; !== e[&quot;target&quot;][&quot;id&quot;]) {\n // stop if it's not a click on the button\n return;\n }\n \n \n console.log(my_plugin__data[&quot;api_url&quot;]);\n \n \n // do the http request\n \n \n });\n \n});\n</code></pre>\n<p>and to create urls that return data, I recommend to add a custom endpoint in the api system of wordpress</p>\n<pre><code>add_action(&quot;rest_api_init&quot;, function () {\n \n register_rest_route(&quot;my_plugin&quot;, &quot;openai_generate_text&quot;,\n [\n &quot;methods&quot; =&gt; WP_REST_Server::EDITABLE, // POST PUT PATCH\n &quot;callback&quot; =&gt; function (\\WP_REST_Request $request) {\n \n $params = $request-&gt;get_params();\n \n $r = [\n &quot;success&quot; =&gt; TRUE,\n &quot;data&quot; =&gt; [\n &quot;text&quot; =&gt; &quot;api | {$params[&quot;prompt&quot;]}&quot;,\n ],\n ];\n \n return rest_ensure_response($r);\n \n },\n &quot;permission_callback&quot; =&gt; &quot;__return_true&quot;,\n ]\n );\n \n \n});\n</code></pre>\n<p>be careful that the javascript code you write doesn't work if there is more than one of this widget.</p>\n"^^ . + . + . + "0"^^ . + . + . + "<p>I run (Real Estate RETS) queries that will only return objects. The contents of these objects appear to be strings that contain different types of information about sets of images (ie. several different pictures from the same house). All I want is the link to each picture (&quot;Location:&quot; in the sample below), put into an array that I can use elsewhere in the script.</p>\n<p>I have figured out how to accomplish this using a nested set of <code>explode()</code> commands, but I was wondering if there is a more direct, efficient way to do this: something like <code>ltrim(delete everything to the end of the word &quot;Location: &quot;)</code>, and then <code>rtrim(delete everything after &quot;.jpg&quot;)</code> leaving me with each value in an array like <code>$picturelinks</code>.</p>\n<p>Here is a sample of the data I'd like to do this with.</p>\n<pre><code>Array (\n [1] =&gt; WhateverGibberish\n Content-Type: image/jpeg\n Content-ID: bunchofnumbers\n Object-ID: 1\n Location: http://cdn.photos.sparkplatform.com/met/347305719000000-o.jpg\n Content-Description: Welcome\n Preferred: 1\n \n [2] =&gt; WhateverGibberish\n Content-Type: image/jpeg\n Content-ID: bunchofnumbers\n Object-ID: 2\n Location: http://cdn.photos.sparkplatform.com/met/350148712000000-o.jpg\n Content-Description: Welcome home\n \n [3] =&gt; WhateverGibberish\n Content-Type: image/jpeg\n Content-ID: bunchofnumbers\n Object-ID: 3\n Location: http://cdn.photos.sparkplatform.com/met/351982042000000-o.jpg\n Content-Description: Brick\n\n [4] =&gt; WhateverGibberish\n Content-Type: image/jpeg\n Content-ID: bunchofnumbers\n Object-ID: 4\n Location: http://cdn.photos.sparkplatform.com/met/353549178000000-o.jpg\n Content-Description: Brix\n)\n</code></pre>\n<p>Here is the php code that does accomplish the task, but I wonder if there is a method that would run faster:</p>\n<pre><code>&lt;?php\n$photos = $rets-&gt;GetObject(&quot;Property&quot;, &quot;HiRes&quot;, $sysid, &quot;*&quot;, 1); //1 gets links\nforeach($photos as $photo) { //array includes everything for all photos \n unset ($photo['Success']); //not needed\n unset ($photo['Content-Type']); //not needed\n unset ($photo['Length']); //not needed\n \n $pile=explode('--',$photo['Data']);\n unset ($pile[0]);\n foreach ($pile as $blah) {\n $subpile=explode('Location: ',$blah);\n $picstuff[]=$subpile[1];\n }\n foreach($picstuff as $piclilnk) {\n $breakme=explode('Content-Description: ',$piclilnk);\n $linksonly[]=$breakme[0];\n $otherstuff[]=$breakme[1];\n }\n //print_r($linksonly);\n //print_r($otherstuff);\n?&gt;\n</code></pre>\n"^^ . + . + . + . + "0"^^ . + . + "1"^^ . + . + . + "1"^^ . + . + "2"^^ . + "0"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + "3"^^ . + . + . + . + "0"^^ . + . + . + "1"^^ . + "<p>Solution:\nIt is necessary to add an indication of the queue to the configuration, for example:</p>\n<pre><code>\n queues:\n searchIndex: ~\n</code></pre>\n"^^ . + . + . + . + "roblox"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + . + "<p>I've created an entity with the following ACL configuration:</p>\n<pre><code>/**\n * @ORM\\Entity\n * @ORM\\Table(name=&quot;my_table&quot;)\n * @ORM\\HasLifecycleCallbacks()\n * @Config(\n * routeView=&quot;my_route_view&quot;,\n * defaultValues={\n * &quot;security&quot;={\n * &quot;type&quot;=&quot;ACL&quot;,\n * &quot;group_name&quot;=&quot;&quot;,\n * &quot;permissions&quot;=&quot;VIEW&quot;\n * },\n * &quot;entity&quot;={\n * &quot;icon&quot;=&quot;fa-briefcase&quot;\n * },\n * &quot;dataaudit&quot;={\n * &quot;auditable&quot;=false\n * }\n * }\n * )\n *\n */\n</code></pre>\n<p>In the permission setting I only put the VIEW permission therefore, only the acl has been created for the view permission. Now I need to create ACL's for the rest of permissions: create, update and delete. I've tried the following solution:</p>\n<p>1.- Remove the permission attribute:</p>\n<pre><code>/**\n * @ORM\\Entity\n * @ORM\\Table(name=&quot;pb_inventory_synchronization_queue&quot;)\n * @ORM\\HasLifecycleCallbacks()\n * @Config(\n * routeView=&quot;pb_inventory_synchronization_queue_view&quot;,\n * defaultValues={\n * &quot;security&quot;={\n * &quot;type&quot;=&quot;ACL&quot;,\n * &quot;group_name&quot;=&quot;&quot;\n * },\n * &quot;entity&quot;={\n * &quot;icon&quot;=&quot;fa-briefcase&quot;\n * },\n * &quot;dataaudit&quot;={\n * &quot;auditable&quot;=false\n * }\n * }\n * )\n *\n */\n</code></pre>\n<p>2.- add permissions explicitly</p>\n<pre><code>/**\n * @ORM\\Entity\n * @ORM\\Table(name=&quot;pb_inventory_synchronization_queue&quot;)\n * @ORM\\HasLifecycleCallbacks()\n * @Config(\n * routeView=&quot;pb_inventory_synchronization_queue_view&quot;,\n * defaultValues={\n * &quot;security&quot;={\n * &quot;type&quot;=&quot;ACL&quot;,\n * &quot;group_name&quot;=&quot;&quot;,\n * &quot;permissions&quot;=&quot;VIEW;EDIT;DELETE;CREATED;&quot;\n * },\n * &quot;entity&quot;={\n * &quot;icon&quot;=&quot;fa-briefcase&quot;\n * },\n * &quot;dataaudit&quot;={\n * &quot;auditable&quot;=false\n * }\n * }\n * )\n *\n */\n</code></pre>\n<p>But it does not work. Only the view permission is showed in the role section, and when I try to edit, delete or create through the API a 403 error with this message is showed</p>\n<blockquote>\n<p>No access to this type of entities.</p>\n</blockquote>\n<p>What do you think I need to do to enable all the ACL's?</p>\n"^^ . + "@NicoHaase Thanks for your comment! I’ve removed Laravel 5 and 6, as they were added by mistake. I’ve used this code:\n\nif (null !== $request->server->get('HTTP_POSTMAN_TOKEN')) {\n abort(404);\n}\n\nHowever, this only blocks Postman requests and not cURL requests. Could you suggest a fix for this?"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + "1"^^ . + "2"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "4"^^ . + . + "Just writing "works not" is a bit thin, you should write what you expected and what happened instead. Additionally, look for errors (e.g. in logging etc.) and reveal the notices. Also make visible what you do not understand so that it is more clear what you are actually asking about."^^ . + . + "<p>Unfortunately, the <a href="https://github.com/datastax/php-driver" rel="nofollow noreferrer">Cassandra PHP driver</a> is no longer under active development, and hasn't had a PR merged in a few years.</p>\n<p>So there are a few options here:</p>\n<ul>\n<li><p>Revert your local PHP version back down to 7.1.x.</p>\n</li>\n<li><p>Build your data access layer using another language with a driver that is still actively developed: Java, Python, JS/TS/Node.js, etc.</p>\n</li>\n<li><p>Try <a href="https://astra.datastax.com" rel="nofollow noreferrer">Astra DB</a> as your database, and then you can take advantage of Astra's Data API, which negates the need for a driver as you can interact with your data layer with restful calls.</p>\n</li>\n</ul>\n<p>Now, I'm a DataStax employee, so I'm going to be a little biased here. But if you don't want to downgrade your local PHP version, then making some simple restful API calls might be the easiest way to go. At least give Astra DB a look. It's free tier is pretty generous, and then you wouldn't have to run your own DB, either.</p>\n"^^ . + "TYPO3 tx_news - fetch only news, that don't have any news related to them"^^ . + "This is a bug in the VSCode extension, and based on the bug report at https://community.devsense.com/d/2253-mysqli-driver-is-deprecated it will be fixed in the next update."^^ . + "0"^^ . + . + "Apache in macOS Sequoia with Apple Silicon"^^ . + "1"^^ . + . + "So I need another query builder in order to create raw SQL and then execute them if using the solution in https://stackoverflow.com/questions/53867867/doctrine-query-builder-inner-join-with-subselect"^^ . + "2"^^ . + "1"^^ . + "0"^^ . + . + "1"^^ . + "How to connect HTML to MySQL (Workbench) and PHP?"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + "no written by self"^^ . + . + . + . + "0"^^ . + . + . + "What do the SQL statements have to do with `password_verify`? If you are asking us why the passwords don't verify, provide the data you are testing it with. The SQL is irrelevant."^^ . + . + . + . + "<p>I suspect your Routing includes are wrong. You currently have:</p>\n<pre><code>'BudgetingModule\\Config/Routes.php',\n'FeeModule\\Config/Routes.php',\n</code></pre>\n<p>But you will need to make this something more like this:</p>\n<pre><code>'/var/www/html/path_to/BudgetingModule/Config/Routes.php',\n'/var/www/html/path_to/FeeModule/Config/Routes.php',\n</code></pre>\n<p>Note also you have forward slashes and backslashes in the same path which might confuse things. Alternatively if your modules are in the <code>APPPATH</code> location you can replace the <code>/var/www/html/path</code> bit.</p>\n"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + "<p>The sniff must be placed into a subdirectory in the <code>./sniffs</code> sub-directory of your ruleset directory <code>./_dev/MyCustom</code>:</p>\n<ol start="0">\n<li><code>./MyCustom</code> is missing (optional, you could re-use <code>./_dev</code> for it but then don't complain when you need to clean that up later, for the rest of the answer I'll use it)</li>\n<li>The directory <code>_dev/MyCustom/Sniffs</code> does not exists. <em>(<a href="https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Coding-Standard-Tutorial#creating-the-coding-standard-directory" rel="nofollow noreferrer">ref</a>)</em></li>\n<li>Read the rest of that page, no need to copy it all over here. There is <em>another</em> sub-directory to create <em>(<a href="https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Coding-Standard-Tutorial#creating-the-sniff" rel="nofollow noreferrer">ref</a>)</em> etc. pp.</li>\n</ol>\n<p>As long as you see the diagnostic messages, they are correct. They might not be well understood, but phpcs is not lying. Use Xdebug on the CLI for your benefit before you pull out any of your hairs (<code>XDEBUG_MODE=debug XDEBUG_SESSION=1 phpcs ...</code>).</p>\n"^^ . + . + . + . + "1"^^ . + "<p>Instead of making an additional query to filter orders, it's much better and lightweight to change the original orders query using <code>posts_request</code> hook...</p>\n<p>It also solves the issue where your custom filter dropdown disappears.</p>\n<p>Try the following revised code:</p>\n<pre class="lang-php prettyprint-override"><code>add_action('restrict_manage_posts', 'add_custom_product_filter_to_orders', 25);\nfunction add_custom_product_filter_to_orders() {\n global $typenow, $pagenow;\n\n if ( 'edit.php' === $pagenow &amp;&amp; 'shop_order' === $typenow ) :\n\n $products = get_posts( array(\n 'post_type' =&gt; 'product',\n 'posts_per_page' =&gt; -1,\n 'tax_query' =&gt; array( array(\n 'taxonomy' =&gt; 'product_cat',\n 'field' =&gt; 'slug',\n 'terms' =&gt; 'test',\n ) ),\n ) );\n\n if ( !$products ) return;\n\n $selected_product = isset($_GET['product_id']) ? absint($_GET['product_id']) : '';\n\n printf('&lt;select name=&quot;product_id&quot;&gt;\n &lt;option value=&quot;&quot;&gt;%s&lt;/option&gt;', esc_html__('All products') );\n \n foreach ($products as $product) {\n printf('&lt;option value=&quot;%d&quot; %s&gt;%s&lt;/option&gt;', $product-&gt;ID, selected($selected_product, $product-&gt;ID, false), get_the_title($product-&gt;ID) );\n }\n\n echo '&lt;/select&gt;';\n endif;\n}\n\n// Change the main SQL query\nadd_filter('posts_request', 'change_admin_orders_request_by_product', 20, 2);\nfunction change_admin_orders_request_by_product($sql, $query) {\n global $typenow, $pagenow, $wpdb;\n\n if ( is_admin() &amp;&amp; 'edit.php' === $pagenow &amp;&amp; 'shop_order' === $typenow\n &amp;&amp; isset($_GET['product_id']) &amp;&amp; ! empty($_GET['product_id']) ) {\n $join = &quot; INNER JOIN {$wpdb-&gt;prefix}woocommerce_order_items AS oi\n ON {$wpdb-&gt;prefix}posts.ID = oi.order_id\n INNER JOIN {$wpdb-&gt;prefix}woocommerce_order_itemmeta AS oim\n ON oi.order_item_id = oim.order_item_id&quot;;\n $and = $wpdb-&gt;prepare(&quot; \n AND oim.meta_key = '_product_id' AND oim.meta_value = %d&quot;, absint($_GET['product_id']) );\n \n $sql = str_replace( &quot;FROM wp_posts&quot;, &quot;FROM wp_posts {$join}&quot;, $sql );\n $sql = str_replace( &quot;WHERE 1=1 AND&quot;, &quot;WHERE 1=1 {$and} AND&quot;, $sql );\n }\n return $sql;\n}\n</code></pre>\n<p>Code goes in functions.php file of your child theme (or in a plugin). Tested and works.</p>\n<p>Filtering orders for a product with results:</p>\n<p><a href="https://i.sstatic.net/19gpIMg3.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/19gpIMg3.png" alt="enter image description here" /></a></p>\n<p>Filtering orders for a product without results:</p>\n<p><a href="https://i.sstatic.net/7AfjkAWe.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7AfjkAWe.png" alt="enter image description here" /></a></p>\n<p>The custom dropdown filter is still displayed.</p>\n<p><strong>Note:</strong> This code will not when High Performance Order Storage is enabled.</p>\n"^^ . + . + "<p>There are some mistakes in your code and some considerations:</p>\n<ol>\n<li><p>The <code>woocommerce_after_main_content</code> is a global hook. It means it runs on multiple WooCommerce pages: <a href="https://woocommerce.github.io/code-reference/files/woocommerce-templates-archive-product.html#source-view.88" rel="nofollow noreferrer">archive-product.php</a> and <a href="https://woocommerce.github.io/code-reference/files/woocommerce-templates-single-product.html#source-view.47" rel="nofollow noreferrer">single-product.php</a>. So without a conditional check like <code>is_product_category()</code> your custom field will also display on single product page.</p>\n</li>\n<li><p>You use <code>the_field()</code> which is good for simple and plain text or HTML, but if you use image, you might consider using <code>get_field()</code> instead. It all depends on how the field is set up (<strong><a href="https://stackoverflow.com/a/52247896">please see this answer</a></strong>). Here are also references to <a href="https://www.advancedcustomfields.com/resources/get_field/" rel="nofollow noreferrer">get_field()</a> and <a href="https://www.advancedcustomfields.com/resources/the_field/" rel="nofollow noreferrer">the_field()</a>.</p>\n</li>\n</ol>\n<p>The below code will display the ACF image field after the main content, on woocommerce Archive/Category pages, the following way:</p>\n<ul>\n<li><p>Hook into <code>woocommerce_after_main_content</code> on category pages only.</p>\n</li>\n<li><p>It will dynamically target the correct category on which the field is being displayed, by using: <code>get_queried_object()</code>.</p>\n</li>\n<li><p>It ensures that the ACF function fetches the correct data tied to the current category, by passing <code>get_field()</code> to a variable.</p>\n</li>\n<li><p>Conditional check, if the ACF field is not empty, and otherwise not output anything.</p>\n</li>\n<li><p>It will display the image as santizied output, using <code>esc_url()</code> and <code>esc_attr()</code> .</p>\n</li>\n</ul>\n<pre><code>/*Adding ACF custom metadata field after the main content woocommerce product category page*/\nadd_action( 'woocommerce_after_main_content', 'wc_add_lower', 100 );\nfunction wc_add_lower() {\n // Execute the code only on WooCommerce product category pages\n if ( is_product_category() ) {\n // Get the current product category object\n $term = get_queried_object();\n // Store ACF field 'lower' for the current product category (taxonomy term)\n $lower_image = get_field('lower', $term);\n // Check if the field has a value and output sanitized image &amp; alt text\n if ( $lower_image ) {\n echo '&lt;img src=&quot;' . esc_url( $lower_image['url'] ) . '&quot; alt=&quot;' . esc_attr( $lower_image['alt'] ) . '&quot;&gt;';\n }\n }\n}\n</code></pre>\n<p><strong>Related questions and sources:</strong></p>\n<ul>\n<li><p><a href="https://stackoverflow.com/questions/52245445/display-acf-field-image-below-the-product-title-in-woocommerce-archive-pages">Display ACF field/image below the product title in WooCommerce archive pages</a></p>\n</li>\n<li><p><a href="https://stackoverflow.com/questions/40707541/woocommerce-category-acf-field-not-showing">Woocommerce category ACF field not showing</a></p>\n</li>\n<li><p><a href="https://stackoverflow.com/questions/69849525/display-random-images-in-product-category-page/69851173#69851173">Display random Images in product category page</a></p>\n</li>\n<li><p><a href="https://www.advancedcustomfields.com/resources/adding-fields-taxonomy-term/" rel="nofollow noreferrer">Adding Fields to a Taxonomy Term</a></p>\n</li>\n</ul>\n"^^ . + . + . + . + "The stripslashes() on it's own worked, thanks"^^ . + . + . + . + "<p>The <code>upsert()</code> method as per documentation requires a unique identifier. Looking by the way you are updating or creating your GuideStep you'd need something of the sort:</p>\n<pre><code>foreach ($groupedSteps as $step){\n GuideStep::upsert(\n [\n 'recipe_id' =&gt; $recipeId, \n 'step_number' =&gt; $step['step_number']\n 'step_text' =&gt; $step['step_text']\n 'step_image' =&gt; $step['step_image']\n ],\n uniqueBy: ['recipe_id', 'step_number'],\n update: ['step_text', 'step_image']\n );\n}\n</code></pre>\n<p>You can check more on how it is used <a href="https://laravel.com/docs/12.x/eloquent#upserts" rel="nofollow noreferrer">here</a>.<br />\nDeleting then creating instead of updating is a very bad idea due to a couple of reasons, you can check <a href="https://stackoverflow.com/a/427430/21528741">this discussion</a>.</p>\n<p>I haven't tested the code but it should work right off the bat.</p>\n<p>Also, make sure to always <a href="https://laravel.com/docs/12.x/validation#quick-writing-the-validation-logic" rel="nofollow noreferrer">validate your request</a> in the controller, so that no surprise data comes in</p>\n"^^ . + . + "0"^^ . + . + . + "@Barmar i have updated the question with the code i attempted, is this correct logic?"^^ . + . + . + "1"^^ . + . + . + "2"^^ . + . + . + . + . + "php-7.1"^^ . + . + . + "1"^^ . + "0"^^ . + "Limit total quantity globally for specific product category in WooCommerce"^^ . + "0"^^ . + "0"^^ . + . + "1"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + "1"^^ . + "2"^^ . + "4"^^ . + . + "sql-server"^^ . + . + . + "0"^^ . + . + "Yes, of course. What you're stuck at?"^^ . + . + . + . + "0"^^ . + . + "<p>Using Laravel 8, I have a FormRequest Validation as followed</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nnamespace App\\Http\\Requests\\EXTERNAL;\n\nuse InfyOm\\Generator\\Request\\APIRequest;\n\nclass ActionUpdateRequest extends APIRequest\n{\n public function rules(): array\n {\n return [\n 'data' =&gt; 'required',\n ];\n }\n\n public function messages(): array\n {\n return [\n 'data.required' =&gt; 'error.action.required.data',\n ];\n }\n}\n</code></pre>\n<p>When trying to call the endpoint that uses that request validation, I get this error\n<code>mb_strtoupper(): Argument #1 ($string) must be of type string, array given</code></p>\n<p>After some digging around it appears the input key <code>data</code> was the issue when it tries to replace the default error message by the one provided, replacing <code>data</code> by anything else works properly but I can't find the root cause of it, any idea?</p>\n<p>For reference, here is the full stack trace</p>\n<pre><code>[2025-03-04 13:30:31] local.ERROR: mb_strtoupper(): Argument #1 ($string) must be of type string, array given {&quot;exception&quot;:&quot;[object] (TypeError(code: 0): mb_strtoupper(): Argument #1 ($string) must be of type string, array given at /var/www/vendor/laravel/framework/src/Illuminate/Support/Str.php:732)\n[stacktrace]\n#0 /var/www/vendor/laravel/framework/src/Illuminate/Support/Str.php(732): mb_strtoupper(Array, 'UTF-8')\n#1 /var/www/vendor/laravel/framework/src/Illuminate/Validation/Concerns/FormatsMessages.php(297): Illuminate\\\\Support\\\\Str::upper(Array)\n#2 /var/www/vendor/laravel/framework/src/Illuminate/Validation/Concerns/FormatsMessages.php(220): Illuminate\\\\Validation\\\\Validator-&gt;replaceAttributePlaceholder('error.action.re...', Array)\n#3 /var/www/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(883): Illuminate\\\\Validation\\\\Validator-&gt;makeReplacements('error.action.re...', 'data', 'Required', Array)\n#4 /var/www/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(611): Illuminate\\\\Validation\\\\Validator-&gt;addFailure('data', 'Required', Array)\n#5 /var/www/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(416): Illuminate\\\\Validation\\\\Validator-&gt;validateAttribute('data', 'Required')\n#6 /var/www/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(447): Illuminate\\\\Validation\\\\Validator-&gt;passes()\n#7 /var/www/vendor/laravel/framework/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php(25): Illuminate\\\\Validation\\\\Validator-&gt;fails()\n#8 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FormRequestServiceProvider.php(30): Illuminate\\\\Foundation\\\\Http\\\\FormRequest-&gt;validateResolved()\n#9 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(1265): Illuminate\\\\Foundation\\\\Providers\\\\FormRequestServiceProvider-&gt;Illuminate\\\\Foundation\\\\Providers\\\\{closure}(Object(App\\\\Http\\\\Requests\\\\EXTERNAL\\\\ActionUpdateRequest), Object(Illuminate\\\\Foundation\\\\Application))\n#10 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(1230): Illuminate\\\\Container\\\\Container-&gt;fireCallbackArray(Object(App\\\\Http\\\\Requests\\\\EXTERNAL\\\\ActionUpdateRequest), Array)\n#11 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(1215): Illuminate\\\\Container\\\\Container-&gt;fireAfterResolvingCallbacks('App\\\\\\\\Http\\\\\\\\Reques...', Object(App\\\\Http\\\\Requests\\\\EXTERNAL\\\\ActionUpdateRequest))\n#12 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(778): Illuminate\\\\Container\\\\Container-&gt;fireResolvingCallbacks('App\\\\\\\\Http\\\\\\\\Reques...', Object(App\\\\Http\\\\Requests\\\\EXTERNAL\\\\ActionUpdateRequest))\n#13 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(853): Illuminate\\\\Container\\\\Container-&gt;resolve('App\\\\\\\\Http\\\\\\\\Reques...', Array, true)\n#14 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\\\\Foundation\\\\Application-&gt;resolve('App\\\\\\\\Http\\\\\\\\Reques...', Array)\n#15 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(838): Illuminate\\\\Container\\\\Container-&gt;make('App\\\\\\\\Http\\\\\\\\Reques...', Array)\n#16 /var/www/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php(79): Illuminate\\\\Foundation\\\\Application-&gt;make('App\\\\\\\\Http\\\\\\\\Reques...')\n#17 /var/www/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php(48): Illuminate\\\\Routing\\\\ControllerDispatcher-&gt;transformDependency(Object(ReflectionParameter), Array, Object(stdClass))\n#18 /var/www/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php(28): Illuminate\\\\Routing\\\\ControllerDispatcher-&gt;resolveMethodDependencies(Array, Object(ReflectionMethod))\n#19 /var/www/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(41): Illuminate\\\\Routing\\\\ControllerDispatcher-&gt;resolveClassMethodDependencies(Array, Object(App\\\\Http\\\\Controllers\\\\EXTERNAL\\\\ActionController), 'update')\n#20 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\\\\Routing\\\\ControllerDispatcher-&gt;dispatch(Object(Illuminate\\\\Routing\\\\Route), Object(App\\\\Http\\\\Controllers\\\\EXTERNAL\\\\ActionController), 'update')\n#21 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\\\Routing\\\\Route-&gt;runController()\n#22 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\\\\Routing\\\\Route-&gt;run()\n#23 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\\\Routing\\\\Router-&gt;Illuminate\\\\Routing\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#24 /var/www/vendor/acme-packages/laravel-api/src/Middlewares/VerifyApiKeyAccess.php(63): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#25 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Acme\\\\Api\\\\Middlewares\\\\VerifyApiKeyAccess-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure), 'update_action')\n#26 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#27 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\\\Routing\\\\Middleware\\\\SubstituteBindings-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#28 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(127): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#29 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(103): Illuminate\\\\Routing\\\\Middleware\\\\ThrottleRequests-&gt;handleRequest(Object(Illuminate\\\\Http\\\\Request), Object(Closure), Array)\n#30 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(55): Illuminate\\\\Routing\\\\Middleware\\\\ThrottleRequests-&gt;handleRequestUsingNamedLimiter(Object(Illuminate\\\\Http\\\\Request), Object(Closure), 'external-api', Object(Closure))\n#31 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\\\Routing\\\\Middleware\\\\ThrottleRequests-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure), 'external-api')\n#32 /var/www/vendor/acme-packages/laravel-api/src/Middlewares/VerifyApiKeyAccess.php(63): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#33 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Acme\\\\Api\\\\Middlewares\\\\VerifyApiKeyAccess-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#34 /var/www/app/Http/Middleware/SentryContext.php(26): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#35 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\\\Http\\\\Middleware\\\\SentryContext-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#36 /var/www/app/Http/Middleware/ApiLanguage.php(21): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#37 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\\\Http\\\\Middleware\\\\ApiLanguage-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#38 /var/www/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#39 /var/www/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\\\Session\\\\Middleware\\\\StartSession-&gt;handleStatefulRequest(Object(Illuminate\\\\Http\\\\Request), Object(Illuminate\\\\Session\\\\Store), Object(Closure))\n#40 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\\\Session\\\\Middleware\\\\StartSession-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#41 /var/www/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#42 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\\\Cookie\\\\Middleware\\\\AddQueuedCookiesToResponse-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#43 /var/www/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#44 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\\\Cookie\\\\Middleware\\\\EncryptCookies-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#45 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#46 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(723): Illuminate\\\\Pipeline\\\\Pipeline-&gt;then(Object(Closure))\n#47 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\\\\Routing\\\\Router-&gt;runRouteWithinStack(Object(Illuminate\\\\Routing\\\\Route), Object(Illuminate\\\\Http\\\\Request))\n#48 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\\\\Routing\\\\Router-&gt;runRoute(Object(Illuminate\\\\Http\\\\Request), Object(Illuminate\\\\Routing\\\\Route))\n#49 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(651): Illuminate\\\\Routing\\\\Router-&gt;dispatchToRoute(Object(Illuminate\\\\Http\\\\Request))\n#50 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\\\\Routing\\\\Router-&gt;dispatch(Object(Illuminate\\\\Http\\\\Request))\n#51 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\\\Foundation\\\\Http\\\\Kernel-&gt;Illuminate\\\\Foundation\\\\Http\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#52 /var/www/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(66): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#53 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Barryvdh\\\\Debugbar\\\\Middleware\\\\InjectDebugbar-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#54 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#55 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\\\Foundation\\\\Http\\\\Middleware\\\\TransformsRequest-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#56 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\\\Foundation\\\\Http\\\\Middleware\\\\ConvertEmptyStringsToNull-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#57 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#58 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\\\Foundation\\\\Http\\\\Middleware\\\\TransformsRequest-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#59 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\\\Foundation\\\\Http\\\\Middleware\\\\TrimStrings-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#60 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#61 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\\\Foundation\\\\Http\\\\Middleware\\\\ValidatePostSize-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#62 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#63 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\\\Foundation\\\\Http\\\\Middleware\\\\PreventRequestsDuringMaintenance-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#64 /var/www/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#65 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\\\Proxy\\\\TrustProxies-&gt;handle(Object(Illuminate\\\\Http\\\\Request), Object(Closure))\n#66 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(Illuminate\\\\Http\\\\Request))\n#67 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\\\\Pipeline\\\\Pipeline-&gt;then(Object(Closure))\n#68 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\\\\Foundation\\\\Http\\\\Kernel-&gt;sendRequestThroughRouter(Object(Illuminate\\\\Http\\\\Request))\n#69 /var/www/public/index.php(54): Illuminate\\\\Foundation\\\\Http\\\\Kernel-&gt;handle(Object(Illuminate\\\\Http\\\\Request))\n</code></pre>\n<p>Edit: Fixed code snippet @ali-amini</p>\n"^^ . + "http-referer"^^ . + . + "0"^^ . + . + . + "I suspect you either don't understand the setup or didn't read thoroughly the setup.\n\nguest machine (10.211.55.2) is only serving db at port *5000*\n\nA host machine (localhost) is serving the web/PHP/db-lib at port 80/443 with db-lib connected to guest-machine via port 5000 which is accessible via the command line and not accessible via browser (just for the DB access) while normal web test page with db access is working as normal"^^ . + "<p>There are some mistakes in your code attempt, to get the sales count for a product from a specific date:</p>\n<ul>\n<li>You need to replace &quot;wp_&quot; prefix from the table string name with <code>{$wpdb-&gt;prefix}</code>,</li>\n<li>The WPDB <code>prepare()</code> method, requires placeholders, for each variable,</li>\n<li>With WPDB <code>prepare()</code> method, each comma separated variable is inside, not outside,</li>\n<li>The &quot;date to&quot; is not needed in your query,</li>\n<li>The <code>limit</code> argument is not needed as you are trying to get the count.</li>\n</ul>\n<p>See <a href="https://developer.wordpress.org/reference/classes/wpdb/" rel="nofollow noreferrer">WPDB() WordPress Class</a> Documentation.</p>\n<p>Try the following instead <em>(with a &quot;from&quot; date)</em>:</p>\n<pre class="lang-php prettyprint-override"><code>global $wpdb;\n\n$product_id = 4098995;\n\n$count = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;\n SELECT COUNT(product_id) \n FROM {$wpdb-&gt;prefix}wc_order_product_lookup \n WHERE product_id = %d \n AND date_created &gt; '%s';\n&quot;, $product_id, date(&quot;Y-m-d&quot;, strtotime('-8 years') ) ) );\n</code></pre>\n<p>It should work.</p>\n<hr />\n<h4>Using a date range</h4>\n<p>With a date range you can use the <code>BETWEEN</code> operator instead like:</p>\n<pre class="lang-php prettyprint-override"><code>global $wpdb;\n\n$product_id = 4098995;\n$from_date = date(&quot;Y-m-d&quot;, strtotime('-8 years') );\n$to_date = date(&quot;Y-m-d&quot;, strtotime('-1 years') );\n\n$count = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;\n SELECT COUNT(product_id) \n FROM {$wpdb-&gt;prefix}wc_order_product_lookup \n WHERE product_id = %d \n AND date_created BETWEEN '%s' AND '%s';\n&quot;, $product_id, $from_date, $to_date ) );\n</code></pre>\n"^^ . + . + . + "A better way is to use WooCommerce dedicated hook `woocommerce_product_query`like in [those answer](https://stackoverflow.com/search?tab=votes&q=woocommerce_product_query%20post__in&searchOn=3) that don't require increasing the hook priority."^^ . + . + . + "1"^^ . + "0"^^ . + . + "0"^^ . + "BUT, i note that the api request not share the same cookie value (for example, io is null, but when i check in the console, he has a value)"^^ . + "Did you read the other question I mentioned? In particular the answer https://stackoverflow.com/a/24644450/20418616 and note that your mailserver 'may even silently drop mails with From: sender domains it's not configured for'"^^ . + . + . + . + . + . + "0"^^ . + . + "php exec() on Windows fails when adding 2>&1 (after working for years)"^^ . + "2"^^ . + "0"^^ . + . + . + . + "Which exception do you see?"^^ . + . + . + "Does https://stackoverflow.com/questions/5041737/how-to-connect-to-a-sqlite3-db-with-php answer your question? Answers to this question show you how to connect to a SQLite database in PHP. I'm not sure why you mention `System.Data.Sqlite`: that is used to connect a .NET application to a SQLite database."^^ . + . + . + . + . + "0"^^ . + "Update count on fancybox previous or next button click"^^ . + . + . + . + "<p>I'm trying to use Psalm to detect SQL Injections. I have the following code :</p>\n<pre class="lang-php prettyprint-override"><code>$pdo = new PDO(&quot;mysql:host=db;dbname=tp;port=3306&quot;, &quot;user&quot;, &quot;password&quot;);;\n\n// VULNERABLE CODE - direct string concatenation in query\n$userId = $_GET['id']; // User input from URL parameter\n\n// Vulnerable query without parameterization\n$query = &quot;SELECT * FROM users WHERE id = &quot; . $userId;\n$result = $pdo-&gt;query($query);\n\necho &quot;&lt;pre&gt;&quot;;\nvar_dump($result-&gt;fetchAll());\necho &quot;&lt;/pre&gt;&quot;;\ndie();\n</code></pre>\n<p>And I run the following command to scan (I have no config file)</p>\n<pre><code>vendor/bin/psalm --taint-analysis ./src/index.php \n</code></pre>\n<p>But no error is found...</p>\n"^^ . + . + . + . + . + . + . + . + . + . + . + "orders"^^ . + . + . + "I think there could be some permission block from AppRunner to prevent root from redirecting to `/proc/1/fd/1`. Have you tried creating a periodic log cron job as root `RUN echo "* * * * * root tail -f /app/log/file.log > /proc/1/fd/1" >> /etc/crontab` in the container dockerfile to see if it is allowed"^^ . + "<p>When working with React and the endless VSCode libraries we got used to tracking files and components with cmd+click (at least I did).</p>\n<p>However, when working with Laravel (in a new VSCode profile) I couldn't activate this tracking functionality.</p>\n<p>attempts:</p>\n<ul>\n<li>✅ Intelephense PHP extension</li>\n<li>✅ Add an alias in <code>settings.json</code></li>\n<li>✅ Laravel Blade Snippets extension</li>\n<li>✅ Set <code>*.blade.php</code> as html in <code>settings.json</code></li>\n</ul>\n<p>Use Command + P to search files directly (ok, that's good..)</p>\n<p><a href="https://i.sstatic.net/1K0FzKs3.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/1K0FzKs3.gif" alt="in the gif we see the src of an image using the laravel asset. {{ asset('/assets/images/banner/home-2.png')}} and it is clicked with cmd+click, but this file is not tracked and a file creation pop up is opened by vscode." /></a></p>\n<p>As mentioned, the expectation was to open a new tab in the editor with a preview of the file or code, if applicable.</p>\n"^^ . + . + "1"^^ . + . + "Your current provided code is incomplete, as alone it doesn't provoke the issue you describe. You need to provide in your question all the related code that is involved, including the missing function code used with `pre_get_posts` hook. Nobody can guess things by magic."^^ . + "access-token"^^ . + . + . + "@IMSoP Yes, exacly i mean to developing that libraries or libraries (If i split them). Yep - "can't afford a few megabytes of development space" that the main reason. "What on earth development system are you using" - doesn't matter, as I say it's "academically", but let's say that I develop that on my own hard disk which has 1 GB space all, and I'm poor, it helps now to understand?"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + "What makes your two environments different when the schema is the same?"^^ . + . + "From googling, the issue is with the executable, not a programming issue. You may have the wrong version (64 bit exe on a 32 bit system, or vice versa), have a corrupted executable, or something else. Unfortunately, since it is a system/program issue, it's not an issue really suited for Stack Overflow."^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + . + "1"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + "<p>I have a webpage with a navbar menu. When a user clicks on a menu item, it dynamically loads the corresponding PHP file into the home dynamic content section using JavaScript, and the content updates without reloading the page.</p>\n<p>One of the menu options displays a message form within the dynamic content area. However, when I submit the form, it redirects to the form.php file, causing the entire page to reload and breaking the dynamic content.</p>\n<p>I want to submit the form data without causing a page reload, while keeping the dynamic content intact. I would like to display the success or failure message after submission, without reloading the page.</p>\n<p>How can I achieve this using JavaScript to submit the form and display the result without breaking the dynamic content?</p>\n<p><strong>home.php</strong></p>\n<p><code>&lt;li class=&quot;nav-item m-2&quot;&gt;&lt;a href=&quot;message.php&quot; id=&quot;message&quot; class=&quot;nav-link text-white px-3 py-2&quot;&gt;message&lt;/a&gt;&lt;/li&gt;</code></p>\n<p><strong>js</strong></p>\n<pre><code>const massage = document.getElementById(&quot;message&quot;);\n\nfunction loadPage(event, page) {\n if (event) event.preventDefault();\n\n fetch(page) // Fetch the PHP page\n .then(response =&gt; response.text())\n .then(data =&gt; {\n mainContent.innerHTML = data;\n })\n .catch(error =&gt; console.error(&quot;Error loading page:&quot;, error));\n}\n\nif (message) makeTimetable.addEventListener(&quot;click&quot;, (event) =&gt; loadPage(event, &quot;../message.php&quot;));\n</code></pre>\n"^^ . + . + . + . + . + "<p>I want to execute this code form the terminal on Linux and it seems my file is not finding the needed model</p>\n<p>This is the function i want to run</p>\n<pre><code>use backend\\models\\Invoice;\n\nfunction myTest(){\n $model = Invoice::find()-&gt;where(['status' =&gt; Invoice::STATUS_UNPAID])-&gt;all();\n \n if($model){\n foreach ($model as $value) {\n Invoice::payInvoice($value-&gt;id);\n }\n \n }\n}\n\nmyTest();\n</code></pre>\n<p>On terminal i run this</p>\n<pre><code># php -f /var/www/html/checkstall.test/checkstall.com/common/cronjob/test.php\n</code></pre>\n<p>Below is the output i got</p>\n<pre><code>PHP Fatal error: Uncaught Error: Class &quot;backend\\models\\Invoice&quot; not found in /var/www/html/checkstall.test/checkstall.com/common/cronjob/test.php:6\nStack trace:\n#0 /var/www/html/checkstall.test/checkstall.com/common/cronjob/test.php(16): myTest()\n#1 {main}\n thrown in /var/www/html/checkstall.test/checkstall.com/common/cronjob/test.php on line 6\n</code></pre>\n<p>And i'm so sure \\backend\\models\\Invoice is present because i can run this code form within my project without any Error. I think this has to do with how Yii uses and include files in terminal or so.</p>\n"^^ . + "thanks for your, you're right yii have a console application which i believe this is how the framwork communicate with console"^^ . + . + . + "0"^^ . + . + "Other than that, I'd suggest some troubleshooting. Take advantage of your browser's developer tools, and watch both the Console and Network tabs when changing the selected input to see if it's doing what you expect, if there's any errors in the console, and if there are requests happening in the Network tab."^^ . + . + . + . + "<p>When developing locally on a Windows 11 machine with PHP 8, Laravel 11 and Filament, I adjust my <code>composer.json</code> to have</p>\n<pre><code>&quot;dev&quot;: [\n &quot;Composer\\\\Config::disableProcessTimeout&quot;,\n &quot;npx concurrently -c \\&quot;#93c5fd,#c4b5fd,#fb7185,#fdba74\\&quot; \\&quot;php artisan serve\\&quot; \\&quot;php artisan queue:listen --tries=1\\&quot; \\&quot;npm run dev\\&quot; --names=server,queue,logs,vite&quot;\n]\n</code></pre>\n<p>so that I can simply run <code>composer dev</code>.</p>\n<p>As I'm running a new project, notice i get</p>\n<blockquote>\n<p>[vite] Port 5173 is in use, trying another one...</p>\n</blockquote>\n<p><a href="https://i.sstatic.net/jtoIKxTF.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/jtoIKxTF.png" alt="composer dev showing port in use" /></a></p>\n<p>and when I go to the admin page to login, I see the page of another project.</p>\n<p>The VS Code for that other project and its terminal are closed and I've stopped with CTRL + C which showed something like this</p>\n<p><a href="https://i.sstatic.net/k8srUib8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/k8srUib8.png" alt="Terminated" /></a></p>\n<p>I cleared all caches and restarted the Apache web server in XAMPP, but the issue remains.</p>\n"^^ . + "0"^^ . + . + "<p>I have variable products (beers), each product can be sold in bottles, cans or kegs.</p>\n<p>On cart and checkout pages I need to check whether total sum of bottles/cans in cart creates a multiple of 6. (e.g. 1 bottle of Beer01, 4 bottles of Beer02, 1 bottle of Beer03 =&gt; user is allowed to finish the order). Each bottle/can variation has a shipping class &quot;bottle&quot;, kegs have no shipping class.</p>\n<p>Tried to use this solution to limit the cart items with a certain shipping class, but it works for simple products only, not for variable ones: <a href="https://stackoverflow.com/a/47219447/4214743">https://stackoverflow.com/a/47219447/4214743</a></p>\n<p>This thread - <a href="https://stackoverflow.com/questions/66155124/woocommerce-check-cart-items-quantity-for-multiples-of-6-starting-at-12">WooCommerce check cart items quantity for multiples of 6 starting at 12</a> doesn't apply to my problem. It counts whole cart of simple products, not variations with certain shipping class.</p>\n<p>Could not find any solution yet.</p>\n"^^ . + . + "Check out the answers to the duplicate question."^^ . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + "This reads a bit like a generative artificial intelligence answer. Are you aware that the use of those tools isn't allowed for creating answers? The reasons are obvious. See: [What is this site’s policy on content generated by generative artificial intelligence tools?](https://stackoverflow.com/help/gen-ai-policy)"^^ . + . + . + . + . + . + "html"^^ . + . + . + . + . + . + "0"^^ . + "If you are server-side in a plugin and fetching data from an API, there's zero requirements for you to run through WP KSES when inserting, so that's where I'm trying to figure things out. If you _want_ to run through WP KSES, which is fine, then your problem is "when I run this HTML through WP KSES with these settings it is stripping the XYZ tags". Otherwise, is your problem that when someone edits the post in the future, after you insert programmatically, that the tags get stripped?"^^ . + . + "0"^^ . + . + . + "Read a tutorial on how to create a form from database data. SO is not a tutoring service, we can't teach you how to do things like this."^^ . + . + . + . + "It's not failing. It actually works properly as it only shows contents in the default namespace that way and that is empty."^^ . + "<p>I'm having a problem. when I try to make a request, sometimes when I perform a composer update or other actions, I get error curl 60. SSL issues.</p>\n<p>I've reviewed many posts about this problem and tried several solutions. None of them worked for me, except for one. It is: Add this line in the request:</p>\n<pre><code>withOptions(['verify' =&gt; false])\n</code></pre>\n<p>I mean, I haven't found a solution for Composer update. So, it only works as an emergency measure for requests. Now, what I've tried:</p>\n<ul>\n<li><p>Change the certificate cacert.pem</p>\n</li>\n<li><p>I made sure the php.ini file had the correct path.</p>\n</li>\n</ul>\n<p>I attach photos of the folder directory, in addition to the php.ini</p>\n<p>You had it like this in php.ini, but I promise you I've put 20 different paths, all pointing to the file. And nothing.</p>\n<pre><code>curl.cainfo = &quot;C:\\laragon\\bin\\php\\php-8.3.7-Win32-vs16-x64\\extras\\ssl\\cacert.pem&quot;\n[openssl]\n; The location of a Certificate Authority (CA) file on the local filesystem\n; to use when verifying the identity of SSL/TLS peers. Most users should\n; not specify a value for this directive as PHP will attempt to use the\n; OS-managed cert stores in its absence. If specified, this value may still\n; be overridden on a per-stream basis via the &quot;cafile&quot; SSL stream context\n; option.\n;openssl.cafile\n\n; If openssl.cafile is not specified or if the CA file is not found, the\n; directory pointed to by openssl.capath is searched for a suitable\n; certificate. This value must be a correctly hashed certificate directory.\n; Most users should not specify a value for this directive as PHP will\n; attempt to use the OS-managed cert stores in its absence. If specified,\n; this value may still be overridden on a per-stream basis via the &quot;capath&quot;\n; SSL stream context option.\n;openssl.capath=\n</code></pre>\n<p>The openssl.cafile, which I mentioned before the problem arose, was commented out. I tried uncommenting it, adding the path, and testing whether adding the same path worked, and it didn't work either. I also tried some commands disabling composer verification in an SSL project, which I honestly don't remember which commands they were.</p>\n<p>How to fix curl error 60</p>\n"^^ . + . + "0"^^ . + . + . + . + . + . + "That's certainly the problem then. The IMG tag SRC attribute needs a URL to work, but you are providing arbitrary text."^^ . + "@ADyson That's what I said, until a year ago for this reason - I would use a rich text editor TinyMCE to edit articles, and I would use jQuery to shorten JS, and I would use PHPMailer to send emails, and today after I realized that I don't need all this fuss and that it's possible to achieve even better results with a fairly short code, I just threw everything away and lo and behold, everything works even better, faster and more securely for me. In short, I would be happy if you know a solution to what I asked."^^ . + . + "0"^^ . + . + "Do you _need_ the domain? Can you just not use an absolute path such as `<img src="/wp-content/uploads/myimage.png" alt="">`"^^ . + "0"^^ . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + "Please [edit] your question if you have more to add, rather than extending the code snippet into a separate comment. Also you really need to sort out the formatting - here's a guide if you need it: [How do I format my posts?](https://stackoverflow.com/help/formatting) . Thanks."^^ . + . + . + . + "@NicoHaase Me neither. I guess Symfony UX Turbo intercepts the form result (here an external redirect url) to submit it in AJAX or something like that."^^ . + . + . + . + . + . + "<p>My code for moving an image to another subdomain public path:</p>\n<pre><code>&lt;?php\n\nif ($request-&gt;front_picture_path != '') {\n $imageName3 = time() . '_front.' . request()-&gt;front_picture_path-&gt;getClientOriginalExtension();\n\n request()-&gt;front_picture_path-&gt;move(($path), $imageName3);\n\n $imgdata['right_picture_path'] = public_path('uploads_ext/uploads') . '/' . $imageName3;\n}\n</code></pre>\n<p>Currently, my public path is, for example:\n<code>/test/abc/test/client12/web/19/web/public/uploads_ext/uploads/1723021012_left.jpg</code></p>\n<p>But I want to move to another subdomain:\n<code>/test/abc/test/client12/web21/web/public/uploads_ext/uploads/1723021012_left.jpg</code></p>\n<p>How to achieve this?</p>\n"^^ . + . + . + "<p>Yes, in Carbon 3.x, diffInSeconds() now returns a signed value, unlike Carbon 2.x, which always returned positive.</p>\n<p>Fix:</p>\n<p>Use abs() to get a positive value:</p>\n<pre><code>$duration_in_secs = abs($time_after-&gt;diffInSeconds($time_before));\n</code></pre>\n<p>Or swap the arguments:</p>\n<pre><code>$duration_in_secs = $time_before-&gt;diffInSeconds($time_after);\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + "1"^^ . + "Fetch products using slug in Magento"^^ . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + "laravel-seeder"^^ . + "What do you get when you dd($validated)? It might be that the validation is failing."^^ . + . + . + . + "1"^^ . + "1"^^ . + "0"^^ . + . + . + . + . + "1"^^ . + "Maybe it's just a direct PUT and you simply write the file data directly into the body with no other structure. We don't know - you need to check the documentation of this service."^^ . + "<p>Consider using something like <a href="https://herd.laravel.com/windows" rel="nofollow noreferrer">Laravel Herd</a>. It's now pretty much the best tool for running Laravel/PHP apps locally for dev on Windows machines. You can <a href="https://herd.laravel.com/docs/windows/advanced-usage/php-versions#per-site-php-versions" rel="nofollow noreferrer">run multiple PHP versions</a> for different projects amongst a load of other features including a GUI for managing Node versions.</p>\n"^^ . + . + . + "0"^^ . + "@shingo I am trying that currently in a workspace file, but it does not seem to work. When I do it in settings it works. Not sure what I am doing wrong. I used intelephense.environment.includePaths."^^ . + . + ""*set the password to type "password_hash" in phpmyadmin*" What does that mean? This sentence doesn't make any sense. I know PMA has a feature where it can generate the value of `password_hash` when inserting value, but it's not a type. Is that what you mean?"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + "What specific thing is producing the error? Do you have the command or HTTP request, and the exact exception or HTTP response? In the Dockerfile, I don't see the `FROM` line that declares the base image, nor a `COPY` line that would include your application code in the image."^^ . + "<blockquote>\n<p>I guess I'm confused about the actually utility of something like composer with applications your actually delivering to a customer. How does that usually work, you tell your client &quot; hey You need to have composer installed and run composer install in order for this software to run smoothly</p>\n</blockquote>\n<p>You have to use the right composer(1) function:</p>\n<pre><code>composer archive\n</code></pre>\n<p>Then deliver the package to your client.</p>\n"^^ . + . + . + . + . + . + "3"^^ . + . + . + "see: [How to find the last day of the month from date?](https://stackoverflow.com/questions/1686724/how-to-find-the-last-day-of-the-month-from-date)"^^ . + "<ol>\n<li><p><strong>Avoid execution time limits</strong> by adding:</p>\n<pre><code>ini_set('max_execution_time', 0); \n</code></pre>\n</li>\n<li><p><strong>Run the extraction process in the background</strong>, using Laravel Queue or another worker. <strong>Avoid using system functions (<code>exec()</code>, <code>shell_exec()</code>)</strong>, as they can cause security issues and lack portability.</p>\n</li>\n</ol>\n"^^ . + "1"^^ . + "if you want to allow duplicates than remove the unique constrain on the column?"^^ . + "0"^^ . + "0"^^ . + . + . + . + "prepared-statement"^^ . + . + . + . + . + . + "Magento 2.4.7 Cloud - Product attribute value exceed 500"^^ . + . + . + "0"^^ . + . + "`the ability to store and retrieve documents using OneDrive`... https://github.com/microsoftgraph/msgraph-sdk-php/blob/main/docs/Examples.md#download-an-item, https://github.com/microsoftgraph/msgraph-sdk-php/blob/main/docs/Examples.md#upload-an-item"^^ . + "1"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + ""but does this mean every machine that runs this code must have Composer installed" - no, thats not neccessary. How does your deployment process to the different systems look like?"^^ . + "1"^^ . + . + . + . + "@barmar do you have any links that might help? I couldnt find anything useful thats why i came on here"^^ . + . + . + "PHP Carbon diffInWeekdays alternative to return float instead of int"^^ . + . + "-1"^^ . + "-1"^^ . + . + . + . + "cakephp-5.x"^^ . + "payment-gateway"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + "If the vendor project is open-source and you believe it contains a bug such that you need to override it with a fix, have you considered submitting a patch so it's fixed upstream and you don't have to worry about this in future? Or at least submitting a ticket to request that it's fixed (this latter option would also be viable for a propietary library too)?"^^ . + "@Olivier: with multiple values the query still works. In my example I did not an any indexes, but when adding 20 values the result can be seen here: https://dbfiddle.uk/2hI2Iiwp."^^ . + . + "1"^^ . + "1"^^ . + "@mrmcwolf `throwing unhandled exceptions is the same as not checking the return result` - not at all. It's directly opposite. Not checked result is silent while exceptions are quite vocal."^^ . + "2"^^ . + . + . + . + "You have the span with text-content, it's read. Then you have the submit input, it's read. Reason: aria-hidden="true" should not be used on elements that can receive focus."^^ . + . + . + . + . + "function"^^ . + "If you attach, make sure you have not attached before. Compare: https://stackoverflow.com/q/23968415/367456"^^ . + . + . + . + . + "No idea if that is your issue, but what I spotted is, that you echo the do_shortcode and then call ob_get_clean() to pass $html via JSON. If you only need the shortcode output, you can skip the echo and ob handling and just assign $html = do_shortcode(...). That should be more clean. Compare https://developer.wordpress.org/reference/functions/do_shortcode/"^^ . + . + . + . + . + . + "0"^^ . + . + . + "Laravel pagination not displayed or not working"^^ . + . + . + "1"^^ . + . + . + . + "Wordpress in kubernetes cluster failed to open stream: No such file or directory"^^ . + "You need to [edit] your question if you have a big update for us. As you can see, code placed in the comments is hard to read and not formatted. It's not the right place for it. Change the question so it's up to date, instead. See also [ask]. Thanks"^^ . + . + . + . + . + . + "People can, and do, write bots using headless browsers or testing tools like Selenium, which can then navigate a page and run JS etc. So they might not be able to retrieve the link by simple page scraping, but more sophisticated efforts could potentially still do so. That blog article is a bit naive, to be honest. Having said that, a JS-generated value will somewhat reduce the surface area for attacks"^^ . + . + "-2"^^ . + . + "0"^^ . + "@Chris Haas I could install it but not enable it. As it is not officially supported I went back to 8.2."^^ . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + "-1"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + "<p>I'm trying to set up an automatic deployment when a pull request is merged into the main branch using Bitbucket webhooks.</p>\n<p>However, I'm facing an issue with validating the webhook signature using the secret key.</p>\n<p><strong>What I Have</strong></p>\n<p>My secret key: q3bn5JCdR1yqK46V. (Already changed before posting this)</p>\n<p>The webhook triggers correctly and sends the following headers:</p>\n<pre><code>X-Hub-Signature: sha256=51ff4d1fe17b05bc6c649abf4bb09e0f3d8d90d45faa43abcf66822cb658ae57\nX-Hub-Signature-256: sha256=51ff4d1fe17b05bc6c649abf4bb09e0f3d8d90d45faa43abcf66822cb658ae57\n</code></pre>\n<p><strong>What I'm Doing</strong></p>\n<p>I assumed the X-Hub-Signature-256 is the HMAC-SHA256 hash of the payload using my secret key, so I'm trying to generate the same hash with:</p>\n<pre><code>$hash = 'sha256=' . hash_hmac('sha256', $payload, $secret);\n</code></pre>\n<p>However, the hash I generate does not match the one provided in the headers.</p>\n<p>How can I validate the Bitbucket webhook secret key using the content sent in the request?</p>\n"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + "1"^^ . + . + . + . + "<p>You can check with the following code as there may be some data value or data type matching issue with database column</p>\n<pre><code>$code = trim($code); // It will remove extra spaces\n$code = (string) $code; // It will Ensure about string type value\n\nLiveProducts::where('code', $code)-&gt;first();\n</code></pre>\n"^^ . + "Can you tell us what is shown in the console ?? when you enter the page the second time"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + "1"^^ . + "2"^^ . + "1"^^ . + . + . + . + . + "1"^^ . + "2"^^ . + . + "<p>I've created an API which will take first name, last name and email and generate all possible combinations of emails and returns the valid emails(Which are exist in this world). It works for innofied.com but doesn't works gmail.com. For gmail.com it says all the valid emails. I'm using gmail SMTP for this</p>\n<p>The following is the code in api.php</p>\n<pre><code>Route::post('/validate-emails', [EmailValidationController::class, 'validateEmails']);\n</code></pre>\n<p>The following is the code in EmailValidationController</p>\n<pre><code>&lt;?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Validator;\nuse App\\Services\\Integrations\\Email\\EmailServiceInterface;\n\nclass EmailValidationController extends Controller\n{\n public function __construct(\n private EmailServiceInterface $emailValidationService\n ) {}\n\n public function validateEmails(Request $request)\n {\n $validator = Validator::make($request-&gt;all(), [\n 'first_name' =&gt; 'required|string',\n 'last_name' =&gt; 'required|string',\n 'domain' =&gt; 'required|string'\n ]);\n\n if ($validator-&gt;fails()) {\n return response()-&gt;json(['error' =&gt; $validator-&gt;errors()], 422);\n }\n\n $first = strtolower($request-&gt;first_name);\n $last = strtolower($request-&gt;last_name);\n $domain = strtolower($request-&gt;domain);\n\n $emails = $this-&gt;emailValidationService-&gt;generateEmailPermutations($first, $last, $domain);\n $validEmails = $this-&gt;emailValidationService-&gt;validateEmails($emails);\n\n return response()-&gt;json([\n 'all_combinations' =&gt; $emails,\n 'valid_combinations' =&gt; array_values($validEmails),\n ]);\n }\n}\n</code></pre>\n<p>The following is the code EmailService</p>\n<pre><code>&lt;?php\n\nnamespace App\\Services\\Integrations\\Email;\n\nuse App\\Services\\Integrations\\Email\\EmailServiceInterface;\nuse Illuminate\\Support\\Facades\\Log;\n\nclass EmailService implements EmailServiceInterface\n{\n /**\n * Generate all possible email permutations.\n *\n * @param string $firstName\n * @param string $lastName\n * @param string $domain\n * @return array\n */\n public function generateEmailPermutations(\n string $firstName,\n string $lastName,\n string $domain\n ): array {\n $first = strtolower($firstName);\n $last = strtolower($lastName);\n $f = substr($first, 0, 1);\n $l = substr($last, 0, 1);\n\n return [\n &quot;$first@$domain&quot;,\n &quot;$last@$domain&quot;,\n &quot;$first$last@$domain&quot;,\n &quot;$first.$last@$domain&quot;,\n &quot;$f$last@$domain&quot;,\n &quot;$f.$last@$domain&quot;,\n &quot;$first$l@$domain&quot;,\n &quot;$first.$l@$domain&quot;,\n &quot;$f$l@$domain&quot;,\n &quot;$f.$l@$domain&quot;,\n &quot;$last$first@$domain&quot;,\n &quot;$last.$first@$domain&quot;,\n &quot;$last$f@$domain&quot;,\n &quot;$last.$f@$domain&quot;,\n &quot;$l$first@$domain&quot;,\n &quot;$l.$first@$domain&quot;,\n &quot;$l$f@$domain&quot;,\n &quot;$l.$f@$domain&quot;,\n &quot;$first-$last@$domain&quot;,\n &quot;$f-$last@$domain&quot;,\n &quot;$first-$l@$domain&quot;,\n &quot;$f-$l@$domain&quot;,\n &quot;$last-$first@$domain&quot;,\n &quot;$last-$f@$domain&quot;,\n &quot;$l-$first@$domain&quot;,\n &quot;$l-$f@$domain&quot;,\n &quot;{$first}_{$last}@$domain&quot;,\n &quot;{$f}_{$last}@$domain&quot;,\n &quot;{$first}_{$l}@$domain&quot;,\n &quot;{$f}_{$l}@$domain&quot;,\n &quot;{$last}_{$first}@$domain&quot;,\n &quot;{$last}_{$f}@$domain&quot;,\n &quot;{$l}_{$first}@$domain&quot;,\n &quot;{$l}_{$f}@$domain&quot;,\n ];\n }\n\n /**\n * Validate email addresses using MX and SMTP verification.\n */\n public function validateEmails(array $emails): array\n {\n return array_filter($emails, fn($email) =&gt; $this-&gt;validateEmailSMTP($email));\n }\n\n private function getMXRecord($domain)\n {\n $mxRecords = dns_get_record($domain, DNS_MX);\n return $mxRecords ? $mxRecords[0]['target'] : null;\n }\n\n private function validateEmailSMTP($email)\n {\n $domain = explode('@', $email)[1];\n $mxServer = $this-&gt;getMXRecord($domain);\n\n if (!$mxServer) {\n return false; // No mail server found\n }\n\n $from = config('mail.from.address');\n $mailServerDomain = config('mail.mailers.smtp.mail_server_domain');\n $sock = fsockopen($mxServer, 25, $errno, $errstr, 5);\n\n if (!$sock) {\n return false;\n }\n\n stream_set_timeout($sock, 5);\n\n $this-&gt;getSMTPResponse($sock); // Read initial 220 response\n fwrite($sock, &quot;HELO $mailServerDomain\\r\\n&quot;);\n $this-&gt;getSMTPResponse($sock); // Read HELO response\n\n fwrite($sock, &quot;MAIL FROM:&lt;$from&gt;\\r\\n&quot;);\n $this-&gt;getSMTPResponse($sock); // Read MAIL FROM response\n\n fwrite($sock, &quot;RCPT TO:&lt;$email&gt;\\r\\n&quot;);\n $response = $this-&gt;getSMTPResponse($sock); // Read RCPT TO response\n\n fwrite($sock, &quot;QUIT\\r\\n&quot;);\n fclose($sock);\n\n return strpos($response, &quot;250&quot;) !== false &amp;&amp; !strpos($response, &quot;550&quot;);\n }\n\n private function getSMTPResponse($sock)\n {\n $response = '';\n while ($line = fgets($sock, 1024)) {\n $response .= $line;\n if (substr($line, 3, 1) == &quot; &quot;) { // End of response\n break;\n }\n }\n return $response;\n }\n}\n</code></pre>\n<p>It works for the following input\nInput</p>\n<pre><code>{\n &quot;first_name&quot;: &quot;deep&quot;,\n &quot;last_name&quot;: &quot;jajodia&quot;,\n &quot;domain&quot;: &quot;innofied.com&quot;\n}\n</code></pre>\n<p>Output</p>\n<pre><code>{\n &quot;all_combinations&quot;: [\n &quot;deep@innofied.com&quot;,\n &quot;jajodia@innofied.com&quot;,\n &quot;deepjajodia@innofied.com&quot;,\n &quot;deep.jajodia@innofied.com&quot;,\n &quot;djajodia@innofied.com&quot;,\n &quot;d.jajodia@innofied.com&quot;,\n &quot;deepj@innofied.com&quot;,\n &quot;deep.j@innofied.com&quot;,\n &quot;dj@innofied.com&quot;,\n &quot;d.j@innofied.com&quot;,\n &quot;jajodiadeep@innofied.com&quot;,\n &quot;jajodia.deep@innofied.com&quot;,\n &quot;jajodiad@innofied.com&quot;,\n &quot;jajodia.d@innofied.com&quot;,\n &quot;jdeep@innofied.com&quot;,\n &quot;j.deep@innofied.com&quot;,\n &quot;jd@innofied.com&quot;,\n &quot;j.d@innofied.com&quot;,\n &quot;deep-jajodia@innofied.com&quot;,\n &quot;d-jajodia@innofied.com&quot;,\n &quot;deep-j@innofied.com&quot;,\n &quot;d-j@innofied.com&quot;,\n &quot;jajodia-deep@innofied.com&quot;,\n &quot;jajodia-d@innofied.com&quot;,\n &quot;j-deep@innofied.com&quot;,\n &quot;j-d@innofied.com&quot;,\n &quot;deep_jajodia@innofied.com&quot;,\n &quot;d_jajodia@innofied.com&quot;,\n &quot;deep_j@innofied.com&quot;,\n &quot;d_j@innofied.com&quot;,\n &quot;jajodia_deep@innofied.com&quot;,\n &quot;jajodia_d@innofied.com&quot;,\n &quot;j_deep@innofied.com&quot;,\n &quot;j_d@innofied.com&quot;\n ],\n &quot;valid_combinations&quot;: [\n &quot;deep@innofied.com&quot;,\n &quot;deep.jajodia@innofied.com&quot;\n ]\n}\n</code></pre>\n<p>Here deep@innofied.com,deep.jajodia@innofied.com are valid and exist. It works for innofied.com but for gmail it doesn't work</p>\n<p>Input for gmail</p>\n<pre><code>{\n &quot;first_name&quot;: &quot;sourav&quot;,\n &quot;last_name&quot;: &quot;saha964&quot;,\n &quot;domain&quot;: &quot;gmail.com&quot;\n}\n</code></pre>\n<p>Output</p>\n<pre><code>{\n &quot;all_combinations&quot;: [\n &quot;sourav@gmail.com&quot;,\n &quot;saha964@gmail.com&quot;,\n &quot;souravsaha964@gmail.com&quot;,\n &quot;sourav.saha964@gmail.com&quot;,\n &quot;ssaha964@gmail.com&quot;,\n &quot;s.saha964@gmail.com&quot;,\n &quot;souravs@gmail.com&quot;,\n &quot;sourav.s@gmail.com&quot;,\n &quot;ss@gmail.com&quot;,\n &quot;s.s@gmail.com&quot;,\n &quot;saha964sourav@gmail.com&quot;,\n &quot;saha964.sourav@gmail.com&quot;,\n &quot;saha964s@gmail.com&quot;,\n &quot;saha964.s@gmail.com&quot;,\n &quot;ssourav@gmail.com&quot;,\n &quot;s.sourav@gmail.com&quot;,\n &quot;ss@gmail.com&quot;,\n &quot;s.s@gmail.com&quot;,\n &quot;sourav-saha964@gmail.com&quot;,\n &quot;s-saha964@gmail.com&quot;,\n &quot;sourav-s@gmail.com&quot;,\n &quot;s-s@gmail.com&quot;,\n &quot;saha964-sourav@gmail.com&quot;,\n &quot;saha964-s@gmail.com&quot;,\n &quot;s-sourav@gmail.com&quot;,\n &quot;s-s@gmail.com&quot;,\n &quot;sourav_saha964@gmail.com&quot;,\n &quot;s_saha964@gmail.com&quot;,\n &quot;sourav_s@gmail.com&quot;,\n &quot;s_s@gmail.com&quot;,\n &quot;saha964_sourav@gmail.com&quot;,\n &quot;saha964_s@gmail.com&quot;,\n &quot;s_sourav@gmail.com&quot;,\n &quot;s_s@gmail.com&quot;\n ],\n &quot;valid_combinations&quot;: [\n &quot;sourav@gmail.com&quot;,\n &quot;saha964@gmail.com&quot;,\n &quot;souravsaha964@gmail.com&quot;,\n &quot;sourav.saha964@gmail.com&quot;,\n &quot;ssaha964@gmail.com&quot;,\n &quot;s.saha964@gmail.com&quot;,\n &quot;souravs@gmail.com&quot;,\n &quot;sourav.s@gmail.com&quot;,\n &quot;ssourav@gmail.com&quot;,\n &quot;s.sourav@gmail.com&quot;\n ]\n}\n</code></pre>\n<p>Here only souravsaha964@gmail.com is valid and others are not</p>\n"^^ . + . + . + "0"^^ . + "3"^^ . + . + . + "yajra-datatable"^^ . + "use `dump` to not kill the script instead of `dd` (which means "dump and die")... the session middleware has to save the session but its not getting there if you kill the execution"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + . + "Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/259302/discussion-between-first-major-and-rozsazoltan)."^^ . + . + . + . + . + "How do i access my lamp server via a domain"^^ . + . + . + . + "upload"^^ . + . + . + "yes i agree its not supposed to reach production its for debugging only not like a try catch statement or similar it meants to expose to check the var itself what its raw output kinda like a console.log , but i think the issue in the request itself isnt it showing pending ? according to the error logs ?"^^ . + "How to update and delete records in a table based on a new request?"^^ . + . + "You are sending a json string and not form-urlencoded data."^^ . + "0"^^ . + "@kikon it is currently on a local environment and hardly publicly deployed as it is part of a much bigger application"^^ . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + "2"^^ . + "0"^^ . + . + "0"^^ . + "<p>i'm trying to implement google speech to text for live audio streams. I have been able to implement for location audio file correctly. However, live audio content is not successful.</p>\n<p>I am using V1 of the speech-to-text api. I have gRPC installed already.</p>\n<p>This is my PHP script</p>\n<pre><code>require 'vendor/autoload.php';\n$conn= new mysqli('localhost',&quot;&quot;, &quot;&quot;, &quot;&quot;);\n\nuse Google\\Cloud\\Speech\\V1\\SpeechClient;\nuse Google\\Cloud\\Speech\\V1\\RecognitionConfig;\nuse Google\\Cloud\\Speech\\V1\\RecognitionAudio;\nuse Google\\Cloud\\Speech\\V1\\StreamingRecognitionConfig;\nuse Google\\Cloud\\Speech\\V1\\StreamingRecognizeRequest;\nuse Google\\Cloud\\Speech\\V1\\StreamingRecognizeResponse;\nuse Google\\Cloud\\Speech\\V1\\StreamingRecognitionResult;\nuse Google\\Cloud\\Speech\\V1\\SpeechContext;\nuse Google\\Cloud\\Speech\\V1\\SpeakerDiarizationConfig;\nuse Google\\Cloud\\Speech\\V1\\WordInfo;\nuse Google\\Cloud\\Speech\\V1\\RecognitionConfig\\AudioEncoding;\n\nputenv('GOOGLE_APPLICATION_CREDENTIALS=' . __DIR__ . '/xxx-455121-be3eb805f1d7.json');\n\n\n$ffmpegCommand = &quot;ffmpeg -re -i http://stream.live.vc.bbcmedia.co.uk/bbc_world_service -ac 1 -ar 16000 -f s16le pipe:1&quot;;\n$handle = popen($ffmpegCommand, &quot;r&quot;);\n\ntry {\n $client = new SpeechClient(['transport' =&gt; 'grpc', 'credentials' =&gt; json_decode(file_get_contents(getenv('GOOGLE_APPLICATION_CREDENTIALS')), true)]);\n} catch (Exception $e) {\n echo 'Error: ' . $e-&gt;getMessage(); \n exit;\n}\n\n$encoding = AudioEncoding::MP3;\ntry {\n$config = (new RecognitionConfig())\n -&gt;setEncoding($encoding)\n -&gt;setSampleRateHertz(24000)\n -&gt;setLanguageCode('en-US')\n -&gt;setEnableAutomaticPunctuation(true);\n} catch (Exception $e) {\n echo 'Error: ' . $e-&gt;getMessage(); \n exit;\n}\n\ntry {\n $streamConfig = new StreamingRecognitionConfig([\n 'config' =&gt; $config,\n 'interim_results' =&gt; true,\n ]);\n} catch (Exception $e) {\n echo 'Error: ' . $e-&gt;getMessage();\n exit;\n}\ntry {\n $stream = $client-&gt;streamingRecognize();\n $stream-&gt;write(new StreamingRecognizeRequest([\n 'streaming_config' =&gt; $streamConfig\n ]));\n} catch (Exception $e) {\n echo 'Error: ' . $e-&gt;getMessage(); \n exit;\n}\n\n\nwhile (!feof($handle)) {\n usleep(5000);\n $chunk = fread($handle, 4096);\n printf('chunk: ' . $chunk);\n if ($chunk !== false) {\n try {\n $stream-&gt;write(new StreamingRecognizeRequest([\n 'audio_content' =&gt; $chunk\n ]));\n } catch (Exception $e) {\n printf('Errorc: ' . $e-&gt;getMessage());\n }\n }\n}\n\nprint_r($stream-&gt;responses());\nforeach ($stream-&gt;responses() as $response) {\n mysqli_query($conn, &quot;INSERT INTO transcriptions (transcript) VALUES ('loop1')&quot;);\n foreach ($response-&gt;getResults() as $result) {\n mysqli_query($conn, &quot;INSERT INTO transcriptions (transcript) VALUES ('loop2')&quot;);\n foreach ($result-&gt;getAlternatives() as $alternative) {\n $trans = $alternative-&gt;getTranscript();\n mysqli_query($conn, &quot;INSERT INTO transcriptions (transcript) VALUES ('$trans')&quot;);\n printf('Transcript: %s' . PHP_EOL, $alternative-&gt;getTranscript());\n printf('loop');\n }\n }\n}\n\npclose($handle);\n$stream-&gt;close();\n$client-&gt;close();\n</code></pre>\n<p>?&gt;`</p>\n<p>The script breaks at <code>$chunk = fread($handle, 4096)</code></p>\n<p>This is the error message</p>\n<p><a href="https://i.sstatic.net/oszz6zA4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/oszz6zA4.png" alt="The error logs when i run the script" /></a></p>\n<p>Please assist</p>\n"^^ . + . + "2"^^ . + . + "0"^^ . + "<p>You have the right idea with checking the return value of the <code>fopen</code> call, but as you noted, calling <code>exit</code> terminates the page loading.</p>\n<p>Instead, you can surround the relevant code in an <code>if</code> block:</p>\n<pre class="lang-php prettyprint-override"><code>Page title here\nNar bar here\nSome more text here...\n&lt;?php\n$file = fopen($_GET[&quot;potus&quot;] . &quot;.txt&quot;, &quot;r&quot;);\nif ($file) {\n //output a line of the file until the end is reached\n while(!feof($file)) {\n //will return each line with a break\n echo fgets($file). '&lt;br /&gt;';\n }\n} else {\n echo &quot;Oh No. The info has not been found. Please try again.&quot;;\n}\n?&gt;\nFooter\nSupport links\n</code></pre>\n"^^ . + . + . + . + . + "@hakre Sorry, I have no idea how things work next, could you guide me?"^^ . + . + "0"^^ . + "3"^^ . + "<p>I was running into the same issue and did some more digging myself. Appears to be an issue with when this deprecation happens.</p>\n<p><a href="https://github.com/php/php-src/issues/17422" rel="nofollow noreferrer">https://github.com/php/php-src/issues/17422</a></p>\n<p>As an example I've put two 8.4 deprecations together and set error reporting to 0. The implicit null deprecation still outputs an error but the unserialize deprecation does not. <a href="https://3v4l.org/KjOdp#v8.4.5" rel="nofollow noreferrer">Example code</a>.</p>\n<p>For us this means php 8.4.5 (current version) is not yet production ready as we don't have control of every package to fix what is only a deprecation and extra output to stdout ruins json output.</p>\n<p>Recommendation: stay with php 8.3 until this is fixed.</p>\n"^^ . + . + . + . + "0"^^ . + "3"^^ . + "1"^^ . + . + "Do you have any other firewalls before login? If you have e.g. main firewall, it has to be after login and probably after api"^^ . + . + "laravel-9"^^ . + "3"^^ . + . + . + . + . + . + "@aynber it's a "normalized" convention in use"^^ . + . + "-1"^^ . + "You have a space at the beginning of the URL."^^ . + . + . + . + "Related: https://stackoverflow.com/q/9018494/457268"^^ . + . + . + . + . + "Most desktop systems have a native ability to *" transform html into a pdf format"* thus no need for users to install anything you just use your application to call the print system with the html name. What does help is if you auto download and un tar the latest chrome-headless- shell and that can be scripted in just a few lines such as for win32 5 lines https://stackoverflow.com/a/78963217/10802527"^^ . + . + . + . + . + . + . + "Add `'echo' => 0` to options"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + "0"^^ . + . + "@TimBiegeleisen Thanks, I think I was always kind of under the radar, what gave me away? :-)"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + "I do have a seeder with factories in it... that's what I'm showing :p Could you be more specific? In my case, "Valid Data" means having 7 OpeningHours with "Day" attributes in sequence form 1 to 7"^^ . + . + "0"^^ . + "[Whats the point of running Laravel with the command 'php artisan serve'?](https://stackoverflow.com/a/40894760/15167500)"^^ . + . + . + . + "0"^^ . + "Hide the files outside the web root. Then have a php script which resource requests go to, passing in the ID of the resource as a query parameter - php then authorises the request and (if it's allowed) then outputs the content of the file and suitable headers"^^ . + . + "1"^^ . + "1"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "1"^^ . + "And btw this isn't exactly "premature optimisation", because to tell the truth, I also keep this project locally on my disk, and out of 1 TB of free space I only have 3 GB left, so I'm getting close to making a decision what to delete."^^ . + "0"^^ . + "0"^^ . + . + . + . + . + "<p>I came up with this Regex but I think I can make its performance better because my server is struggling executing it thousands of times per minute on long strings.</p>\n<pre><code>$que = preg_replace(&quot;/\\\\b(xxg|xxl|xxs)\\\\b|\\\\b(([^0-9])\\\\3+)\\\\b|([^0-9])\\\\4+/&quot;,&quot;$1$2$4&quot;,$que);\n</code></pre>\n<p>Basically this regex converts strings like:</p>\n<p><code>aaa ccdd</code> -&gt; <code>aaa cd</code></p>\n<p><code>uuii</code> -&gt; <code>ui</code></p>\n<p><code>xxg aabbb</code> -&gt; <code>xxg ab</code> (xxg is a special case as I putted it inside my regex).</p>\n<p>Basically, the regex replaces all letters that repeats to one single letter except when the word consists of the letter repeating itself and except on the substrings <code>xxg</code> and <code>xxl</code> and <code>xxs</code>.</p>\n<p>Any alternative I can try to check if I get a better performance?</p>\n<p>One improvement that I realized is the code below (wich saves about 20% on CPU time):</p>\n<pre><code>$que = preg_replace(&quot;/(?|\\\\b(xxg|xxl|xxs)\\\\b|\\\\b(([^0-9])\\\\2+)\\\\b|([^0-9])\\\\1+)/&quot;,&quot;$1&quot;,$string);\n</code></pre>\n"^^ . + "1"^^ . + . + "How to get an error on float and int casting on an object instead of a warning in php?"^^ . + . + "1"^^ . + "0"^^ . + "sqlite"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + "<ul>\n<li><p>A body-less <code>foreach()</code> loop signature can ignore all pre-existing row elements and solely create a reference to the new column and since <a href="https://stackoverflow.com/q/71030746/2943403">the <code>key</code> variable is accessed after the <code>value</code> variable</a>, the <a href="https://stackoverflow.com/q/77741716/2943403"><code>$key</code> value is assigned to the referenced column</a>. In my opinion, this is the most elegant, non-functional-style script, but it might not be the most intuitive solution for all developers. <a href="https://3v4l.org/AA53T" rel="nofollow noreferrer">Demo</a></p>\n<pre class="lang-php prettyprint-override"><code>foreach ($members as $col =&gt; [&amp;$col]);\nvar_export($members);\n</code></pre>\n<p>The <code>0</code> column/key is implied by omitting <code>0 =&gt;</code> before the reference declaration inside of the square braced expression. If you want to give the new column a key other than <code>0</code>, then write that in the array destructuring expression. <a href="https://3v4l.org/cu6bY" rel="nofollow noreferrer">Demo</a></p>\n</li>\n</ul>\n<hr />\n<br>\n<ul>\n<li><p>The above snippet is more elegant than declaring the temporary row variable which doesn't need to be used to affect the original array. <a href="https://3v4l.org/tTsNp" rel="nofollow noreferrer">Demo</a></p>\n<pre class="lang-php prettyprint-override"><code>foreach ($members as $col =&gt; $row) {\n $members[$col][] = $col;\n}\nvar_export($members);\n</code></pre>\n</li>\n</ul>\n<hr />\n<br>\n<ul>\n<li><p>Using <code>array_walk()</code> serves the same purpose as a <code>foreach()</code> with its ability to access rows and first level keys, but it doesn't return a payload, so modifying data by reference is the only way. <a href="https://3v4l.org/ofF4H" rel="nofollow noreferrer">Demo</a></p>\n<pre class="lang-php prettyprint-override"><code>array_walk($members, fn(&amp;$row, $col) =&gt; $row += [$col]);\nvar_export($members);\n</code></pre>\n</li>\n</ul>\n<hr />\n<br>\n<ul>\n<li><p>Probably least attractive versus earlier snippets, you could use a functional-style with <code>array_reduce()</code> to append the new column to each row. <a href="https://3v4l.org/4codU" rel="nofollow noreferrer">Demo</a></p>\n<pre class="lang-php prettyprint-override"><code>var_export(\n array_reduce(\n array_keys($members),\n fn($result, $k) =&gt; $result + [$k =&gt; $members[$k] + [$k]],\n []\n )\n);\n</code></pre>\n</li>\n</ul>\n"^^ . + . + "<blockquote>\n<p>Now how do I activate this &quot;command&quot; file and specify a specific period for it to work after, as was the case in previous Laravel versions?</p>\n</blockquote>\n<p>I may not fully understand your question.. maybe you can link to examples of those previous versions?</p>\n<p>If you mean &quot;register&quot; a command file, then according to the <a href="https://laravel.com/docs/11.x/artisan#registering-commands" rel="nofollow noreferrer">documentation</a>:</p>\n<blockquote>\n<p>By default, Laravel automatically registers all commands within the <code>app/Console/Commands</code> directory.</p>\n<p>...</p>\n<p>If necessary, you may also manually register commands by providing the command's class name to the <code>withCommands</code> method (in <code>bootstrap/app.php</code>):</p>\n</blockquote>\n<pre class="lang-php prettyprint-override"><code>use App\\Domain\\Orders\\Commands\\SendEmails;\n \n-&gt;withCommands([\n SendEmails::class,\n])\n</code></pre>\n<blockquote>\n<p>When Artisan boots, all the commands in your application will be resolved by the service container and registered with Artisan.</p>\n</blockquote>\n<p>If you want to schedule the command every 5 minutes, then you can use Laravel's <a href="https://laravel.com/docs/11.x/scheduling#scheduling-artisan-commands" rel="nofollow noreferrer">task scheduling</a>:</p>\n<pre class="lang-php prettyprint-override"><code>// routes/console.php or bootstrap/app.php\nuse Illuminate\\Support\\Facades\\Schedule;\nSchedule::command('user:expiration')-&gt;everyFiveMinutes();\n</code></pre>\n"^^ . + . + . + "WebP Express does not process images loaded via AJAX in WordPress"^^ . + . + . + . + . + "Hi @C3roe, I'm embedding it in the header of my Divi website."^^ . + . + . + "variable-assignment"^^ . + . + "<p>What I'm trying to accomplish is producing numbered pagination for posts which are loaded via an ajax function. I have to make the numbered pagination work via ajax as well. Explanation of each code block below:</p>\n<p>This function produces taxonomy terms which currently have posts assigned. Code resides in functions.php.</p>\n<pre><code>&lt;?php\n function ee_event_categories() {\n $event_cats = get_terms( array(\n 'taxonomy' =&gt; 'tribe_events_cat',\n 'hide_empty' =&gt; true,\n ) );\n ?&gt;\n &lt;div class=&quot;filter-column category-block&quot;&gt;\n &lt;?php foreach ( $event_cats as $event_cat ) : ?&gt;\n &lt;button \n data-taxonomy=&quot;&lt;?php echo $event_cat-&gt;taxonomy; ?&gt;&quot; \n data-slug=&quot;&lt;?php echo $event_cat-&gt;slug; ?&gt;&quot;\n data-term-id=&quot;&lt;?php echo $event_cat-&gt;term_id; ?&gt;&quot;&gt;\n &lt;?php echo $event_cat-&gt;name; ?&gt;\n &lt;/button&gt;\n &lt;?php endforeach; ?&gt;\n &lt;/div&gt;\n &lt;?php\n $cat = ob_get_clean();\n return $cat;\n }\n add_shortcode( 'ee_event_categories', 'ee_event_categories' );\n?&gt;\n</code></pre>\n<p>Upon clicking on the resulting buttons from the previous function, a custom WP_Query runs and displays posts that match the criteria in the function below. This function resides in functions.php. I think I have to pass the $paged variable from the load_events_by_category() function into the javascript code. Unfortunately, I'm at a loss as to how to do it. Maybe the $paged variable needs to be applied as a second key / value pair in the wp_localize_script() declaration? Now I'm thinking out loud.</p>\n<pre><code>&lt;?php\nfunction load_events_by_category() {\n $paged = ($_POST['paged']) ? $_POST['paged'] : 1;\n $taxonomy = $_POST['taxonomy'];\n $slug = $_POST['slug'];\n $term_id = intval($_POST['term_id']);\n $category_events_args = array(\n 'post_type' =&gt; 'tribe_events',\n 'posts_per_page' =&gt; 4,\n 'post_status' =&gt; 'publish',\n 'eventDisplay' =&gt; 'custom',\n 'order' =&gt; 'ASC',\n 'paged' =&gt; $paged,\n 'tax_query' =&gt; array(\n array(\n 'taxonomy' =&gt; 'tribe_events_cat',\n 'field' =&gt; 'term_id',\n 'terms' =&gt; $term_id\n )\n )\n );\n $catquery = new WP_Query( $category_events_args );\n ob_start(); \n if( $catquery-&gt;have_posts() ) : ?&gt;\n &lt;div class=&quot;this-weeks-events&quot;&gt;\n &lt;div class=&quot;featured-events-grid&quot;&gt;\n &lt;?php while ( $catquery-&gt;have_posts() ) : $catquery-&gt;the_post(); ?&gt;\n &lt;div class=&quot;featured-events-grid-child&quot;&gt;\n &lt;div class=&quot;event-date&quot;\n data-taxonomy=&quot;&lt;?php echo $taxonomy ?&gt;&quot;\n data-slug=&quot;&lt;?php echo $slug; ?&gt;&quot; \n data-term-id=&quot;&lt;?php echo $term_id; ?&gt;&quot; \n style=&quot;background:&lt;?php echo the_field('event_category_background', $taxonomy . '_' . $term_id ); ?&gt;&quot;\n &gt;\n &lt;p class=&quot;event-day&quot;&gt;&lt;?php echo tribe_get_start_date( $event_id, false, 'D' ); ?&gt;&lt;/p&gt;\n &lt;p class=&quot;event-start-date&quot; style=&quot;color:&lt;?php echo the_field('event_date_color', $taxonomy . '_' . $term_id ); ?&gt;&quot;&gt;&lt;?php echo tribe_get_start_date( $event_id, false, 'j' ); ?&gt;&lt;/p&gt;\n &lt;p class=&quot;event-month&quot;&gt;&lt;?php echo tribe_get_start_date( $event_id, false, 'F' ); ?&gt;&lt;/p&gt;\n &lt;/div&gt;&lt;!-- end div event-date --&gt;\n\n &lt;?php if( has_post_thumbnail() ) : ?&gt;\n &lt;div class=&quot;featured-image&quot;&gt;\n &lt;a href=&quot;&lt;?php echo the_permalink(); ?&gt;&quot;&gt;&lt;?php the_post_thumbnail( 'full' ); ?&gt;&lt;/a&gt;\n &lt;/div&gt;&lt;!-- end div featured-image --&gt;\n &lt;?php endif; ?&gt;\n &lt;div class=&quot;featured-events-details-grid&quot;&gt;\n &lt;div&gt;&lt;h2&gt;&lt;a href=&quot;&lt;?php echo the_permalink(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;&lt;/div&gt;\n &lt;div&gt;\n &lt;i class=&quot;far fa-clock&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt;\n &lt;?php echo tribe_get_start_time( $event_id ); ?&gt;\n -\n &lt;?php echo tribe_get_end_time( $event_id ); ?&gt;\n &lt;?php if( tribe_is_recurring_event() ) : ?&gt;\n &lt;p class=&quot;event-recurring&quot;&gt;&lt;img src=&quot;&lt;?php echo get_stylesheet_directory_uri() . '/images/arrows-rotate.webp' ?&gt;&quot; alt=&quot;rotating arrow icon for weekly events&quot; width=&quot;20&quot; height=&quot;20&quot; /&gt; Weekly Event&lt;/p&gt;\n &lt;?php endif; ?&gt;\n &lt;/div&gt;\n &lt;/div&gt;&lt;!-- end div featured-events-details-grid --&gt;\n &lt;/div&gt;&lt;!-- end div featured-events-grid-child --&gt;\n &lt;?php endwhile; ?&gt;\n &lt;/div&gt;&lt;!--end featured events grid --&gt; \n &lt;?php\n $nextpage = $paged+1;\n $previouspage = $paged-1;\n $total = $catquery-&gt;max_num_pages;\n $pagination_args = array(\n 'base' =&gt; '%_%',\n 'format' =&gt; '?paged=%#%',\n 'total' =&gt; $total,\n 'current' =&gt; $paged,\n 'show_all' =&gt; false,\n 'end_size' =&gt; 1,\n 'mid_size' =&gt; 2,\n 'prev_next' =&gt; true,\n 'prev_text' =&gt; __('&lt;span class=&quot;prev&quot; data-attr=&quot;'.$previouspage.'&quot;&gt;&amp;laquo;&lt;/span&gt;'),\n 'next_text' =&gt; __('&lt;span class=&quot;next&quot; data-attr=&quot;'.$nextpage.'&quot;&gt;&amp;raquo;&lt;/span&gt;'),\n 'type' =&gt; 'plain',\n 'add_args' =&gt; false,\n 'add_fragment' =&gt; '',\n 'before_page_number' =&gt; '',\n 'after_page_number' =&gt; ''\n );\n $paginate_links = paginate_links($pagination_args);\n\n if ($paginate_links) : ?&gt;\n &lt;div id='pagination' class='pagination'&gt;\n &lt;?php echo $paginate_links; ?&gt;\n &lt;/div&gt;\n &lt;?php endif; ?&gt;\n &lt;/div&gt;&lt;!-- end div this weeks events --&gt;\n &lt;?php endif; ?&gt;\n &lt;?php wp_reset_postdata(); ?&gt;\n &lt;?php\n $content = ob_get_clean();\n echo $content;\n die();\n}\nadd_action( 'wp_ajax_load_events_by_category', 'load_events_by_category' );\nadd_action( 'wp_ajax_nopriv_load_events_by_category', 'load_events_by_category' );\n?&gt;\n</code></pre>\n<p>I'm not sure if this is important but I'll include it anyway. It's how I'm using wp_localize_script, also located in functions.php.</p>\n<pre><code>&lt;?php wp_enqueue_script( 'ajax-load-category-events', get_stylesheet_directory_uri() . '/dist/ajax-category-events.js', array( 'jquery' ), '1.0', true ); \nwp_localize_script( 'ajax-load-category-events', 'categoryevents', array(\n 'ajaxurl' =&gt; admin_url( 'admin-ajax.php' )\n));\n?&gt;\n</code></pre>\n<p>And finally, here's the code in above javascript file.</p>\n<pre><code>(function ($) {\n $(&quot;.category-block button&quot;).on('click', function (e) {\n e.preventDefault();\n $.ajax({\n type: 'POST',\n url: categoryevents.ajaxurl,\n data: {\n action: 'load_events_by_category',\n taxonomy: $(this).data('taxonomy'),\n slug: $(this).data('slug'),\n term_id: $(this).data('term-id')\n },\n success: function (html) {\n $('#fl-main-content').find('#event_results .fl-rich-text').empty();\n $('#event_results .fl-rich-text').append(html);\n },\n error: function (error) {\n console.log(&quot;Error: &quot;, error)\n }\n })\n });\n})(jQuery);\n</code></pre>\n<p>I actually did try passing the $paged variable into the script vars of the wp_localize_script declaration. I thought that would at least make the javascript &quot;aware&quot; of what page of results were showing.</p>\n<p><code> wp_localize_script( 'ajax-load-category-events', 'categoryevents', array( 'ajaxurl' =&gt; admin_url( 'admin-ajax.php' ), 'paged' =&gt; $_POST['paged'] ? $_POST['paged'] : 1; ));</code></p>\n<p>I also spent hours upon hours reviewing similar SO questions and looking for tutorials on how to solve this problem. I'll be darned but it doesn't seem using ajax pagination inside ajax produced content is much of a thing.</p>\n"^^ . + "if PHP commands didn't already exist for this, negating the need to use exec (see the first duplicate question), you'd need to make sure the command-line string you're generating to pass into exec had the directory name in quote-marks (see the other duplicate questions). Not sure where you got the backslash idea from? Maybe that works but it's a much more fiddly solution. Also not sure why you didn't consider quote-marks? And this really has nothing to do with glob per se, despite the title. Glob merely supplied the input data. The actual problem is about cd-ing to a directory with spaces"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + "<p>I'm trying to build a simple laravel API that connects with a MongoDB database using Jensseger. I cannot for the life of me figure out what is wrong. I believe it's a versioning issue between the php-mongo extension and Jenssenger, but can't get the versions right.</p>\n<p>I get this error when I try to run <code>php artisan serve</code>.</p>\n<pre><code>$ php artisan serve\nPHP Parse error: syntax error, unexpected '=' in /var/www/html/laravel/vendor/symfony/string/Resources/functions.php on line 34\n</code></pre>\n<p>I have these versions.</p>\n<pre><code>Ubuntu 18.04.6 LTS\nPHP 7.2.24-0ubuntu0.18.04.17 \nPhp-mongodb extension: 1.3.4-1build1\n</code></pre>\n<p>This is my composer.json.</p>\n<pre><code>\n {\n &quot;name&quot;: &quot;laravel/laravel&quot;,\n &quot;type&quot;: &quot;project&quot;,\n &quot;description&quot;: &quot;The Laravel Framework.&quot;,\n &quot;keywords&quot;: [\n &quot;framework&quot;,\n &quot;laravel&quot;\n ],\n &quot;license&quot;: &quot;MIT&quot;,\n &quot;require&quot;: {\n &quot;php&quot;: &quot;^7.2.5&quot;,\n &quot;fideloper/proxy&quot;: &quot;^4.2&quot;,\n &quot;fruitcake/laravel-cors&quot;: &quot;^1.0&quot;,\n &quot;guzzlehttp/guzzle&quot;: &quot;^6.3&quot;,\n &quot;jenssegers/mongodb&quot;: &quot;^3.6&quot;,\n &quot;laravel/framework&quot;: &quot;^7.0&quot;,\n &quot;laravel/tinker&quot;: &quot;^2.0&quot;,\n &quot;mongodb/mongodb&quot;: &quot;*&quot;\n },\n &quot;require-dev&quot;: {\n &quot;facade/ignition&quot;: &quot;^2.0&quot;,\n &quot;fzaninotto/faker&quot;: &quot;^1.9.1&quot;,\n &quot;mockery/mockery&quot;: &quot;^1.3.1&quot;,\n &quot;nunomaduro/collision&quot;: &quot;^4.1&quot;,\n &quot;phpunit/phpunit&quot;: &quot;^8.5&quot;\n },\n &quot;config&quot;: {\n &quot;optimize-autoloader&quot;: true,\n &quot;preferred-install&quot;: &quot;dist&quot;,\n &quot;sort-packages&quot;: true, \n &quot;platform&quot;: {\n &quot;php&quot;: &quot;7.2.24&quot;\n }\n },\n &quot;extra&quot;: {\n &quot;laravel&quot;: {\n &quot;dont-discover&quot;: []\n }\n },\n &quot;autoload&quot;: {\n &quot;psr-4&quot;: {\n &quot;App\\\\&quot;: &quot;app/&quot;\n },\n &quot;classmap&quot;: [\n &quot;database/seeds&quot;,\n &quot;database/factories&quot;\n ]\n },\n &quot;autoload-dev&quot;: {\n &quot;psr-4&quot;: {\n &quot;Tests\\\\&quot;: &quot;tests/&quot;\n }\n },\n &quot;minimum-stability&quot;: &quot;dev&quot;,\n &quot;prefer-stable&quot;: true,\n &quot;scripts&quot;: {\n &quot;post-autoload-dump&quot;: [\n &quot;Illuminate\\\\Foundation\\\\ComposerScripts::postAutoloadDump&quot;,\n &quot;@php artisan package:discover --ansi&quot;\n ],\n &quot;post-root-package-install&quot;: [\n &quot;@php -r \\&quot;file_exists('.env') || copy('.env.example', '.env');\\&quot;&quot;\n ],\n &quot;post-create-project-cmd&quot;: [\n &quot;@php artisan key:generate --ansi&quot;\n ]\n }\n}\n</code></pre>\n<p>I get this error when I try to run composer install.</p>\n<pre><code>composer install;\nInstalling dependencies from lock file (including require-dev)\nVerifying lock file contents can be installed on current platform.\nWarning: 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 &lt;package name&gt;`.\nYour lock file does not contain a compatible set of packages. Please run composer update.\n\n Problem 1\n - brick/math is locked to version 0.12.3 and an update of this package was not requested.\n - brick/math 0.12.3 requires php ^8.1 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 2\n - carbonphp/carbon-doctrine-types is locked to version 3.2.0 and an update of this package was not requested.\n - carbonphp/carbon-doctrine-types 3.2.0 requires php ^8.1 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 3\n - league/mime-type-detection is locked to version 1.16.0 and an update of this package was not requested.\n - league/mime-type-detection 1.16.0 requires php ^7.4 || ^8.0 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 4\n - mongodb/mongodb is locked to version 1.21.1 and an update of this package was not requested.\n - mongodb/mongodb 1.21.1 requires ext-mongodb ^1.21.0 -&gt; it has the wrong version installed (1.3.4).\n Problem 5\n - nikic/php-parser is locked to version v5.4.0 and an update of this package was not requested.\n - nikic/php-parser v5.4.0 requires php &gt;=7.4 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 6\n - psr/container is locked to version 1.1.2 and an update of this package was not requested.\n - psr/container 1.1.2 requires php &gt;=7.4.0 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 7\n - psr/log is locked to version 2.0.0 and an update of this package was not requested.\n - psr/log 2.0.0 requires php &gt;=8.0.0 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 8\n - psy/psysh is locked to version v0.12.7 and an update of this package was not requested.\n - psy/psysh v0.12.7 requires php ^8.0 || ^7.4 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 9\n - ramsey/collection is locked to version 2.1.0 and an update of this package was not requested.\n - ramsey/collection 2.1.0 requires php ^8.1 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 10\n - ramsey/uuid is locked to version 4.7.6 and an update of this package was not requested.\n - ramsey/uuid 4.7.6 requires php ^8.0 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 11\n - symfony/css-selector is locked to version v7.2.0 and an update of this package was not requested.\n - symfony/css-selector v7.2.0 requires php &gt;=8.2 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 12\n - symfony/deprecation-contracts is locked to version v3.5.1 and an update of this package was not requested.\n - symfony/deprecation-contracts v3.5.1 requires php &gt;=8.1 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 13\n - symfony/event-dispatcher is locked to version v6.4.13 and an update of this package was not requested.\n - symfony/event-dispatcher v6.4.13 requires php &gt;=8.1 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 14\n - symfony/event-dispatcher-contracts is locked to version v3.5.1 and an update of this package was not requested.\n - symfony/event-dispatcher-contracts v3.5.1 requires php &gt;=8.1 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 15\n - symfony/service-contracts is locked to version v3.5.1 and an update of this package was not requested.\n - symfony/service-contracts v3.5.1 requires php &gt;=8.1 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 16\n - symfony/string is locked to version v6.4.15 and an update of this package was not requested.\n - symfony/string v6.4.15 requires php &gt;=8.1 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 17\n - symfony/translation is locked to version v6.4.19 and an update of this package was not requested.\n - symfony/translation v6.4.19 requires php &gt;=8.1 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 18\n - symfony/translation-contracts is locked to version v3.5.1 and an update of this package was not requested.\n - symfony/translation-contracts v3.5.1 requires php &gt;=8.1 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 19\n - tijsverkoyen/css-to-inline-styles is locked to version v2.3.0 and an update of this package was not requested.\n - tijsverkoyen/css-to-inline-styles v2.3.0 requires php ^7.4 || ^8.0 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 20\n - facade/ignition is locked to version 2.17.7 and an update of this package was not requested.\n - facade/ignition 2.17.7 requires ext-curl * -&gt; it is missing from your system. Install or enable PHP's curl extension.\n Problem 21\n - facade/ignition-contracts is locked to version 1.0.2 and an update of this package was not requested.\n - facade/ignition-contracts 1.0.2 requires php ^7.3|^8.0 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 22\n - mockery/mockery is locked to version 1.6.12 and an update of this package was not requested.\n - mockery/mockery 1.6.12 requires php &gt;=7.3 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 23\n - phpunit/php-token-stream is locked to version 4.0.4 and an update of this package was not requested.\n - phpunit/php-token-stream 4.0.4 requires php ^7.3 || ^8.0 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n Problem 24\n - symfony/routing is locked to version v5.4.48 and an update of this package was not requested.\n - symfony/deprecation-contracts v3.5.1 requires php &gt;=8.1 -&gt; your php version (7.2.5; overridden via config.platform, actual: 7.2.24) does not satisfy that requirement.\n - symfony/routing v5.4.48 requires symfony/deprecation-contracts ^2.1|^3 -&gt; satisfiable by symfony/deprecation-contracts[v3.5.1].\n\nTo enable extensions, verify that they are enabled in your .ini files:\n - /etc/php/7.2/cli/php.ini\n - /etc/php/7.2/cli/conf.d/10-mysqlnd.ini\n - /etc/php/7.2/cli/conf.d/10-opcache.ini\n - /etc/php/7.2/cli/conf.d/10-pdo.ini\n - /etc/php/7.2/cli/conf.d/15-xml.ini\n - /etc/php/7.2/cli/conf.d/20-calendar.ini\n - /etc/php/7.2/cli/conf.d/20-ctype.ini\n - /etc/php/7.2/cli/conf.d/20-dom.ini\n - /etc/php/7.2/cli/conf.d/20-exif.ini\n - /etc/php/7.2/cli/conf.d/20-fileinfo.ini\n - /etc/php/7.2/cli/conf.d/20-ftp.ini\n - /etc/php/7.2/cli/conf.d/20-gettext.ini\n - /etc/php/7.2/cli/conf.d/20-iconv.ini\n - /etc/php/7.2/cli/conf.d/20-json.ini\n - /etc/php/7.2/cli/conf.d/20-mbstring.ini\n - /etc/php/7.2/cli/conf.d/20-mongodb.ini\n - /etc/php/7.2/cli/conf.d/20-mysqli.ini\n - /etc/php/7.2/cli/conf.d/20-pdo_mysql.ini\n - /etc/php/7.2/cli/conf.d/20-phar.ini\n - /etc/php/7.2/cli/conf.d/20-posix.ini\n - /etc/php/7.2/cli/conf.d/20-readline.ini\n - /etc/php/7.2/cli/conf.d/20-shmop.ini\n - /etc/php/7.2/cli/conf.d/20-simplexml.ini\n - /etc/php/7.2/cli/conf.d/20-sockets.ini\n - /etc/php/7.2/cli/conf.d/20-sysvmsg.ini\n - /etc/php/7.2/cli/conf.d/20-sysvsem.ini\n - /etc/php/7.2/cli/conf.d/20-sysvshm.ini\n - /etc/php/7.2/cli/conf.d/20-tokenizer.ini\n - /etc/php/7.2/cli/conf.d/20-wddx.ini\n - /etc/php/7.2/cli/conf.d/20-xmlreader.ini\n - /etc/php/7.2/cli/conf.d/20-xmlwriter.ini\n - /etc/php/7.2/cli/conf.d/20-xsl.ini\nYou can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.\nAlternatively, you can run Composer with `--ignore-platform-req=ext-mongodb --ignore-platform-req=ext-curl` to temporarily ignore these required extensions.\n\n</code></pre>\n<p>Any help would be appreciated. Thanks!</p>\n<p>EDIT: included a new error after updating composer.json</p>\n<pre><code> Problem 1\n - Root composer.json requires mongodb/mongodb ^1.6 -&gt; satisfiable by mongodb/mongodb[1.6.0, ..., v1.x-dev].\n - mongodb/mongodb[1.10.0, ..., v1.10.x-dev] require ext-mongodb ^1.11.0 -&gt; it has the wrong version installed (1.6.1).\n - mongodb/mongodb[1.11.0, ..., v1.11.x-dev] require ext-mongodb ^1.12.0 -&gt; it has the wrong version installed (1.6.1).\n - mongodb/mongodb[1.12.0, ..., v1.12.x-dev] require ext-mongodb ^1.13.0 -&gt; it has the wrong version installed (1.6.1).\n - mongodb/mongodb[1.13.0-beta1, ..., v1.13.x-dev] require ext-mongodb ^1.14.0 -&gt; it has the wrong version installed (1.6.1).\n - mongodb/mongodb[1.15.0, ..., v1.15.x-dev] require ext-mongodb ^1.15.0 -&gt; it has the wrong version installed (1.6.1).\n - mongodb/mongodb[1.16.0, ..., v1.16.x-dev] require ext-mongodb ^1.16.0 -&gt; it has the wrong version installed (1.6.1).\n - mongodb/mongodb[1.17.0, ..., v1.20.x-dev] require php ^7.4 || ^8.0 -&gt; your php version (7.2.24; overridden via config.platform, same as actual) does not satisfy that requirement.\n - mongodb/mongodb[1.21.0, ..., v1.x-dev] require php ^8.1 -&gt; your php version (7.2.24; overridden via config.platform, same as actual) does not satisfy that requirement.\n - mongodb/mongodb[1.6.0, ..., v1.6.x-dev] require ext-mongodb ^1.7 -&gt; it has the wrong version installed (1.6.1).\n - mongodb/mongodb[1.7.0-beta1, ..., v1.7.x-dev] require ext-mongodb ^1.8 -&gt; it has the wrong version installed (1.6.1).\n - mongodb/mongodb[1.8.0-RC1, ..., v1.8.x-dev] require ext-mongodb ^1.8.1 -&gt; it has the wrong version installed (1.6.1).\n - mongodb/mongodb[1.9.0-alpha1, ..., v1.9.x-dev] require ext-mongodb ^1.10.0 -&gt; it has the wrong version installed (1.6.1).\n</code></pre>\n"^^ . + "amazon-ecs"^^ . + . + . + . + . + "Thanks, however, glossaries is for creating glossaries, translate is for translations"^^ . + "0"^^ . + "-3"^^ . + "Correction, the codesigning didn't work. And although logging es enabled, nothing is written to the log file. I guess php crashes before it can write anything."^^ . + . + . + "0"^^ . + "0"^^ . + . + "<p>Whatever solution you choose, there will <em>always</em> be loops involved. That's how computers work.</p>\n<p>However, in your case there's a handy PHP function that might speed things up a bit: <a href="https://www.php.net/manual/en/function.array-column.php" rel="nofollow noreferrer">array_column()</a>. In your case this would already do the job:</p>\n<pre><code>$new = array_column($old, 3);\n</code></pre>\n<p>The looping here is done, implicitly, inside the function, which is probably slightly faster than doing it explicitly with a <code>foreach</code> loop.</p>\n<p>You might have noticed I ignored the array keys. That's because they are the normal numerical keys you would get anyway. However, in case that your question doesn't reflect the real data you have, and it often does on Stack Overflow, there is a way to keep the keys:</p>\n<pre><code>$keys = array_keys($old);\n$values = array_column($old, 3);\n$new = array_combine($keys, $values);\n</code></pre>\n<p>I cannot know if this will be faster than your loop, for the real data you have. You simply will have to test it.</p>\n<p>You can, of course, write this in one line:</p>\n<pre><code>$new = array_combine(array_keys($old), array_column($old, 3));\n</code></pre>\n<p>Which is still readable and comprehensible. There's no real advantage to using just one line, so the 3 line version has my preference.</p>\n<p>There are many other solutions, using array functions, but most of them won't be so easy to understand as this one.</p>\n"^^ . + . + "The majority of times this happens because you're not using a webserver which supports POST requests (and therefore almost certainly doesn't support PHP either). Are you perhaps using the Live Server in Visual Studio Code, for example? It only supports GET requests and basic client-side websites. You _can_ configure it I believe to run PHP and so on, but probably you're better off using a proper webserver such as Apache will full support for PHP etc. This will also be closer to any live environment you might deploy your code to in future."^^ . + "Your question boils down to "how can I tell if a function/method/class is deprecated". The answer I linked contains solution: try to use it and if you see a deprecation notice in your logs then it means it's deprecated"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + "0"^^ . + . + "1"^^ . + . + "That makes sense. By adding that header I *think* the behavior you get is the same of adding `Accept: application/json`. The 500 error was probably due to an infinite redirect. The way a form request handles errors is to redirect back to the form but if there's no referrer (like testing in isolation with postman), that can cause issues unless you tell it to return json."^^ . + "0"^^ . + . + "2"^^ . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + "there is a metabox with a id `progetti_gallery` then it interferes with the hidden input that stores images id. just change the metabox id and it should work."^^ . + . + . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + "rotation"^^ . + . + "0"^^ . + "0"^^ . + "0"^^ . + "Woocommerce, get ID and passing over"^^ . + . + . + "0"^^ . + . + . + . + . + "3"^^ . + . + "-2"^^ . + . + . + "That's why you've chosen the trait now, that's an appropriate thing you can do. In hindsight you should consider to favor composition over inheritance. A trait often shows that, too. Btw. it's normal to find this out late, as at first extending was the way to go with ease. IMHO consider, probably after a day or so, to view the big picture from above again as you may spot another improvement."^^ . + . + "0"^^ . + "0"^^ . + . + "How do I update PDO to use the latest sqlite3 version?"^^ . + "ssl"^^ . + . + . + "1"^^ . + . + . + "0"^^ . + . + "6"^^ . + . + "<p>Im trying to change the color of the grid lines since my background is dark. I have managed to change the color of the ticks, and the line itself. However I've been trying to change the grid color for almost two hours and haven't succeeded yet. Any help would be appreciated. Thanks!</p>\n<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false" data-babel-preset-react="false" data-babel-preset-ts="false">\r\n<div class="snippet-code">\r\n<pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script&gt;\n const &lt;?php echo $info['alias'] . "xValues"?&gt; = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24];\n const &lt;?php echo $info['alias'] . "yValues"?&gt; = [80, 60, 80, 60, 100, 80];\n new Chart("&lt;?php echo $info['alias'] ?&gt;", {\n type: "line",\n data: {\n labels: &lt;?php echo $info['alias'] . "xValues"?&gt;,\n datasets: [{\n fill: false,\n lineTension: 0,\n backgroundColor: "white",\n borderColor: "white",\n data: [{\n x: 4,\n y: &lt;?php echo $nivel1?&gt;\n }, {\n x: 8,\n y: &lt;?php echo $nivel2?&gt;\n }, {\n x: 12,\n y: &lt;?php echo $nivel3?&gt;\n }, {\n x: 16,\n y: &lt;?php echo $nivel4?&gt;\n }, {\n x: 20,\n y: &lt;?php echo $nivel5?&gt;\n }, {\n x: 24,\n y: &lt;?php echo $nivel6?&gt;\n }]\n }]\n },\n options: {\n legend: {display: false},\n scales: {\n yAxes: [{ticks: {min: 0, max:100, fontColor: 'white'}, gridLines: {display: false ,color: 'white'}}],\n xAxes: [{ticks: {fontColor: 'white'}}],\n y: {\n grid: {\n color: 'white'\n }\n }\n }\n }\n });\n &lt;/script&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n"^^ . + . + "0"^^ . + . + . + . + . + "0"^^ . + "Update your question to show your current code and show $query."^^ . + "1"^^ . + "1"^^ . + "1"^^ . + "1"^^ . + "Neither. You shouldn't use `mysqli_close` either. You are using it right before outputting header location which should be followed by `exit` and that means it's already one of the last statements to be executed. You only close and free mysqli objects when you have a lot of processing to be done after fetching the data. The best practice is to never use these functions."^^ . + . + "Sounds like you need to check out why you should use composition over inheritance"^^ . + "0"^^ . + . + . + . + . + "Are you saying that `$_SESSION[job_id]` includes `$dir`? Which database column are you referring to?"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + "<p>You have to update the PDO extension, and specifically the <a href="https://github.com/php/php-src/tree/master/ext/pdo_sqlite" rel="nofollow noreferrer">sqlite3 driver extension of PDO</a> with the updated libraries as well.</p>\n<p>PDO is part of core, you can find the source code here: <a href="https://github.com/php/php-src/?tab=readme-ov-file#building-php-source-code" rel="nofollow noreferrer">https://github.com/php/php-src/?tab=readme-ov-file#building-php-source-code</a></p>\n<p>SQLite3 is already mentioned in the prerequisites before make.</p>\n"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + "1"^^ . + "2"^^ . + . + "This question is similar to: [Error converting nvarchar to datetime data type using Laravel and MSSQL](https://stackoverflow.com/questions/49999319/error-converting-nvarchar-to-datetime-data-type-using-laravel-and-mssql). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem."^^ . + . + . + . + . + "Connecting system.data.sqlite database with PHP"^^ . + . + "0"^^ . + . + "2"^^ . + . + "This might be duplicate issue. You can check this:\nhttps://stackoverflow.com/questions/61818140/cannot-use-sendgrid-java-api-to-send-utf-8-encoded-emails"^^ . + "0"^^ . + "Exclude multiple product IDs from WooCommerce coupons in an efficient way"^^ . + . + . + . + . + . + "@IMSoP Yep, its more about downloading and wasting hard disk space than loading. As you correctly pointed out, the code would never be loaded. My mistake in terminology."^^ . + "What prevents you from obtaining the diagnostics? From what I see those are `**av_interleaved_write_frame(): Broken pipe** 256.0kbits/s speed=1.02x\n**Error writing trailer of pipe:: Broken pipe**`. How are you doing the error handling? And please show an MRE as well, the code is hard to decipher and it could help to have an additional more minimal example. -- Ah now seeing popen(). You probably want proc_open() as you can bind input, output and the diagnostics on their own stream there and track is accordingly."^^ . + . + "That should probably be the next thing to try as the client side code then. Use the tools for the job"^^ . + "Looks like it's open again"^^ . + . + . + . + "2"^^ . + "The location is Japan and the access source is also the same.\nI don't use a proxy and x.com is not blocked."^^ . + . + . + . + . + "1"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + "Get every fifth array value in PHP"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "How come the letter `i` breaks my regex for `preg_replace_callback` but works with javascript"^^ . + . + "`correct me if I'm wrong here, JS captures the value of the Select, sends it via post to a PHP file that then does some work w/ that value, then sends the corresponding data (variable? array?) back for some more JS to work with` ...yes that's the general idea"^^ . + "0"^^ . + . + . + . + . + "3"^^ . + . + "Yeah, that's what I did, and I get that error. Have you tried this yourself and seen it working?"^^ . + . + . + . + "Extract text colour from PDF"^^ . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + "-1"^^ . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + "Indeed, as it's a static method with a single argument, this should be easy to register as a blade @directive https://laravel.com/docs/blade#extending-blade ..."^^ . + "Laravel version 12.3.0 SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "displaying menu options on paginated pages"^^ . + "0"^^ . + . + . + . + "<p>Ok, nevermind I found the solution.<br>\nThe issue was that the canvas is loaded on the page's first load (but with a height of 0), so when I loaded the charts with its configuration, the canvas size did not change and the chart was actually displayed in the same height of 0.<br><br>\nI added <code>maintainAspectRatio: false</code> in the chart options in order for the canvas to adapt its size to the new chart size.<br><br>\nThanks for your help anyway!</p>\n"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + "<p>There is an <code>$absolute</code> parameter for this method, it was <code>true</code> by default in 2.x (so you get a positive number whatever was the order).</p>\n<p>In 3.x default value is <code>false</code>. When doing from-&gt;diffInXyz(to) if from &gt; to, you get a negative value. You can either:</p>\n<ul>\n<li>swap from and to</li>\n<li>use <code>abs()</code> function</li>\n<li>set <code>absolute: true</code> parameter explicitly</li>\n</ul>\n"^^ . + . + "<p>This turned out to be a problem with the value of <code>SANCTUM_STATEFUL_DOMAINS</code> environment variable. While it worked correctly with <code>https://${APP_NAME}</code> on the local docker container, I had to specify <code>www.</code> prefix on production server. To be safe I then added all possible combinations with and without <code>https</code> and <code>www</code>:</p>\n<p><code>SANCTUM_STATEFUL_DOMAINS=https://${APP_NAME},https://www.${APP_NAME},https://${APP_NAME}/,https://www.${APP_NAME}/,${APP_NAME},www.${APP_NAME}</code></p>\n<p>It works correctly now.</p>\n"^^ . + . + "1"^^ . + . + "1"^^ . + "<p>We are trying to install &amp; enable the wincache dll extension into PHP 8.3 version but it is not enable. We added the file and enable <code>extension=php_wincache.dll</code> in php.ini file. But, when we see the PHP info, the wincache modules is not show in the details.</p>\n<p><em>Php version :8.3.19 NTS (non thread safe)\nWindows IIS</em></p>\n<p>Could you please provide us non thread safe wincache DLL file and provide the points to install into the IIS server (PHP 8.3)</p>\n<p>Thanks,</p>\n"^^ . + . + . + "<p>I’m encountering an issue with my Symfony 7.1 application running inside a Docker container behind an Nginx reverse proxy. When I access the login page using my production domain (e.g., <code>https://example-prod.com/login</code>), I get an &quot;Invalid CSRF token&quot; error. However, when I access the application directly via the server’s IP (e.g., <code>http://192.168.1.10/login</code>), the CSRF token works correctly.</p>\n<p><strong>My Stack:</strong></p>\n<ul>\n<li><strong>Framework:</strong> Symfony 7.1</li>\n<li><strong>Containerization:</strong> Docker</li>\n<li><strong>Web Server:</strong> Nginx (acting as a reverse proxy)</li>\n<li><strong>PHP Handler:</strong> PHP-FPM</li>\n</ul>\n<p><strong>What I’ve Tried So Far:</strong></p>\n<ol>\n<li><p><strong>Trusted Proxies &amp; Hosts:</strong><br />\nI configured the following in my <code>.env</code>:</p>\n<pre class="lang-none prettyprint-override"><code>TRUSTED_PROXIES=127.0.0.1,172.17.0.1,192.168.1.10\nTRUSTED_HOSTS='^example-prod\\.com$'\n</code></pre>\n<p>This should instruct Symfony to trust the reverse proxy headers.</p>\n</li>\n<li><p><strong>Nginx Proxy Headers:</strong><br />\nIn my Nginx configuration, I set the following headers for all relevant locations (e.g., <code>/login</code>, <code>/admin</code>, <code>/api</code>, etc.):</p>\n<pre class="lang-none prettyprint-override"><code>location /login {\n proxy_pass http://immo-backend:80/login;\n proxy_set_header Host $host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n proxy_set_header X-Forwarded-Host $host;\n proxy_set_header X-Forwarded-Port $server_port;\n}\n</code></pre>\n<p>I’ve tried similar settings for <code>/admin</code>, <code>/register</code>, and <code>/bundles</code>.</p>\n</li>\n<li><p><strong>Cache Clearing:</strong><br />\nAfter making configuration changes, I cleared the Symfony cache:</p>\n<pre class="lang-bash prettyprint-override"><code>sudo docker exec -it immo-backend bin/console cache:clear --env=prod\n</code></pre>\n</li>\n<li><p><strong>Session Cookie Settings:</strong><br />\nI considered adjusting session cookie settings (e.g., setting <code>cookie_domain</code> to <code>example-prod.com</code>), but that breaks my development environment. I need a solution that works in production without affecting dev.</p>\n</li>\n</ol>\n<p><strong>Relevant Logs:</strong></p>\n<p>The PHP-FPM error log shows the following (anonymized for clarity):</p>\n<pre><code>[31-Mar-2025 20:04:40] NOTICE: fpm is running, pid 16\n[31-Mar-2025 20:04:40] NOTICE: ready to handle connections\n127.0.0.1 - 31/Mar/2025:20:08:13 +0000 &quot;GET /index.php&quot; 200\n127.0.0.1 - 31/Mar/2025:20:08:15 +0000 &quot;POST /index.php&quot; 302\n127.0.0.1 - 31/Mar/2025:20:08:15 +0000 &quot;GET /index.php&quot; 200\n127.0.0.1 - 31/Mar/2025:20:08:17 +0000 &quot;GET /index.php&quot; 200\n</code></pre>\n<p>Additionally, the generated HTML for the login page shows the <code>_csrf_token</code> field with a placeholder value (&quot;csrf-token&quot;), indicating that the token is not properly generated or validated when using the domain.</p>\n<p><strong>The Issue:</strong></p>\n<ul>\n<li><p><strong>Direct IP Access:</strong><br />\nAccessing <code>http://192.168.1.10/login</code> works fine, and the CSRF token is accepted.</p>\n</li>\n<li><p><strong>Domain Access:</strong><br />\nAccessing <code>https://example-prod.com/login</code> yields an &quot;Invalid CSRF token&quot; error.</p>\n</li>\n</ul>\n<p>This discrepancy leads me to believe that something in the request context (headers, scheme, or cookie domain) is not being handled correctly when using the domain name behind the Nginx proxy.</p>\n<p><strong>Question:</strong></p>\n<p>What could be causing the CSRF token to be invalid when I access the application via the production domain behind the Nginx proxy, while it works perfectly with the IP? How can I adjust my configuration (both in Symfony and Nginx) so that the request context (including HTTPS and domain headers) is correctly recognized in production without breaking the development environment?</p>\n<p>Any help or suggestions are greatly appreciated!</p>\n"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + "Where and when are you calling/using this module() function? It's unclear how this all fits together. If you need `$modulShape` in the `module()` function, why not just change the function definition to accept that variable as a parameter? Is there something blocking you from doing that? The context and the problem are unclear. Please [edit] your question to explain the situation in a bit more detail."^^ . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + "<p>I'm facing an issue when trying to install the <a href="https://github.com/pqina/filepond" rel="nofollow noreferrer">FilePond </a> library using Symfony's importmap system.</p>\n<p>I attempted to add FilePond to my project by running php bin/console importmap:require filepond (or by manually adding an entry in my importmap.php file), followed by php bin/console importmap:install. However, as soon as I run the install command, I get the following error:</p>\n<pre><code>In ErrorChunk.php line 73:\n Body size limit exceeded\n\nIn Http2ConnectionProcessor.php line 711:\n Body size limit exceeded\n\nIn Http2ConnectionProcessor.php line 757:\n Body size limit exceeded\n</code></pre>\n<p>I have tried several solutions to fix this issue:</p>\n<p>Increasing the HTTP client's body size limit by modifying the php.ini file (adjusting memory_limit, upload_max_filesize, etc.), and redefining the HTTP client service in services.yaml with the max_body_size option.</p>\n<p>Changing the FilePond entry to use a &quot;path&quot; with a direct CDN URL instead of &quot;version&quot;, to bypass automatic resolution.</p>\n<p>Despite these attempts, the error persists, and I can't properly download the assets from the CDN.</p>\n<p>Has anyone encountered this issue with FilePond or other libraries via importmap? Any suggestions on how to bypass this size limit?</p>\n<p>Thanks in advance for your help!</p>\n"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + "swig"^^ . + . + "0"^^ . + "<p>To hide the prices in Cart and Checkout page, you will need to add multiple filters, as prices are displayed in various parts of the store, each having its own filter or hook.</p>\n<p>Here is a list of all <a href="https://woocommerce.github.io/code-reference/hooks/hooks.html" rel="nofollow noreferrer">WooCommerce Action &amp; Filter Hooks</a>.</p>\n<p>So by using your apprach, you can effectivly hide these elements, by returning an empty string/array:</p>\n<pre><code>/* Hooks to hide prices in cart and checkout pages */\n/* Hides the prices by returning an emtpy string/array */\n\n// Hide the price of individual items in the cart\nadd_filter( 'woocommerce_cart_item_price', '__return_empty_string' );\n// Hide the subtotal of individual items in the cart\nadd_filter( 'woocommerce_cart_item_subtotal', '__return_empty_string' );\n// Hide the subtotal of all items in the cart\nadd_filter( 'woocommerce_cart_subtotal', '__return_empty_string' );\n// Hide the total price of all items in the cart\nadd_filter( 'woocommerce_cart_total', '__return_empty_string' );\n// Hide tax in the cart and checkout pages\nadd_filter( 'woocommerce_cart_tax_totals', '__return_empty_array' );\n</code></pre>\n<p>However, you should be aware of that this will not hide the prices from the customer order emails.</p>\n"^^ . + . + . + . + . + . + . + . + . + "Although I understand the motivation behind the downvote, I believe that selecting and using the right version control systems should be something developers learn during their learning phase. For Windows, the most common - which I think is a bad habit - is using XAMPP. Then, when updating, everyone inevitably faces the issue: it's cumbersome. Downvote or not, I believe my answer is useful for those who are unfamiliar with version control, are new to the topic, and want to educate themselves."^^ . + . + . + . + . + "More to the point: You are using a prepared statement, and you have used a parameter for one variable, but you should use parameters for all the other variables too. It's safer, avoids many syntax errors, and it's actually easier to write the code and easier to read the code."^^ . + . + . + . + "0"^^ . + "0"^^ . + . + . + "i mean, dont't use money datatype. Use numeric"^^ . + "3"^^ . + . + . + "<p>I'm trying to write tests to assert that methods called in my <code>AppServiceProvider</code> boot method are present &amp; enforced logic.</p>\n<p>So far I'm using mocks &amp; reflection, however I am having an issue with the <code>DB::prohibitDestructiveCommands(app()-&gt;isProduction())</code> method call.</p>\n<p>The method <code>prohibitDestructiveCommands()</code> isn't on the underlying proxied class <code>(DatabaseManager)</code>, it's on the actual facade class.</p>\n<p>This has made it quite difficult for me. I have spent far too long trying to solve this; to come up with a solution that will allow to assert that the facade method is called.</p>\n<p>So I have landed on the following test as being a possible way to solve my issue:</p>\n<pre class="lang-php prettyprint-override"><code>test('Invokes DB::prohibitDestructiveCommands in production', function () \n {\n $this-&gt;app-&gt;detectEnvironment(fn() =&gt; 'production');\n \n $mock = mock('overload:Illuminate\\Support\\Facades\\DB');\n \n $mock-&gt;shouldReceive('getFacadeRoot')\n -&gt;once()\n -&gt;andReturn(new DB);\n \n $mock-&gt;shouldReceive('prohibitDestructiveCommands')\n -&gt;once()\n -&gt;with(true);\n \n $this-&gt;provider-&gt;boot();\n \n $mock-&gt;shouldHaveReceived('prohibitDestructiveCommands');\n }\n);\n</code></pre>\n<p>It still has the problem, that the Facade is already loaded in that namespace and can't be overloaded, so it results in the test having the following error:</p>\n<pre><code>Mockery\\Exception\\RuntimeException:\n Could not load mock Illuminate\\Support\\Facades\\DB,\n class already exists\nat vendor/mockery/mockery/library/Mockery/Container.php:401\nat vendor/mockery/mockery/library/Mockery.php:681\nat vendor/mockery/mockery/library/helpers.php:40\n</code></pre>\n<p>If you can figure out how I can overcome this, or another way of asserting that a method from a principal facade class is invoked, then I would really appreciate the assistance.</p>\n<p>Note: I know that I could wrap the method like so &amp; mock the provider to assert the call of that method, however it's not a wonderful solution to enforcing behaviour through tests, as the call to <code>DB::prohibitDestructiveCommands(app()-&gt;isProduction())</code> could be removed or changed by a dev at a later time from the wrapping method &amp; tests wouldn't pickup the structural change.</p>\n<p>I am also aware, I can test the outcome of the calling the prohibited commands, but this is a unit tests, and shouldn't be cross testing behaviour like this, just the structure of the class.</p>\n"^^ . + . + . + . + . + . + . + "<p>I have a model call User which has SoftDelete enabled. When I &quot;delete&quot; any user, it is marked as deleted but as the record is not actually deleted from the database it does not trigger the 'ON_DELETE' =&gt; 'SET_NULL' in my database.</p>\n<p>My main model Project has a foreign key with the User model by project.user_id = user.id</p>\n<p>What I would like to achieve is that every time I soft delete a User, the user_id field in the Project table is set to null, which will be easily achieved by the mySql relationship but as explained I don't want the record to be physically deleted.</p>\n"^^ . + . + "Attempt to read property "user" on null"^^ . + . + . + "The suppression field is not listed in the allowed fields list."^^ . + "Just FYI, if you go down the manual install path, each time PHP gets an update, something is going to change and it will be your burden to fix/change things. Part of the beauty of composer (and semver) is that you can more easily upgrade to newer versions, and also rollback if needed."^^ . + . + . + . + . + . + "microsoft-graph-api"^^ . + "0"^^ . + . + . + "1"^^ . + . + "postgresql"^^ . + . + . + . + . + "3"^^ . + "php binary could not be either found or executed. Make sure PHP is installed, and add path"^^ . + . + "I don't get any errors. The URL doesn't change in the password reset email."^^ . + . + . + . + . + . + . + . + . + "<p>I have a problem when adding a record to the database. When I receive a 200 response code with redirected: true, the record is not added to my users table. However, if I receive a 204 response with redirected: false, the record is added successfully.</p>\n<p>I also noticed in Postman that if I log out and then register again, I receive a 204 response code.</p>\n<p><a href="https://i.sstatic.net/EDzz6FFZ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/EDzz6FFZ.png" alt="enter image description here" /></a></p>\n<p>//Register.jsx</p>\n<pre><code>async function handleRegister(e) {\n e.preventDefault();\n \n await fetch('http://localhost:8000/sanctum/csrf-cookie', {\n method: &quot;GET&quot;,\n credentials: &quot;include&quot;\n });\n\n // Extract CSRF token\n const csrfToken = decodeURIComponent(\n document.cookie.split('; ').find(row =&gt; row.startsWith('XSRF-TOKEN='))?.split('XSRF-TOKEN=')[1] || ''\n );\n console.log(csrfToken);\n \n const res = await fetch('http://localhost:8000/register', {\n method: &quot;POST&quot;,\n headers: {\n &quot;X-XSRF-TOKEN&quot;: csrfToken\n },\n credentials: &quot;include&quot;,\n body: JSON.stringify(formData),\n });\n\n if (!res.ok) { \n console.error(&quot;Registration failed:&quot;, res);\n if (res.errors) {\n setErrors(res.errors);\n console.error(&quot;Errors:&quot;, res.errors);\n }\n } else {\n navigate(&quot;/login&quot;);\n console.log(res);\n }\n}\n</code></pre>\n<p>//RegisteredUserController.php</p>\n<pre><code>namespace App\\Http\\Controllers\\Auth;\n\nuse App\\Http\\Controllers\\Controller;\nuse App\\Models\\User;\nuse Illuminate\\Auth\\Events\\Registered;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Http\\Response;\nuse Illuminate\\Support\\Facades\\Auth;\nuse Illuminate\\Support\\Facades\\Hash;\nuse Illuminate\\Validation\\Rules;\n\nclass RegisteredUserController extends Controller\n{\n /**\n * Handle an incoming registration request.\n *\n * @throws \\Illuminate\\Validation\\ValidationException\n */\n public function store(Request $request): Response\n {\n $request-&gt;validate([\n 'name' =&gt; ['required', 'string', 'max:255'],\n 'email' =&gt; ['required', 'string', 'lowercase', 'email', 'max:255', 'unique:'.User::class],\n 'password' =&gt; ['required', 'confirmed', Rules\\Password::defaults()],\n ]);\n\n $user = User::create([\n 'name' =&gt; $request-&gt;name,\n 'email' =&gt; $request-&gt;email,\n 'password' =&gt; Hash::make($request-&gt;string('password')),\n ]);\n\n event(new Registered($user));\n\n Auth::login($user);\n\n return response()-&gt;noContent();\n }\n}\n</code></pre>\n<p>//auth.php</p>\n<pre><code>Route::post('/register', [RegisteredUserController::class, 'store'])\n -&gt;middleware('guest')\n -&gt;name('register');\n</code></pre>\n"^^ . + . + . + . + . + "<p>I have gone through many documentations online but not able to figure out how to achieve this.</p>\n<p>Caller calls my Twilio number, I want to welcome the caller and then put the caller on hold for like 10 seconds while I process my logic to get a number from database where I need to forward the caller to. After like 10 seconds, I want to dial the number from the database. During this entire waiting I want caller to hear the hold music.</p>\n<p>So far I am able to play the hold music but as soon as I update the live call and dial another number, hold music stops and there is alike a silence for 2-3seconds before the number starts ringing.</p>\n<p>I have done this:</p>\n<pre><code>$twilio = new Client(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN);\n$twilio-&gt;calls($call_sid)-&gt;update(\n array(\n &quot;twiml&quot; =&gt; &quot;&lt;Response&gt;&lt;Play&gt;https://champagne-crocodile-4378.twil.io/assets/hold-music-cropped.mp3&lt;/Play&gt;&lt;/Response&gt;&quot;,\n )\n);\n</code></pre>\n<p>// Make a curl request to my logic endpoint along with call sid.</p>\n<h3>Function where I process my logic</h3>\n<pre><code>$twiml = &quot;&lt;Response&gt;&lt;Dial&gt;&lt;Number&gt;+1234567890&lt;/Number&gt;&lt;/Dial&gt;&lt;/Response&gt;&quot;;\n$twilio = new Client(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN);\n$twilio-&gt;calls($call_sid)-&gt;update(\n array(\n &quot;twiml&quot; =&gt; $twiml,\n )\n);\n</code></pre>\n<p>When the above code executes, hold music stops.</p>\n<p>I want to keep the hold music playing until the dialed number receives the call. Please guide me.</p>\n"^^ . + "Understood. This is great, Loic. I was looking for a script (or plugin) I could run once across all the variable products on the site at one time. Do you think that's possible? Or do you think this is a better solution? I thought that might be a more efficient solution in the long run -- since I'll be manually placing all variations for new products going forward in alpha order."^^ . + "1"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + . + "<p>When having a large array and you want weighted random values, you could create a new array having higher weighted values occuring more often, but this will consume a lot of extra memory.</p>\n<p>Using the total weight, you can subtract the weight of a random entitiy until the weight is going negative and return it. This will preserve the weighting.</p>\n<p>Here we have 1.000.000 samples, so John gets most parts, then Peter, then Paul.</p>\n<pre class="lang-php prettyprint-override"><code>// Normalized weighting (all together sum up to 1)\n$sum = 3+2+1;\n$array = [\n 'John' =&gt; 3 / $sum,\n 'Peter' =&gt; 2 / $sum,\n 'Paul' =&gt; 1 / $sum,\n];\n\n$keys = array_keys($array);\n$samples = 1e6;\n$pool = array_fill_keys($keys, 0);\n$len = count($array) - 1;\n\nfor($i = 0; $i &lt; $samples; $i++) {\n $weight = 1;\n while($weight &gt; 0) {\n $key = $keys[rand(0, $len)];\n $weight -= $array[$key];\n }\n $pool[$key]++;\n}\n</code></pre>\n<p>Dump of the pool:</p>\n<pre><code>array(3) {\n [&quot;John&quot;] =&gt; int(588533)\n [&quot;Peter&quot;]=&gt; int(289020)\n [&quot;Paul&quot;] =&gt; int(122447)\n}\n</code></pre>\n"^^ . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + "That works a treat .. Thank you so much"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + "There isn't really another solution AFAIK. Apache's authentication systems are entirely separate to your php app"^^ . + . + "stream"^^ . + "0"^^ . + . + . + . + "@dudley, I have edited the code. Please try this new code. I have made following changes : Removed "resources/" from the post type rewrite slug → 'slug' => '%resource-type%', Updated the post_type_link filter to correctly replace %resource-type% with the taxonomy slug, Modified the rewrite rules to properly recognize posts"^^ . + . + . + . + . + "0"^^ . + "5"^^ . + "0"^^ . + . + . + . + "0"^^ . + "1"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + "How can I use a many-to-many relationship to display articles by tag in Laravel?"^^ . + . + . + . + "Please don't leave the default text “enter image description here”, always change it to some descriptive image title.\nPlease don't post textual information in the form of pictures. Please see: [Why should I not upload images of code/data/errors?](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors)\nIf you still need an image, it can complement the textual information."^^ . + "1"^^ . + . + "How to make my calendar table display a guest stay as a single 'entry' in a row instead of two separate entries"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + "<p>Make sure that you have installed Reverb and filled the Reverb variables in your <code>.env</code> file and that the broadcast driver is set to Reverb.</p>\n<p><strong>Install Reverb in Laravel</strong></p>\n<pre><code>php artisan install:broadcasting\n</code></pre>\n<p><strong>Configure <code>.env</code> file</strong></p>\n<pre><code>BROADCAST_CONNECTION=reverb\n\nREVERB_SERVER_HOST=127.0.0.1\nREVERB_SERVER_PORT=8080\nREVERB_APP_ID=app_id\nREVERB_APP_KEY=your_key\nREVERB_APP_SECRET=your_secret_key\nREVERB_HOST=your_server\nREVERB_PORT=80\nREVERB_SCHEME=http\n</code></pre>\n"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + "<p>I am currently trying to program a QR code generator using PHP and <a href="https://github.com/chillerlan/php-qrcode" rel="nofollow noreferrer">the QRCode library from Chillerlan</a>.</p>\n<p>I have the following problem: I would like to use different module shapes for the layout of the QR codes.\nHere is an excerpt of my code:</p>\n<pre><code>class QRSvgWithLogoAndCustomShapes extends QRMarkupSVG {\n protected function module(int $x, int $y, int $M_TYPE): string {\n if (\n !$this-&gt;matrix-&gt;isDark($M_TYPE)\n // we're skipping the finder patterns here\n || $this-&gt;matrix-&gt;checkType($x, $y, QRMatrix::M_FINDER)\n || $this-&gt;matrix-&gt;checkType($x, $y, QRMatrix::M_FINDER_DOT)\n ) {\n return '';\n }\n\n // return a heart shape (or any custom shape for that matter)\n // return sprintf('M%1$s %2$s m0.5,0.96 l-0.412,-0.412 a0.3 0.3 0 0 1 0.412,-0.435 a0.3 0.3 0 0 1 0.412,0.435Z', $x, $y);\n // return sprintf('M%1$s %2$s a0.5,0.5 0 1,0 0.001,0', $x, $y);\n // return sprintf('M%1$s %2$s l0.2,0.4 l0.45,0.05 l-0.35,0.25 l0.12,0.48 l-0.45,-0.25 l-0.45,0.25 l0.12,-0.48 l-0.35,-0.25 l0.45,-0.05Z', $x, $y);\n \n return sprintf('M%1$s %2$s a0.5,0.5 0 1,0 0.001,0', $x, $y);\n }\n}\n\nclass QrCodeGenerator {\n public function qrgenerate(string $data, $modulShape, bool $includeLogo = false) {\n $options = new SVGWithLogoAndCustomShapesOptions;\n \n // SVG logo options (see extended class below)\n if ($includeLogo) {\n $options-&gt;svgLogo = TEMPLATE_PATH.'module/home/github.svg'; // logo from: https://github.com/simple-icons/simple-icons\n $options-&gt;svgLogoScale = 0.25;\n $options-&gt;svgLogoCssClass = 'qr-logo dark';\n } else {\n // No logo, so we set svgLogo to an empty string\n $options-&gt;svgLogo = '';\n }\n\n $options-&gt;version = -1;\n $options-&gt;versionMin = 1;\n $options-&gt;versionMax = 40;\n $options-&gt;outputType = QROutputInterface::CUSTOM;\n $options-&gt;outputInterface = QRSvgWithLogoAndCustomShapes::class;\n $options-&gt;outputBase64 = false;\n $options-&gt;eccLevel = EccLevel::H;\n\n $options-&gt;drawLightModules = true; // optional, currently has no effect\n $options-&gt;svgUseFillAttributes = true; // optional, currently has no effect\n\n if ($modulShape == 'circular') {\n $options-&gt;drawCircularModules = true; // true = round modules\n $options-&gt;circleRadius = 0.4; // keep the default value, as it looks good\n }\n\n $options-&gt;connectPaths = true; // optional, leave it as is for now\n // If using round modules, choose which parts should remain square\n $options-&gt;keepAsSquare = [\n QRMatrix::M_FINDER_DARK,\n QRMatrix::M_FINDER_DOT,\n QRMatrix::M_ALIGNMENT_DARK,\n ];\n\n $qrcode = new QRCode($options);\n $qrImage = $qrcode-&gt;render($data); // Generate the QR code as a PNG image\n\n $matrix = $qrcode-&gt;getMatrix($qrcode); // Read the used version, $matrix-&gt;version() gives the version for storing in the DB\n $version = $matrix-&gt;version();\n\n $qrCodeData = [$data, 'version' =&gt; $matrix-&gt;version(), $modulShape];\n var_dump($qrImage);\n exit;\n return $qrCodeData;\n }\n}\n</code></pre>\n<p>Now, I need to use the $modulShape variable inside the protected function module.\nHow can I achieve this, so that I can check the respective module type via if-else and output the corresponding shape accordingly?</p>\n"^^ . + . + . + "Thanks @Armanist for the answer, this is the only website I'm going to land on this hosting. I'll try the move the files out as you and Set Bembeneck suggest and will update the results"^^ . + . + . + "<p>You cannot use the &quot;render&quot; method if the Twig Bundle is not available. Try running &quot;composer require symfony/twig-bundle&quot;.\nLogicException\nin C:\\Users\\User\\OneDrive\\Bureau\\lovoresume\\vendor\\symfony\\framework-bundle\\Controller\\AbstractController.php (line 418)\n} private function doRenderView(string $view, ?string $block, array $parameters, string $method): string { if (!$this-&gt;container-&gt;has('twig')) { throw new \\LogicException(\\sprintf('You cannot use the &quot;%s&quot; method if the Twig Bundle is not available. Try running &quot;composer require symfony/twig-bundle&quot;.', $method)); } foreach ($parameters as $k =&gt; $v) { if ($v instanceof FormInterface) { $parameters[$k] = $v-&gt;createView();\nAbstractController-&gt;doRenderView('listCV.html.twig', null, array('cvs' =&gt; array(object(Cv), object(Cv), object(Cv), object(Cv)), 'cvTemplates' =&gt; array(object(TemplateCv), object(TemplateCv)), 'ficheCompetencesTemplates' =&gt; array(object(TemplateFicheCompetence))), 'render')\nin C:\\Users\\User\\OneDrive\\Bureau\\lovoresume\\vendor\\symfony\\framework-bundle\\Controller\\AbstractController.php (line 436)\nAbstractController-&gt;doRender('listCV.html.twig', null, array('cvs' =&gt; array(object(Cv), object(Cv), object(Cv), object(Cv)), 'cvTemplates' =&gt; array(object(TemplateCv), object(TemplateCv)), 'ficheCompetencesTemplates' =&gt; array(object(TemplateFicheCompetence))), null, 'render')\nin C:\\Users\\User\\OneDrive\\Bureau\\lovoresume\\vendor\\symfony\\framework-bundle\\Controller\\AbstractController.php (line 250)\nAbstractController-&gt;render('listCV.html.twig', array('cvs' =&gt; array(object(Cv), object(Cv), object(Cv), object(Cv)), 'cvTemplates' =&gt; array(object(TemplateCv), object(TemplateCv)), 'ficheCompetencesTemplates' =&gt; array(object(TemplateFicheCompetence))))\nin C:\\Users\\User\\OneDrive\\Bureau\\lovoresume\\src\\Controller\\CvController.php (line 84)\nCvController-&gt;list(object(EntityManagerGhost614a58f), object(TemplateCvRepository), object(TemplateFicheRepository))\nin C:\\Users\\User\\OneDrive\\Bureau\\lovoresume\\vendor\\symfony\\http-kernel\\HttpKernel.php (line 183)\nHttpKernel-&gt;handleRaw(object(Request), 1)\nin C:\\Users\\User\\OneDrive\\Bureau\\lovoresume\\vendor\\symfony\\http-kernel\\HttpKernel.php (line 76)\nHttpKernel-&gt;handle(object(Request), 1, true)\nin C:\\Users\\User\\OneDrive\\Bureau\\lovoresume\\vendor\\symfony\\http-kernel\\Kernel.php (line 182)\nKernel-&gt;handle(object(Request))\nin C:\\Users\\User\\OneDrive\\Bureau\\lovoresume\\vendor\\symfony\\runtime\\Runner\\Symfony\\HttpKernelRunner.php (line 35)\nHttpKernelRunner-&gt;run()\nin C:\\Users\\User\\OneDrive\\Bureau\\lovoresume\\vendor\\autoload_runtime.php (line 29)\nrequire_once('C:\\Users\\User\\OneDrive\\Bureau\\lovoresume\\vendor\\autoload_runtime.php')\nin C:\\Users\\User\\OneDrive\\Bureau\\lovoresume\\public\\index.php (line 5)</p>\n"^^ . + "0"^^ . + "Only issue is that if you use PHP/Laravel to validate the date, `31-02-2025` is actually a valid date; `Carbon\\Carbon::parse('31-02-2025')` returns `2025-03-03`. That being said; what have you tried? Where are you stuck? Please [edit your question](https://stackoverflow.com/posts/79533454/edit) and include your code"^^ . + "Just for production (not development): [Laravel - What steps should one take to make a Laravel app ready for production mode](https://stackoverflow.com/a/59664416/15167500) - If you're running it on a development codebase, you might need the php artisan optimize:clear command to clear the cached configurations."^^ . + "0"^^ . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + "laravel-routing"^^ . + "2"^^ . + . + "global"^^ . + "WHERE Clause in MySQL PDO not working (PHP)"^^ . + "1"^^ . + . + . + . + "1"^^ . + . + "Good answer.\n\nI did look at how ASN.1 compilers do it and apparently they have to be in a module script for it to work when compiling to encoding rules. In addition, I'm thinking that the values have to be attached to the module when decoding from encoding rules as well.\n\nI've been reading the ASN.1 books provided by OSS, I have an understanding of the scripting language but not encoding, this helps.\n\nThanks."^^ . + . + . + "<p>You are getting that error because WooCommerce cart is not yet initialized. Use <a href="https://github.com/woocommerce/woocommerce/blob/2f180e1f170d457686cac16ad10ad6aa61d66b7d/plugins/woocommerce/includes/wc-core-functions.php#L2644" rel="nofollow noreferrer"><code>wc_load_cart()</code></a> function to initialize the cart.</p>\n<p>Example:</p>\n<pre class="lang-php prettyprint-override"><code>function payment_gateway_disable_on_account( $available_gateways ) {\n global $woocommerce;\n\n if ( is_null( $woocommerce-&gt;cart ) ) {\n // If cart is not initialized, call this function\n wc_load_cart();\n }\n\n ...\n}\n</code></pre>\n"^^ . + . + . + "0"^^ . + "0"^^ . + "Thanks for your help.\n@hakre It's done. Thanks!"^^ . + . + . + "0"^^ . + . + "2"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + "<p>If the user_id can't be null, it means that you don't load the association from the image, meaning $image doesn't embed its associated user.</p>\n<p>Here is an example to retrieve an association</p>\n<p><strong>$image= Image::with('user')-&gt;get();</strong></p>\n<p>The string inside with correspond to the relationship method name in the Image model</p>\n<pre><code>&lt;?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Image extends Model\n{\n use HasFactory;\n\n protected $fillable = ['user_id', 'image_path', 'description'];\n\n /**\n * Define the relationship: An image belongs to a user.\n */\n public function user()\n {\n return $this-&gt;belongsTo(User::class, 'user_id');\n }\n}\n</code></pre>\n"^^ . + . + . + "<p>I have php 8.0.30:</p>\n<pre><code>PHP 8.0.30 (cli) (built: Sep 2 2023 08:05:13) ( NTS )\nCopyright (c) The PHP Group\nZend Engine v4.0.30, Copyright (c) Zend Technologies\n with Zend OPcache v8.0.30, Copyright (c), by Zend Technologies\n with Xdebug v3.4.1, Copyright (c) 2002-2025, by Derick Rethans\n</code></pre>\n<p>When loading extensions, it uses the path:</p>\n<pre><code>/usr/lib/php/20200930/\n</code></pre>\n<p>Now, I installed runkit7 via:</p>\n<pre><code>pecl install runkit7-4.0.0a6\n</code></pre>\n<p>Yet the <code>runkit7.so</code> file will be placed at:</p>\n<pre><code>/usr/lib/php/20230831/runkit7.so\n</code></pre>\n<p>Simply moving the <code>runkit7.so</code> file to the used directory won't work as there is a strong requirement for the versions to match:</p>\n<pre><code>PHP Warning: PHP Startup: runkit7: Unable to initialize module\nModule compiled with module API=20230831\nPHP compiled with module API=20200930\nThese options need to match\n in Unknown on line 0\n</code></pre>\n<p>How to install pecl extension for my module version?</p>\n<hr />\n<p>I have different versions of php installed:</p>\n<pre><code>$ sudo update-alternatives --list php\n/usr/bin/php7.4\n/usr/bin/php8.0\n/usr/bin/php8.1\n/usr/bin/php8.2\n/usr/bin/php8.3\n</code></pre>\n<p>I have <code>https://ppa.launchpadcontent.net/ondrej/php/ubuntu/</code> in my sources.</p>\n<p>The server has:</p>\n<pre><code>$ lsb_release -a\nNo LSB modules are available.\nDistributor ID: Ubuntu\nDescription: Ubuntu 22.04.3 LTS\nRelease: 22.04\nCodename: jammy\n</code></pre>\n"^^ . + . + . + . + . + . + "I just tried your example, spelling it `bcc` instead of `bbc` and omitting the whitespace, and my Outlook interpreted it correctly"^^ . + . + . + "Have you tried using another web browser?"^^ . + . + . + . + . + "0"^^ . + . + . + . + "you can use css with an attribute selector which searches in the url `a[href*="/event/"] { color : red; }`"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + "<p>That's it, I figured it out, it's working. Example:</p>\n<pre><code>&lt;?\nif (isset($_GET['page'])) {\n $page = (int)$_GET['page'];\n $per_page = 200;\n $start = get_start($page, $per_page);\n $cities = get_cities($start, $per_page);\n $html = '';\n if ($cities) {\n foreach ($cities as $city) {\n $html .= &quot;\n &lt;li&gt;\n &lt;button class='alert-button'&gt;Button 1&lt;/button&gt;\n &lt;button class='alert-button'&gt;Button 2&lt;/button&gt;\n &lt;/li&gt; \n\n &quot;;\n }\n }\n echo $html;\n die;\n}\n\n?&gt;\n\n&lt;script&gt;\n const container = document.querySelector('#cities');\n\n // Click handler for entire DIV container\n container.addEventListener('click', function (e) {\n // But only alert for elements that have an alert-button class\n if (e.target.classList.contains('alert-button')) {\n alert(e.target.innerHTML);\n }\n });\n\n const newBtn = document.createElement('button');\n newBtn.classList.add('alert-button');\n newBtn.innerHTML = 'Button 3';\n container.append(newBtn);\n&lt;/script&gt;\n</code></pre>\n"^^ . + . + . + . + "-1"^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "@Dharman: Yes, that's for trouble shooting only, so that there is an active action. In fact after Aynber's comment, I think it is just that the user misconfigured the error log so that no logging is done. It's perhaps better to leave it with the SAPI logger for a more out-of-the-box experience."^^ . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + "You're missing the `$pdo, $lastname, $firstname` arguments when calling the function."^^ . + . + . + . + "<p>To give you an idea, here's how I would implement it.</p>\n<p>routes/api.php</p>\n<pre><code>Route::group(['middleware' =&gt; 'auth:sanctum', 'prefix' =&gt; 'users', 'as' =&gt; 'users.'], function () {\n Route::post('{user}/follow', [\\App\\Http\\Controllers\\UserController::class, 'follow'])-&gt;name('follow');\n Route::delete('{user}/follow', [\\App\\Http\\Controllers\\UserController::class, 'unfollow'])-&gt;name('unfollow');\n});\n↓\nPOST /api/users/1/follow\nDELETE /api/users/1/follow\n</code></pre>\n<p>Routes to follow and unfollow user ID 1.</p>\n<p>The implementation would look something like this.</p>\n<pre><code>class UserController {\n public function follow(User $user)\n {\n $me = auth()-&gt;user(); // logged in user.\n\n // follow target user.\n $me-&gt;followings()-&gt;attach($user-&gt;a);\n\n return response()-&gt;noContent();\n }\n\n public function unfollow(User $user)\n {\n $me = auth()-&gt;user(); // logged in user.\n\n // unfollow target user.\n $me-&gt;followings()-&gt;detach($user-&gt;a);\n\n return response()-&gt;noContent();\n }\n}\n</code></pre>\n<p>The <code>followings()</code> relation has a method called <code>attach()</code> and is specifically used for many to many relationships. Once you attach the followings, you can access them with <code>$user-&gt;followings</code>.</p>\n<p>Take note, I didn't include any validations in this example.</p>\n<p>Also, there's already a package for that and I think it's easy to use.</p>\n<p><a href="https://github.com/overtrue/laravel-follow" rel="nofollow noreferrer">https://github.com/overtrue/laravel-follow</a></p>\n<p>You can read more on <a href="https://laravel.com/docs/11.x/eloquent-relationships#updating-many-to-many-relationships" rel="nofollow noreferrer">many to many relationships</a> in the laravel docs.</p>\n<p>Hopefully you got a gist of the implementation.</p>\n"^^ . + . + . + "vscode-extensions"^^ . + . + "<p>Great question IMHO, this is how I try to remember it myself:</p>\n<pre><code> static key word, late static binding since PHP 5.3\n ```````````````.``````````````````````````````´´´`\n |\n\n static :: foo(); &lt;--- I see a method\n\n ^^\n scope resolution operator\n</code></pre>\n<p>Normally when I look at the code, I first see the method perhaps because I'm in for the call, for the action.</p>\n<p>This can distract already.</p>\n<p>Then I often forget that <code>::</code> is the scope resolution operator. Perhaps because I'm using static methods <em>little</em> (as you noticed, they require it as there is no instance and it is <code>-&gt;</code> then what I very much often make use of.)</p>\n<p>The <code>static</code> keyword I also use relatively little. I know for some it was a big feature when PHP 5.3 introduced late static binding. I dunno why I use it that little.</p>\n<p>All this combines leads to me often having this and similar questions.</p>\n<p>Inside a method for example:</p>\n<pre class="lang-php prettyprint-override"><code>class OfSuchA\n{\n function that()\n {\n $this-&gt;mostOften();\n # could be #\n self::mostOften();\n # and to answer your question #\n static::mostOften();\n }\n}\n</code></pre>\n<p><em>(<a href="https://3v4l.org/FT2P1#v8.4.5" rel="nofollow noreferrer">Demo (3v4l.org)</a>)</em></p>\n<p>I most often use <code>$this-&gt;</code> calls, only for the <code>parent</code> I use the scope resolution operator (<code>parent::current()</code>, e.g. extending <em>IteratorIterator</em>.)</p>\n"^^ . + "<p>There are two hints in the error message that are worth pursuing the investigation:</p>\n<ul>\n<li>&quot;tried to allocate <strong>62914592 bytes</strong>&quot;<br />\nit's not some random string concatenation that, willing to reserve 10 bytes, gets the bad luck of being the one that makes total memory consumption exceed the limit after ten other million concatenations did the same;<br />\nhere it's something trying to get a <strong>62 MB memory block at once</strong>: an image processor loading a big photo in memory, an unzip of a 10 MB file, a dump of a database…</li>\n<li>&quot;<strong>class-wpdb.php</strong> on line 1812&quot;<br />\nWell, with such a name, it looks like the culprit is something reading a <strong>big chunk from a database</strong>.</li>\n</ul>\n<p>With that all, the first thing you have to do is <strong>go look at line 1812 of the file</strong> <code>/www/volleyballandme_311/public/wp-includes/class-wpdb.php</code>. We can't do it for you (even if we knew your WordPress version this would be complicated to find the exact same as you).</p>\n<p>If, as assumed, this crashes in a function reading the results of an SQL query, <strong>find which query</strong> (a quick way would be to add a <code>file_put_contents('/tmp/queries.sql', $theVariableHoldingTheQuery.&quot;\\n&quot;, FILE_APPEND);</code> before what looks like the call to the database some lines before line 1812).<br />\nThen try to run the query (the last one written in file <code>/tmp/queries.sql</code>) directly in your database (without PHP), to see if its result is that big.</p>\n<p>If yes, it will be up to you to understand why you have so much data in that table: is it expected? If yes increasing the memory limits will help, if no purge your data.</p>\n"^^ . + . + . + . + . + "Is it safe to let users change their own role in Wordpress?"^^ . + "1"^^ . + . + . + "Content dependent on usergroup in MediaWiki"^^ . + "1"^^ . + . + "0"^^ . + . + . + . + . + . + . + "sonarqube"^^ . + "laravel 5.8 validate() not working while Validator() is working in ubuntu apache"^^ . + "continue"^^ . + . + . + "<p>I found the solution after thoroughly checking Symfony's issues!</p>\n<p>The issue was caused by an outdated HTTP client. To fix it, simply update the HTTP client by running:</p>\n<p><code>composer require amphp/http-client</code></p>\n<p>After installing this package, the <code>importmap:install</code> command worked without any issues.</p>\n<p>If anyone else encounters the <strong>&quot;Body size limit exceeded&quot;</strong> error, make sure your HTTP client is up to date. Hope this helps!</p>\n"^^ . + . + . + "webauthn"^^ . + . + . + "@ITgoldman `$role_check` needs to be an array since it's used in the `in_array()` function in the if-statement."^^ . + . + . + "0"^^ . + . + "Why does PHP-FPM queue connections when max active processes is less than total processes"^^ . + . + . + . + . + "<p>For laravel 12, you can add the following in <code>bootstrap/app.php</code>:</p>\n<pre><code>&lt;?php\n\nuse Illuminate\\Foundation\\Application;\nuse Illuminate\\Foundation\\Configuration\\Exceptions;\nuse Illuminate\\Foundation\\Configuration\\Middleware;\n\nreturn Application::configure(basePath: dirname(__DIR__))\n -&gt;withRouting(\n web: __DIR__.'/../routes/web.php',\n commands: __DIR__.'/../routes/console.php',\n health: '/up',\n )\n -&gt;withMiddleware(function (Middleware $middleware) {\n $middleware-&gt;redirectUsersTo('/admin/cities'); // add this\n })\n -&gt;withExceptions(function (Exceptions $exceptions) {\n //\n })-&gt;create();\n</code></pre>\n<p>You can check from <a href="https://laravel.com/docs/12.x/authentication#redirecting-authenticated-users" rel="nofollow noreferrer">this page here</a>.</p>\n"^^ . + "Make sure that in the bash process which is executed by `git`, not only the `alias` definition is present, but also a `shopt expand_aliases` is done. Otherwise bash would ignore the alias. I don't know which file you have to place this settings into. Perhaps you have to create a separate file for this and do an `export BASH_ENV=/abs/path/to/this/file` before calling _git_. See the section called _INVOCATION_ in the bash man page."^^ . + "You may understand what I am talking about. I just want to open a password protected sqlite db using php. The sqlite db is protected by system.data.sqlite ADO encryption. Is it possible to open this database by php ?"^^ . + . + . + . + "<p>I’ve been dealing with this issue after upgrading from PHP 8.3 to 8.4 and Symfony 7.2. Sometimes, deprecation warnings appear on stdout, like:</p>\n<pre><code>Deprecated: BenjaminFavre\\OAuthHttpClient\\OAuthHttpClient::stream(): Implicitly marking parameter $timeout as nullable is deprecated, the explicit nullable type must be used instead in [...] on line 87.\n</code></pre>\n<p>I have already updated all deprecations in my code, but vendor-related deprecations keep appearing.</p>\n<p>The most frustrating part is that I can't consistently reproduce the issue. Restarting PHP-FPM or clearing the cache does not trigger the warnings, yet about 1 in every 20 requests, the deprecations appear at the beginning of my API responses.</p>\n<p>While I can't be certain and it may be my own bias, the deprecations seem more likely to appear after slow requests, such as those involving external I/O.</p>\n<p>My php.ini error reporting settings for PHP-FPM are as follows:</p>\n<pre><code>error_reporting = E_ALL &amp; ~E_DEPRECATED &amp; ~E_STRICT\n</code></pre>\n<p>Symfony’s phpinfo() output shows:</p>\n<pre><code>error_reporting = -1 (Local Value) \nerror_reporting = 22527 (Master Value, equivalent to E_ALL &amp; ~E_STRICT &amp; ~E_DEPRECATED)\n</code></pre>\n<p>As mentioned, the biggest issue is that these deprecations don’t appear on every request, making testing changes a hassle.</p>\n<p>Has anyone encountered a similar issue or found a way to suppress these intermittent warnings?</p>\n<p>Edit: As stated by @Adysos, the intermittent nature of the warnings is simply because the code is not always being called.</p>\n<p><strong>I do understand what those deprecations mean and how to fix them. Still, what I don't know is why those deprecations are appearing on STDOUT despite being explicitly excluded in the php.ini configuration.</strong></p>\n"^^ . + . + . + "Do you mean its a bit pointless to use it because I am closing $link at the same point anyway? Otherwise I got the impression it was best case to use this after a query to free the memory but it seemed this was only important on mysqli_query statements."^^ . + "Hmm, this sounds more like a specific question for virtuemart and joomla. I think it should be migrated to https://joomla.stackexchange.com/ . Perhaps you can clarify your question, for a programming question, we can't speak for you, and questions asking for "is there any way?" are not a good fit as normally the answer is: yes, with programming. Or: it depends. That's not good to collect in a Q&A site like Stackoverflow. Consider to add more focus what this is about."^^ . + . + "the data you are sending seems at odds with the content-type header you are sending"^^ . + . + "elasticsearch"^^ . + . + "You say you downgraded the PHP version but you did it on the same server? The server hasn't changed, just the PHP version?"^^ . + . + . + . + . + "where do you use this code?"^^ . + "1"^^ . + . + "<p>I have an array with all German telephone area codes that is 5266 items long and looks like this:</p>\n<pre><code>$area_codes = array(\n '015019',\n '015020',\n '01511',\n '01512',\n '01514',\n '01515',\n '01516',\n '01517',\n '015180',\n '015181',\n '015182',\n '015183',\n '015184',\n '015185',\n 'and so on'\n);\n</code></pre>\n<p>I also have strings of telephone numbers that look like this:</p>\n<pre><code>015169999999\n</code></pre>\n<p>That is, the telephone number strings consist only of digits, without spaces, dashes, parentheses or other characters that are often used to visually structure telephone numbers.</p>\n<p>I want to split the area code from the subscriber number and assign each to a separate variable. For the example number above, the expected result would be:</p>\n<pre><code>echo $area_code;\n01516\necho $subscriber_number;\n9999999\n</code></pre>\n<p>To identify the area code within the string, I am looping through the array of area codes:</p>\n<pre><code>foreach ($area_codes as $area_code) {\n if (str_starts_with($telephone_number, $area_code) == TRUE) {\n echo $area_code;\n $subscriber_number = str_replace($area_code, &quot;&quot;, $telephone_number);\n echo $subscriber_number;\n break;\n }\n}\n</code></pre>\n<p>How can I return the area code without looping?</p>\n<hr />\n<p>Solutions <a href="https://stackoverflow.com/a/2124549/25634160">like this</a> require that I know where to split the string, but the area codes have different lengths.</p>\n"^^ . + . + "2"^^ . + "1"^^ . + . + "1"^^ . + . + "@Aquaholic: Isn't that the intended functionality? What isn't working? You mention pseudo-code, but have you tried actually building and testing this?"^^ . + "Where is that code block coming from? I can see the first trailing comma, but I do not see the second trailing comma?"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "1"^^ . + "<p>Here is my XML code:</p>\n<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;file&gt;\n &lt;header&gt;\n &lt;information&gt;Example information&lt;/information&gt;\n &lt;agency&gt;1@test.uk&lt;/agency&gt;\n &lt;date&gt;2025-03-19 16:13:44&lt;/date&gt;\n &lt;version&gt;0.4&lt;/version&gt;\n &lt;path&gt;mail@mail.uk&lt;/path&gt;\n &lt;value&gt;full&lt;/value&gt;\n &lt;/header&gt;\n &lt;offers_list&gt;\n &lt;department tab=&quot;local&quot; type=&quot;sell&quot;&gt;\n &lt;offert&gt;\n &lt;param name=&quot;id&quot;&gt;445/443/TS&lt;/param&gt;\n &lt;location&gt;\n &lt;area level=&quot;1&quot;&gt;UK&lt;/area&gt;\n &lt;area level=&quot;2&quot;&gt;ON&lt;/area&gt;\n &lt;area level=&quot;3&quot;&gt;PIN&lt;/area&gt;\n &lt;area level=&quot;4&quot;&gt;As&lt;/area&gt;\n &lt;area level=&quot;5&quot;&gt;Ord&lt;/area&gt;\n &lt;/location&gt;\n &lt;price currency=&quot;USD&quot;&gt;1059000.00&lt;/price&gt;\n &lt;n_geo_y&gt;51.1894791&lt;/n_geo_y&gt;\n &lt;n_geo_x&gt;19.9072292&lt;/n_geo_x&gt;\n &lt;street&gt;Example&lt;/street&gt;\n &lt;/offert&gt;\n &lt;/department&gt;\n &lt;/offers_list&gt;\n&lt;/file&gt;\n</code></pre>\n<p>and I'm trying to convert this XML text to array in that way:</p>\n<pre><code> $xml_string = file_get_contents($path.'file_xml.xml');\n $xml = simplexml_load_string($xml_string, null, LIBXML_NOCDATA);\n $xml = json_decode(json_encode($xml), true);\n var_dump($xml);\n</code></pre>\n<p>Result:</p>\n<pre><code>array(2) {\n [&quot;header&quot;]=&gt;\n array(6) {\n [&quot;information&quot;]=&gt;\n string(19) &quot;Example information&quot;\n [&quot;agency&quot;]=&gt;\n string(9) &quot;1@test.uk&quot;\n [&quot;date&quot;]=&gt;\n string(19) &quot;2025-03-19 16:13:44&quot;\n [&quot;version&quot;]=&gt;\n string(3) &quot;0.4&quot;\n [&quot;path&quot;]=&gt;\n string(12) &quot;mail@mail.uk&quot;\n [&quot;value&quot;]=&gt;\n string(4) &quot;full&quot;\n }\n [&quot;offers_list&quot;]=&gt;\n array(1) {\n [&quot;department&quot;]=&gt;\n array(2) {\n [&quot;@attributes&quot;]=&gt;\n array(2) {\n [&quot;tab&quot;]=&gt;\n string(5) &quot;local&quot;\n [&quot;type&quot;]=&gt;\n string(4) &quot;sell&quot;\n }\n [&quot;offert&quot;]=&gt;\n array(6) {\n [&quot;param&quot;]=&gt;\n string(10) &quot;445/443/TS&quot;\n [&quot;location&quot;]=&gt;\n array(1) {\n [&quot;area&quot;]=&gt;\n array(5) {\n [0]=&gt;\n string(2) &quot;UK&quot;\n [1]=&gt;\n string(2) &quot;ON&quot;\n [2]=&gt;\n string(3) &quot;PIN&quot;\n [3]=&gt;\n string(2) &quot;As&quot;\n [4]=&gt;\n string(3) &quot;Ord&quot;\n }\n }\n [&quot;price&quot;]=&gt;\n string(10) &quot;1059000.00&quot;\n [&quot;n_geo_y&quot;]=&gt;\n string(10) &quot;51.1894791&quot;\n [&quot;n_geo_x&quot;]=&gt;\n string(10) &quot;19.9072292&quot;\n [&quot;street&quot;]=&gt;\n string(7) &quot;Example&quot;\n }\n }\n }\n}\n</code></pre>\n<p>Finally, I got array but not complete. For example, I can't find this part of XML code:</p>\n<blockquote>\n<p>&lt; param <strong>name=&quot;id&quot;</strong>&gt;445/443/TS</p>\n</blockquote>\n<p>As result, I can't find attributes <strong>name</strong> with value like <strong>id</strong>.</p>\n<p>Is it possible to convert full XML code to array in PHP?</p>\n"^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + "2"^^ . + "Does toArray() in Yii2 ActiveRecord always return only explicitly set attributes?"^^ . + . + "fpm"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + "admin"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + "-1"^^ . + . + "1"^^ . + . + "0"^^ . + "@hakre Edited, thank you"^^ . + "0"^^ . + "0"^^ . + "<p>I'm working on a WordPress theme using Sage 10, and I'm having trouble parsing the content created with the Classic Editor (without blocks) in the single.blade.php file.</p>\n<p>Here’s how I’m retrieving the post content:</p>\n<pre><code>$content = get_post_field('post_content', get_the_ID());\n</code></pre>\n<p>Then, I pass the $content to a parsing function:</p>\n<pre><code>function parse_classic_content($content) {\n$dom = new DOMDocument();\nlibxml_use_internal_errors(true);\n$dom-&gt;loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'));\nlibxml_clear_errors();\n\n$body = $dom-&gt;getElementsByTagName('body')-&gt;item(0);\n$children = iterator_to_array($body-&gt;childNodes);\n$newContent = '';\n$count = 0;\n\nforeach ($children as $child) {\n $newContent .= $dom-&gt;saveHTML($child);\n $count++;\n\n if ($count % 10 === 0) {\n $newContent .= '&lt;p&gt;separator every 10 items&lt;/p&gt;';\n }\n}\n\nreturn preg_replace('~&lt;\\?xml.*?~', '', $newContent);\n}\n</code></pre>\n<p>The issues I’m facing:</p>\n<ol>\n<li>Element Removal: Sometimes some elements are missing or not rendered as expected.</li>\n<li>Separator Logic: I don't understand why the separator element is not being rendered every 10 elements. When I inspect the DOM, I see it placed every 5, 6, or 7 elements instead.</li>\n</ol>\n<p>Am I making a mistake somewhere in my logic? Could there be an issue with how I'm cycling through the elements or modifying the DOM?</p>\n<p>Nice to have:\nI would like to check, inside the loop, if there are any anchor tag inside the paragraph elements. How can I do that?</p>\n<p>Any advice or insights would be appreciated. Thanks!</p>\n"^^ . + . + . + . + . + . + . + "https://curl.se/libcurl/c/CURLINFO_REFERER.html. It not working. maybe `CURLINFO_REFERER` is not supported in PHP?"^^ . + . + "I’m not sure what problem you’re having. Please open a discussion on PHPStan’s GitHub."^^ . + . + "Twilio Play music while dialing to a number"^^ . + "many-to-many"^^ . + . + . + . + . + "0"^^ . + "<p>I'm having a small problem in my laravel project. I integrated elfinder to manage files, images (I use pakapge barrydh) but on localhost it works but when I deploy to laravel cloud it shows an error Invalid backend response.\nError occurred on the server side.\nHTTP error 500 then. Please give me a solution to fix it. Thanks</p>\n<p><img src="https://i.sstatic.net/mLfedyiD.png" alt="enter image description here" /></p>\n<p>[1]:</p>\n"^^ . + . + "0"^^ . + . + "How to get data values from collection using group by on laravel"^^ . + "0"^^ . + . + "1"^^ . + . + . + . + "discount"^^ . + . + . + . + "I think it's the wrong approach to try querying the API every minute in a chained manner. Instead, run a PHP script with a 1-minute interval that always performs the next API request. The processing shouldn't take too long, and then the script can definitely be optimized. I think it's bad practice to increase the timeout duration and allow a single operation to run for as long as possible."^^ . + . + . + "0"^^ . + "0"^^ . + . + . + "File upload php 8.2.27 doesn't load files over 1MB"^^ . + . + . + "0"^^ . + . + . + . + . + "I think you can indeed use the `count()`, isn't it? Then do `return ['total' => $query->count(), 'results' => $query->execute()];`"^^ . + "Can you show the frontend code that shows where you expect this hook to be called for you? For instance, are you using `the_content()` or something else?"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + "so yes, connections from web-server to 10.211.55.2 are clearly firewalled"^^ . + . + . + . + "Then as Chris mentioned you'll need to open a port / tunnel on your router to allow the inbound connection and route it to your server. If your server is on a VM as well, there may be additional networking config there to allow it to be seen by the rest of the network outside its host machine. And bear in mind that opening ports up etc represents a security risk to your home network, and could even be against your ISP's terms of service. Most ppl get a free / cheap hosting service online to serve as the live environment, and keep the local one for development and testing purposes."^^ . + . + . + . + . + . + "0"^^ . + "<p>Converting the table in your question:</p>\n<pre><code>Person P1 P2 P3\nJohn 3/6 2/6 1/6\nPeter 2/6 2/6 2/6\nPaul 1/6 2/6 3/6\n</code></pre>\n<p>to SQL:</p>\n<pre><code>select \n value, \n Probability,\n @r:=rand(),\n case when @r &lt; Probability/6 then 1 \n when @r &lt; (Probability/6 + 2/6) then 2 \n else 3 end as P\nfrom mytable\norder by P;\n</code></pre>\n<p>Or, doing this server times, and calculating the times a certain position is achieved</p>\n<pre><code>with recursive \nnrs as (\n select 1 as x\n union all\n select x+1 from nrs where x&lt;1000\n)\nselect \n value, \n Probability, \n count(CASE WHEN P=1 THEN 1 END) as P1,\n count(CASE WHEN P=2 THEN 1 END) as P2,\n count(CASE WHEN P=3 THEN 1 END) as P3\nfrom (\n select \n value, \n Probability,\n @r:=rand(),\n case when @r &lt; Probability/6 then 1 \n when @r &lt; (Probability/6 + 2/6) then 2 \n else 3 end as P\n from mytable,nrs\n) y \ngroup by value,Probability\norder by Probability desc;\n</code></pre>\n<p>see: <a href="https://dbfiddle.uk/sxUgSHZt" rel="nofollow noreferrer">DBFIDDLE</a> (not the previous posted: <a href="https://dbfiddle.uk/0t10GD9S" rel="nofollow noreferrer">https://dbfiddle.uk/0t10GD9S</a>)</p>\n"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + "What is the file size, and what did you set the PHP configuration values to? Did you call `phpinfo` from within the same context to verify these changes actually took effect?"^^ . + . + . + . + . + "Log in using your phone number and email address in Breeze laravel 11"^^ . + "0"^^ . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + "<p>I am using Fancybox for photo gallery. and using following code to update photo views on click with php mysql and ajax.</p>\n<p>I want to update views for images when previous or next button in opened fancybox is clicked.</p>\n<p><strong>Current code :</strong></p>\n<p><strong><code>Javascript :</code></strong></p>\n<pre><code>&lt;script&gt;\n$('document').ready(function(){\n $('.updatecount').click(function(){\n var unique_id = $(this).parent().data('id');\n $.ajax({ \n url: 'photo-gallery-count-update.php',\n data: {&quot;uniqueid&quot;: unique_id},\n method: 'post'\n });\n });\n});\n&lt;/script&gt;\n</code></pre>\n<p><strong><code>HTML Part :</code></strong></p>\n<pre><code>&lt;div class=&quot;card &quot; data-id=&quot;&lt;?php echo $pdata['unique_id'];?&gt;&quot;&gt;\n &lt;div class=&quot;card-image updatecount&quot;&gt;\n &lt;a href=&quot;&lt;?php echo $img_url;?&gt;&quot; data-fancybox=&quot;gallery&quot; data-caption=&quot;&lt;?php echo $caption_final;?&gt;&quot;&gt;\n &lt;img src=&quot;&lt;?php echo $img_url;?&gt;&quot; alt=&quot;Image Gallery&quot;&gt;\n &lt;/a&gt;\n &lt;/div&gt;\n &lt;div class=&quot;c1&quot;&gt;&lt;?php echo $subtitle_final;?&gt;&lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n<p><strong><code>photo-gallery-count-update.php :</code></strong></p>\n<pre><code>&lt;?php\ninclude(&quot;db.php&quot;);\n\nif(isset($_POST['uniqueid'])){\n $unique_id = $database-&gt;filter($_POST['uniqueid']);\n\n $query= &quot;select * from $photo_gallery_table where unique_id='$unique_id'&quot;;\n $numrow = $database-&gt;num_rows($query);\n\n if ($numrow != 0){\n $result = $database-&gt;get_results($query);\n\n foreach ($result as $data){\n $viewed = $data['viewed'];\n $viewed_new = $viewed + 1;\n $viewed_on = date(&quot;Y-m-d H:i:s&quot;);\n $unique_id_db = $data['unique_id'];\n \n $insertdata = array ( \n 'viewed' =&gt; $viewed_new,\n 'viewed_on' =&gt; $viewed_on, \n );\n $where = array (\n 'unique_id' =&gt; $unique_id_db\n );\n $database-&gt;update($photo_gallery_table, $insertdata, $where);\n }\n }\n }\n?&gt;\n</code></pre>\n<p>This code is working when Photo is clicked directly.</p>\n<p>When photo is clicked, fancybox get opened showing photo.</p>\n<p><strong>I want to update views for next or previous photos when clicked on Next / Previous button in opened fancybox.</strong></p>\n<p>I tried adding class names <code>.fancybox-slide--next</code>, <code>.fancybox-slide--previous</code> in javascript click event, but it didn't work.</p>\n"^^ . + "Also you say "not sending HTML emails"...please clarify...that does that mean it still sends the emails but you only see the plain-text version in your mail client? Is _that_ what you mean? Your description is ambiguous. If so, please specify what mail clients you've tested this in (testing only in one isn't a sufficient test for this kind of thing - you need to rule out the mail client as the cause of the problem)? Again you should first upgrade to a supported PHPMailer version as well to ensure it's generating emails in line with modern standards and security etc. Try that first."^^ . + . + . + . + . + . + . + "That is a good idea. For me the thing to do is test if the selected endddate is in fact the last day of the month, If it is use last day of month in the previous years if not simply use it as the last day in the range `("$y-m-t")`"^^ . + "2"^^ . + "0"^^ . + "2"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + "`<` has a higher precedence than `??`, so `$var['x']??0 < 1` is equivalent to `$var['x']??(0 < 1)`"^^ . + "<p>(note: this is a formatted comment, not an answer)</p>\n<p>From the code you pasted, your bash script does not have <code>set -e</code>. So a failing action (like, say, <code>npm install</code> and <code>npm run build</code> failing immediately because <em>reasons</em> ?) will not interrupt it, it will proceed with <code>rsync ...</code>, and the final exit code of your script will be the exit code of that last command.</p>\n<p>If your script exits with a 0 exit code, this merely means that <code>rsync</code> was successful -- not that no error happened.</p>\n<p>So:</p>\n<ul>\n<li>one suggestion is: turn on <code>set -e</code> (note: you may need to handle cases where your initial git commands fail ?)</li>\n<li>one question is: have you inspected your script's stderr ? my blind guess is npm is printing on stderr what went wrong</li>\n</ul>\n"^^ . + . + "Alrighty, thanks for help!"^^ . + "Why do you need to send any information in the body for retrieving a user profile? Shouldn't that profile be completely independent from any request data (besides the URL where the user identifier is submitted)? Also, please add all clarification **to your question** by editing it, not to the comment section"^^ . + "2"^^ . + . + . + . + . + "0"^^ . + "check your guards to ensure you are allowing all expected fields"^^ . + . + . + . + "1"^^ . + . + . + "laravel-middleware"^^ . + . + . + . + . + "0"^^ . + "`$e['Continent']` should be a numeric array, not an associative array. Its elements are associative arrays. So `$e['Continent'] = array(\n "ContinentID" => $row['ContinentID'],\n "Continent" => $row['Continent'],\n );` is wrong."^^ . + "1"^^ . + . + . + "0"^^ . + "0"^^ . + "<p>Wanting to split the string is an XY Problem in the first place. You don't need a temporary array. Just inject the spaces where they are needed -- only at the zero-width position between two 2-digit substrings. Match 2 digits, forget that match (holding a zero-width position in the string), lookahead for 2 more digits. <a href="https://3v4l.org/jBP2H" rel="nofollow noreferrer">Demo</a></p>\n<pre class="lang-php prettyprint-override"><code>echo preg_replace(\n '/\\d{2}\\K(?=\\d{2})/',\n ' ',\n $string\n );\n</code></pre>\n<p><code>/(\\d{2})\\K(?=(?1))/</code> and<br>\n<code>/\\d\\d\\K(?=\\d\\d)/</code> also work the same.</p>\n<p>You can even skip-fail the last 2-3 digits in the string then inject the spaces after all other pairs of digits. <a href="https://3v4l.org/BVRKW" rel="nofollow noreferrer">Demo</a></p>\n<pre><code>echo preg_replace(\n '/\\d{2,3}$(*SKIP)(*FAIL)|\\d{2}\\K/',\n ' ',\n $tests\n );\n</code></pre>\n<p>If you don't like <code>\\K</code> in the pattern, a backreference in the replacement will be necessary.</p>\n<pre class="lang-php prettyprint-override"><code>echo preg_replace('/\\d\\d(?=\\d\\d)/', '$0 ', $string);`\n</code></pre>\n"^^ . + "1"^^ . + . + . + . + . + "probably you've enabled cookie based authentication beside token based authentication"^^ . + "@ADyson: Thanks for the advice but I have echoed error message in this script to see if any DB error is causing the error."^^ . + . + . + "<p>Instead of echoing the response, replace it with the line below</p>\n<pre><code>$data = json_decode($response-&gt;getBody(), true);\n\n/*\n$data will be a php associative array with the data\n {&quot;data&quot;:{&quot;name&quot;:{&quot;__typename&quot;:&quot;Name&quot;,&quot;id&quot;:&quot;nm0000573&quot;,&quot;nameText&quot;:{&quot;text&quot;:&quot;Dolly Parton&quot;}\n*/\n\n$actorName = $data['data']['name']['nameText']['text'];\n\necho $actorName;\n</code></pre>\n<p>Also, I noticed that there is no image field in the sample response you specified</p>\n"^^ . + "Why is my frontend not receiving the event from the backend?"^^ . + . + . + "1"^^ . + "html-table"^^ . + "0"^^ . + "1"^^ . + "2"^^ . + . + "<p>I got an error on Laravel. It is about an Unknown Database though I haven't created a database. Another is I got a lot of deprecated warnings when opening phpmyadmin. I also notice that I got a lot of files from my laravel installation. I'm running php 8.4.5 on Windows.</p>\n<p>This is the error that is showing when I run my project\nIlluminate\\Database\\QueryException\nSQLSTATE[HY000] [1049] Unknown database 'projectName' (Connection: mysql, SQL: select * from <code>sessions</code> where <code>id</code> = EfdTf3aMrh4YQjWQKEGm7W9kFZIuYqqyvnVWAEzo limit 1)</p>\n"^^ . + "1"^^ . + "1"^^ . + . + "2"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + "livewire.js and flux.js is not found in Laravel 12 register page"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + "I also tried to desactivate the firewall, without success"^^ . + . + . + . + . + "Is that an error thrown by PHP or SQL? Please check that, and remove the unrelated tags"^^ . + . + . + . + . + . + "command"^^ . + "1"^^ . + "What makes you suspect it's related to PHP 8?"^^ . + "Please always post what you've tried, even if it doesn't work. In this situation, make sure you have warnings and errors enabled to see all potential messages, and also post the results of `$vehicle_id` as well as the SQL you have tried creating."^^ . + "Wow thanks so much, I am able to go to sleep now and wanted to peek and see if anyone else replied and what you have provided looks like it would be perfect. I will try it once I wake up."^^ . + . + "_This is not working_\n\nAny error? I would suggest using `$request->validate([ ... ])` https://laravel.com/docs/12.x/validation#quick-writing-the-validation-logic"^^ . + . + "0"^^ . + . + "<p>I did a quick change to the previous code because</p>\n<pre><code>sprintf('&lt;strong&gt;%s&lt;/strong&gt; %s %s', __('Width'), $value, $unit_label);\n</code></pre>\n<p>return text width: X and measurement unit (inces)</p>\n<p>In this way we get 3 shortcode with only the value and it is more flexible.</p>\n<pre><code>/*\n * Shortcode for product dimentions [product_height id=&quot;your ids here&quot;]\n *******************************************************/\nuse Automattic\\WooCommerce\\Utilities\\I18nUtil;\n\n// For Product Height:\nfunction display_product_formatted_height( $atts ) {\n // Extract shortcode attributes\n extract( shortcode_atts( array(\n 'id' =&gt; get_the_ID(),\n ), $atts, 'product_height' ) );\n\n $product = wc_get_product( $id );\n\n if( ! $product ) {\n return;\n } elseif ( $value = $product-&gt;get_height() ) {\n $unit_label = I18nUtil::get_dimensions_unit_label( get_option( 'woocommerce_dimension_unit' ) );\n return sprintf($value, $unit_label);\n }\n}\nadd_shortcode( 'product_height', 'display_product_formatted_height' );\n\n// For Product Width:\nfunction display_product_formatted_width( $atts ) {\n // Extract shortcode attributes\n extract( shortcode_atts( array(\n 'id' =&gt; get_the_ID(),\n ), $atts, 'product_width' ) );\n\n $product = wc_get_product( $id );\n\n if( ! $product ) {\n return;\n } elseif ( $value = $product-&gt;get_width() ) {\n $unit_label = I18nUtil::get_dimensions_unit_label( get_option( 'woocommerce_dimension_unit' ) );\n return sprintf($value, $unit_label);\n }\n}\nadd_shortcode( 'product_width', 'display_product_formatted_width' );\n\n// For Product Length:\nfunction display_product_formatted_length( $atts ) {\n // Extract shortcode attributes\n extract( shortcode_atts( array(\n 'id' =&gt; get_the_ID(),\n ), $atts, 'product_length' ) );\n\n $product = wc_get_product( $id );\n\n if( ! $product ) {\n return;\n } elseif ( $value = $product-&gt;get_length() ) {\n $unit_label = I18nUtil::get_dimensions_unit_label( get_option( 'woocommerce_dimension_unit' ) );\n return sprintf($value, $unit_label);\n }\n}\nadd_shortcode( 'product_length', 'display_product_formatted_length' );\n</code></pre>\n"^^ . + . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + "What you're doing wrong is authenticating with OAuth 2.0 Application-Only to an endpoint which doesn't permit that - exactly as the error message says. The documentation shows which endpoints are accessible by which authentication methods"^^ . + . + . + . + "codeigniter-4"^^ . + ""the size of 50x vendor directories will be even bigger than it is now" - how is that the case if you solely split up an existing package into 50 smaller ones?"^^ . + . + "2"^^ . + . + . + "1"^^ . + . + . + "php-di"^^ . + . + . + "0"^^ . + . + "Why my query takes ~74 second to be executed?"^^ . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + "1"^^ . + . + "1"^^ . + "0"^^ . + . + . + "0"^^ . + "2"^^ . + . + . + . + . + "-1"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + "<p>I am currently having trouble serving my code in different ways since all have different results. Currently this code works in Apache (installed via XAMPP), but when I run <code>php artisan serve</code> it shows 404 Not Found, and in vite it shows page not found.\nNote: Yes, I created the register page.</p>\n<p>in views/home.blade.php</p>\n<pre><code>&lt;body&gt;\n &lt;h1&gt;register&lt;/h1&gt;\n\n &lt;form action=&quot;/vite_experiment/public/register&quot; method=&quot;POST&quot;&gt;\n @csrf\n &lt;input type=&quot;text&quot; placeholder=&quot;user&quot;&gt;\n &lt;input type=&quot;text&quot; placeholder=&quot;email&quot;&gt;\n &lt;input type=&quot;password&quot; placeholder=&quot;password&quot;&gt;\n &lt;button&gt;register&lt;/button&gt;\n &lt;/form&gt;\n&lt;/body&gt;\n</code></pre>\n<p>in controller:</p>\n<pre><code> public function register(Request $request) {\n // Handle the registration logic\n return &quot;Thank you&quot;;\n }\n</code></pre>\n<p>in routes/web.php</p>\n<pre><code>Route::post('/register', [UserController::class, 'register']);\n</code></pre>\n<p>Thank you in advance!</p>\n"^^ . + "0"^^ . + . + "*"[...] much nicer/cleaner way "* - Not to my knowledge, unfortunately, plus that's a subjective statement; nicer and cleaner probably means something completely different to me and you (or possibly not, who knows)."^^ . + . + "unique"^^ . + "1"^^ . + . + . + . + . + "0"^^ . + . + "0"^^ . + "So if we make a workable demo of the PHP side here: https://phpize.online/sql/mysql80/56b9317d52a25e57e7af15d54ba65b06/php/php84/85c3c791d6f7994e9982c120085a81f1/ (run the SQL side, and then the PHP side, to see it operational) you see the expected behaviour where the UPDATE sent by PHP returns 0 affected rows because the password in the table already has the same value it's trying to change it to"^^ . + . + "The way you've shown it here, that `toastr.error` JavaScript command will _always_ execute, regardless of whether there's anything in the PHP flashdata or not. Even if you unset the session variable I expect it still shows you a toastr dialog, even if it's empty sometimes?"^^ . + "Model Observer issue in nested transaction update of model"^^ . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "JS can store data in several ways in the browser. You can use `sessionStorage` to save things that will be deleted when you close the window. You can use `localStorage` to save things for a longer time. It is also possible to [set a Cookie in JavaScript](https://www.w3schools.com/js/js_cookies.asp), which will be transfered to the server during the next requests (ex: loading new pages or doing AJAX requests). The PHP can then read this sent cookie data while it is generating the response. **Tell us what you are trying to do**, because it might not be the best way of solving your problem."^^ . + . + . + . + "1"^^ . + . + "1"^^ . + . + . + "0"^^ . + "1"^^ . + "0"^^ . + . + . + "2"^^ . + "0"^^ . + . + "smtp"^^ . + "0"^^ . + . + . + . + . + "3"^^ . + "0"^^ . + . + "0"^^ . + "Load Divi global header and footer on external php page"^^ . + . + "You can use the [`LIBXML_HTML_NOIMPLIED`](https://www.php.net/manual/en/libxml.constants.php#constant.libxml-html-noimplied) option."^^ . + "<p>I'm using exec() for years on my PHP app (v8.3.14) on Apache 2.4, and used to add &quot;2&gt;&amp;1&quot; on the command lines to get the output and errors and display or log it.</p>\n<p>But recently (few days) it starts failing on my PC and I found that it is the 2&gt;&amp;1 part that makes it fail. If I add it, the return code goes from 0 (ok) to 1 (error) and I can't get the error message.</p>\n<pre><code>// simple example:\nexec('ver',$out,$code); // -&gt; code 0 and out [&quot;Microsoft Windows [version 10.0.26100.3194]&quot;]\nexec('ver 2&gt;&amp;1',$out,$code); // -&gt; code 1 and empty message\n</code></pre>\n<p>The command works on cmd prompt with and without 2&gt;&amp;1 so it seems to be a PHP problem. It's like '2&gt;&amp;1' is becoming part of the arguments passed to the executable (which fails because it cannot handle it) instead of an option for the system to handle the response.</p>\n<p>I didn't make changes on my PHP/Apache installation the last days. There was probably a minor Windows update, as often. Is anyone experimenting the same problem and have a solution?</p>\n"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + "`checked if the autoload.php in the vendor is properly installed`...ok, but the system can't lie to you: it simply didn't find that file in that location in your environment. `C:\\Users\\Lenovo\\Intello-Weboldal\\intello-web\\includes\\api/vendor/autoload.php` isn't there, it would seem. Is that the path you were expecting it to try and find the autoload file in?"^^ . + . + "`The bit about maintaining your own InMemoryAccessTokenCache confuses me. Is that required`...are you talking about the guidance here: https://github.com/microsoftgraph/msgraph-sdk-php/blob/main/docs/Examples.md#access-token-management ? I can't see anything that suggests you have to implement your own cache, no, it comes with a default one. What gave you the impression you might have to do that? It's an option certainly, but only an option."^^ . + "1"^^ . + "0"^^ . + "-2"^^ . + . + . + . + "1"^^ . + "<p>Dear Developers all around the world, I'm trying to write a program that can perform some calculations. This is going to be a part of an in house ERP.</p>\n<p>I have one number (Total Invoice Amount) , I need the breakdown for this number.</p>\n<p>For example</p>\n<p>Total Invoice Amount = X amount + 25 percent of x + 5 percent of (25 percent of x)</p>\n<p>We know the total invoice amount, it is coming to us from external sources, so, for example, let it be 5600</p>\n<p>x + 0.25x + 0.05(0.25x) = 5600</p>\n<hr />\n<p>Mathematically we can do :</p>\n<p>x + 0.25x + 0.0125 x = 5600</p>\n<p>1.2625x = 5600</p>\n<p>x = 4435.64</p>\n<p>But I don't know how to use symbolic algebra in php. Could anyone suggest some solution ?</p>\n"^^ . + "0"^^ . + . + . + . + . + "createquery"^^ . + . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + "open-telemetry"^^ . + . + . + "<p>I'm a bit confused on how I should deploy my Node.JS chat on my domain.</p>\n<p>I currently got a website with php files which im using with mySQL, it works fine.\nNow I want to implement a chatapp i built with node.js to my website.</p>\n<p>Here is where I get confused, the chatapp is just complement to my website do I have to run nodejs on my domain? Or should I run it from somewhere else? I tried a subdomain but I was unable to run it from there. However it worked when I run node.js directly on my domain. But I got issues with my php files and nothing from my queries where returning anymore. If this is the way to go what is the correct what to <code>app.get</code> a php file?</p>\n<p>I hope its understandable, redirects that helps me are much appreciated.</p>\n"^^ . + . + . + "@ArkadiuszDrabczyk thanks again. Do I use setenv, or add it to the configure command? Sorry for my total ignorance in this!"^^ . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + "1"^^ . + "2"^^ . + "Akeneo Docker - Issues with running PHP Deamon for import and export"^^ . + . + "This is what your code generates. Cart totals Subtotal $200.00 Custom Tax $1,990.00 Total $2,190.00. The margin is $100 and the tax rate is %10 so the tax should be $10"^^ . + "0"^^ . + . + . + "content-management-system"^^ . + . + "preg-match-all"^^ . + "0"^^ . + "PHP Dealing with Latin to UTF8"^^ . + . + . + . + "2"^^ . + . + "1"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + "As you haven't shared any details about your setup, it's impossible to tell you why this error occurs"^^ . + . + . + . + . + . + "1"^^ . + . + . + "<p>Running Wordpress behind nginx proxy, my configuration is:</p>\n<pre><code>map $http_x_forwarded_for $block_access{\n default 1;\n XXX.XXX.XXX.XXX 0; # allowed ip\n include /etc/nginx/conf.d/IPv4.conf.tmp; # uptimerobot\n}\n\nupstream wordpress {\n server ip-XXX-XX-XX-XXX.us-west-2.compute.internal:80;\n}\n\nserver {\n listen 80;\n listen [::]:80;\n server_name nerodata.com;\n\n include /etc/nginx/conf.d/CloudflareIPv4.conf.tmp; # cloudflare\n deny all;\n\n root /usr/share/nginx/my_website;\n index index.php;\n\n fastcgi_buffers 16 16k;\n fastcgi_buffer_size 32k;\n\n\n location ~ ^/(wp-admin|wp-login\\.php) {\n\n if ($block_access) {\n return 403;\n }\n\n try_files $uri =404;\n fastcgi_pass unix:/run/php-fpm/www.sock;\n fastcgi_index index.php;\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n include fastcgi_params;\n\n }\n\n location = /favicon.ico {\n log_not_found off;\n access_log off;\n }\n\n location = /robots.txt {\n allow all;\n log_not_found off;\n access_log off;\n }\n\n location / {\n try_files $uri $uri/ /index.php?q=$uri&amp;$args;\n }\n\n location ~ \\.php$ {\n\n try_files $uri =404;\n fastcgi_pass unix:/run/php-fpm/www.sock;\n fastcgi_index index.php;\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n include fastcgi_params;\n }\n\n location ~* \\.(js|css|png|jpg|jpeg|gif|ico|svg)$ {\n expires max;\n log_not_found off;\n }\n\n}\n</code></pre>\n<p>This works perfectly fine to return 403 when needed, however, when the IP is allowed, I get 404 from nginx.What am I missing?</p>\n"^^ . + "saml"^^ . + "<p>Does Sanctum (or Laravel) cookie-based session require me to have Laravel deployed to the root folder?</p>\n<h2>Background</h2>\n<p>My application lives in a monorepo with <code>server</code>, <code>client</code> and some other folders, with <code>server</code> folder containing Laravel 11 (used as backend API) and <code>client</code> folder containing Vue 3 SPA. The setup works okay when deployed to a docker container, but deploying it to a shared hosting results in the following strange issue:</p>\n<p>Issuing login/logout commands works correctly in that I get the expected response body, but somehow subsequent calls to the server do not recognize the request as authenticated. For example, doing <code>Auth::check()</code> in the subsequent request returns <code>false</code>. My feeling is that this has got something to do with the cookies not be set correctly.</p>\n<p>I have spent time to make sure I'm not doing any of the usual mistakes:</p>\n<ul>\n<li><p><code>SESSION_DOMAIN</code>, <code>SANCTUM_STATEFUL_DOMAINS</code> are set correctly on the server.</p>\n</li>\n<li><p>Since Laravel is in the <code>public_html/server</code> subfolder, I have the following <code>.htaccess</code> in the root:</p>\n<pre><code>RewriteEngine On\n\nSetEnvIf Authorization &quot;(.*)&quot; HTTP_AUTHORIZATION=$1\n\nRewriteCond %{REQUEST_URI} ^/api/ [OR]\nRewriteCond %{REQUEST_URI} ^/storage/\nRewriteRule ^ server/public/$1 [L]\n\nRewriteCond %{DOCUMENT_ROOT}/server/public%{REQUEST_URI} -f\nRewriteRule ^(.*)$ server/public/$1 [L]\n\nRewriteRule ^ server/public/index.php [L]\n</code></pre>\n</li>\n<li><p>and the usual Laravel <code>.htaccess</code> file in <code>server/public</code>:</p>\n<pre><code>&lt;IfModule mod_rewrite.c&gt;\n &lt;IfModule mod_negotiation.c&gt;\n Options -MultiViews -Indexes\n &lt;/IfModule&gt;\n\n RewriteEngine On\n\n SetEnvIf Authorization &quot;(.*)&quot; HTTP_AUTHORIZATION=$1\n\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteCond %{REQUEST_URI} (.+)/$\n RewriteRule ^ %1 [L,R=301]\n\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteRule ^ index.php [L]\n&lt;/IfModule&gt;\n</code></pre>\n</li>\n</ul>\n<p>Could it be that one of these <code>.htaccess</code> files is interfering with how Sanctum issues/recognizes its cookies?</p>\n"^^ . + . + . + . + "1"^^ . + . + "0"^^ . + . + . + "laravel-formrequest"^^ . + . + "0"^^ . + . + . + . + . + "It's worth being precise with your terminology, to understand the actual impact of things: you say "when I load the entire package I get 50x more than I need", but what I suspect you mean is "when I _install_ the entire package I _have to download_ 50x more than I need". That distinction is quite important: as long as you are using [autoloading](https://www.php.net/autoload) sensibly, the unused code isn't actually _loaded_ when the code executes, the only impact is _the number of files downloaded when you install it_."^^ . + "-3"^^ . + "-1"^^ . + . + . + . + . + "WOW! preg_match('/^\\s*location:\\s*(.*)/im', $p, $match)) worked great! I added microtime() to completely stripped down versions of the query script (one with my explodes() and the other with preg_match() and tested each five times.\nNested explodes() version:\n2.2705860137939\n2.2768650054932\n0.53050899505615\n0.9162609577179\n0.95514106750488\n\nPregmatch version:\n0.58952713012695\n0.59466981887817\n0.51377582550049\n0.49790787696838\n0.52830195426941"^^ . + . + . + "htaccess remove trailing slash on root directory redirecting too many times"^^ . + "1"^^ . + "2"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + "I thought it was the script because my previous script doesn't do this when I revert it back to the previous version.. This behaviour started when I moved to PHPMailer"^^ . + . + . + "2"^^ . + "_"But can I simplify it more like the sku url."_ - no, I don't think you can. https://developer.adobe.com/commerce/webapi/rest/quick-reference/ shows that they provide an explicit API endpoint path `/products/{sku}`, but there is no equivalent for other properties, like the `url_key`. So you will have to use `searchCriteria[filterGroups]` for stuff like this."^^ . + . + "1"^^ . + . + . + . + "-3"^^ . + "1"^^ . + . + "composer dev is starting my other Laravel project"^^ . + . + . + . + . + "HTTP requests in PHP/Laravel are stateless, and objects do not persist across routes automatically. Therefore, you need to use a session as suggested by @TimLewis , or you could employ less secure methods, which are not recommended."^^ . + . + . + . + . + . + . + . + . + "i have debugged and checked everything but it seems invalid still not working with server"^^ . + . + "@hakre I figured that might be what's going on, and I'm perfectly happy with leaving it at "one text for everyone" if that's all there is to it. However, if there is a way to make this particular situation cater to both the aforementioned audiences via two strings in a way that only one is readable by the screen-reader and, yet, is still focusable AND has text that won't be read by a screen-reader, that'd be amazing.\n\nIt's quite unfortunate the the value attribute itself can't except HTML tags, because then I'd make it so that only the text itself is hidden by aria."^^ . + "0"^^ . + . + . + . + . + "1"^^ . + "Then something that just annoys me. You call the password hash in your PHP code `$storedHash`. That's a reasonable name: It's a hash, and it came from the database. I would have preferred `$passwordHash`, which is a more accurate description of the value. But in your database you call it `password`. It's **not** a password, and that name looks nothing like `$storedHash`. What is it? A password or a hash? See, if you call them both `passwordHash`, in your database and your PHP code, you can instantly see what's what. Choosing names is hard, I know."^^ . + . + "How can I access Microsoft-graph-api with access token in PHP?"^^ . + . + . + . + "Are you saying you are getting an image from the front camera but the resolution is poor? What device are you testing on?"^^ . + . + "_"The result is undefined"_ - can't confirm / reproduce. It logs `fff` to the console for me, in Chrome. (_Below_ that line it shows `undefined` of course, because console.log doesn't have a return value.)"^^ . + . + . + . + . + "For anyone else wondering, we found that by creating a python script we were able to connect but not the PHP equivalent. Not an answer so not marking it as such but it was the solution we used."^^ . + "5"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + "Voting is also strongly influenced by when an answer was posted. The first answers consistently receive more upvotes, since voters rarely return to a Q&A that they have already visited. — I have upvoted all answers because I am grateful for the time and effort you all invested in helping me."^^ . + . + . + . + . + "@ChrisHaas check https://curl.se/libcurl/c/CURLOPT_AUTOREFERER.html (or just skim my answer)"^^ . + . + "2"^^ . + . + "2"^^ . + "0"^^ . + . + . + "0"^^ . + "I don't see how we can debug this. Can you deploy it to a public server, or is it just on your local server?"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "<p>Just add the following code to your <code>form()</code> action after the <code>-&gt;placeholder</code> to set the field's value to the path of the main image if it exists:</p>\n<pre><code>-&gt;afterStateHydrated(function (Forms\\Get $set, $record) {\n if ($record &amp;&amp; $record-&gt;mainImage()) {\n $main_image = $record-&gt;mainImage();\n $set('image', $main_image-&gt;path);\n }\n })\n</code></pre>\n"^^ . + . + "0"^^ . + . + . + . + "Curly braces syntax for addressing a class constant with a variable"^^ . + . + "widget"^^ . + . + . + "0"^^ . + "WPgraphQL Is it possible to duplicate results programmaticaly based on acf repeater"^^ . + . + . + "0"^^ . + "Have you checked Paypal's documentation to determine what is expected in the request?"^^ . + "1"^^ . + "0"^^ . + "This is the same for (dynamic) instance properties. There are two namespaces, the one for properties need to be preferred. The variable can be called IIRC since 5.3 closure and the wrapping in parenthesis works since 5.6?. `$myClass->myCallable = \\Foo::class . '::bar';\n $myClass->myCallable();` (same crash, despite the property can be dynamically declared (extends stdClass here))"^^ . + "<p>I need help refactoring this function so that it can effectively handle nested IF formulas.<br />\nThe function doesn't handle nested IFs well once it goes deeper than one level.</p>\n<pre><code>public function transformIfStatements(string $formulaText): string\n {\n $formulaText = preg_replace_callback(\n '/IF\\(\\s*([^,]+)\\s*,\\s*(IF\\([^)]+\\)|[^,]+)\\s*,\\s*(IF\\([^)]+\\)|[^)]+)\\s*\\)/',\n function ($matches) {\n return '(' . trim($matches[1]) . ') ? (' . trim($matches[2]) . ') : (' . trim($matches[3]) . ')';\n },\n $formulaText\n );\n \n return $formulaText;\n }\n</code></pre>\n<p>Take a look at case 3 below:</p>\n<p><em><strong>Case 1:</strong></em></p>\n<p><strong>Input</strong>: <code>&quot;IF(1&gt;10, &quot;Large&quot;, &quot;Medium&quot;)&quot;</code></p>\n<p><strong>Output</strong>: <code>&quot;(1&gt;10) ? (&quot;Large&quot;) : (&quot;Medium&quot;)&quot;</code> // <em><strong>Valid</strong></em></p>\n<p><em><strong>Case 2:</strong></em></p>\n<p><strong>Input</strong>: <code>&quot;IF(1&gt;10, IF(44&gt;20, &quot;Large&quot;, &quot;Medium&quot;), &quot;Small&quot;)&quot;</code></p>\n<p><strong>Output</strong>: <code>&quot;(1&gt;10) ? ((44&gt;20) ? (&quot;Large&quot;) : (&quot;Medium&quot;)) : (&quot;Small&quot;)&quot;</code> // <em><strong>Valid</strong></em></p>\n<p><em><strong>Case 3:</strong></em></p>\n<p><strong>Input</strong>: <code>&quot;IF(1&gt;10, IF(44&gt;20, &quot;Large&quot;, IF(4&lt;5, &quot;Tiny&quot;, &quot;Medium&quot;)), &quot;Small&quot;)&quot;</code></p>\n<p><strong>Output</strong>: <code>&quot;(1&gt;10) ? ((44&gt;20) : (&quot;Large&quot;) ? ((4&lt;5) : (&quot;Tiny&quot;) ? (&quot;Medium&quot;))) : (&quot;Small&quot;)&quot;</code> // <em><strong>Invalid</strong></em></p>\n<p><em><strong>NB</strong>:<br />\n<code>&quot;IF(A1&gt;10, IF(A1&gt;20, &quot;Large&quot;, IF(A1&lt;5, &quot;Tiny&quot;, &quot;Medium&quot;)), &quot;Small&quot;)&quot; would be a more realistic input. The inputs in above test cases were used for the sake of simplicity.</code></em></p>\n<p>Thanks in advance!</p>\n"^^ . + . + . + . + "0"^^ . + . + . + . + "Laravel Files upload"^^ . + . + . + "0"^^ . + . + . + "4"^^ . + . + . + . + . + . + . + . + "-1"^^ . + "<p>I am using the following code that applies progressive discounts based on order amount.</p>\n<pre><code>add_action('woocommerce_cart_calculate_fees', 'woo_discount_total');\nfunction woo_discount_total(WC_Cart $cart) {\n\n if( is_admin() &amp;&amp; !defined('DOING_AJAX') ) {\n return;\n }\n $woo_current_price = $cart-&gt;subtotal;\n\n if($woo_current_price &gt;= 3000 &amp;&amp; $woo_current_price &lt;= 9990) {\n $discount = $cart-&gt;subtotal * 0.02; // 0.02 = 2%\n $cart-&gt;add_fee('Sale 2% ', -$discount);\n }\n elseif($woo_current_price &gt;= 10000) {\n $discount = $cart-&gt;subtotal * 0.05; // 0.05 = 5%\n $cart-&gt;add_fee('Sale 5% ', -$discount);\n }\n}\n</code></pre>\n<p>But there is a problem. If there is a product on sale with a 15% discount in the cart, then all discounts are summed.</p>\n<p>As far as I understand, I need to spell out the conditions?</p>\n<p>What I would like is:</p>\n<ul>\n<li>If there are discounted items in the cart, my discounts are ignored.</li>\n<li>If there are no discounted items in the cart, my discounts continue to work.</li>\n</ul>\n<p>How can this be implemented?</p>\n"^^ . + . + "gd"^^ . + . + . + "0"^^ . + "<p>If you have hidden the HTML table column for quantity from <code>email-order-items.php</code> template, it is not enough and you also need to make some other changes.</p>\n<p>The templates involved are located in WooCommerce plugin inside the &quot;templates&quot; folder:</p>\n<ul>\n<li><code>emails/email-order-details.php</code></li>\n<li><code>emails/email-order-items.php</code></li>\n</ul>\n<p>You need to copy those 2 template files in your child theme, inside a &quot;woocommerce&quot; folder like:</p>\n<pre><code>- `yourchildtheme/woocommerce/emails/email-order-details.php`\n- `yourchildtheme/woocommerce/emails/email-order-items.php`\n</code></pre>\n<p>Now you can make changes to those template files copies.</p>\n<p><strong>To resume:</strong> <br>You need also to adjust (or remove) the <code>colspan</code> attribute value everywhere.</p>\n<h4>1) Open/edit the copied <code>email-order-items.php</code> template file</h4>\n<p><strong>Replace with:</strong></p>\n<pre><code>&lt;?php\n/**\n * Email Order Items\n *\n * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-items.php.\n *\n * HOWEVER, on occasion WooCommerce will need to update template files and you\n * (the theme developer) will need to copy the new files to your theme to\n * maintain compatibility. We try to do this as little as possible, but it does\n * happen. When this occurs the version of the template file will be bumped and\n * the readme will list any important changes.\n *\n * @see https://woocommerce.com/document/template-structure/\n * @package WooCommerce\\Templates\\Emails\n * @version 9.7.0\n */\n\nuse Automattic\\WooCommerce\\Utilities\\FeaturesUtil;\n\ndefined( 'ABSPATH' ) || exit;\n\n$margin_side = is_rtl() ? 'left' : 'right';\n\n$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );\n$price_text_align = $email_improvements_enabled ? 'right' : 'left';\n\nforeach ( $items as $item_id =&gt; $item ) :\n $product = $item-&gt;get_product();\n $sku = '';\n $purchase_note = '';\n $image = '';\n\n if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {\n continue;\n }\n\n if ( is_object( $product ) ) {\n $sku = $product-&gt;get_sku();\n $purchase_note = $product-&gt;get_purchase_note();\n $image = $product-&gt;get_image( $image_size );\n }\n\n ?&gt;\n &lt;tr class=&quot;&lt;?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?&gt;&quot;&gt;\n &lt;td class=&quot;td font-family text-align-left&quot; style=&quot;vertical-align: middle; word-wrap:break-word;&quot;&gt;\n &lt;?php if ( $email_improvements_enabled ) { ?&gt;\n &lt;table class=&quot;order-item-data&quot;&gt;\n &lt;tr&gt;\n &lt;?php\n // Show title/image etc.\n if ( $show_image ) {\n /**\n * Email Order Item Thumbnail hook.\n *\n * @param string $image The image HTML.\n * @param WC_Order_Item_Product $item The item being displayed.\n * @since 2.1.0\n */\n echo '&lt;td&gt;' . wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) ) . '&lt;/td&gt;';\n }\n ?&gt;\n &lt;td&gt;\n &lt;?php\n /**\n * Order Item Name hook.\n *\n * @param string $item_name The item name HTML.\n * @param WC_Order_Item_Product $item The item being displayed.\n * @since 2.1.0\n */\n echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item-&gt;get_name(), $item, false ) );\n\n // SKU.\n if ( $show_sku &amp;&amp; $sku ) {\n echo wp_kses_post( ' (#' . $sku . ')' );\n }\n\n /**\n * Allow other plugins to add additional product information.\n *\n * @param int $item_id The item ID.\n * @param WC_Order_Item_Product $item The item object.\n * @param WC_Order $order The order object.\n * @param bool $plain_text Whether the email is plain text or not.\n * @since 2.3.0\n */\n do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );\n\n wc_display_item_meta( $item );\n\n /**\n * Allow other plugins to add additional product information.\n *\n * @param int $item_id The item ID.\n * @param WC_Order_Item_Product $item The item object.\n * @param WC_Order $order The order object.\n * @param bool $plain_text Whether the email is plain text or not.\n * @since 2.3.0\n */\n do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );\n\n ?&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;/table&gt;\n &lt;?php\n } else {\n\n // Show title/image etc.\n if ( $show_image ) {\n /**\n * Email Order Item Thumbnail hook.\n *\n * @param string $image The image HTML.\n * @param WC_Order_Item_Product $item The item being displayed.\n * @since 2.1.0\n */\n echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) );\n }\n\n /**\n * Order Item Name hook.\n *\n * @param string $item_name The item name HTML.\n * @param WC_Order_Item_Product $item The item being displayed.\n * @since 2.1.0\n */\n echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item-&gt;get_name(), $item, false ) );\n\n // SKU.\n if ( $show_sku &amp;&amp; $sku ) {\n echo wp_kses_post( ' (#' . $sku . ')' );\n }\n\n /**\n * Allow other plugins to add additional product information.\n *\n * @param int $item_id The item ID.\n * @param WC_Order_Item_Product $item The item object.\n * @param WC_Order $order The order object.\n * @param bool $plain_text Whether the email is plain text or not.\n * @since 2.3.0\n */\n do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );\n\n wc_display_item_meta(\n $item,\n array(\n 'label_before' =&gt; '&lt;strong class=&quot;wc-item-meta-label&quot; style=&quot;float: ' . ( is_rtl() ? 'right' : 'left' ) . '; margin-' . esc_attr( $margin_side ) . ': .25em; clear: both&quot;&gt;',\n )\n );\n\n /**\n * Allow other plugins to add additional product information.\n *\n * @param int $item_id The item ID.\n * @param WC_Order_Item_Product $item The item object.\n * @param WC_Order $order The order object.\n * @param bool $plain_text Whether the email is plain text or not.\n * @since 2.3.0\n */\n do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );\n }\n ?&gt;\n &lt;/td&gt;\n &lt;!-- Removed quantity\n &lt;td class=&quot;td font-family text-align-&lt;?php echo esc_attr( $price_text_align ); ?&gt;&quot; style=&quot;vertical-align:middle;&quot;&gt;\n &lt;?php\n echo $email_improvements_enabled ? '&amp;times;' : '';\n $qty = $item-&gt;get_quantity();\n $refunded_qty = $order-&gt;get_qty_refunded_for_item( $item_id );\n\n if ( $refunded_qty ) {\n $qty_display = '&lt;del&gt;' . esc_html( $qty ) . '&lt;/del&gt; &lt;ins&gt;' . esc_html( $qty - ( $refunded_qty * -1 ) ) . '&lt;/ins&gt;';\n } else {\n $qty_display = esc_html( $qty );\n }\n echo wp_kses_post( apply_filters( 'woocommerce_email_order_item_quantity', $qty_display, $item ) );\n ?&gt;\n &lt;/td&gt;\n --&gt;\n &lt;td class=&quot;td font-family text-align-&lt;?php echo esc_attr( $price_text_align ); ?&gt;&quot; style=&quot;vertical-align:middle;&quot;&gt;\n &lt;?php echo wp_kses_post( $order-&gt;get_formatted_line_subtotal( $item ) ); ?&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php\n\n if ( $show_purchase_note &amp;&amp; $purchase_note ) {\n ?&gt;\n &lt;tr&gt;\n &lt;!-- changed colspan attribute value from &quot;3&quot; to &quot;2&quot; --&gt;\n &lt;td colspan=&quot;2&quot; class=&quot;font-family text-align-left&quot; style=&quot;vertical-align:middle;&quot;&gt;\n &lt;?php\n echo wp_kses_post( wpautop( do_shortcode( $purchase_note ) ) );\n ?&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php\n }\n ?&gt;\n\n&lt;?php endforeach; ?&gt;\n</code></pre>\n<p><strong>Save and close</strong></p>\n<h4>2) Open/edit the copied <code>email-order-details.php</code> template file:</h4>\n<p><strong>Replace with:</strong></p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n/**\n * Order details table shown in emails.\n *\n * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-details.php.\n *\n * HOWEVER, on occasion WooCommerce will need to update template files and you\n * (the theme developer) will need to copy the new files to your theme to\n * maintain compatibility. We try to do this as little as possible, but it does\n * happen. When this occurs the version of the template file will be bumped and\n * the readme will list any important changes.\n *\n * @see https://woocommerce.com/document/template-structure/\n * @package WooCommerce\\Templates\\Emails\n * @version 9.7.0\n */\n\nuse Automattic\\WooCommerce\\Utilities\\FeaturesUtil;\n\ndefined( 'ABSPATH' ) || exit;\n\n$text_align = is_rtl() ? 'right' : 'left';\n\n$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );\n$heading_class = $email_improvements_enabled ? 'email-order-detail-heading' : '';\n$order_table_class = $email_improvements_enabled ? 'email-order-details' : '';\n$order_total_text_align = $email_improvements_enabled ? 'right' : 'left';\n\nif ( $email_improvements_enabled ) {\n add_filter( 'woocommerce_order_shipping_to_display_shipped_via', '__return_false' );\n}\n\n/**\n * Action hook to add custom content before order details in email.\n *\n * @param WC_Order $order Order object.\n * @param bool $sent_to_admin Whether it's sent to admin or customer.\n * @param bool $plain_text Whether it's a plain text email.\n * @param WC_Email $email Email object.\n * @since 2.5.0\n */\ndo_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text, $email ); ?&gt;\n\n&lt;h2 class=&quot;&lt;?php echo esc_attr( $heading_class ); ?&gt;&quot;&gt;\n &lt;?php\n if ( $email_improvements_enabled ) {\n echo wp_kses_post( __( 'Order summary', 'woocommerce' ) );\n }\n if ( $sent_to_admin ) {\n $before = '&lt;a class=&quot;link&quot; href=&quot;' . esc_url( $order-&gt;get_edit_order_url() ) . '&quot;&gt;';\n $after = '&lt;/a&gt;';\n } else {\n $before = '';\n $after = '';\n }\n if ( $email_improvements_enabled ) {\n echo '&lt;span&gt;';\n }\n /* translators: %s: Order ID. */\n $order_number_string = $email_improvements_enabled ? __( 'Order #%s', 'woocommerce' ) : __( '[Order #%s]', 'woocommerce' );\n echo wp_kses_post( $before . sprintf( $order_number_string . $after . ' (&lt;time datetime=&quot;%s&quot;&gt;%s&lt;/time&gt;)', $order-&gt;get_order_number(), $order-&gt;get_date_created()-&gt;format( 'c' ), wc_format_datetime( $order-&gt;get_date_created() ) ) );\n if ( $email_improvements_enabled ) {\n echo '&lt;/span&gt;';\n }\n ?&gt;\n&lt;/h2&gt;\n\n&lt;div style=&quot;margin-bottom: &lt;?php echo $email_improvements_enabled ? '24px' : '40px'; ?&gt;;&quot;&gt;\n &lt;table class=&quot;td font-family &lt;?php echo esc_attr( $order_table_class ); ?&gt;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;6&quot; style=&quot;width: 100%;&quot; border=&quot;1&quot;&gt;\n &lt;?php if ( ! $email_improvements_enabled ) { ?&gt;\n &lt;thead&gt;\n &lt;tr&gt;\n &lt;th class=&quot;td&quot; scope=&quot;col&quot; style=&quot;text-align:&lt;?php echo esc_attr( $text_align ); ?&gt;;&quot;&gt;&lt;?php esc_html_e( 'Product', 'woocommerce' ); ?&gt;&lt;/th&gt;\n &lt;!-- Removed quantity\n &lt;th class=&quot;td&quot; scope=&quot;col&quot; style=&quot;text-align:&lt;?php echo esc_attr( $text_align ); ?&gt;;&quot;&gt;&lt;?php esc_html_e( 'Quantity', 'woocommerce' ); ?&gt;&lt;/th&gt;\n --&gt;\n &lt;th class=&quot;td&quot; scope=&quot;col&quot; style=&quot;text-align:&lt;?php echo esc_attr( $text_align ); ?&gt;;&quot;&gt;&lt;?php esc_html_e( 'Price', 'woocommerce' ); ?&gt;&lt;/th&gt;\n &lt;/tr&gt;\n &lt;/thead&gt;\n &lt;?php } ?&gt;\n &lt;tbody&gt;\n &lt;?php\n $image_size = $email_improvements_enabled ? 48 : 32;\n echo wc_get_email_order_items( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n $order,\n array(\n 'show_sku' =&gt; $sent_to_admin,\n 'show_image' =&gt; $email_improvements_enabled,\n 'image_size' =&gt; array( $image_size, $image_size ),\n 'plain_text' =&gt; $plain_text,\n 'sent_to_admin' =&gt; $sent_to_admin,\n )\n );\n ?&gt;\n &lt;/tbody&gt;\n &lt;tfoot&gt;\n &lt;?php\n $item_totals = $order-&gt;get_order_item_totals();\n $item_totals_count = count( $item_totals );\n\n if ( $item_totals ) {\n $i = 0;\n foreach ( $item_totals as $total ) {\n $i++;\n $last_class = ( $i === $item_totals_count ) ? ' order-totals-last' : '';\n ?&gt;\n &lt;tr class=&quot;order-totals order-totals-&lt;?php echo esc_attr( $total['type'] ?? 'unknown' ); ?&gt;&lt;?php echo esc_attr( $last_class ); ?&gt;&quot;&gt;\n &lt;!-- Removed colspan attribute\n &lt;th class=&quot;td text-align-left&quot; scope=&quot;row&quot; style=&quot;&lt;?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?&gt;&quot;&gt;\n &lt;?php\n echo wp_kses_post( $total['label'] ) . ' ';\n if ( $email_improvements_enabled ) {\n echo isset( $total['meta'] ) ? wp_kses_post( $total['meta'] ) : '';\n }\n ?&gt;\n &lt;/th&gt;\n &lt;td class=&quot;td text-align-&lt;?php echo esc_attr( $order_total_text_align ); ?&gt;&quot; style=&quot;&lt;?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?&gt;&quot;&gt;&lt;?php echo wp_kses_post( $total['value'] ); ?&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php\n }\n }\n if ( $order-&gt;get_customer_note() &amp;&amp; ! $email_improvements_enabled ) {\n ?&gt;\n &lt;tr&gt;\n &lt;!-- Removed colspan attribute\n &lt;th class=&quot;td text-align-left&quot; scope=&quot;row&quot;&gt;&lt;?php esc_html_e( 'Note:', 'woocommerce' ); ?&gt;&lt;/th&gt;\n --&gt;\n &lt;td class=&quot;td text-align-left&quot;&gt;&lt;?php echo wp_kses( nl2br( wptexturize( $order-&gt;get_customer_note() ) ), array() ); ?&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php\n }\n if ( $order-&gt;get_customer_note() &amp;&amp; $email_improvements_enabled ) {\n ?&gt;\n &lt;tr class=&quot;order-customer-note&quot;&gt;\n &lt;!-- Changed colspan attribute value from &quot;3&quot; to &quot;2&quot;\n &lt;td class=&quot;td text-align-left&quot; colspan=&quot;2&quot;&gt;\n &lt;b&gt;&lt;?php esc_html_e( 'Customer note', 'woocommerce' ); ?&gt;&lt;/b&gt;&lt;br&gt;\n &lt;?php echo wp_kses( nl2br( wptexturize( $order-&gt;get_customer_note() ) ), array( 'br' =&gt; array() ) ); ?&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php\n }\n ?&gt;\n &lt;/tfoot&gt;\n &lt;/table&gt;\n&lt;/div&gt;\n\n&lt;?php\nif ( $email_improvements_enabled ) {\n remove_filter( 'woocommerce_order_shipping_to_display_shipped_via', '__return_false' );\n}\n\n/**\n * Action hook to add custom content after order details in email.\n *\n * @param WC_Order $order Order object.\n * @param bool $sent_to_admin Whether it's sent to admin or customer.\n * @param bool $plain_text Whether it's a plain text email.\n * @param WC_Email $email Email object.\n * @since 2.5.0\n */\ndo_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text, $email );\n?&gt;\n</code></pre>\n<p><strong>Save and close</strong></p>\n<p>It should solve your issue.</p>\n<p><strong>Related:</strong> <a href="https://stackoverflow.com/questions/78721114/add-a-column-to-show-order-item-price-excl-tax-in-woocommerce-email-notificatio/78722788#78722788">Add a column to show order item price excl. tax in Woocommerce email notifications</a></p>\n"^^ . + . + . + . + . + . + . + "i also try ```Auth::guard('api')``` but it's return false"^^ . + . + "dompdf"^^ . + . + . + . + ".text() and .html is not working in my code"^^ . + "The module() function comes from the QR library and is called when generating a QR code. That part works fine. However, I'm currently struggling to pass the variable from one class to another. When I pass the variable to the class via the constructor and then try to pass it to the module() method, I get an error saying string must be compatible with chillerlan\\QRCode\\Output\\QRMarkupSVG::module(int $x, int $y, int $M_TYPE): string. I'm only overriding the module() method, which originally comes from QRMarkupSVG in the library."^^ . + . + . + . + . + . + . + "-1"^^ . + . + . + "1"^^ . + "WP Query to identify future dated Woocommerce products with custom meta date field"^^ . + . + . + . + . + . + . + . + "0"^^ . + "artisan-serve"^^ . + "<p>According to your logs <code> Illuminate\\Broadcasting\\PendingBroadcast {#5325}</code> it seems the request itself is pending i suggest checking the Laravel queues because the request might be sent but its queued kind of like its a pending post or request</p>\n<pre class="lang-bash prettyprint-override"><code>php artisan queue:work\n</code></pre>\n<p>Also kindly check this section of this documentation <a href="https://laravel.com/docs/12.x/queues#connections-vs-queues" rel="nofollow noreferrer">Connections vs Queues - Lara</a></p>\n"^^ . + . + "laravel-collection"^^ . + . + "0"^^ . + . + "1"^^ . + . + . + "-2"^^ . + "0"^^ . + "1"^^ . + . + . + . + "parallels"^^ . + . + "this one still getting displayed on terminal $this->logger->critical('An error occurred', [\n 'exception' => $exception,\n ]);. but i want to prevent it for security purpose. i just want to be logged not display on the terminal"^^ . + . + "laravel-storage"^^ . + . + "That sounds good. However, 2030 and b are specified. But it can also be 2031 and 2031c. That means I want to react variably to it without having "2030" fixed in the code."^^ . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + "translation"^^ . + "Photo gallery Page"^^ . + . + "xero-api"^^ . + "1"^^ . + . + . + "4"^^ . + . + "1"^^ . + "<p>I have created a very simple PHP file as displayed below.</p>\n<p>If I call the API using postman, it works fine and prints the value of &quot;a&quot;.\nBut when I call through my javascript code, it only returns &quot;........&gt;&gt;&gt;&gt;&gt;&gt;&gt;&quot; but not the value of &quot;a&quot;.</p>\n<pre><code>header(&quot;Access-Control-Allow-Origin: *&quot;);\nheader('Access-Control-Allow-Methods: GET, POST');\nheader(&quot;Access-Control-Allow-Headers: content-type,x-requested-with&quot;);\necho &quot;........&gt;&gt;&gt;&gt;&gt;&gt;&gt;&quot;;\n$name = $_POST['a'];\necho $name;\n</code></pre>\n<p>Javascript code</p>\n<pre><code>fetch(url, {\nmethod: &quot;POST&quot;,\nbody: JSON.stringify(attrObj),\nheaders: {\n&quot;Content-type&quot;: &quot;application/json&quot;,\n},\n})\n.then((response) =&gt; response.json())\n.then((json) =&gt; callback.call(obj, json));\n</code></pre>\n"^^ . + . + "0"^^ . + . + . + . + "<p>I am using inline JQuery to POST to a url on my site so that I can include a CSRF token via a PHP variable. I've been trying to find an answer but can't seem to find it, I just keep finding questions about how to set a header for ajax requests instead of if we NEED/HAVE to and why? Is this not the same as just including a CSRF token in a form POST submission and verifying that the CSRF Token value is correct/valid?</p>\n<p>I am using an ajax request like this:</p>\n<pre><code>$.ajax({\nurl: &quot;api/json/file-exists&quot;,\n method: &quot;POST&quot;,\n data: {\n file_path: url,\n token: &quot;&lt;?=$session-&gt;get('csrf_token')?&gt;&quot;,\n },\n success: function(response) {\n // ...\n },\n error: function(xhr, status, error) {\n // ...\n }\n });\n</code></pre>\n<p>Is this not good enough / Are ajax requests different from other requests and need to have headers set? And if so, why?</p>\n<p>I do not use Laravel or any framework.</p>\n"^^ . + . + . + . + . + "Yes, data providers are static methods, and yes, there is setUpBeforeClass(). If you need a (data) "providing" function otherwise, make it private and call it in the objects' test-method as the object already exists then."^^ . + "Big picture question: Who are you obfuscating from? Regular users or power users? Your average regular user won't know what to do with PHP code for the most part, it is for all intents and purposes obfuscated already. If this is for power users, then if your code is important/good enough they'll be able to get to it. Before WordPress does its thing, something is going to have to "do something", and it is trivial to inject a "dump code" in right after the "something" and before WordPress gets involved. If you have _secrets_ in your code, obfuscation isn't really a code way to guard those"^^ . + "0"^^ . + . + . + "by the way, there are 4 functions in the code, three return a result and it is not validated anywhere (well, we can assume `while` for validation, so 1 out of 3)."^^ . + "fastcgi"^^ . + . + . + . + "-3"^^ . + . + "phpstan"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + "Programmatically mark lesson as complete in learnpress"^^ . + "1"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "Like Barmar wrote, PHP serialized data, a database inside the database. You have to mount the inner data-base and then query the data, so it's a two-phase operation."^^ . + "After some test if i do : localhost/index.php it redirect me on the correct thing\nPut i dont want to add a index.php to my url"^^ . + . + "<p>You cannot reference the keys of the array when you're <strong>declaring</strong> the array, but you can do this when you are <strong>using</strong> the array. Like this:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\n$menuItems = [\n &quot;menu_title&quot; =&gt; [\n &quot;view_type&quot; =&gt; [\n &quot;name&quot; =&gt; &quot;display_name&quot;,\n &quot;url&quot; =&gt; &quot;hello.html&quot;,\n ],\n ],\n];\n\nforeach ($menuItems as $menuItemKey =&gt; $menuItem) {\n foreach ($menuItem as $menuLinkKey =&gt; $menuLink) {\n $name = $menuLink['name'];\n $url = $menuLink['url'] . &quot;?p=$menuLinkKey&amp;t=$menuItemKey&quot;;\n echo '&lt;a href=&quot;' . $url . '&quot;&gt;' . $name . '&lt;/a&gt;';\n } \n}\n</code></pre>\n<p>The output is:</p>\n<pre class="lang-html prettyprint-override"><code>&lt;a href=&quot;hello.html?p=view_type&amp;t=menu_title&quot;&gt;display_name&lt;/a&gt;\n</code></pre>\n<p>Live demo: <a href="https://3v4l.org/WQXsY" rel="nofollow noreferrer">https://3v4l.org/WQXsY</a></p>\n<p>See the <a href="https://www.php.net/manual/en/control-structures.foreach.php" rel="nofollow noreferrer">foreach control structure</a></p>\n"^^ . + . + . + . + . + "0"^^ . + "proc-open"^^ . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + "@BillKarwin Thank you so much for your suggestions. I modified my code, but I'm still being unsuccessful. Is there a way to debug the query execution? I'm using catch (PDOException $e) but I don't see any errors in the console or anywhere else."^^ . + . + . + . + "@kamilio3214 [please read](https://stackoverflow.com/a/15320411/285587)."^^ . + . + "0"^^ . + . + . + "Please note that [Generative AI (e.g., ChatGPT) is banned](https://meta.stackoverflow.com/questions/421831) and read [Help Center: AI policy](https://stackoverflow.com/help/ai-policy). It is not permitted to use AI tools to generate or reword content that you post on Stack Overflow."^^ . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "<p>Ok, I want a page from my wordpress website to be geo-localised, meaning I want to exclude people from country X to be able to read the page but automatically be redirected to the home page</p>\n<p>I wrote the following code in functions.php\n, but somehow it does not trigger a redirect. In the example I want to redirect visitors from Belgium to the homepage when they land on a specific url.</p>\n<pre><code>function redirect_belgian_users() {\n if (!isset($_SERVER[&quot;REMOTE_ADDR&quot;])) {\n error_log(&quot;No IP-address detected.&quot;);\n return;\n }\n\n // Establish the IP-adres\n $user_ip = $_SERVER[&quot;HTTP_X_FORWARDED_FOR&quot;] ?? $_SERVER[&quot;REMOTE_ADDR&quot;];\n error_log(&quot;Geo-block function triggered for IP: &quot; . $user_ip);\n\n // Vraag de geo-locatie op\n $response = wp_remote_get(&quot;http://ipinfo.io/{$user_ip}/json&quot;);\n\n if (is_wp_error($response)) {\n error_log(&quot;Geo-block API error: &quot; . $response-&gt;get_error_message());\n return;\n }\n\n $geo_data = json_decode(wp_remote_retrieve_body($response), true);\n\n if (empty($geo_data[&quot;country&quot;])) {\n error_log(&quot;Geo-block: No country information received.&quot;);\n return;\n }\n\n error_log(&quot;Geo-block: IP {$user_ip} is in {$geo_data[&quot;country&quot;]}&quot;);\n\n if ($geo_data[&quot;country&quot;] !== &quot;BE&quot;) {\n error_log(&quot;Visitors not from Belgium. No action needed.&quot;);\n return;\n }\n\n // Check of de gebruiker zich op de specifieke pagina bevindt\n $current_url_path = parse_url($_SERVER[&quot;REQUEST_URI&quot;], PHP_URL_PATH);\n $restricted_url_path = &quot;an-url-I-want-to-geo-block&quot;;\n\n error_log(&quot;Huidige pagina: {$current_url_path}&quot;);\n \n if ($current_url_path !== $restricted_url_path) {\n error_log(&quot;User is not on the geo-blocked page. No redirect.&quot;);\n return;\n }\n\n // Redirect uitvoeren\n error_log(&quot;Redirecting Belgian visitor from {$current_url_path}&quot;);\n wp_safe_redirect(home_url());\n exit;\n}\nadd_action(&quot;template_redirect&quot;, &quot;redirect_belgian_users&quot;);\n</code></pre>\n<p>My debug report said: [22-Mar-2025 11:03:51 UTC] Geo-block function triggered for IP: 217.113.194.181\n[22-Mar-2025 11:03:51 UTC] Geo-block: No land information received.</p>\n<p>I tried to further rewrite the code but it does not seem to work.</p>\n"^^ . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + "3"^^ . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "@TimLewis I'm aware of that. I was in tinker sesssion and I was accessing the value via config() first. Since it's not working, I accessed it directly from env() and still got the same issue. And yes, I was restarting the tinker session."^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "2"^^ . + . + . + "0"^^ . + . + . + . + . + . + "system.data.sqlite"^^ . + . + . + . + "<p>I relatively new on using firebase on laravel and currently encountering an error in postman\n&quot;Error: read ECONNRESET&quot; everytime I run createUser what could be the problem?</p>\n<pre><code>public function __construct()\n{\n $this-&gt;auth = Firebase::auth();\n $this-&gt;firestore = Firebase::firestore();\n}\n\npublic function createUser($registrant)\n{\n //this works\n $user = $this-&gt;auth-&gt;createUserWithEmailAndPassword($registrant['email'], $registrant['password']);\n\n $userColl = $this-&gt;firestore-&gt;database()-&gt;collection('users')-&gt;document('test');\n // returning ECONNRESET\n $userRef = $userColl-&gt;set([\n $registrant\n ]);\n}\n</code></pre>\n"^^ . + . + . + . + . + "1"^^ . + . + . + "`fetch_assoc` returns a single row, if you want the whole result, you should call `fetch_all`."^^ . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + "Oh yes, I don't. Because I don't have to. It's a network problem, firewall or not. That's all I need to know to tell this question is off topic on a *programming* related Q&A. What you don't understand is that your "parallels" is not "local". It's a distinct host with its distinct address. And so your web-server is somehow prevented from accessing that address. The sooner you'd face this fact, the sooner you'll resolve your problem"^^ . + "P.S. Obviously if you're making a child class, then in order to use the new, overriden version of the function you need to ensure that any class you declare is an instance of `QRSvgWithLogoAndCustomShapes`, not an instance of `QRMarkupSVG`. The error message suggests you may have instantiated `QRMarkupSVG` instead. It's not clear when or how you're instantiating the class or calling the module() function, because none of the code you've provided does either of those things."^^ . + "function for sql_execute with mysqli"^^ . + . + "2"^^ . + "Missing validation in Laravel in some cases when using Form Request"^^ . + . + "3"^^ . + "2"^^ . + . + . + "Thank You. So i can use woocommerce_before_calculate_totals to modify the price in the cart totals without affecting the cart line items on the cart page?"^^ . + . + "0"^^ . + . + "The weird part though is that i can connect fine using isql as the current terminal user. But if I try to connect as "www-data" this error is displayed."^^ . + "guzzle"^^ . + . + "1"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + "Oh, it was this comment that gave the router perspective, can you edit your answer to include this? This is what I decided to work with. It sounds really better than the htaccess tweak."^^ . + . + . + . + "How to get image paths to be used in page templates?"^^ . + . + . + "Insteading of echoing, have you tried doing `var_dump(the_field('is_neighborhood'))`? Then you can see exactly what is being returned by that call."^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + "Welcome to Stack Overflow @MaxLhrm - https://stackoverflow.com/help/someone-answers"^^ . + "<p>When using a C program to access a MySQL database the exe produces no output but does provide an error code. Modifying the code to do a simple &quot;Hello World&quot; is successful. Running either of these exe programs on the Windows command line does work - ie the program to access the database returns rows of data. There are no error messages in Events (application or other).</p>\n<p>Development environment</p>\n<ul>\n<li>Windows 11, Apache 2.4, MySQL 8.0.33, MSYS2 (I used: <code>pacman -S mingw-w64-ucrt-x86_64-gcc to get gcc</code>)</li>\n<li>Using MSYS2 UCRT64 application to compile the c code</li>\n<li>Compiled using: <code>gcc firstc.c -o atest.exe -I'c:\\Program Files\\MySQL\\MySQl Server 8.0\\include' -L'c:\\Program Files\\MySQL\\MySQl Server 8.0\\lib' -llibmysql</code></li>\n</ul>\n<p>C code -&gt; compiles to atest.exe with no errors</p>\n<pre><code>#include &lt;mysql.h&gt;\n#include &lt;stdio.h&gt;\nint main() {\n MYSQL *conn;\n MYSQL_RES *res;\n MYSQL_ROW row;\n char *server = &quot;localhost&quot;;\n char *user = &quot;root&quot;;\n char *password = &quot;local&quot;;\n char *database = &quot;care&quot;;\n conn = mysql_init(NULL); \n \n if (!mysql_real_connect(conn, server, user, password, database, 0, NULL, 0)) {\n printf(&quot;%s\\n&quot;, mysql_error(conn));\n return(5);\n }\n \n if (mysql_query(conn, &quot;SELECT * FROM departments&quot;)) { \n printf(&quot;%s\\n&quot;, mysql_error(conn));\n return(6);\n }\n \n res = mysql_use_result(conn);\n \n while ( (row = mysql_fetch_row(res)) != NULL ) {\n printf(&quot;%s %s %s\\n&quot;, row[1], row[2], row[0]);\n }\n \n mysql_free_result(res);\n mysql_close(conn);\n\n}\n</code></pre>\n<p>Dumpbin gives with /dependents option for atest.exe:</p>\n<pre><code>File Type: EXECUTABLE IMAGE\nImage has the following dependencies:\nKERNEL32.dll\napi-ms-win-crt-environment-l1-1-0.dll\napi-ms-win-crt-heap-l1-1-0.dll\napi-ms-win-crt-math-l1-1-0.dll\napi-ms-win-crt-private-l1-1-0.dll\napi-ms-win-crt-runtime-l1-1-0.dll\napi-ms-win-crt-stdio-l1-1-0.dll\napi-ms-win-crt-string-l1-1-0.dll\napi-ms-win-crt-time-l1-1-0.dll\nlibmysql.dll\n</code></pre>\n<p>The libmysql.dll has been copied from the MySQL folder to c:\\windows\\System32 and the c:\\apache24\\htdocs folder where the PHP code an exe resides. In addition it was copied to the folder where the source C code is compiled. Reason: just in case the PHP program/exe can not find/access it in the database folders.</p>\n<p>PHP code to run the exe:</p>\n<pre><code>&lt;?php\n$command = &quot;c:\\apache24\\htdocs\\atest.exe 2&gt;&amp;1&quot;; // should access MySQL and return rows\n$response = system($command, $retval);\necho '&lt;hr&gt;Response: ' . $response . '&lt;hr&gt;Return value: ' . $retval;\n?&gt;\n</code></pre>\n<p>Browser window shows on running PHP code (exe which accesses MySQL):</p>\n<pre><code>Response: \nReturn value: -1073741515\n</code></pre>\n<p>i.e. there is no output but the error code 1073741515 is displayed</p>\n<p>Expecting to get back rows of data from MySQL database.</p>\n<p>UPDATE: 10/3/25</p>\n<p>I checked again the error code and it should be -1073741515 (minus 1073741515). This converts to C0000135 Hex 2s complement.</p>\n<p>Feedback responses:</p>\n<p>-1073741515 as a file system error not MySQL error? If this is the case how do I identify which file is missing? Does it suggest that the issue is a file permissions error?</p>\n<p>Apache runs as user: SYSTEM - The PC runs as a web server with Apache (not IIS) as the front end.</p>\n<p>MySQL runs as a Network Service but can also run as a local user. The application runs with MySQL &quot;root&quot; access.</p>\n<p>The PHP script runs as user SYSTEM</p>\n<p>I am unable to get the c++ GetUserName function working - due to a lack of c++ programming experience and missing c++ dll's on my PC. ie my environment is set up for c programming not c++.</p>\n<p>Response to possible duplicates: <a href="https://stackoverflow.com/questions/11432940/what-does-error-code-0xc0000135-or-1073741515-exit-code-mean-when-starting-a">What does Error-code 0xc0000135 (or -1073741515 Exit-code) mean when starting a Windows</a></p>\n<p>.NET Framework 3.5 is installed. Activating it starts IIS and locks out Apache. Currently it is switched off. If the issue is .NET -- I can still run a &quot;Hello World&quot; c program from PHP but cannot run a database query written in c as an exe and both programs work when run from the command line. i.e. .NET does not seem to be the issue. My anti-virus does not block the &quot;Hello World&quot; problem so I have discounted this as the problem. There are no .NET errors displayed when running the app.</p>\n<p>I also turned on/off my anti-virus. This made no difference.</p>\n<p>I have checked the Event logs and can find nothing related to this issue.</p>\n<p>When running the app there is no message: &quot;The application failed to initialize properly (0xc0000135)&quot;.</p>\n"^^ . + . + "<p>I edited the config file <code>psalm.xml</code></p>\n<ul>\n<li><p>On <code>psalm</code> tag I added the attribute <code>runTaintAnalysis=&quot;true&quot;</code></p>\n</li>\n<li><p>I enabled the <code>pdo</code> extension (<code>&lt;enableExtensions&gt;&lt;extension name=&quot;pdo&quot; /&gt;&lt;/enableExtensions&gt;</code></p>\n</li>\n</ul>\n<pre><code>&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;!-- Add runTaintAnalysis --&gt;\n&lt;psalm\n errorLevel=&quot;1&quot; \n resolveFromConfigFile=&quot;true&quot;\n xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;\n xmlns=&quot;https://getpsalm.org/schema/config&quot;\n xsi:schemaLocation=&quot;https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd&quot;\n findUnusedBaselineEntry=&quot;true&quot;\n findUnusedCode=&quot;true&quot;\n runTaintAnalysis=&quot;true&quot; \n&gt;\n &lt;projectFiles&gt;\n &lt;directory name=&quot;src&quot; /&gt;\n &lt;ignoreFiles&gt;\n &lt;directory name=&quot;vendor&quot; /&gt;\n &lt;/ignoreFiles&gt;\n &lt;/projectFiles&gt;\n &lt;!-- Important --&gt;\n &lt;enableExtensions&gt;\n &lt;extension name=&quot;pdo&quot; /&gt;\n &lt;/enableExtensions&gt;\n&lt;/psalm&gt;\n</code></pre>\n<p>And now I just run the commande like so</p>\n<pre><code>vendor/bin/psalm \n</code></pre>\n<p>Found randomly in the config file reference <a href="https://psalm.dev/docs/running_psalm/configuration/#enableextensions" rel="nofollow noreferrer">https://psalm.dev/docs/running_psalm/configuration/#enableextensions</a></p>\n"^^ . + . + "0"^^ . + . + . + . + . + . + "user-input"^^ . + "0"^^ . + "-1"^^ . + . + "This answer would be better if you show the working code, rather than attempting to describe it."^^ . + "By default there's no referer at all, since `curl` isn't a browser following a link. However, if you use `CURLOPT_FOLLOWLOCATION` and `CURLOPT_AUTOREFERER`, it will send a refer when it follows a redirect, using the URL of the redirecting site as the referer."^^ . + . + "0"^^ . + . + . + "2"^^ . + . + . + "0"^^ . + "1"^^ . + "0"^^ . + "Route didn't move into next page and data didn't saved into database"^^ . + "<p>Your extraction code is correct,</p>\n<pre><code>$referrerValue = curl_getinfo($ch, CURLINFO_REFERER);\n</code></pre>\n<p>is the correct way to fetch the last referer header sent by curl.</p>\n<p>Curl does not track referer automatically, it is opt-in, you have to run</p>\n<pre><code>curl_setopt($ch, CURLOPT_AUTOREFERER, true);\n</code></pre>\n<p>to opt-in to referer-tracking,\nand even then, there will only be a referer if your curl code actually set CURLOPT_FOLLOWLOCATION and follows a redirect, or you manually inject a referer with CURLOPT_REFERER.</p>\n"^^ . + . + . + . + "0"^^ . + "2"^^ . + . + "custom-taxonomy"^^ . + "I have tested the function curl_get_contents_partial which is discussed on that page, gre_gor. However, the output consists of funny symbols like %PDF-1.2 4 0 obj << /Length 5 0 R /Filter /FlateDecode >> stream xڍVY��6~���#D\\���.6��iS^$@�>hm�V�1����p(��"^^ . + "However, it seems to me that the task is how to make a php script generate xml. So, most likely we have an XY problem."^^ . + . + "<p>I am using Laravel 12.x with Inertia, React, Typescript, WorkOS Auth, and Cashier (Paddle).</p>\n<p>With my current implementation I can get the checkout overlay to open and process payment, but in my database I am not storing the transaction &amp; subscription. Cashier does not seem to be aware a transaction occurred and a user is subscribed after checkout. On Paddle's end, everything is as expected when I open the customer portal. I am just failing to process my user's transaction and subscription.</p>\n<p>I believe I am incorrectly implementing Cashier by manually calling <code>$user-&gt;createAsCustomer();</code> myself in my controller, rather than creating a checkout with Cashier and letting Cashier handle the record creation. I think I am totally doing this wrong.</p>\n<p><a href="https://laravel.com/docs/12.x/cashier-paddle#quickstart-selling-subscriptions" rel="nofollow noreferrer">Cashier (Paddle) Documentation</a></p>\n<p>How could I fix my implementation and leverage Cashier correctly? I struggle with the documentation because of my React/Inertia stack (rather than blade). I see in the documentation <code>$checkout = $user-&gt;checkout('pri_34567')-&gt;returnTo(route('dashboard'));</code> but I couldn't get that working with my front-end.</p>\n<p>SubscriptionController.php</p>\n<pre class="lang-php prettyprint-override"><code>class SubscriptionController extends Controller\n{\n public function store(Request $request)\n {\n try {\n\n $user = $request-&gt;user();\n\n $priceId = config('subscription.paddle_price_id');\n\n $user-&gt;createAsCustomer();\n\n $redirectUrl = route('dashboard');\n\n // Return the data for the frontend ... I think this is the wrong approach\n return response()-&gt;json([\n 'priceId' =&gt; $priceId,\n 'redirectUrl' =&gt; $redirectUrl\n ]);\n\n } catch (\\Exception $e) {\n Log::error('CHECKOUT - Subscription error: ' . $e-&gt;getMessage());\n Log::error($e-&gt;getTraceAsString());\n return response()-&gt;json(['error' =&gt; $e-&gt;getMessage()], 500);\n }\n }\n}\n</code></pre>\n<p>My react component has a button that <code>onClick</code> calls this function:</p>\n<p>useHandleCheckoutOpen.tsx</p>\n<pre class="lang-js prettyprint-override"><code>\nimport axios from 'axios';\nimport { type User } from '@/types';\nimport { router } from '@inertiajs/react';\n\nexport function useHandleCheckoutOpen(user: User) {\n return async () =&gt; {\n try {\n const response = await axios.post('/subscribe');\n\n if (response.data.error) {\n console.error('Server returned an error:', response.data.error);\n return;\n }\n\n const { priceId, redirectUrl } = response.data;\n\n if (window.Paddle &amp;&amp; window.Paddle.Checkout) {\n window.Paddle.Checkout.open({\n items: [\n {\n priceId,\n quantity: 1,\n },\n ],\n settings: {\n displayMode: 'overlay',\n allowLogout: false,\n // successUrl: redirectUrl,\n },\n customer: {\n name: user.name,\n email: user.email,\n },\n });\n } else {\n console.error('Paddle script not loaded or window.Paddle not defined.');\n }\n } catch (error: any) {\n console.error('Error starting subscription:', error);\n if (error.response) {\n console.error('Server response:', error.response.data);\n }\n }\n };\n}\n</code></pre>\n<p>I have included <code>use Billable</code> in my User Model. My web.php is:</p>\n<p>web.php</p>\n<pre class="lang-php prettyprint-override"><code>Route::middleware([\n 'auth',\n ValidateSessionWithWorkOS::class,\n])-&gt;group(function () {\n Route::post('/paddle/webhook', WebhookController::class);\n Route::post('/subscribe', [SubscriptionController::class, 'store'])-&gt;name('subscribe');\n Route::get('/customer-portal', [CustomerPortalController::class, 'show'])-&gt;name('customer-portal');\n});\n</code></pre>\n<p>I have tried to implement what the Cashier (paddle) documentation references, but because the examples are in blade I am not sure how to relate that to my react front-end. Most examples I can find outside of the documentation are not up to date and refer to old methods that Cashier no longer supports like <code>-&gt;create()</code></p>\n<p>The docs say</p>\n<pre><code>use Illuminate\\Http\\Request;\n\nRoute::get('/subscribe', function (Request $request) {\n $checkout = $request-&gt;user()-&gt;checkout('price_basic_monthly')\n -&gt;returnTo(route('dashboard'));\n\n return view('subscribe', ['checkout' =&gt; $checkout]);\n})-&gt;name('subscribe');\n</code></pre>\n<p>with the blade component:</p>\n<pre><code>&lt;x-paddle-button :checkout=&quot;$checkout&quot; class=&quot;px-8 py-4&quot;&gt;\n Subscribe\n&lt;/x-paddle-button&gt;\n</code></pre>\n"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "2"^^ . + . + . + "0"^^ . + . + "-4"^^ . + "Can you share your php error logs please it may help us to identify the issue on php.ini use : error_reporting = E_ALL\ndisplay_errors = On\nlog_errors = On\nerror_log = /path/to/php_error.log"^^ . + . + . + . + "0"^^ . + . + "No idea why you get redirected, too much stuff is missing from this question. I do notice that this code has quite a few security holes in it. Have a look at [SQL-injection](https://www.php.net/manual/en/security.database.sql-injection.php), which is the most common and most attacked security problem. Always bind variables. Try to use [the standard methods for hashing passwords](https://www.php.net/manual/en/ref.password.php), I have no idea what hashing you're doing here. Note how `$_POST['login-as']` is part of the form, and can be manipulated by a hacker. That seems a bad idea."^^ . + "Are you 100% sure that $this->password has a value?"^^ . + . + . + "3"^^ . + . + "1"^^ . + "-1"^^ . + . + "0"^^ . + "0"^^ . + "1"^^ . + "Yes that sounds like it would work. I don't really want to restructure the site though if possible."^^ . + . + "1"^^ . + . + . + "-1"^^ . + "0"^^ . + . + . + . + . + . + "<p>Classes that are created in <code>eval()</code> are not the same classes:</p>\n<pre><code>function test3($test) {\n return eval(&quot;return new class($test) {\n public function __construct(public \\$test) {}};&quot;\n );\n}\ncompare(test3(1), test3(1)); // false, false, false,\n</code></pre>\n<p>Another option is move the code that creates class to the other file, and in method require that file:</p>\n<pre><code>function test4($test) {\n return require __DIR__ . '/otherFile.php';\n}\ncompare(test4(1), test4(1)); // false, false, false,\n</code></pre>\n<p>otherFile.php:</p>\n<pre><code>&lt;?php\nreturn new class($test) {\n public function __construct(public $test) {}\n}\n</code></pre>\n"^^ . + "0"^^ . + . + . + "@RaffaeleBertani , Hello Please Check I added My Login Controller code !!"^^ . + "1"^^ . + . + "0"^^ . + . + . + . + "<p>I'm using Laravel Octane with OpenSwoole, and I'm trying to run nested Octane::concurrently() calls. However, I keep getting this error:</p>\n<blockquote>\n<p>OpenSwoole\\Server::taskWaitMulti(): taskWaitMulti method can only be used in the worker process</p>\n</blockquote>\n<p>Here’s the code that produces the error:</p>\n<pre><code>Octane::concurrently([\n 'outer_concurrency' =&gt; function () {\n return Octane::concurrently([\n 'inner_result' =&gt; function () {\n return 1;\n },\n ]);\n },\n]);\n</code></pre>\n<p>It seems like Octane is trying to execute taskWaitMulti() outside a worker process. Is nested concurrency not supported in OpenSwoole, or am I missing something?</p>\n<p>Any insights or workarounds would be appreciated`</p>\n"^^ . + . + . + . + "0"^^ . + . + "-1"^^ . + "<p>Previous to PHP8 <code>imagedestroy($image)</code> would be used to clear image resource data from the server memory. This is very useful on crowded situations and especially when dealing in loops with processing multiple images.</p>\n<p>However, the <code>imagedestroy()</code> <a href="https://www.php.net/manual/en/function.imagedestroy.php" rel="nofollow noreferrer">manual</a> states</p>\n<blockquote>\n<p><strong>Note:</strong><br>\nThis function has no effect. Prior to PHP 8.0.0, this function was used to close the resource.</p>\n</blockquote>\n<p>How in PHP8+ should we clear up image data/memory during a script?</p>\n"^^ . + . + . + . + . + . + . + "<p>I am using this php script (see below) when someone enters <a href="http://website.tld/index.php?demo=john" rel="nofollow noreferrer">http://website.tld/index.php?demo=john</a> this pulls the page named &quot;john&quot; from the actions folder and displays it at <a href="http://website.tld/index.php?demo=john" rel="nofollow noreferrer">http://website.tld/index.php?demo=john</a>. I have been trying to play around with different type of codes and not much has been a success by giving me 500 error status, anyway I found this php code <code>&lt;?php echo $_SERVER['QUERY_STRING'] ?&gt; </code> witch gives me what I want some what of what I wanted but not quite exactly as I only want to display john and not show demo=, what can I do to achieve this?</p>\n<pre><code>$page = $_POST[&quot;demo&quot;];\nif($page == null)\n{\n $page = &quot;actions/users.php&quot;;\n}\n\nif (file_exists(&quot;actions/$page.php&quot;))\n{\n include (&quot;actions/$page.php&quot;);\n}\nelse\n{\n include (&quot;actions/404.php&quot;);\n}\n?&gt; ```\n</code></pre>\n"^^ . + . + "webpack"^^ . + . + . + . + . + . + "google-speech-to-text-api"^^ . + "<p>I don't see all your config files, but you should check this:</p>\n<ol>\n<li>In <code>config/routes.yaml</code> you have to remove <code>api_login_check</code>. This route is not yours, you don't have to implement it</li>\n<li>Check if <code>api_login_check</code> exists in <code>config/routes/security.yaml</code>. Probably it is, but if no - just copy this part from your <code>config/routes.yaml</code></li>\n<li>Be sure your <code>login</code> firewall is the first one in the list. <strong>It's really important</strong>. Otherwise Symfony will try to find a custom controller to match api_login_check route.</li>\n<li>As @Justinas mentioned in his comment, check if LexikJWTAuthenticationBundle is actually enabled in <code>config/bundles.php</code>. There should be a line like</li>\n</ol>\n<pre><code>Lexik\\Bundle\\JWTAuthenticationBundle\\LexikJWTAuthenticationBundle::class =&gt; ['all' =&gt; true],\n</code></pre>\n"^^ . + . + "3"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + "what tells the error log?"^^ . + "<p>i'm working on a Laravel 11 and the PHP 8.2.12 project on Windows 11, using kreait/firebase-php to connect to Firestore. I have a strange issue where calling a specific route that interacts with Firestore causes the Laravel server to completely stop responding. However, all other routes work fine, including Firebase Realtime Database and Firebase Authentication.\nand im an owner in firestore</p>\n<p><strong>What Works</strong></p>\n<ul>\n<li>✅ Firebase Authentication works.</li>\n<li>✅ Firebase credentials file is accessible.</li>\n<li>✅ Other routes unrelated to Firestore work fine.</li>\n</ul>\n<p><strong>What Fails</strong></p>\n<ul>\n<li><p>❌ Calling Firestore (/test route) kills the server.</p>\n</li>\n<li><p>❌ No errors appear in laravel.log.</p>\n</li>\n<li><p>❌ The browser shows:</p>\n<blockquote>\n<p>127.0.0.1 refused to connect (ERR_CONNECTION_REFUSED)</p>\n</blockquote>\n</li>\n</ul>\n<p><strong>Route Definitions (web.php)</strong></p>\n<pre><code>&lt;?php\n\nuse Illuminate\\Support\\Facades\\Route;\nuse App\\Http\\Controllers\\FirebaseController;\nuse Kreait\\Firebase\\Factory;\n\nRoute::get('/', function () {\n return view('welcome');\n});\n\n// Works fine\nRoute::get('/index', [FirebaseController::class, 'index']);\n\n// This route causes the issue\nRoute::get('/test', function () {\n try {\n $firebase = (new Factory)-&gt;withServiceAccount(base_path(env('FIREBASE_CREDENTIALS')));\n $db = $firebase-&gt;createFirestore()-&gt;database();\n $collection = $db-&gt;collection('Volunteers');\n $documents = $collection-&gt;documents();\n\n if ($documents-&gt;isEmpty()) {\n return 'No documents found';\n }\n\n foreach ($documents as $document) {\n print_r($document-&gt;data());\n }\n } catch (\\Exception $e) {\n return 'Error: ' . $e-&gt;getMessage();\n }\n});\n\n// Checks if Firebase credentials file is accessible (Works fine)\nRoute::get('/check-firebase-key', function () {\n $path = base_path('storage/firebase/firebase_credentials.json');\n\n if (!file_exists($path)) {\n return response()-&gt;json(['error' =&gt; 'Firebase credentials file not found!'], 404);\n }\n\n $content = json_decode(file_get_contents($path), true);\n return response()-&gt;json($content);\n});\n\n// Checks Firebase Authentication (Works fine)\nRoute::get('/test-firebase-auth', function () {\n $path = base_path('storage/firebase/firebase_credentials.json');\n\n if (!file_exists($path)) {\n return response()-&gt;json(['error' =&gt; 'Firebase credentials file not found!'], 404);\n }\n\n try {\n $factory = (new Factory())-&gt;withServiceAccount($path);\n $auth = $factory-&gt;createAuth();\n return response()-&gt;json(['message' =&gt; 'Firebase Authentication is working!']);\n } catch (AuthException | FirebaseException $e) {\n return response()-&gt;json(['error' =&gt; $e-&gt;getMessage()], 500);\n }\n});\n\n</code></pre>\n<p>Checked the .env file path\nTried using the full absolute path:</p>\n<pre><code>FIREBASE_CREDENTIALS=C:\\Users\\asus-pc\\newPro\\backend\\storage\\firebase\\firebase_credentials.json\n</code></pre>\n<p>The issue still persists.</p>\n<p>Used base_path() with withServiceAccount()\n<code>$firebase = (new Factory)-&gt;withServiceAccount(base_path(env('FIREBASE_CREDENTIALS')));</code>\nNo success.</p>\n<p>Verified File Permissions\nEnsured that the firebase_credentials.json file is readable and has the correct permissions.</p>\n<p>Cleared Laravel Cache and Restarted Server:</p>\n<pre><code>php artisan config:clear\nphp artisan cache:clear\nphp artisan serve\n</code></pre>\n<p>Did not solve the issue.</p>\n<p>Confirmed kreait/firebase-php Installation:</p>\n<pre><code>composer require kreait/firebase-php\ncomposer update kreait/firebase-php\n</code></pre>\n<p>Everything is up to date.\nChecked if PHP has grpc enabled (required for Firebase Firestore) and grpc is enabled.</p>\n<p>Core Issue:\nWhen accessing the /test route, the Laravel server stops responding completely.\nAll other routes work fine.\nIt seems like Laravel cannot correctly read the firebase_credentials.json file, but it also crashes the entire server instead of just throwing an error.\nWhat could be causing this issue, and how can I fix it?</p>\n"^^ . + "lint"^^ . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + "3"^^ . + . + . + . + "<p>You can check and see if the date was posted and if it was use that date instead of the default. Check the $_POST variable for the value</p>\n<pre><code> &lt;form autocomplete=&quot;off&quot; class=&quot;form-inline&quot; method=&quot;POST&quot; action=&quot;&quot;&gt;\n &lt;?php\n if (isset($_POST['date1'] &amp;&amp; isset($_POST['date2']){\n $firstday = $_POST['date1']; \n $lastday = $_POST['date2']; \n }\n else{\n $firstday = date('Y-m-01');\n $lastday = date('Y-m-t');\n }\n ?&gt;\n &lt;label&gt;Date:&lt;/label&gt;\n &lt;input type=&quot;date&quot; id=&quot;myDate1&quot; name=&quot;date1&quot; value=&quot;&lt;?php echo $firstday;?&gt;&quot;&gt;\n &lt;label&gt;To&lt;/label&gt;\n &lt;input type=&quot;date&quot; id=&quot;myDate2&quot; name=&quot;date2&quot; value=&quot;&lt;?php echo $lastday;?&gt;&quot;&gt;\n &lt;button class=&quot;btn btn-primary&quot; name=&quot;search&quot;&gt;&lt;span class=&quot;glyphicon glyphicon-search&quot;&gt;&lt;/span&gt;&lt;/button&gt;\n</code></pre>\n"^^ . + . + "I didn't get that to work during testing, because the loader and all controllers defined in it have to be available when the cache is built."^^ . + "Please keep in mind that you should **never** run `composer update` on your production system!"^^ . + . + . + "<p>WooCommerce uses the <a href="https://github.com/woocommerce/woocommerce/blob/release/9.7/plugins/woocommerce/includes/wc-core-functions.php#L675-L856" rel="nofollow noreferrer">function <code>get_woocommerce_currency_symbol()</code></a> to get the current currency symbol, so you can use <code>woocommerce_currency_symbol</code> filter hook to change the currency symbol for &quot;SAR&quot; currency.</p>\n<p>Also, WooCommerce uses the <a href="https://github.com/woocommerce/woocommerce/blob/release/9.7/plugins/woocommerce/includes/wc-formatting-functions.php#L542-L630" rel="nofollow noreferrer">function <code>wc_price()</code></a> to format all displayed prices. Then you can use <code>wc_price</code> available filter hook to make changes to the price HTML output.</p>\n<p>Try to replace your current related code with:</p>\n<pre><code>// Alter WooCommerce currency symbol for &quot;SAR&quot; currency\nadd_filter( 'woocommerce_currency_symbol', 'sar_currency_symbol', 20, 2 );\nfunction sar_currency_symbol( $currency_symbol, $currency ) {\n // NOT in Admin WooCommerce general settings\n if ( is_admin() &amp;&amp; isset($_GET['page']) &amp;&amp; 'wc-settings' === $_GET['page'] \n &amp;&amp; isset($_GET['tab']) &amp;&amp; 'general' === $_GET['tab'] ) {\n return $currency_symbol;\n }\n\n $sar_src = get_option('sar_svg_png_url');\n\n if ( $currency === 'SAR' &amp;&amp; $sar_src ) {\n return sprintf('&lt;img src=&quot;%s&quot; alt=&quot;SAR Symbol&quot; style=&quot;display:inline-block; width:20px; height:auto; vertical-align:middle;&quot;&gt;', \n esc_url( $sar_src ) ); \n }\n return $currency_symbol;\n}\n\n// Alter WooCommerce price HTML output for &quot;SAR&quot; currency (optional)\nadd_filter( 'wc_price', 'sar_currency_symbol_price_html', 20, 3 );\nfunction sar_currency_symbol_price_html( $price_html, $price, $args ) {\n $sar_src = get_option('sar_svg_png_url');\n\n if ( $args['currency'] === 'SAR' &amp;&amp; $sar_src ) {\n // Replace WC default currency html &quot;class&quot; attribute for &quot;SAR&quot; currency\n $price_html = str_replace('woocommerce-Price-currencySymbol', 'sar-svg-symbol', $price_html); \n }\n return $price_html;\n}\n</code></pre>\n<p>It will handle the correct currency symbol HTML output everywhere for &quot;SAR&quot; currency.</p>\n<p>For example, in cart:</p>\n<p><a href="https://i.sstatic.net/bZ86SQxU.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bZ86SQxU.png" alt="Cart page" /></a></p>\n"^^ . + . + "How Delphi TLbRijndael (generalization of AES) compares to PHP openssl_encrypt(...) and is it possible to achieve equal results between them?"^^ . + . + . + "Password_verify from PHP always return false"^^ . + . + "1"^^ . + "0"^^ . + . + "<p>There is a working example of a javascript script that loads content when scrolling. Everything works, but inside foreach, modal windows don't open and scripts don't work at all. I would really appreciate your help.</p>\n<pre><code>&lt;script&gt;\n const citiesContainer = document.getElementById('cities');\n const btnLoad = document.getElementById('load');\n const loader = document.querySelector('.loader');\n let page = 1;\n let lock = false;\n\n async function getCities() {\n const res = await fetch(`index.php?page=${page}`);\n return res.text();\n }\n\n // getCities();\n async function showCities() {\n const cities = await getCities();\n if (cities) {\n citiesContainer.insertAdjacentHTML('beforeend', cities);\n lock = false;\n } else {\n btnLoad.classList.add('d-none');\n lock = true;\n }\n }\n\n loader.classList.add('show');\n setTimeout(() =&gt; {\n showCities();\n loader.classList.remove('show');\n }, 1000);\n\n btnLoad.addEventListener('click', () =&gt; {\n loader.classList.add('show');\n setTimeout(() =&gt; {\n page++;\n showCities();\n loader.classList.remove('show');\n }, 1000);\n });\n\n window.addEventListener('scroll2', () =&gt; {\n const {scrollTop, scrollHeight, clientHeight} = document.documentElement;\n // console.log(scrollTop, scrollHeight, clientHeight);\n if (scrollTop + clientHeight &gt;= scrollHeight) {\n if (false === lock) {\n lock = true;\n loader.classList.add('show');\n setTimeout(() =&gt; {\n page++;\n showCities();\n loader.classList.remove('show');\n }, 1000);\n }\n }\n });\n\n\n // МОДАЛЬНОЕ ОКНО //\n\ndocument.addEventListener('DOMContentLoaded', () =&gt; {\n const mOpen = document.querySelectorAll('[data-modal]');\n if (mOpen.length == 0) return; // если нет элементов управления всплывающими окнами, прекращаем работу скрипта\n\n const overlay = document.querySelector('.modal__overlay'),\n modals = document.querySelectorAll('.modal__body'),\n mClose = document.querySelectorAll('[data-close]');\n\n for (let el of mOpen) {\n el.addEventListener('click', modalShow); // регистрируются обработчик события открытия модального окна\n }\n for (let el of mClose) {\n el.addEventListener('click', modalClose); // регистрируются обработчик события нажатия на крестик\n }\n\n document.addEventListener('keydown', modalClose); // регистрируются обработчик события нажатия на клавишу\n\n function modalShow(modal) {\n let modalId = this.dataset.modal;\n document.getElementById(modalId).classList.add('open');\n overlay.classList.add('open');\n }\n\n function modalClose(event) {\n if ( event.type != 'keydown' || event.keyCode === 27 ) {\n for (let modal of modals) {\n modal.classList.remove('open');\n overlay.classList.remove('open');\n }\n }\n }\n \n})\n\n // -- //\n\n&lt;/script&gt;\n&lt;style&gt;\n.loader {display: none;}\n.loader img {width: 100px;}\n.show {display: block;}\n\n.modal__body {\n position: fixed; top: 0; left: 50%; margin: 8px 0; max-height: 95%; width: 95%; max-width: 500px;\n opacity: 0; visibility: hidden; z-index: 5; background: #F4F5F5;\n -webkit-transition: 0.3s all; -moz-transition: 0.3s all; -o-transition: 0.3s all; -ms-transition: 0.3s all; transition: 0.3s all;\n -webkit-transform: translate(-50%, -100%); -moz-transform: translate(-50%, -100%); -ms-transform: translate(-50%, -100%); transform: translate(-50%, -100%);\n}\n\n&lt;/style&gt;\n&lt;?php\nfunction get_start(int $page, int $per_page): int {\n return ($page - 1) * $per_page;\n}\n\nfunction get_cities(int $start, int $per_page): array {\n global $db;\n $stmt = $db-&gt;prepare(&quot;SELECT * FROM city LIMIT $start, $per_page&quot;);\n $stmt-&gt;execute();\n return $stmt-&gt;fetchAll();\n}\n\n\n\nif (isset($_GET['page'])) {\n $page = (int)$_GET['page'];\n $per_page = 200;\n $start = get_start($page, $per_page);\n $cities = get_cities($start, $per_page);\n $html = '';\n if ($cities) {\n foreach ($cities as $city) {\n $html .= &quot;\n &lt;li&gt;\n {$city['name']}: {$city['population']} \n &lt;a href='javascript:void(0)' data-modal='com-delete_{$city['id']}'&gt;Удалить&lt;/a&gt;\n &lt;/li&gt; \n\n &lt;!-- Модальное окно --&gt;\n &lt;div class='modal__body' id='com-delete_{$city['id']}'&gt;\n &lt;div class='modal__content'&gt;\n &lt;a href='/comments/control/action/delete/id/565' class='button'&gt;Удалить&lt;/a&gt;\n &lt;a href='javascript:void(0)' class='button' data-close=''&gt;Отмена&lt;/a&gt;\n &lt;/div&gt;\n &lt;/div&gt;&quot;;\n }\n }\n echo $html;\n die;\n}\n?&gt;\n\n\n&lt;ul id=&quot;cities&quot;&gt;&lt;/ul&gt;\n\n&lt;div class=&quot;loader&quot;&gt;\n &lt;img src=&quot;ripple.svg&quot; alt=&quot;&quot;&gt;\n&lt;/div&gt;\n&lt;button class=&quot;btn btn-primary&quot; id=&quot;load&quot;&gt;Load more&lt;/button&gt;\n\n&lt;footer style=&quot;background-color: #000; height: 200px; padding: 0;&quot;&gt;&lt;/footer&gt;\n\n</code></pre>\n<p>There is a working example of a javascript script that loads content when scrolling. Everything works, but inside foreach, modal windows don't open and scripts don't work at all. I would really appreciate your help.</p>\n"^^ . + . + "Unless you've changed your code substantially, your `while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { ?>` loop contains an entire HTML document - it'll create a whole new page every time. Make the loop only contain the things you actually want to repeat (in this case, just the option tags). Everything else should be before/after the loop, as needed."^^ . + . + "@user2531657: Go in with a step debugger. You want insights, you have the running code, so you get insights. We can't run xdebug as good as you can with your existing setup and test script."^^ . + "mysql-workbench"^^ . + "1"^^ . + . + "@David - as per the code, if only 1 sec or less is remaining, then the if-else of writing to the db will get triggered, and entry will be made to the db (I guess that's what my pseud-code in the question indicates)"^^ . + "1"^^ . + . + . + . + "imagick"^^ . + . + "codeigniter"^^ . + "0"^^ . + "0"^^ . + . + . + "1"^^ . + "0"^^ . + "0"^^ . + . + "2"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + "<p><code>array1.*</code> validates the values of <em>array1</em> and indeed not the keys.</p>\n<p>The idea you had to provide the keys upfront is not bad at all, as it would turn the keys into values and you then would be able to validate them with the standard rules:</p>\n<pre class="lang-php prettyprint-override"><code>$to_validate = $this-&gt;request-&gt;getPost();\n$to_validate['array1_keys'] = array_keys($to_validate['array1'] ?? []);\n...\n</code></pre>\n<p>Then it is possible to use <code>array1_keys.*</code> next to <code>array1.*</code>.</p>\n<p>I would start with that as you can find out how far you get with the standard rules.</p>\n<p>Furthermore if you would like to dig deeper towards custom rules, I'd suggest to look into <a href="https://codeigniter4.github.io/userguide/libraries/validation.html#rules-for-file-uploads" rel="nofollow noreferrer">rules for file uploads</a> as they refer to array fields. Their implementation (read the source code of them) should show how you can access array data including keys (IIRC). You can then experiment <a href="https://codeigniter4.github.io/userguide/libraries/validation.html#creating-custom-rules" rel="nofollow noreferrer">creating your own rules</a>.</p>\n"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + "You can always `break` out of a loop"^^ . + . + "1"^^ . + "0"^^ . + . + "You get the name and team for the home team. Just need 2 more tables for the away team."^^ . + . + "0"^^ . + . + . + "Besides the fact that I would never suggest to write such code by hand (there's a good reason to use a library for this): you're still using PHP 7.4? Please keep in mind that this version is horribly outdated!"^^ . + . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + "<p>The problem turned out to be not at all what I thought it was. I thought that the <code>npm</code> commands were running correctly but not waiting for completion. It turned out they were &quot;quietly&quot; failing and the script continued on to completion, making it seem like everything was fine.</p>\n<p>The <code>npm</code> commands failed because I'm using <code>nvm</code> and although running the <code>bash</code> script manually worked fine, when run via <code>php</code> the path to the version of <code>npm</code> I was using was not being set (even when running under the same user account), so <code>npm</code> was not being found.</p>\n<p>The fix turned out to be adding a command at the top of the script to run <code>nvm</code>'s initialization script that lived in my user's home account. That set the <code>npm</code> path and allowed those commands to succeed.</p>\n<pre><code>source /home/ubuntu/.nvm/nvm.sh\n</code></pre>\n<p>I realized this because user @EdMorton pointed out that my <code>php</code> script was not redirecting <code>stderr</code> to <code>stdout</code>, therefore any errors would be unknown to me. I updated the command to redirect <code>stderr</code> to <code>stdout</code> via <code> 2&gt;&amp;1</code> at the end, so it became:</p>\n<pre><code>$commandOutput = shell_exec(&quot;/bin/bash ./sync.sh --repo=&quot; . $hook[&quot;repo&quot;] . &quot; --branch=&quot; . $hook[&quot;branch&quot;] . &quot; --subdomain=&quot; . $subdomain . &quot; 2&gt;&amp;1&quot;);\n</code></pre>\n<p>That <code>$commandOutput</code> was being logged to the database, so when I checked the output I saw that the <code>npm</code> commands in the bash script were giving errors saying that the npm command was not found, which led me to the fix above.</p>\n"^^ . + . + . + . + "0"^^ . + . + . + . + "<p>I have an email or blog post containing HTML with inline elements like &lt;span&gt;, &lt;p&gt;, &lt;strong&gt; and custom attributes. Right now I send the entire HTML directly to OpenAI’s API translation and get a translated response. However, when the content is too big (token limit) I don't know what to do.</p>\n<p>Example Input:</p>\n<pre><code>&lt;p&gt;&lt;strong data-info=&quot;important&quot;&gt;Welcome&lt;/strong&gt; to our &lt;span class=&quot;highlight&quot;&gt;new platform&lt;/span&gt;. \nConsult &lt;a href=&quot;https://example.com&quot;&gt;terms and conditions&lt;/a&gt; for more details.&lt;/p&gt;\n</code></pre>\n<p>How can I efficiently split large HTML content into smaller chunks for multiple OpenAI API requests without breaking the structure?</p>\n<p>I have tried sending only the extracted text without HTML to OpenAI API for translation, but it is not reliable and better to send whole content without any change.</p>\n"^^ . + . + . + . + . + . + "-2"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + "First thing that catches the eye: `(...)` creates a capturing group; if you want the brackets to be meant _literally_, you need to escape them. And for further testing, might I recommend https://regex101.com"^^ . + . + . + . + . + . + "3"^^ . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + "<p>I am new to Keycloak, but I have set up a Keycloak server, the installation, configuration, and access to my web application.</p>\n<p>Authentication goes through a custom SPI for read-only access to a database managed by our web application.\nNo proxy, just a web app using ExtJS and PHP on Apache2 with mod_auth_openid.</p>\n<p>The problem — something I didn't think would be this complicated to me — is understanding what a logout is and how to do it with Keycloak.</p>\n<p>Despite, I've already read some of the documentation and examples on the subject, a lot of them are new to me, I feel like I've tried everything, and I still don't understand the expected behavior.</p>\n<p>I was deleting/clearing cookies, but it does not seem to be working with the Keycloak cookies (both in JS and PHP).</p>\n<pre><code>document.cookie.split(&quot;;&quot;).forEach(cookie =&gt; {\n document.cookie = cookie.replace(/^ +/, &quot;&quot;)\n .replace(/=.*/, \n &quot;=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/&quot;);\n});\n</code></pre>\n<pre><code>foreach($_COOKIE as $name =&gt; $value) {\n setcookie($name, '', time()-3600, '/');\n}\nheader(&quot;Location: /&quot;);\n</code></pre>\n<p>I'm looking forward to work with the logout URI :\n&quot;https://1.1.1.1/realms/dev/protocol/openid-connect/logout&quot;</p>\n<p>I saw some example with what it seems to be a depreciated method to me, /auth/.</p>\n<p>Whether I call it via POST or GET, manually through my browser or in my PHP, with or without parameters, it does not log the user out.</p>\n<p>Here is the PHP code I am using to try the logout part:</p>\n<pre><code>\n$realm = &quot;dev&quot;;\n$keycloak_base_url = &quot;https://1.1.1.1:8443&quot;;\n$redirect_uri = &quot;https://1.1.1.1/app/&quot;;\n$client_id = &quot;mySuperclient&quot;;\n$client_secret = &quot;mySuperSecret&quot;;\n\n\n$refresh_token = $_SERVER['OIDC_refresh_token'];\n$access_token = $_SERVER['OIDC_access_token'];\n$logout_url = &quot;$keycloak_base_url/realms/$realm/protocol/openid-connect/logout&quot;;\n\n$data = [\n 'client_id' =&gt; $client_id,\n 'refresh_token' =&gt; $refresh_token,\n];\n\n$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, $logout_url);\ncurl_setopt($ch, CURLOPT_POST, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\ncurl_setopt($ch, CURLOPT_HEADER, true);\ncurl_setopt($ch, CURLOPT_VERBOSE, true);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\n$response = curl_exec($ch);\n$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n$curl_error = curl_error($ch);\ncurl_close($ch);\n\nif ($http_code === 204) {\n echo &quot;Successful! Redirecting...&quot;;\n header(&quot;Location: /app/&quot;); \n exit();\n} else {\n echo &quot;Failed! HTTP Code: $http_code &lt;br&gt;&quot;;\n echo &quot;&lt;pre&gt;&quot; . htmlspecialchars($response) . &quot;&lt;/pre&gt;&lt;br&gt;&quot;;\n}\n</code></pre>\n<p>OS : Debian 12.9\nPHP version: 8.2.26\nKeycloak : 26.1.0 (bare metal install)\nmod-auth-openidc :2.4.12.3</p>\n<p>I don't really know, but everything seems to be good, the client, scopes and redirect uris works, all that remains is the logout part...</p>\n<p>EDIT1: The use of</p>\n<pre><code>header (&quot;Location: $logout_url&quot;);\n</code></pre>\n<p>redirects me to a Keycloak logout confirmation page. Even with a manual validation, I still can access my web app without login.</p>\n<p>I think I have to add some data to that logout redirect, but can't figure out what is necessary.</p>\n"^^ . + "0"^^ . + "<p>The Body size limit exceeded error when running <code>php bin/console importmap:install</code> in Symfony typically occurs because Symfony’s HTTP client enforces a default <strong>10MB response body limit</strong>. This limit affects the Importmap system when downloading large JavaScript packages like FilePond.</p>\n<p>There are two possible solutions: configure this limit and using CDN</p>\n<h2>Configure limit</h2>\n<p>Symfony allows customization of the HTTP client used by the Importmap system. You can override the client and remove the body size restriction safely.</p>\n<p><strong>1. In your config/services.yaml, add the following:</strong></p>\n<pre><code>services:\n Symfony\\Component\\AssetMapper\\ImportMap\\HttpClient\\PackageDownloader:\n arguments:\n $client: '@importmap.http_client'\n\n importmap.http_client:\n class: Symfony\\Contracts\\HttpClient\\HttpClientInterface\n factory: ['Symfony\\Component\\HttpClient\\HttpClient', 'create']\n arguments:\n -\n max_body_length: 0 # 0 means no limit\n</code></pre>\n<p><strong>2. Then clear the cache and reinstall the packages:</strong></p>\n<pre><code>php bin/console cache:clear\nphp bin/console importmap:install\n</code></pre>\n<p>Setting max_body_length: 0 disables the body size limit <strong>only for the Importmap-related HTTP client</strong>, not for the rest of your application (unless you’ve globally overridden the default HTTP client).</p>\n<h2><strong>CDN</strong></h2>\n<p>If you’d rather load FilePond directly from a CDN without downloading it locally, you can run:</p>\n<pre><code>php bin/console importmap:require filepond --path=https://unpkg.com/filepond@^4/dist/filepond.js\n</code></pre>\n<p>This will register the script in your importmap.php, but it will <strong>not</strong> download it to your local project — it will be loaded from the CDN at runtime.</p>\n"^^ . + "1"^^ . + "<p>It isn't mentioned in the <a href="https://www.php.net/manual/en/language.operators.precedence.php" rel="nofollow noreferrer">Operator Precedence</a> documentation but <code>::</code> seems to have lower precedence than function parenthesis. This should work:</p>\n<pre><code>(self::$myCallable)('this also works');\n</code></pre>\n<p>Full example:</p>\n<pre><code>class Foo\n{\n public static function bar(string $label): void\n {\n echo &quot;Callable called: $label\\n&quot;;\n }\n}\n\nclass MyClass\n{\n private static string $myCallable;\n\n public function myFunc(): void\n {\n static::$myCallable = \\Foo::class . '::bar';\n (self::$myCallable)('this also works');\n }\n}\n\n$myCallable = \\Foo::class . '::bar';\n$myCallable('calling this works!');\n\n(new MyClass)-&gt;myFunc();\n</code></pre>\n<p><a href="https://3v4l.org/2OP8C" rel="nofollow noreferrer">Demo</a></p>\n"^^ . + . + "<p>I am working on a Laravel-based e-commerce website and storing product images in storage/products/. The images load fine on my local development server, but on the live server, I get a 403 Forbidden error when trying to access them.</p>\n<p>Issue:\nWhen I try to load an image directly in the browser:</p>\n<p><a href="https://www.ruparoggo.com/storage/products/VYPEHJ68d7MLQwDALBauxIqIplFoZOmdHFkeCIUn.jpg" rel="nofollow noreferrer">https://www.ruparoggo.com/storage/products/VYPEHJ68d7MLQwDALBauxIqIplFoZOmdHFkeCIUn.jpg</a></p>\n<p>I receive the following error:</p>\n<p>GET <a href="https://www.ruparoggo.com/storage/products/VYPEHJ68d7MLQwDALBauxIqIplFoZOmdHFkeCIUn.jpg" rel="nofollow noreferrer">https://www.ruparoggo.com/storage/products/VYPEHJ68d7MLQwDALBauxIqIplFoZOmdHFkeCIUn.jpg</a>\nStatus: 403 Forbidden\nReferrer Policy: strict-origin-when-cross-origin\nHowever, on my local environment, everything works fine.</p>\n<p>I ran the following commands on my server to ensure storage is accessible:</p>\n<p>chmod -R 775 storage\nchmod -R 775 storage/products\nchmod -R 775 storage/app/public\nchown -R www-data:www-data storage\nI ran:\nphp artisan storage:link</p>\n<p>and also modified the .htaccess</p>\n\n RewriteEngine On\n<pre><code># Handle Authorization Header\nRewriteCond %{HTTP:Authorization} .\nRewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]\n\n# Redirect Trailing Slashes If Not A Folder...\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteCond %{REQUEST_URI} (.+)/$\nRewriteRule ^ %1 [L,R=301]\n\n# Send Requests To Front Controller...\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteRule ^ index.php [L]\n\n# Allow access to storage directory\nRewriteRule ^storage/(.*)$ /rup/storage/app/public/$1 [L]\n</code></pre>\n\n"^^ . + "0"^^ . + . + "laravel-authentication"^^ . + . + "0"^^ . + "1"^^ . + "0"^^ . + "3"^^ . + "0"^^ . + . + . + "https://php.watch/versions/8.2/dynamic-properties-deprecated, and the duplicate, could easily have been found by researching the phrasing of the error message."^^ . + . + "0"^^ . + . + "1"^^ . + . + "1"^^ . + . + . + . + "_"The testers mention that they were able to successfully upload"_...I think that's a generous interpretation of the wording given in the question. All we actually know for sure is that the testers reported that the endpoint returned a "200 OK" in that scenario. It doesn't prove that anything else happened. The OP didn't mention that this actually caused a succesful file upload, and hasn't provided any code which would process a reuqest with the structure the testers provided and actually save the file that was sent. I think this point needs clarifying before an answer can be given"^^ . + . + "0"^^ . + . + "The linked Q&A says that PDT 8.2 is outdated for current PhpUnit. Have you verified that? Have you contacted the vendor of that software which PhpUnit versions are supported?"^^ . + . + . + . + "0"^^ . + . + . + . + . + "I would like a standard function! The images I posted are more to show the function names! I didn't code anything more than the model class and a line where to put the future function."^^ . + "0"^^ . + "<p>Forgive my ignorance but I've not played around with PHP's garbage collection before. Specifically, I'm running a CakePHP 5.x Command Script and running into memory exhausted issues.</p>\n<p>As a test to see how I can clear some memory, I'm trying to run gc_collect_cycles(); on this part of the code:</p>\n<pre><code>$connection = ConnectionManager::get('default');\n $this-&gt;logMessage('Memory usage before query: ' . memory_get_usage(true) / 1024 / 1024 . 'MB');\n $studentList = $connection-&gt;execute(&quot;SELECT DISTINCT\n stu.STU_ID AS person_id\n FROM SMS.S1STU_DET AS stu\n LEFT JOIN Pulse.$studentsTableName AS students\n ON students.person_id = stu.STU_ID\n LEFT JOIN Pulse.$coursesTableName AS courses\n ON courses.person_id = stu.STU_ID\n LEFT JOIN Pulse.$unitsTableName AS units\n ON units.person_id = stu.STU_ID\n LEFT JOIN Pulse.$rawCasesTableName AS cases\n ON cases.person_id = stu.STU_ID\n WHERE 1 = 1\n AND (\n students.person_id IS NOT NULL\n OR\n courses.person_id IS NOT NULL\n OR\n units.person_id IS NOT NULL\n OR\n cases.person_id IS NOT NULL\n )\n &quot;)-&gt;fetchAll('assoc');\n\n $this-&gt;logMessage('Memory usage after query: ' . memory_get_usage(true) / 1024 / 1024 . 'MB');\n\n unset($studentList);\n gc_collect_cycles();\n\n $this-&gt;logMessage('Memory usage after garbage collection: ' . memory_get_usage(true) / 1024 / 1024 . 'MB');\n exit();\n</code></pre>\n<p>And this is the output I get:</p>\n<pre><code>2025-02-23 11:32:54 - Memory usage before query: 8MB\n2025-02-23 11:32:57 - Memory usage after query: 48MB\n2025-02-23 11:32:57 - Memory usage after garbage collection: 44MB\n</code></pre>\n<p>As you can see gc_collect_cycles() didn't find anything to clean up (it drops to 44MB regardless if I run gc_collect_cycles() or not. So I'm obviously not understanding and/or using this correctly. Is there anyway I can free up memory to get close to the starting 8MB again?</p>\n"^^ . + . + "@OlgaS i searched everywhere and i cant find the Appearance tab in Google Search Console can u tell me where i can find it?"^^ . + "-1"^^ . + "1"^^ . + . + . + . + "How to send an array from a text field of HTML form and sum its values?"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "In this case don't miss to remember them how this rule is stupid."^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + "Old avatar not deleted when uploading a new one"^^ . + "0"^^ . + . + . + "<p>The official <a href="https://docs.akeneo.com/latest/install_pim/docker/installation_docker.html" rel="nofollow noreferrer">documentation</a> of Akeneo's Docker installation is stating that you should be able to run a PHP daemon with the following command:</p>\n<p>$ APP_ENV=dev make start-job-worker</p>\n<p>I tried this command from the container and I got this issue:</p>\n<pre><code>Command &quot;akeneo:batch:job-queue-consumer-daemon&quot; is not defined. \n \n</code></pre>\n<p>Can anyone point me how can I start the job processing daemon, please?</p>\n"^^ . + . + . + "PHP is not as slow as R, so don't be afraid of using explicit loops (although in this case `array_column()` should be faster)."^^ . + . + . + "whole point of the middleware is for you to not have to set the locale for each route. when the user wants to change locale you should make a post request to some controller that updates the session locale for that user"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + "I think you should [edit] your question and provide the code how you _did_ it in the last previous version when it worked for you. Otherwise it's hard to guess (at least for me), what exactly you're asking about."^^ . + "0"^^ . + . + . + . + "types"^^ . + . + . + . + . + . + . + . + "2"^^ . + "@deceze Okay, but the "duplicate" question does not tell me that, so it is not a duplicate. Please reopen."^^ . + "Can you please try and explain what you are eventually trying to _achieve_? That might have a better chance of being answerable, than a "is it possible" question that lacks any sort of context."^^ . + . + . + . + . + "1"^^ . + "scheduled-tasks"^^ . + "According to the documentation you should be using `https://api.deepl.com/v2/glossaries` as the API-endpoint, not `https://api.deepl.com/v2/translate`"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + "You'll have to see what user agent string it does send, and see if there's anything else in there which is unique enough for you to be sure which type of browser it is (or claims to be - remember UA strings are easily spoofable). And probably... don't build your own user agent sniffer, there's gonna be a library out there somewhere which is better at it than you or I are, and gets its listings maintained regularly."^^ . + . + "@krisgjika i make sure by the run php file with local host contain the phpinfo() correct if yes i done that and i saw that the changes took place so i really dont know what to do"^^ . + . + "<p>I have an html page which displays a table of pdf files uploaded with columns saying who uploaded it, when it was uploaded, the size etc, plus a thumbnail of the first page of the pdf file. If you want to edit these files you can click on the row of the file you want to edit. This brings you to a second page where the file_id is sent with $_GET and there the complete PDF file needs to be loaded so it can be read in an iframe tag. This works for files smaller than 2MB.</p>\n<p>I cannot load bigger files because the encode64 is limited in length so I did some research which says you should create an objectURL for the files to display them. I don't know javascript that well but it seems the only way to do it.</p>\n<p>The part in the html which displays the file is the following :</p>\n<pre><code>&lt;?php \n $fileObj = new DatabaseConn();\n $fileId = $_GET[&quot;file_id&quot;];\n $fileArray = $fileObj-&gt;selectFile($fileId);\n?&gt;\n&lt;iframe id=&quot;image-preview&quot; src=&quot;&quot; height=&quot;500px&quot; width=&quot;500px&quot;&gt;&lt;/iframe&gt; \n</code></pre>\n<p>I open the database connection and pass the file_id to the select statement which fills up the fileArray with the data attributes of the file containing also the file as a string.</p>\n<p>In the javascript I have</p>\n<pre><code>&lt;script&gt;\n const imageFile = &quot;&lt;?= $fileArray['file_content'] ?&gt;&quot;;\n const imagePreview = document.getElementById(&quot;image-preview&quot;);\n const imageUrl = URL.createObjectURL(imageFile);\n imagePreview.src = imageUrl;\n&lt;/script&gt;\n</code></pre>\n<p>There is no button the second page should open up displaying the file straight away.\nThis doesn't work and just shows an empty iframe because I believe I'm feeding a string into the createOjectURL and it should be a blob so I would need to convert the file to a blob.</p>\n<p>My question is, is this the right and only way to display a large pdf file stored in a mysql database or is there another more elegant way? It seems such a clunky solution.</p>\n"^^ . + . + "<p>The solution was quite unexpected; apparently, there was something going on with apache. I solved by doing the following steps:</p>\n<ul>\n<li>Stop apache (sudo /etc/init.d/apache2 stop on linux);</li>\n<li>Clear the views cache (php artisan view:clear);</li>\n<li>Start the application with php artisan serve and open it in the browser;</li>\n<li>Stop php artisan serve;</li>\n<li>Restart apache (sudo /etc/init.d/apache2 start).</li>\n</ul>\n<p>Now everything seems to work. Don't ask me why...</p>\n"^^ . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + "podscms"^^ . + "0"^^ . + . + "1"^^ . + "It's sql injection-proof simply because no variables are introduced to the sql string, yes. It's not XSS-proof though. And logging in as root to the DB from an application is an unnecessary security risk. So those are some things you can point out for bonus points."^^ . + . + . + . + "https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions"^^ . + "0"^^ . + "0"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + . + "More like a Natural Language Processing library."^^ . + "I think I misunderstood the question. If this is a `mailto` hyperlink, then here's [my test](https://codepen.io/Chris-Haas-the-builder/pen/XJWzdWm) that is working for me. Your mail client might not honor this, and I wouldn't rely on this in the wild. If this is server-side, that's totally different. Please clarify if this is server-wide with PHP, or client-side with HTML. If you are generating the HTML with PHP, that's really just the second case still."^^ . + . + . + . + . + . + "just copy the line and paste the output"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "It sounds like you're saying that it is my code that is converting it from a special character to an html entity? But I'm not doing any such thing that I'm aware of. I'm just taking the $_POST value and sticking it in the database and it gets stored as & #128512;"^^ . + . + . + "Conceptually they're equivalent. But making a copy of the array would be an inefficient way compared to just using another pointer."^^ . + "1"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + "2"^^ . + "3"^^ . + . + . + "This question is similar to: [How to get body of a JSON POST in PHP?](https://stackoverflow.com/questions/8945879/how-to-get-body-of-a-json-post-in-php). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem."^^ . + "How to verify and prevent unintended changes when modifying specific parts of an HTML document using PHP DOMDocument?"^^ . + "0"^^ . + "Why does it need to be "in Laravel" to begin with? SSP IdP runs as a standalone webapp."^^ . + . + . + . + . + . + "mariadb-10.4"^^ . + "Maybe an easy way to understand this is: $GLOBALS _is_ a superglobal."^^ . + "1"^^ . + . + . + "pods-framework"^^ . + "I made some update to the question."^^ . + . + . + . + . + "0"^^ . + "2"^^ . + . + "<p>I'm having real issues trying to pass variables into my docker container to dynamically update my xdebug.ini file;</p>\n<p>I have the following simple <code>docker-compose.yml</code></p>\n<pre><code>services:\n php:\n container_name: php\n build:\n context: .\n command: [&quot;/usr/local/sbin/php-fpm&quot;, &quot;-F&quot;, &quot;-R&quot;]\n expose:\n - &quot;9003&quot;\n env_file:\n - .env\n</code></pre>\n<p>My <code>Dockerfile</code> is basic</p>\n<pre><code>FROM propietary-image-here-custom-8.3-fpm\n\nRUN apt-get update\n\nRUN pecl install xdebug &amp;&amp; docker-php-ext-enable xdebug.so\nCOPY ./xdebug.ini /usr/local/etc/php/conf.d/\n\nCMD [&quot;/usr/local/sbin/php-fpm&quot;, &quot;-F&quot;, &quot;-R&quot;]\n</code></pre>\n<p>My <code>.env</code> is just one line;</p>\n<pre><code>XDEBUG_MODE=debug\n</code></pre>\n<p>and my <code>xdebug.ini</code> is as follows;</p>\n<pre><code>xdebug.mode=${XDEBUG_MODE}\n</code></pre>\n<p>I can boot it all up with <code>docker compose up -d</code> fine and if I run <code>docker compose config</code> i can see the variable.</p>\n<p>But when I enter into the container with <code>docker run -i -t php /bin/bash</code> and execute <code>env</code>, its not there, and its not working with the xdebug.ini.</p>\n"^^ . + . + "0"^^ . + . + "I have no idea, but decimal and numeric is the same, so you can just use $table->decimal('price', 19, 2) i guess?"^^ . + "<p>My rather long SQL query with UNION works perfectly in the phpMyAdmin console of the MySQL database, but when I put it exactly in my PHP script, it throws an error:</p>\n<p>Note: I put exactly the same QUERY hard coded in PHP without variables (with PDO), yet it throws the error and I can't figure out why.</p>\n<blockquote>\n<p>Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND lgst_apoid=1' at line 1</p>\n</blockquote>\n<p>Query:</p>\n<pre class="lang-sql prettyprint-override"><code>SELECT \navs.pzn as avspzn, avs.name as avsname, avs.langtext as langtext, avs.packung as packung, avs.einheit as einheit, avs.rz as rz, avs.zln as zln, shop.aktiv as aktiv, lgst.name as lname, lgst.ls as ls, lgst.pzn as lpzn, lgst.preis as lpreis, shop.name as shopname, avs.preis as avspreis, ghlieferbar.pzn_ghlieferbar as pzn_ghlieferbar \nFROM avs \nLEFT JOIN lgst ON lgst.pzn=avs.pzn \nLEFT JOIN shop ON shop.pzn=avs.pzn \nLEFT JOIN ghlieferbar ON avs.pzn=ghlieferbar.pzn_ghlieferbar\nWHERE langtext LIKE '%hafne%' AND lgst.lgst_apoid=1 \nUNION \nSELECT avs.pzn as avspzn, avs.name as avsname, avs.langtext as langtext, avs.packung as packung, avs.einheit as einheit, avs.rz as rz, avs.zln as zln, shop.aktiv as aktiv, lgst.name as lname, lgst.ls as ls, lgst.pzn as lpzn, lgst.preis as lpreis, shop.name as shopname, avs.preis as avspreis, ghlieferbar.pzn_ghlieferbar as pzn_ghlieferbar \nFROM avs \nRIGHT JOIN lgst ON lgst.pzn=avs.pzn \nLEFT JOIN shop ON shop.pzn=avs.pzn \nLEFT JOIN ghlieferbar ON avs.pzn=ghlieferbar.pzn_ghlieferbar \nWHERE lgst.name LIKE '%hafne%' AND lgst.lgst_apoid=1 \nORDER BY IFNULL(avsname,lname) ASC \nLIMIT 25 OFFSET 0\n</code></pre>\n"^^ . + . + "0"^^ . + "idp"^^ . + . + . + "0"^^ . + "@k0pernikus It depends exactly _how_ you've got multiple versions installed. Are you using an Ubuntu PPA? a Mac with Brew? manually compiling PHP yourself into different directories?"^^ . + "0"^^ . + . + . + "3"^^ . + . + . + . + . + . + . + "-1"^^ . + "ip-address"^^ . + . + . + . + . + "That's great to read! I'd suggest one more thing though: Please place it as an answer to your own question (encouraged!) instead of [edit]ing it into the question as it deserves to be an answer!. If in doubt please see [_Can I answer my own question?_ (Q&A Help)](https://stackoverflow.com/help/self-answer#:~:text=Yes!,to%20answer%20their%20own%20questions.)"^^ . + "5"^^ . + "0"^^ . + . + . + "dto"^^ . + "0"^^ . + . + "0"^^ . + . + "<p>Trying to figure out how to retrieve values from a JSON string, have tried AI engines and myself troubleshooting all values empty in &quot;$parsedJson-&gt;model&quot; and &quot;$parsedJson-&gt;message-&gt;content&quot;. Example non working code below. All help is appreciated.</p>\n<pre><code> &lt;?php \n\n $jsonString = '{&quot;model&quot;:&quot;deepseek-r1:1.5b&quot;,&quot;created_at&quot;:&quot;2025-03-04T17:25:10.105214863Z&quot;,&quot;message&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;1&quot;},&quot;done&quot;:false} {&quot;model&quot;:&quot;deepseek-r1:1.5b&quot;,&quot;created_at&quot;:&quot;2025-03-04T17:25:10.222843048Z&quot;,&quot;message&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;0&quot;},&quot;done&quot;:false} {&quot;model&quot;:&quot;deepseek-r1:1.5b&quot;,&quot;created_at&quot;:&quot;2025-03-04T17:25:10.339924267Z&quot;,&quot;message&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;-&quot;},&quot;done&quot;:false} {&quot;model&quot;:&quot;deepseek-r1:1.5b&quot;,&quot;created_at&quot;:&quot;2025-03-04T17:25:10.457593527Z&quot;,&quot;message&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;2&quot;},&quot;done&quot;:false} {&quot;model&quot;:&quot;deepseek-r1:1.5b&quot;,&quot;created_at&quot;:&quot;2025-03-04T17:25:10.574828786Z&quot;,&quot;message&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;0&quot;},&quot;done&quot;:false} {&quot;model&quot;:&quot;deepseek-r1:1.5b&quot;,&quot;created_at&quot;:&quot;2025-03-04T17:25:10.691704405Z&quot;,&quot;message&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot; minutes&quot;},&quot;done&quot;:false} {&quot;model&quot;:&quot;deepseek-r1:1.5b&quot;,&quot;created_at&quot;:&quot;2025-03-04T17:25:10.808646904Z&quot;,&quot;message&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot; before&quot;},&quot;done&quot;:false} {&quot;model&quot;:&quot;deepseek-r1:1.5b&quot;,&quot;created_at&quot;:&quot;2025-03-04T17:25:10.925968163Z&quot;,&quot;message&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot; serving&quot;},&quot;done&quot;:false}';\n\n // Split the string into individual JSON objects\n $jsonObjects = explode('} {', $jsonString);\n\n// Add the opening and closing braces back to each JSON object\n$jsonObjects = array_map(function($json) {\nreturn '{' . $json . '}';\n}, $jsonObjects);\n\n// Parse each JSON object\n$parsedObjects = [];\nforeach ($jsonObjects as $json) {\n\n$parsedJson = json_decode($json, true);\n\necho 'Model: ' . $parsedJson-&gt;model . &quot;&lt;/br&gt;&quot;;\necho 'Content: ' . $parsedJson-&gt;message-&gt;content . &quot;&lt;/br&gt;&quot;;\n\n}\n?&gt; \n</code></pre>\n"^^ . + "<p>This error:</p>\n<pre><code>Package 'libjpeg' not found\n\nConsider adjusting the PKG_CONFIG_PATH environment variable if you\ninstalled software in a non-standard prefix.\n</code></pre>\n<p>indicates that <a href="https://en.wikipedia.org/wiki/Pkg-config" rel="nofollow noreferrer">package\nconfig</a> for libjpeg is not\nfound. Since libjpeg was built manually and libjpeg.pc exists in\n/usr/local/lib/pkgconfig/libjpeg.pc which is not searched by default\non FreeBSD you have to set <code>PKG_CONFIG_PATH</code> manually using tcsh\nsyntax:</p>\n<pre><code>$ setenv PKG_CONFIG_PATH /usr/local/lib/pkgconfig\n</code></pre>\n<p>That should solve the problem with libjpeg at ./configure step but,\ndepending on how a <a href="https://en.wikipedia.org/wiki/Dynamic_linker" rel="nofollow noreferrer">dynamic\nlinker</a> on FreeBSD is\nworking it might be necessary to manually set <code>LD_LIBRARY_PATH</code> to run\nphp with /usr/local/lib/libjpeg.so.</p>\n"^^ . + "I'd have thought maybe it should fail validation and return perhaps a 400 error because the photo_1 field simply doesn't exist in the request - although your rule says it should be nullable, so perhaps that isn't a problem. And I'm not sure how they consider this behaviour to be "penetrable"? Did the application actually accept and save the file that the testers tried to upload? If it did, that could be an over-posting vulnerability (where the application accepts any posted field and processes it, rather than checking it contains the field names it expected) but you didn't mention that"^^ . + "0"^^ . + "2"^^ . + . + . + . + . + . + . + . + "If you want better/more answers, you should really debug the issue first. Figure out whether the backend or frontend is causing the issue. Then focus your question around the actual issue."^^ . + . + "1"^^ . + . + . + . + "Using a base/generic type class as a parameter in a method"^^ . + "2"^^ . + . + . + . + . + "While I share the sentiment put forward by @ADyson, I think it's a valid question. Maybe you can rephrase it in a way that just asks about how to implement the specific parts that you are struggling with implementing the web push and remove the parts about not wanting to use a 3rd party library."^^ . + "<p>Unzip into a temporary directory, then rename it to the intended directory that the other script is looking for.</p>\n<pre><code>exec('unzip '.escapeshellarg($path.'exports/'.$dir.'/'.$file).' -d '.escapeshellarg($path.'exports/'.$dir.'_work.temp/'));\nrename('.$path.'exports/'.$dir.'_work.temp', '.$path.'exports/'.$dir.'_work');\ndie('UNPACKING');\n</code></pre>\n<p>Note that this only works if the destination directory doesn't already exist, not for extracting into an existing directory.</p>\n"^^ . + "0"^^ . + "0"^^ . + . + . + . + "I dont' have annotations.yaml and attributes.yaml. But here is my login method:\n\n ```public function login(AuthenticationUtils $authenticationUtils): Response\n {\n // get the login error if there is one\n $error = $authenticationUtils->getLastAuthenticationError();\n\n // last username entered by the user\n $lastUsername = $authenticationUtils->getLastUsername();\n\n return $this->render('login/login.html.twig', [\n 'last_username' => $lastUsername,\n 'error' => $error,\n ]);\n }```"^^ . + . + . + "@siggemannen that's absolutely correct, it IS brittle."^^ . + . + . + . + . + . + . + "@anubhava I am happy I was able to see the 3rd revision for this answer with the Branch Reset Group solution. This is where we can capture alternative match results into the same capture group number. This is something I have been looking for. In this case, if there is no match for more/less, instead of returning None for group 2 it returns an empty string. I am referring to your pattern ^Saint\\h+(\\w+)\\h+eats(?|\\h+(\\w+)\\h+of|())\\h+those\\h+(\\w+) (Demo Link: regex101.com/r/QL7CDt/2.) Thank you! : )"^^ . + . + "I have already updated the post, thanks for your answer"^^ . + "0"^^ . + . + "0"^^ . + . + "why close vote , i donot understand"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + . + . + "<p>I am using VS Code for PHP development, and I often work with statements that span multiple lines, such as echo, if, foreach, and similar constructs. I need a quick way to select the entire statement, including line breaks, from the start to the end, without manually selecting each line.</p>\n<p>For example, I have the following code:</p>\n<pre><code>echo '1 Line\n2 Line\n3 Line\n...100 Lines\n';\n</code></pre>\n<p>If my cursor is placed just before the echo statement, I want to select the entire statement (from echo to the closing semicolon ;), even though it spans multiple lines.</p>\n<p>Current issue: VS Code's expand selection (Ctrl + Shift + Right Arrow or Cmd + Shift + Right Arrow) doesn't handle multi-line statements very well, as it expands the selection by words or blocks instead of selecting the full statement that spans multiple lines.</p>\n<p>Is there a quick shortcut or alternative method in VS Code that allows me to select the entire multi-line statement from start to end in one action?</p>\n<p>Any tips or extensions to make this process easier would be greatly appreciated!</p>\n"^^ . + "Hello @Barmar so there is a foreach's internal pointer not a copied array's internal pointer right?"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + "1"^^ . + . + . + . + . + . + . + "-1"^^ . + "1"^^ . + . + . + . + "@HansKilian `docker run -i -t php /bin/bash`"^^ . + "1"^^ . + "How to save image from front camera with input file type capture camera"^^ . + "1"^^ . + . + . + . + "1"^^ . + . + "<p>The error message suggests that ccObject.ShowWaitCursor(true); is being called with an incorrect number of arguments, or the method doesn't exist in CodeCharge Studio 5.1.</p>\n<p><strong>Check</strong> if ccObject.ShowWaitCursor() Exists <strong>in CCS 5.1</strong></p>\n<ul>\n<li><p>Open the developer console (F12 in a browser) and check if ccObject is defined.</p>\n</li>\n<li><p>Type ccObject.ShowWaitCursor in the console and see if it returns a function or undefined.</p>\n</li>\n</ul>\n<p>Also, Some APIs change between versions. Try calling ccObject.ShowWaitCursor(); without the argument:</p>\n<ul>\n<li>ccObject.ShowWaitCursor();</li>\n</ul>\n<p>Ensure that all required JavaScript files are included in CCS 5.1.\nLook for any JavaScript errors in the console that might indicate missing files.</p>\n"^^ . + . + "2"^^ . + "2"^^ . + "You also need to check `curl_getinfo($ch, CURLINFO_HTTP_CODE) == 200`"^^ . + . + . + . + . + "module"^^ . + "0"^^ . + . + . + "0"^^ . + "<p>I have several user groups in <code>LocalSettings.php</code>:</p>\n<pre><code>$wgGroupPermissions[&quot;SM_p1&quot;][&quot;createaccount&quot;] = false;\n$wgGroupPermissions[&quot;SM_p1&quot;][&quot;edit&quot;] = false;\n$wgGroupPermissions[&quot;SM_p1&quot;][&quot;read&quot;] = true;\n$wgGroupPermissions[&quot;SM_p2&quot;][&quot;createaccount&quot;] = false;\n$wgGroupPermissions[&quot;SM_p2&quot;][&quot;edit&quot;] = false;\n$wgGroupPermissions[&quot;SM_p2&quot;][&quot;read&quot;] = true;\n</code></pre>\n<p>I would like to show page content which depends on logged user with help of function <code>#ifingroup</code>.</p>\n<p>I put lines of code in my main mage:</p>\n<pre><code>&lt;strong&gt;MediaWiki has been installed.&lt;/strong&gt;\n\n{{#ifingroup: SM_p1|Welcome, SM_p1 User!|This content is for SM_p1 users only.}}\n\n{{#expr: 5+5 }}\n</code></pre>\n<p><code>Line {{#expr: 5+5 }}</code> brings <code>10</code> as expected. But line <code>{{#ifingroup: SM_p1|Welcome, SM_p1 User!|This content is for SM_p1 users only.}}</code> is displayed as text.</p>\n<p>What extension brings function <code>#ifingroup</code>?</p>\n"^^ . + . + "Run Gobgp commnad By Web Interface ( ubuntu server)"^^ . + . + . + . + "<p>I am trying to convert a small project from Code Charge Studio 4.3 to Code Charge Studio 5.1 but the minute you click the convert button I get this popup error message box:</p>\n<p>An Error has occurred on the script on this page\nLine 128\nChar 4\nError: wrong number of arguments or property assignment\nCode: 0\nURL: file:///C:/Program%20Files%20(x86)/CodeChargeStudio5/Components/Dialogs/Converter/Converter.html</p>\n<p>line 128 of the html file it refers to is:</p>\n<pre><code>ccObject.ShowWaitCursor(true);\n</code></pre>\n<p>Here is the full code section:</p>\n<pre><code>var con;\n var keys = (new VBArray(tfs.files.Keys())).toArray(); \n //var regim=&quot;&quot;;\n ccObject.ShowWaitCursor(true);\n for (var i in keys)\n</code></pre>\n<p>Please any advise appreciated.\nSam</p>\n"^^ . + . + "0"^^ . + . + "<p>The strings documentation isn't the right place to look, the <a href="https://www.php.net/manual/en/language.variables.variable.php" rel="nofollow noreferrer">variable variables</a> documentation is:</p>\n<blockquote>\n<p>In order to use variable variables with arrays, an ambiguity problem has to be resolved. That is, if the parser sees <code>$$a[1]</code> then it needs to know if <code>$a[1]</code> was meant to be used as a variable, or if <code>$$a</code> was wanted as the variable and then the <code>[1]</code> index from that variable. The syntax for resolving this ambiguity is: <code>${$a[1]}</code> for the first case and <code>${$a}[1]</code> for the second.</p>\n<p>Class properties may also be accessed using variable property names. [..]</p>\n<p><strong>Curly braces may also be used to clearly delimit the property name.</strong></p>\n</blockquote>\n<p>Constants aren't explicitly mentioned, but they work the same way.</p>\n"^^ . + . + "0"^^ . + "<p>I have the following prepared statement functionality:</p>\n<pre><code> $stmt = $db-&gt;prepare(&quot;REPLACE INTO devices (id, type, labels, graphical, technical) values (:id, :type, :label, :graphical, :technical)&quot;);\n $stmt-&gt;bindParam(':type', $devdata[&quot;type&quot;], SQLITE3_TEXT);\n $stmt-&gt;bindParam(':label', $label, SQLITE3_TEXT);\n $stmt-&gt;bindParam(':graphical', $graphical, SQLITE3_TEXT);\n $stmt-&gt;bindParam(':technical', $technical, SQLITE3_TEXT);\n $stmt-&gt;bindParam(':id', $devid, SQLITE3_TEXT);\n $stmt-&gt;execute();\n</code></pre>\n<p>However, based on some other conditions, I'd like the ability to assign the following query to $technical:</p>\n<pre><code>(SELECT technical FROM devices WHERE id = :id)\n</code></pre>\n<p>The intent would to have this query executed to grab the value. I cannot seem to get this to work. It literally just populates the database with <code>(SELECT technical FROM devices WHERE id = :id)</code> as the value.</p>\n<p>Is there a way to bind a query as a variable in a prepared statement, and have it executed?</p>\n"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "-1"^^ . + "2"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + "-4"^^ . + . + . + "Ebay API - Search my listing by keyword in title"^^ . + "Create a new Middleware, if the request is authenticated, redirect to `/dashboard` or your desired location and then simply add this to your login route. Optionally, alias it if you intend to reuse it for register etc."^^ . + . + . + "0"^^ . + . + "1"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + "This is called [late static binding](https://www.php.net/manual/en/language.oop5.late-static-bindings.php)."^^ . + . + . + "0"^^ . + "0"^^ . + . + "-1"^^ . + "0"^^ . + "-1"^^ . + . + . + "0"^^ . + . + "https://idownvotedbecau.se/noattempt/ https://idownvotedbecau.se/nocode/ https://idownvotedbecau.se/unclearquestion https://idownvotedbecau.se/nomcve/"^^ . + "2"^^ . + . + "1"^^ . + . + . + "<p>Ok! Problem was in cache, but I forgot that I have deploy server configured in my PhpStorm (Apache) so I've tried to clear cache in project, but I was need to clear cache under deployment folder. Sorry for me being dummy.</p>\n"^^ . + . + "@David OK, thank you, I will try to research that."^^ . + . + "0"^^ . + . + . + "<p>I have recently created a new project in Laravel 11 and can not get my custom error handling class to work. I have a class I use throughout all my Larvael projects (laravel 10). I want to use this class in Laravel 11 to process all my errors, but it seems the new version relies on the <code>withExceptions</code> method in app.php</p>\n<pre><code>-&gt;withExceptions(function (Exceptions $exceptions) {\n</code></pre>\n<p>Does anyone know how I can get the withExceptions class to still use this (or any) external class for handling</p>\n<pre><code>\nuse Illuminate\\Foundation\\Exceptions\\Handler as ExceptionHandler;\n\nclass Handler extends ExceptionHandler {\n\n}\n</code></pre>\n"^^ . + "what happens when you extend a normal FormRequest?"^^ . + . + "Thanks for your response; I had actually gone down the generics route, but it didn't work so I assumed the array shape syntax was incompatible with generics. It turns out that in PHPStorm, you have to have the autoload file config option set even if your autoload file is set in a bootstrap file in your phpstan config. It seems to be working now! Thanks again."^^ . + . + . + . + "0"^^ . + . + . + "Convert command line curl into PHP curl"^^ . + "How can be used TagsInput component to store related data using model hasmany relationship?"^^ . + . + . + . + "Thanks for replying. I have double checked the client_id several times as that was my first thought too. I also setup the sign-in app on two different LinkedIn accounts just in case but the same error happens on both."^^ . + . + "Sadly this didn't work, I'll go digging into the actual CURL request later and see what happens and what the differences are"^^ . + . + "<p>Using the WooCommerce Booking plugin, I have a &quot;WC_Product_Booking&quot; product in cart.\nI am trying to get the start and end dates if possible from this $product object (called $product_data in the code, it is also a cart item).</p>\n<p>I can call the &quot;get_duration()&quot; method just fine, but I would like to also get the other data, like start/end dates, and maybe booking date.</p>\n<p>If I call get_start_date() on the $product_data I get a function/method does not exist error, I think it's for posts of the booking type.</p>\n<pre><code>&lt;?php\n\nadd_filter('booking_display_cart_before_price', 'booking_display_booking_time', 10, 2);\n\nfunction booking_display_booking_time($html, $product_data)\n{\n if ($product_data &amp;&amp; is_a($product_data, 'WC_Product_Booking')) {\n //echo $product_data-&gt;get_min_date();\n\n echo &quot;&lt;pre&gt;&quot;;\n // print_r($booking_relationship_item);\n echo &quot;&lt;/pre&gt;&quot;;\n\n // Get the booking duration in minutes\n $booking_duration = $product_data-&gt;get_duration(); // Get duration in minutes\n // $booking_start_date = $product_data-&gt;get_booking_date();\n $booking_start_date = &quot;&quot;;\n /*\n $start_date = $product_data-&gt;get_start_date();\n $end_date = $product_data-&gt;get_end_date();\n echo $start_date . &quot; &quot; . $end_date;*/\n\n // Get the translated booking unit (hour, day, etc.)\n $booking_unit = sprintf(__($product_data-&gt;get_duration_unit(), 'woocommerce-bookings'));\n\n // Format the booking duration text\n $duration_text = sprintf(__('%d %s', 'woocommerce-bookings'), $booking_duration, $booking_unit);\n\n // Start date\n $html .= '&lt;div class=&quot;booking-cart-product-extra-option&quot;&gt;\n &lt;span class=&quot;booking-cart-product-extra-option-label&quot;&gt;' . __('Booking Date', 'woocommerce-bookings') . ':&lt;/span&gt;\n &lt;span class=&quot;booking-cart-product-extra-option-value&quot;&gt;' . esc_html($booking_start_date) . '&lt;/span&gt;\n &lt;/div&gt;';\n\n // Duration\n $html .= '&lt;div class=&quot;booking-cart-product-extra-option&quot;&gt;\n &lt;span class=&quot;booking-cart-product-extra-option-label&quot;&gt;' . __('Duration', 'woocommerce-bookings') . ':&lt;/span&gt;\n &lt;span class=&quot;booking-cart-product-extra-option-value&quot;&gt;' . esc_html($duration_text) . '&lt;/span&gt;\n &lt;/div&gt;';\n }\n return $html;\n}\n</code></pre>\n<p>Tried calling several methods relating to the booking plugin on the $product_data object.</p>\n"^^ . + "1"^^ . + "-1"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + "1"^^ . + "1"^^ . + . + "0"^^ . + . + . + "0"^^ . + "codeigniter 3 A PHP Error was encountered"^^ . + "<p>Im currently using nginx as a reverse proxy,\nAnd i wanted to try Caddy to do the same !</p>\n<p>To explain 1 have 2 services : 1php and 1go</p>\n<p>The php is a backend that you use by calling /api/&lt;.....&gt;\nThe golang is also a backend that you use by valling /api/device/position</p>\n<p>Both start with the same /api\nex:\nlocalhost/api/login\nlocalhost/api/device/position</p>\n<p>This nginx conf is working</p>\n<pre><code>upstream php_backend {\n server back:9000;\n}\nserver {\n listen 80;\n server_name ${NGINX_BACKEND_DOMAIN};\n\n root /var/www/symfony/public; \n location / {\n try_files $uri /index.php$is_args$args;\n }\n\n location ~ ^/index\\.php(/|$) {\n if ($request_method = 'OPTIONS') {\n add_header 'Access-Control-Allow-Origin' '*' always;\n add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, OPTIONS, PUT, PATCH' always;\n add_header 'Access-Control-Allow-Headers' 'Authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;\n add_header 'Access-Control-Max-Age' 1728000 always;\n add_header 'Content-Type' 'text/plain; charset=utf-8' always;\n add_header 'Content-Length' 0 always;\n return 204;\n }\n \n fastcgi_pass php_backend;\n fastcgi_split_path_info ^(.+\\.php)(/.*)$;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n fastcgi_param DOCUMENT_ROOT $document_root;\n internal;\n }\n\n location ~ \\.php$ {\n return 404;\n }\n\n location /api/device/position {\n proxy_pass http://ping-service;\n proxy_set_header Host $host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n }\n\n error_log /dev/stdout info;\n access_log /var/log/nginx/project_access.log;\n}\n</code></pre>\n<p>And my not working Caddy config</p>\n<pre><code>:{$PORT} {\n # access logs\n log {\n format json # set access log format to json mode\n }\n\n php_fastcgi * wimova-connect-back:9000 {\n root /var/www/symfony/public\n }\n \n # handle /api/device/position requests\n handle /api/device/position {\n reverse_proxy http://ping-service {\n # configure load balancing settings\n import lb_settings\n\n # configure passive health checks\n import passive_health_checks\n\n # sets the Host header to the header to the dynamic name and port options\n header_up Host {upstream_hostport}\n }\n }\n}\n</code></pre>\n<p>The /api/device/position is working well !\nBut the rest is not :\\</p>\n<p>Thanks for your help</p>\n"^^ . + "@ChrisHaas I have noticed a small issue .. is there a way to check that the value of the 2nd line containing the time at the start matches the same as the 1st line time ?"^^ . + . + . + . + . + "I think this is what I was looking for. I'll test it later. Thanks a lot!"^^ . + . + "sql-injection"^^ . + "_ADDENDUM_: I've just looked at the question/answer from which you copied the original rule and that already has the condition to exclude physical directories (as I've added in my answer)!? Why did you remove it?? (Although, bizarrely, none of the answers on that question appear to state _why_ that condition is required!)"^^ . + . + . + "-1"^^ . + . + . + "1"^^ . + "1"^^ . + . + . + . + "https://gist.github.com/bladeSk/6294d3266370868601a7d2e50285dbf5"^^ . + . + "easyadmin"^^ . + . + "0"^^ . + . + . + . + . + . + "2"^^ . + . + "-2"^^ . + "Ow. Worked it out I think. Here is the link.\n\nhttps://phpize.online/sql/mysql80/48403b312e413068b7b758f2ed20acfc/php/php84/06a9e44c30a03b750b746884a42da68c/"^^ . + . + . + . + . + . + "1"^^ . + "Hi there. Can you try to install [laravel telescope](https://laravel.com/docs/11.x/telescope)? You might be able to get more insight on which pages have slower operation."^^ . + . + . + . + . + "4"^^ . + . + . + "1"^^ . + "0"^^ . + . + "openai-api"^^ . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + "Beware [the X/Y Problem](https://xyproblem.info/) - you had some requirements, and thought that `glob` would help; if you found that `glob` was _not_ the right function, you should go back to the _original requirements_. But also remember to Break the Problem Down: if you've successfully got a list of directory names, it doesn't matter where they came _from_ - the solution to "change directory to a name with spaces in" is the same whether that name came from `glob`, user input, etc"^^ . + . + . + . + "Thank you fo rthe quick reply.\nto be honest i am a compelte newbie and stubborn person that wants to do the solution myself.\nThe app is a POS app for a restaurnt i own ( actually mini cafe) and i liked the challange to do it myself without a developer as i come from an IT background, but it appaers i defenetly lack development tech skills.\ncan you guide please"^^ . + . + "2"^^ . + . + "2"^^ . + . + . + "@Peter, if you don't believe this is your issue, then you may contact deepl and report this bug. BTW you set content type to application/json but sent application/x-www-form-urlencoded data."^^ . + . + . + . + . + . + . + "This is nothing novel with PHP; nearly all languages have dependency managers. What you deliver to your client depends on your contractual agreement. A lot of PHP software is hosted by technical people on behalf of a client, so they don't need to use Composer. If the client has technical people and/or they plan to maintain the software themselves then fine, they should know how to use Composer."^^ . + . + . + "1"^^ . + . + "1"^^ . + "0"^^ . + . + . + "2"^^ . + "<p>Put the attribute <code>colspan=&quot;2&quot;</code> on the <code>&lt;th&gt;</code> with the Product label and the <code>&lt;td&gt;</code> with the product text, and the table will lay out the way it used to, with the price in the right column.</p>\n"^^ . + "@CasimiretHippolyte I got this job on January, I am afraid I complain about this rule I might get in trouble. If I was working for longer, I would certainly do as you said."^^ . + . + . + . + "1"^^ . + "Configure apache to serve Laravel app alongside regular app"^^ . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + "1"^^ . + . + "Not sure why that would be. You are using `===` for the comparison, but that post type _should_ be a string value, so I don't see why it would fail. Can you do a `var_dump($post_type);`, and report back the exact output? (type, length)"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "How can I dynamically display and update form fields in Symfony EasyAdmin?"^^ . + . + . + "2"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "could you share how you are storing the session state? Have you enabled any caching in iis or in your application code? have you tried accessing your site in the incognito mode? How often do you face this problem? are you facing this issue for random user or specific user?"^^ . + "1"^^ . + . + . + "-1"^^ . + . + . + . + "Of course, I've already tried to edit the code several times... I've also read up on what should be used instead, but I'm absolutely reaching my limits here"^^ . + "indexing"^^ . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + "@AndreyYanduganov Did you delete your links. I think, from the link you shared I have to create the `/api/login_check` route manually as it is not automatically handled by `lexik/jwt-authentication-bundle`"^^ . + . + "<p>I have been trying to get the visible web page area, and pass it into a PHP variable.\nThe script code I have used is:</p>\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n &lt;body&gt;\n &lt;h1&gt;Get the size of the current screen/window&lt;/h1&gt;\n &lt;p&gt;The example displays the browser window's height and width: (NOT including toolbars/scrollbars)\n &lt;p id=&quot;demo&quot;&gt;&lt;/p&gt;\n &lt;script&gt;\n var w = window.innerWidth;\n var h = window.innerHeight;\n var x = document.getElementById(&quot;demo&quot;);\n x.innerHTML = &quot;Browser width: &quot; + w + &quot;, height: &quot; + h + &quot;.&quot;;\n &lt;/script&gt;\n</code></pre>\n<p>On the web page, it outputs the following</p>\n<pre><code>Get the size of the current screen/window\nThe example displays the browser window's height and width: (NOT including toolbars/scrollbars)\n\nBrowser width: 1920, height: 892.\n</code></pre>\n<p>Which I'm assuming is correct, as it looks right for my screen resolution.\nI then passed the variables into PHP</p>\n<pre><code> &lt;?php\n $STR_php_width = '&lt;script&gt;document.writeln(w);&lt;/script&gt;' ;\n $STR_php_height = '&lt;script&gt;document.writeln(h);&lt;/script&gt;' ;\n echo '$php_width is a ' . gettype($STR_php_width) . ' variable, and has a value of ' . $STR_php_width . '&lt;br&gt;';\n echo '$php_height is a ' . gettype($STR_php_height) . ' variable, and has a value of ' . $STR_php_height . '&lt;br&gt;&lt;br&gt;';\n ?&gt;\n &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<p>The result is</p>\n<pre><code>Get the size of the current screen/window\nThe example displays the browser window's height and width: (NOT including toolbars/scrollbars)\n\nBrowser width: 1920, height: 892.\n\n$STR_phpwidth is a string variable, and has a value of 1920\n$STR_phpheight is a string variable, and has a value of 892\n</code></pre>\n<p>I want to be able to work out percentages of the screen size, so I converted the string variables in float / doubles</p>\n<pre><code> $DOU_floatwidth = floatval($STR_phpwidth);\n $DOU_floatheight = floatval($STR_phpheight);\n echo '$DOU_floatwidth is a ' . gettype($DOU_floatwidth) . ' variable, and has a value of ' . $DOU_floatwidth . '&lt;br&gt;';\n echo '$DOU_floatheight is a ' . gettype($DOU_floatheight) . ' variable, and has a value of ' . $DOU_floatheight . '&lt;br&gt;&lt;br&gt;';\n</code></pre>\n<p>And the output is now</p>\n<pre><code>Get the size of the current screen/window\nThe example displays the browser window's height and width: (NOT including toolbars/scrollbars)\n\nBrowser width: 1920, height: 892.\n\n$STR_phpwidth is a string variable, and has a value of 1920\n$STR_phpheight is a string variable, and has a value of 892\n\n$DOU_floatwidth is a double variable, and has a value of 0\n$DOU_floatheight is a double variable, and has a value of 0\n</code></pre>\n<p>As you can see, the string has not been passed and converted to to a float / double. I have tried several different methods including <code>$DOU_floatwidth = (float)$STR_phpwidth;</code> as well as using <code>floatval</code> and <code>float</code> on the initial <code>$STR_phpwidth</code>.</p>\n<p>If I pass the values using</p>\n<pre><code>$STR_phpwidth = &quot;1920&quot;;\n$STR_phpheight = &quot;892&quot;;\n</code></pre>\n<p>Then the full output is what I expect.</p>\n<pre><code>Get the size of the current screen/window\nThe example displays the browser window's height and width: (NOT including toolbars/scrollbars)\n\nBrowser width: 1920, height: 892.\n\n$STR_phpwidth is a string variable, and has a value of 1920\n$STR_phpheight is a string variable, and has a value of 892\n\n$DOU_floatwidth is a double variable, and has a value of 1920\n$DOU_floatheight is a double variable, and has a value of 892\n\n$DOU_onepercent is a double variable\n1% of the screen width is 19.2px\n</code></pre>\n<p>The full page / code is:</p>\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n &lt;body&gt;\n &lt;h1&gt;Get the size of the current screen/window&lt;/h1&gt;\n &lt;p&gt;The example displays the browser window's height and width: (NOT including toolbars/scrollbars)\n &lt;p id=&quot;demo&quot;&gt;&lt;/p&gt;\n &lt;script&gt;\n var w = window.innerWidth;\n var h = window.innerHeight;\n var x = document.getElementById(&quot;demo&quot;);\n x.innerHTML = &quot;Browser width: &quot; + w + &quot;, height: &quot; + h + &quot;.&quot;;\n &lt;/script&gt;\n &lt;?php\n $STR_phpwidth = '&lt;script&gt;document.writeln(w);&lt;/script&gt;' ;\n $STR_phpheight = '&lt;script&gt;document.writeln(h);&lt;/script&gt;' ;\n $STR_phpwidth = &quot;1920&quot;;\n $STR_phpheight = &quot;892&quot;;\n echo '$STR_phpwidth is a ' . gettype($STR_phpwidth) . ' variable, and has a value of ' . $STR_phpwidth . '&lt;br&gt;';\n echo '$STR_phpheight is a ' . gettype($STR_phpheight) . ' variable, and has a value of ' . $STR_phpheight . '&lt;br&gt;&lt;br&gt;';\n $DOU_floatwidth = floatval($STR_phpwidth);\n $DOU_floatheight = floatval($STR_phpheight);\n echo '$DOU_floatwidth is a ' . gettype($DOU_floatwidth) . ' variable, and has a value of ' . $DOU_floatwidth . '&lt;br&gt;';\n echo '$DOU_floatheight is a ' . gettype($DOU_floatheight) . ' variable, and has a value of ' . $DOU_floatheight . '&lt;br&gt;&lt;br&gt;';\n $DOU_onepercent = $DOU_floatwidth / 100;\n echo '$DOU_onepercent is a ' . gettype($DOU_onepercent) . ' variable&lt;br&gt;';\n echo '1% of the screen width is ' . $DOU_onepercent . 'px&lt;br&gt;';\n ?&gt;\n &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<p>Any ideas where I'm going wrong?</p>\n"^^ . + . + . + . + "1"^^ . + . + "0"^^ . + "1"^^ . + . + "That's a thought - but in a single debugging session, the examination of one variable could lead to the decision to examine another. Don't watch variables have to be set at the beginning of a session? At any rate, I stumbled on the solution - but thanks for the suggestion. I'll edit my post with the new info."^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + "I assume you are using a unique attribute for variations for your variable product. Note that product variations sorting have nothing to do with the sorting of product attribute(s) dropdown(s) used for variations, as each variation can have more than one variation attribute, that is why `$product->get_available_variations()` will never get the same sorting order than the displayed product attribute(s) dropdown(s) (or swatches in some cases)..."^^ . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "*"It's because the exec() and proc_open() functions don't respect the changes made to the user ID or group ID"* Really? Why?"^^ . + . + . + . + "@Tatachiblob I have trid both the commmand and manually deleted it. Still not reading from .env file"^^ . + "1"^^ . + . + "0"^^ . + . + . + . + . + . + . + "How to downgrade PDF version to 1.4 (with php or python)"^^ . + . + "1"^^ . + . + . + . + . + "In PHP 8+ How to clear image data from script (previously imagedestroy())"^^ . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + "@krisgjika Just tried it as I'm just used to the other one which just overrides as [followed](https://github.com/InfyOmLabs/laravel-generator/blob/develop/src/Request/APIRequest.php) \nsame error"^^ . + . + . + . + "Trying to get start/end dates from a booking product in cart (WooCommerce)"^^ . + . + . + . + . + . + . + "3"^^ . + . + . + . + "Loading Route.php and Routing.php settings in different Modules in CodeIgniter4"^^ . + "@LordF Why would there be 50 packages if you didn't want there to be? You don't have to choose between "one giant package with every piece of code you've ever written" and "a separate tiny package for every individual PHP class"."^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + "<p>Trying to get @symfony/ux-react to work as per this documentation:</p>\n<p><a href="https://symfony.com/bundles/ux-react/current/index.html" rel="nofollow noreferrer">https://symfony.com/bundles/ux-react/current/index.html</a></p>\n<p>Did the following steps</p>\n<pre><code>composer require symfony/ux-react\nyarn add -D @babel/preset-react --force\nyarn encore dev --watch\n</code></pre>\n<p>Also added the <code>react.yaml</code> file to config/packages</p>\n<p>All seems to work fine but fails here:</p>\n<pre><code>import { registerReactControllerComponents } from '@symfony/ux-react';\nregisterReactControllerComponents(require.context('./react/controllers', true, /\\.(j|t)sx?$/));\n</code></pre>\n<p>The error message is</p>\n<p>&quot;./assets/js/app.ts&quot; contains a reference to the file &quot;./react/controllers&quot;.\nThis file can not be found, please check it for typos or update it if the file got moved.</p>\n<p>Tried to use relative path but no success either.</p>\n<p>What am I missing?</p>\n"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + "0"^^ . + "Where are you stuck? Do you understand how to serve your page through the Apache server? Are you able to submit the form and get the PHP to run, but it just doesn't send the email (or it sends, but it doesn't get delivered, maybe)? Or are you having a more fundamental problem than that? It isn't clear from your question - please [edit] it. See also [ask]. Thanks."^^ . + . + . + "0"^^ . + . + . + . + . + "2"^^ . + "@C3roe Thanks for your reply but i really don't understand your explaination as i already included the file that contact the Invoice class through the statement use backend\\models\\Invoice, the classes are in invoice and working with yii i never needed to manually auto-load the classes i get them in place using the use key work"^^ . + . + "How to get the current key name while building an array"^^ . + "Laravel error: Attempt to read property "id" on null"^^ . + . + . + . + "@KIKOSoftware But the request URL seems correct to me, the filename is correct and the response as the html from create-react-app"^^ . + "Your joins are still wrong - notice in all 4 cases you're joining to Home fields, never to away fields"^^ . + . + . + . + . + . + "0"^^ . + ""On reload of a link within the page like so: /page/123 it doesn't load, instead returning a 404." - You have no "routing" directives in your `.htaccess` file. (Except for an "incorrect" rewrite to `.php` files) How do you expect such a request to be handled (server-side)? You have other inconsistencies in your `.htaccess` file to do with caching. Is mod_headers installed (normally it is)?"^^ . + . + "<p>You should listen to the carousel &quot;change&quot; event, because user can navigate, for example, using keyboard. See second example here - <a href="https://fancyapps.com/fancybox/api/events/#tips-and-tricks" rel="nofollow noreferrer">https://fancyapps.com/fancybox/api/events/#tips-and-tricks</a></p>\n<pre class="lang-js prettyprint-override"><code>Fancybox.bind(&quot;[data-fancybox]&quot;, {\n on: {\n &quot;Carousel.ready Carousel.change&quot;: (fancybox) =&gt; {\n // Current slide\n const slide = fancybox.getSlide();\n\n // The corresponding trigger element\n // (i.e. the link that is clicked to launch Fancybox)\n const triggerEl = slide.triggerEl;\n\n // ... update your count here !!!\n },\n },\n});\n</code></pre>\n"^^ . + "<p>ATUM location are stored in a taxonomy not in the woo terms</p>\n"^^ . + . + "0"^^ . + "0"^^ . + "1"^^ . + . + . + . + . + "<p>I'm currently learning how to create a WordPress plugin. Is there a way to encrypt or at least obfuscate the plugin's source code so that users can't easily read it, but the code still works? I've tried several obfuscation tools (like this one https://github,com/pH-7/Obfuscator-Class), but they end up causing errors when used in a WordPress plugin.</p>\n"^^ . + "-5"^^ . + "0"^^ . + . + . + . + . + . + "<p>I have an issue using ffmpeg to stream audio and parse to google cloud speech to text in PHP.</p>\n<p>It returns this output.\nI have tried delaying some part of the script, that did not solve it.\nI have also checked for similar questions. however, they are mostly in python and none of the solutions actually work for this.</p>\n<pre class="lang-none prettyprint-override"><code> built with gcc 8 (GCC)\n cpudetect\n libavutil 56. 31.100 / 56. 31.100\n libavcodec 58. 54.100 / 58. 54.100\n libavformat 58. 29.100 / 58. 29.100\n libavdevice 58. 8.100 / 58. 8.100\n libavfilter 7. 57.100 / 7. 57.100\n libavresample 4. 0. 0 / 4. 0. 0\n libswscale 5. 5.100 / 5. 5.100\n libswresample 3. 5.100 / 3. 5.100\n libpostproc 55. 5.100 / 55. 5.100\nInput #0, mp3, from 'https://npr-ice.streamguys1.com/live.mp3':\n Metadata:\n icy-br : 96\n icy-description : NPR Program Stream\n icy-genre : News and Talk\n icy-name : NPR Program Stream\n icy-pub : 0\n StreamTitle :\n Duration: N/A, start: 0.000000, bitrate: 96 kb/s\n Stream #0:0: Audio: mp3, 32000 Hz, stereo, fltp, 96 kb/s\nStream mapping:\n Stream #0:0 -&gt; #0:0 (mp3 (mp3float) -&gt; pcm_s16le (native))\nPress [q] to stop, [?] for help\nOutput #0, s16le, to 'pipe:':\n Metadata:\n icy-br : 96\n icy-description : NPR Program Stream\n icy-genre : News and Talk\n icy-name : NPR Program Stream\n icy-pub : 0\n StreamTitle :\n encoder : Lavf58.29.100\n Stream #0:0: Audio: pcm_s16le, 16000 Hz, mono, s16, 256 kb/s\n Metadata:\n encoder : Lavc58.54.100 pcm_s16le\n**av_interleaved_write_frame(): Broken pipe** 256.0kbits/s speed=1.02x\n**Error writing trailer of pipe:: Broken pipe**\nsize= 54kB time=00:00:01.76 bitrate= 250.8kbits/s speed=0.465x\nvideo:0kB audio:55kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown\nConversion failed!\n</code></pre>\n<p>this is my PHP code</p>\n<pre><code>require_once 'vendor/autoload.php';\n \n $projectId = &quot;xxx-45512&quot;;\n putenv('GOOGLE_APPLICATION_CREDENTIALS=' . __DIR__ . '/xxx-45512-be3eb805f1d7.json');\n \n // Database connection\n $pdo = new PDO('mysql:host=localhost;dbname=', '', '');\n $pdo-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n \n $url = &quot;https://npr-ice.streamguys1.com/live.mp3&quot;;\n \n $ffmpegCmd = &quot;ffmpeg -re -i $url -acodec pcm_s16le -ac 1 -ar 16000 -f s16le -&quot;;\n \n $fp = popen($ffmpegCmd, &quot;r&quot;);\n if (!$fp) {\n die(&quot;Failed to open FFmpeg stream.&quot;);\n }\n sleep(5);\n\n try {\n $client = new SpeechClient(['transport' =&gt; 'grpc', 'credentials' =&gt; json_decode(file_get_contents(getenv('GOOGLE_APPLICATION_CREDENTIALS')), true)]);\n } catch (Exception $e) {\n echo 'Error: ' . $e-&gt;getMessage(); \n exit;\n }\n \n $recognitionConfig = new RecognitionConfig([\n 'auto_decoding_config' =&gt; new AutoDetectDecodingConfig(),\n 'language_codes' =&gt; ['en-US'],\n 'model' =&gt; 'long',\n ]);\n \n $streamingConfig = new StreamingRecognitionConfig([\n 'config' =&gt; $recognitionConfig,\n ]);\n \n $configRequest = new StreamingRecognizeRequest([\n 'recognizer' =&gt; &quot;projects/$projectId/locations/global/recognizers/_&quot;,\n 'streaming_config' =&gt; $streamingConfig,\n ]);\n \n \n function streamAudio($fp)\n {\n while (!feof($fp)) {\n yield fread($fp, 4096);\n }\n }\n \n $responses = $client-&gt;streamingRecognize([\n 'requests' =&gt; (function () use ($configRequest, $fp) {\n yield $configRequest; // Send initial config\n foreach (streamAudio($fp) as $audioChunk) {\n yield new StreamingRecognizeRequest(['audio' =&gt; $audioChunk]);\n }\n })()]\n );\n \n // $responses = $speechClient-&gt;streamingRecognize();\n // $responses-&gt;writeAll([$request,]);\n \n foreach ($responses as $response) {\n foreach ($response-&gt;getResults() as $result) {\n $transcript = $result-&gt;getAlternatives()[0]-&gt;getTranscript();\n // echo &quot;Transcript: $transcript\\n&quot;;\n \n // Insert into the database\n $stmt = $pdo-&gt;prepare(&quot;INSERT INTO transcriptions (transcript) VALUES (:transcript)&quot;);\n $stmt-&gt;execute(['transcript' =&gt; $transcript]);\n }\n }\n \n \n pclose($fp);\n $client-&gt;close();\n</code></pre>\n<p>I'm not sure what the issue is at this time.</p>\n<p>UPDATE</p>\n<p>I've done some more debugging and i have gotten the error to clear and to stream actually starts.\nHowever, I expect the audio to transcribe and update my database but instead I get this error when i close the stream</p>\n<p><a href="https://i.sstatic.net/xCsNFAiI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/xCsNFAiI.png" alt="error after closing stream" /></a></p>\n<p>this is my updated code</p>\n<pre><code> $handle = popen($ffmpegCommand, &quot;r&quot;);\n\n try {\n $client = new SpeechClient(['transport' =&gt; 'grpc', 'credentials' =&gt; json_decode(file_get_contents(getenv('GOOGLE_APPLICATION_CREDENTIALS')), true)]);\n } catch (Exception $e) {\n echo 'Error: ' . $e-&gt;getMessage(); \n exit;\n }\n \n try {\n $recognitionConfig = (new RecognitionConfig())\n -&gt;setAutoDecodingConfig(new AutoDetectDecodingConfig())\n -&gt;setLanguageCodes(['en-US'], ['en-UK'])\n -&gt;setModel('long');\n } catch (Exception $e) {\n echo 'Error: ' . $e-&gt;getMessage(); \n exit;\n }\n \n try {\n $streamConfig = (new StreamingRecognitionConfig())\n -&gt;setConfig($recognitionConfig);\n } catch (Exception $e) {\n echo 'Error: ' . $e-&gt;getMessage();\n exit;\n }\n try {\n $configRequest = (new StreamingRecognizeRequest())\n -&gt;setRecognizer(&quot;projects/$projectId/locations/global/recognizers/_&quot;)\n -&gt;setStreamingConfig($streamConfig);\n } catch (Exception $e) {\n echo 'Error: ' . $e-&gt;getMessage(); \n exit;\n }\n \n $stream = $client-&gt;streamingRecognize();\n $stream-&gt;write($configRequest);\n \n mysqli_query($conn, &quot;INSERT INTO transcriptions (transcript) VALUES ('bef')&quot;);\n \n while (!feof($handle)) {\n $chunk = fread($handle, 25600);\n // printf('chunk: ' . $chunk);\n if ($chunk !== false) {\n try {\n $request = (new StreamingRecognizeRequest())\n -&gt;setAudio($chunk);\n $stream-&gt;write($request);\n } catch (Exception $e) {\n printf('Errorc: ' . $e-&gt;getMessage());\n }\n }\n }\n \n \n $insr = json_encode($stream);\n mysqli_query($conn, &quot;INSERT INTO transcriptions (transcript) VALUES ('$insr')&quot;);\n \n foreach ($stream-&gt;read() as $response) {\n mysqli_query($conn, &quot;INSERT INTO transcriptions (transcript) VALUES ('loop1')&quot;);\n foreach ($response-&gt;getResults() as $result) {\n mysqli_query($conn, &quot;INSERT INTO transcriptions (transcript) VALUES ('loop2')&quot;);\n foreach ($result-&gt;getAlternatives() as $alternative) {\n $trans = $alternative-&gt;getTranscript();\n mysqli_query($conn, &quot;INSERT INTO transcriptions (transcript) VALUES ('$trans')&quot;);\n }\n }\n }\n \n pclose($handle);\n $stream-&gt;close();\n $client-&gt;close();```\n</code></pre>\n"^^ . + . + "Redis with php in docker connection failing after 15k requests when doing load test"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + "What @C3roe wrote, and then: _"This is the structure that is needed and cannot be changed."_ If you can't change it, this is likely not a programming question but asking about how to use some library. Please contact the software libraries vendor for your support options and use Stackoverflow for actual programming questions; see [help] for more information."^^ . + "@ADyson i have an ID column in my table yes, In the calling of the function i have changed it so that the values are being passed in, the code is now <?php displayST('pdo', 'lastName', 'firstName) - The error i am recieving is: displayST(): Argument #1 must be of type object, string given. How would i fix this?"^^ . + "1"^^ . + . + "0"^^ . + "0"^^ . + "1"^^ . + . + . + "<p>Could you please explain why, when launching the indexing process using the command <code>$this-&gt;bus-&gt;dispatch(new ProductIndexMessage($productIds))</code> (with hundreds of such commands being executed at once), they are evenly distributed across all transports and queues? According to the design, they should only be launched on the <code>searchIndex</code> queue.</p>\n<p>PHP: 8.4.5, Symfony 7.2</p>\n<pre><code>/usr/local/bin/php -f /var/www/html/app/bin/console messenger:stats\n ---------------- -------\n Transport Count \n ---------------- -------\n async 40 \n searchIndex 40 \n genImageThumbs 40 \n failed 6 \n ---------------- -------\n</code></pre>\n<p>File:</p>\n<pre><code>&lt;?php\n\ndeclare(strict_types=1);\n\nnamespace App\\Message\\Search;\n\nuse App\\Message\\SearchIndexMessageInterface;\nuse App\\Utils\\Utils;\n\nfinal readonly class ProductIndexMessage implements SearchIndexMessageInterface\n{\n /**\n * @var int[]\n */\n public array $productIds;\n\n public function __construct(int|array $productIds)\n {\n $this-&gt;productIds = Utils::asPosAndNotZeroNotDupIntegerArray($productIds);\n }\n}\n</code></pre>\n<p>There is a configured <code>messanger.yaml</code>:</p>\n<pre><code>framework:\n messenger:\n failure_transport: failed\n\n transports:\n async:\n dsn: '%env(MESSENGER_TRANSPORT_DSN)%/async'\n retry_strategy:\n max_retries: 20\n multiplier: 2\n\n searchIndex:\n dsn: '%env(MESSENGER_TRANSPORT_DSN)%/searchIndex'\n options:\n exchange:\n name: 'searchIndex'\n retry_strategy:\n max_retries: 20\n multiplier: 2\n\n genImageThumbs:\n dsn: '%env(MESSENGER_TRANSPORT_DSN)%/genImageThumbs'\n options:\n exchange:\n name: 'genImageThumbs'\n retry_strategy:\n max_retries: 1\n multiplier: 2\n\n failed: 'doctrine://default?queue_name=failed'\n # sync: 'sync://'\n\n routing:\n Symfony\\Component\\Mailer\\Messenger\\SendEmailMessage: async\n Symfony\\Component\\Notifier\\Message\\ChatMessage: async\n Symfony\\Component\\Notifier\\Message\\SmsMessage: async\n\n # Route your messages to the transports\n App\\Message\\AsyncMessageInterface: async\n App\\Message\\SearchIndexMessageInterface: searchIndex\n App\\Message\\ImageGenThumbsMessageInterface: genImageThumbs\n</code></pre>\n<p>Commands to start workers:</p>\n<pre><code>/usr/local/bin/php /var/www/html/app/bin/console messenger:consume genImageThumbs --limit=1500 --time-limit=86400\n/usr/local/bin/php /var/www/html/app/bin/console messenger:consume searchIndex --limit=1500 --time-limit=86400\n/usr/local/bin/php /var/www/html/app/bin/console messenger:consume async --limit=1500 --time-limit=86400\n</code></pre>\n"^^ . + "0"^^ . + . + . + . + "<p>i have a website made in laravel.</p>\n<p>if someone type <a href="http://www.example.com/product.php" rel="nofollow noreferrer">www.example.com/product.php</a> then it should automatically be redirect to <a href="http://www.example.com" rel="nofollow noreferrer">www.example.com</a></p>\n<p>problem: <a href="http://www.example.com/product.php" rel="nofollow noreferrer">www.example.com/product.php</a>\nneed solution: <a href="http://www.example.com" rel="nofollow noreferrer">www.example.com</a></p>\n<p>please suggest me what should i do?</p>\n<p>i don't have any idea so i don't try anything.</p>\n"^^ . + . + . + . + "Yes, that's right. It turns out that the error is caused by the `unique()` rule which for checking uniqueness through the database. Thank you very much for your help. @krisgjika"^^ . + . + . + "0"^^ . + . + . + . + "<p>This is a common issue with shared hosting. It is not dependent on the framework you are using, whether it's <code>Laravel</code>, <code>Symfony</code>, <code>QuantumPHP</code>, or another. Most frameworks follow a similar architecture, where the <code>public</code> folder contains <code>index.php</code> as the entry point, while the rest of the application code is placed one level up to prevent direct access from outside.</p>\n<p>How you set up your project on shared hosting depends on your current infrastructure. If there are other projects in your <code>public_html</code> folder and you need to add one more, you might consider organizing them as subdomains. However, if this is your only website, the easiest solution is to place all application-related files outside <code>public_html</code> and move the contents of the <code>public</code> folder into <code>public_html</code>.</p>\n<p>Additionally, ensure you upload the entire project, including the <code>vendor</code> folder and the <code>.env</code> file. If the <code>.env</code> file is missing, you can create one from <code>.env.example</code>. For QuantumPHP, you can generate the environment file using:</p>\n<pre><code>php qt core:env\n</code></pre>\n<p>Don't forget to generate the application key as well by running:</p>\n<pre><code>php qt core:key\n</code></pre>\n<p>This setup should work on shared hosting.</p>\n"^^ . + "1"^^ . + . + . + . + "2"^^ . + . + "0"^^ . + "2"^^ . + "3"^^ . + . + "You are looking for [cascading dropdowns](https://www.google.com/search?q=cascading+dropdown+ajax+php+site:stackoverflow.com)"^^ . + "-1"^^ . + . + "0"^^ . + . + . + "0"^^ . + "<p>I'm trying to use pagination but when I check it, it doesn't show up in the UI. I've searched and tried many solutions but still no luck. is there something missing or wrong in my code?</p>\n<p><strong>Blade</strong></p>\n<pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;mt-4&quot;&gt;\n {{ $posts-&gt;links('pagination::tailwind') }}\n&lt;/div&gt;\n</code></pre>\n<p><strong>Controller</strong></p>\n<pre class="lang-php prettyprint-override"><code>public function index(Request $request)\n{\n $filter = [\n 'title' =&gt; $request-&gt;title ?? '',\n 'slug' =&gt; $request-&gt;slug ?? '',\n 'category_name' =&gt; $request-&gt;category_name ?? '',\n ];\n\n $posts = $this-&gt;postHelper-&gt;getAll($filter, $request-&gt;page ?? 1, $request-&gt;item_per_page ?? 25, $request-&gt;sort ?? '');\n\n return view('admin.post.index', ['posts' =&gt; $posts['data']['data']]);\n}\n</code></pre>\n<p><strong>Helper</strong></p>\n<pre class="lang-php prettyprint-override"><code>public function getAll(array $filter, int $page = 1, int $itemPerPage = 0, string $sort = '')\n{\n try {\n $posts = $this-&gt;postModel-&gt;getAll($filter, $page, $itemPerPage, $sort);\n\n if (empty($posts)) {\n return [\n 'status' =&gt; false,\n 'data' =&gt; null,\n ];\n }\n\n return [\n 'status' =&gt; true,\n 'data' =&gt; $posts,\n ];\n } catch (\\Throwable $th) {\n return [\n 'status' =&gt; false,\n 'error' =&gt; $th-&gt;getMessage(),\n ];\n }\n}\n</code></pre>\n<hr />\n<p><strong>Model</strong></p>\n<pre class="lang-php prettyprint-override"><code>public function getAll(array $filter, int $page, int $itemPerPage, string $sort)\n{\n $skip = ($page * $itemPerPage) - $itemPerPage;\n $post = $this-&gt;query();\n\n $total = $post-&gt;count();\n $sort = $sort ?: 'created_at DESC';\n $list = $post-&gt;orderByRaw($sort)-&gt;paginate($itemPerPage);\n\n return [\n 'total' =&gt; $total,\n 'data' =&gt; $list,\n ];\n}\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + ".htaccess"^^ . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + "2"^^ . + . + "2"^^ . + . + "1"^^ . + . + . + . + "Can you show examples of the href that is used? @mmm suggestion looks good, but it depends on the url structure your particular Wordpress system is using."^^ . + . + . + . + "1"^^ . + "0"^^ . + "<p>Summary:\nI'm trying to run a WebSocket server using Ratchet and ReactPHP on my VPS. However, when executing server.php, I receive the following error:</p>\n<pre><code>PHP Fatal error:\nUncaught RuntimeException:\n Failed to listen on &quot;tcp://0.0.0.0:2053&quot;:\n Address already in use (EADDRINUSE)\nin /var/www/meetwithchat/vendor/react/socket/src/TcpServer.php:188\n</code></pre>\n<p>Even after killing the process that appears to be using port 2053, a new process is automatically restarted and binds to the same port. Consequently, my client-side code in script.js fails to establish a WebSocket connection.</p>\n<p>I also get</p>\n<pre><code>WebSocket connection to 'wss://meetwithchat.com:2053/' failed: \n</code></pre>\n<p>Error on Chrome Console.</p>\n<p>server.php:</p>\n<pre><code>&lt;?php\nuse Ratchet\\MessageComponentInterface;\nuse Ratchet\\ConnectionInterface;\nrequire __DIR__ . '/vendor/autoload.php';\n\nclass ChatServer implements MessageComponentInterface {\n // [Properties and constructor omitted for brevity]\n\n public function onOpen(ConnectionInterface $conn) {\n // [Code omitted for brevity]\n }\n\n public function onMessage(ConnectionInterface $from, $msg) {\n // [Code omitted for brevity]\n }\n\n // Additional methods (matchUsers, endChatForBoth, onClose, onError)...\n}\n\n// Create the event loop\n$loop = React\\EventLoop\\Factory::create();\n\n// Set up the SSL context\n$context = [\n 'ssl' =&gt; [\n 'local_cert' =&gt; '/etc/ssl/certs/cloudflare_origin.crt',\n 'local_pk' =&gt; '/etc/ssl/private/cloudflare_origin.key',\n 'allow_self_signed' =&gt; true,\n 'verify_peer' =&gt; false\n ]\n];\n\n// Create a TCP socket listening on all interfaces on port 2053\n$socket = new React\\Socket\\Server('0.0.0.0:2053', $loop);\n// Wrap it with SSL\n$secureSocket = new React\\Socket\\SecureServer($socket, $loop, $context);\n\n// Set up the WebSocket server\n$server = new Ratchet\\Server\\IoServer(\n new Ratchet\\Http\\HttpServer(\n new Ratchet\\WebSocket\\WsServer(\n new ChatServer()\n )\n ),\n $secureSocket,\n $loop\n);\n\nerror_log(&quot;Secure WebSocket server is running on port 2053...&quot;);\n$server-&gt;run();\n?&gt;\n</code></pre>\n<p>script.js:</p>\n<pre><code>let ws = new WebSocket(&quot;wss://meetwithchat.com:2053/&quot;);\n\nws.onopen = function () {\n // Send initial messages to set gender and preference\n ws.send(JSON.stringify({ type: &quot;setGender&quot;, gender: genderValue }));\n ws.send(JSON.stringify({ type: &quot;setPreference&quot;, preference: preferenceValue }));\n};\n\nws.onmessage = function (event) {\n const data = JSON.parse(event.data);\n if (data.type === &quot;match&quot;) {\n // Handle a successful match\n } else if (data.type === &quot;message&quot;) {\n // Append message to chat UI\n } else if (data.type === &quot;chatEnded&quot;) {\n alert(&quot;Partner has left the chat. Chat ended!&quot;);\n resetChat();\n }\n};\n\nws.onclose = function () {\n resetChat();\n};\n</code></pre>\n"^^ . + . + . + . + . + . + . + "2"^^ . + "1"^^ . + "`ODBC Driver 17 for SQL Server` is *very* old. Update to 18. The date-related database types have no format either, they're binary values. Instead of trying to convert them to strings [specify the timestamp precision](https://laravel.com/docs/12.x/migrations), eg `$table->timestamps(2);`. That's the real fix in the [related Laravel issue](https://github.com/laravel/framework/issues/27200#issuecomment-499400008)"^^ . + "0"^^ . + "5"^^ . + "<p>in <strong>AppServiceProvider.php</strong> add <code>Paginator::useBootstrap();</code> in <em><strong>boot</strong></em> method.</p>\n<p>and import below statement:</p>\n<pre><code>use Illuminate\\Pagination\\Paginator;\n</code></pre>\n"^^ . + . + . + . + "1"^^ . + . + . + "in my actual production env, i am not working with valid HTML given by other sites. the example above is a simplified demonstration of issue i am encountering in production"^^ . + "Try `sudo update-alternatives --set php PATH-TO-PHP-BINARY`"^^ . + "<p>My setup of my test suite requires a local web server to be launched.</p>\n<p>So far, I have come up with this: I employ a PHP built-in web server, a PHP script that starts a web server, runs tests, and finally terminates the webserver it started.</p>\n<pre><code>&lt;?php\n\n$childPid = pcntl_fork();\n\nif ($childPid == -1) {\n die('Fork failed');\n} else if ($childPid == 0) {;\n // start webserver\n pcntl_exec('/usr/local/bin/php -S localhost:1234');\n} else {\n // TODO: check if the webserver is ready \n \n // run tests\n passthru(__DIR__.'/vendor/bin/phpunit tests');\n \n // terminate webserver\n exec(&quot;kill -15 $childPid&quot;);\n}\n</code></pre>\n<p>The above script is located under <code>/app/test.php</code>. When I run it like so</p>\n<pre><code>php test.php\n</code></pre>\n<p>I'm getting this error:</p>\n<blockquote>\n<p><code>PHP Warning: pcntl_exec(): Error has occurred: (errno 2) No such file or directory in /app/test.php on line 9</code></p>\n</blockquote>\n<p>For reference, this is what the official doc says about the <code>$path</code> parameter (the first parameter of <code>pcntl_exec</code>):</p>\n<blockquote>\n<p>path must be the path to a binary executable or a script with a valid\npath pointing to an executable in the shebang ( #!/usr/local/bin/perl\nfor example) as the first line. See your system's man execve(2) page\nfor additional information.</p>\n</blockquote>\n<p>I'm pretty sure the path (<code>/usr/local/bin/php</code>) I provided is correct and it's not a symlink.</p>\n<p>When</p>\n<pre><code>/usr/local/bin/php -S localhost:1234\n</code></pre>\n<p>is called from the command line the webserver is launched successfully.</p>\n"^^ . + . + . + . + . + . + "1"^^ . + . + "1"^^ . + . + "0"^^ . + . + . + "1"^^ . + "this is what is returned...\n\n [0] => 9\n [1] => 역시also\n [2] =>\n\n9 in the zero spot of the array is a counter... but no split occurs for me... I am speculating I have spaces or something affecting my string but I am not seeing them... I tried using trim() to get rid of spaces before and after but .... that is the only idea I have for why this is not working for me.... The data itself is coming in from a file and when I run mb_detect_encoding() on the string it returns UTF-8...."^^ . + . + . + "0"^^ . + . + . + . + . + "-1"^^ . + "Related: https://stackoverflow.com/questions/2394532/apache-is-unable-to-initialize-module-because-of-modules-and-phps-api-dont"^^ . + . + "The error log should probably be in `/tmp` or `/var/log` or something similar. Starting from `/` means it will try to write to the root directory, which the server may not be allowed to do"^^ . + . + . + "Got passed that by using --without-iconv as I don't need it. Now an error about Package 'oniguruma' not found. Do you mind if I leave it here for now, it's late here and had a long day. I'm going to accept your answer as you have fixed the problem I came here with, thank you so much!"^^ . + "leaflet"^^ . + . + . + "0"^^ . + "1"^^ . + . + . + "You've done too much `htmlspecialchars()` in your chain of data handling before getting here. Probably something before stored into the database and export to Excel. You'll need to declutter your data handling process to get clear HTML saved in database first. i.e. `<p>LET us try this 'n export</p>` instead of whatever you got here."^^ . + "0"^^ . + "0"^^ . + "2"^^ . + . + . + . + "Join two regex with PHP having different results"^^ . + . + "-2"^^ . + "0"^^ . + . + . + . + . + . + . + "@ADyson What a miracle that I own my own project and I decide what's best for it."^^ . + "<p>It looks like you are deploying to ECS Fargate. ECS does not make container names available for hostname resolution by default. You are getting the error <code>host not found in upstream &quot;php:9000&quot;</code> because when the Nginx container tries to resolve the hostname <code>php</code> it doesn't resolve to anything.</p>\n<p>Since both containers are running in the same task, they can resolve each over via <code>localhost</code>. This is documented <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-task-networking.html" rel="nofollow noreferrer">here</a>. You need to change your Nginx configuration to:</p>\n<pre><code>upstream php {\n server localhost:9000;\n}\n</code></pre>\n"^^ . + . + . + "Any specific reason you are writing this yourself - when they provide a PHP SDK? https://developer.phonepe.com/v1/reference/php-setup"^^ . + . + "Overall this whole affair is hardly related to dblib, pdo or PHP. It's clearly a network problem."^^ . + "If you don't want such notices in your output, configure PHP to log them to a file instead."^^ . + . + "`$var['x']` is non-null, so it's true."^^ . + . + . + . + "0"^^ . + . + "<p>When I run my code, the image is not showing in the admin dashboard, although all other columns (Name, Category, Price, etc.) are displaying correctly. I have already connected the system to the database successfully using PHPMyAdmin, and I can confirm that the data is being fetched properly from the database. The issue seems to be isolated to the image column, as the other product details are being displayed without any problems.</p>\n<p>I have checked the image paths in the database, and they appear to be correct, but the images are not displaying in the admin panel.</p>\n<p>Additionally, I am experiencing an issue with the alignment of the ID column. When I display the product details in a table, all columns (Name, Category, Price, etc.) are aligned correctly in the center, but the ID column is misaligned and appears to be shifted upwards. However, if I place the ID in the same position as the Name column, the ID column aligns correctly, but the Name column becomes misaligned. It seems like the issue is related to the content inside the cells, particularly the first columns of the table.</p>\n<p>Here is the code I am using:</p>\n<pre><code> &lt;thead&gt;\n &lt;tr&gt;\n &lt;?php foreach(array_keys($products[0]) as $title): ?&gt;\n &lt;th scope=&quot;col&quot;&gt;&lt;?= $title ?&gt;&lt;/th&gt;\n &lt;?php endforeach ?&gt;\n &lt;th scope=&quot;col&quot;&gt;Action&lt;/th&gt;\n &lt;/tr&gt;\n &lt;/thead&gt;\n &lt;tbody&gt;\n &lt;?php foreach ($products as $product): ?&gt;\n &lt;tr&gt;\n &lt;td&gt;&lt;?= htmlspecialchars($product['ID']) ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?= htmlspecialchars($product['Name']) ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?= htmlspecialchars($product['Genres']) ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?= number_format($product['Price'], 2) ?&gt;&lt;/td&gt;\n &lt;td style=&quot;max-width: 200px; word-wrap: break-word; overflow: hidden;&quot;&gt;\n &lt;?= htmlspecialchars($product['Description']) ?&gt;\n &lt;/td&gt;\n &lt;td&gt;&lt;img src=&quot;&lt;?= htmlspecialchars($product['Image']) ?&gt;&quot; alt=&quot;Product Image&quot;&gt;&lt;/td&gt;\n &lt;td&gt;\n &lt;a href=&quot;product_edit.php?id=&lt;?= htmlspecialchars($product['ID']) ?&gt;&quot; class=&quot;btn edit&quot;&gt;\n &lt;i class=&quot;fa-regular fa-pen-to-square&quot;&gt;&lt;/i&gt;\n &lt;/a&gt;\n &lt;a href=&quot;product_delete.php?id=&lt;?= htmlspecialchars($product['ID']) ?&gt;&quot; class=&quot;btn delete&quot;&gt;\n &lt;i class=&quot;fa-solid fa-trash&quot;&gt;&lt;/i&gt;\n &lt;/a&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php endforeach; ?&gt;\n &lt;/tbody&gt;\n&lt;/table&gt;\n</code></pre>\n<p>Issues:</p>\n<p>Image not displaying: I’ve verified that the image paths stored in the database appear correct, but the images aren't showing up in the table.</p>\n<p>ID column misalignment: The ID column shifts upwards, while the Name column misaligns when swapped with ID. All other columns align correctly in the center.</p>\n<p>I've tried different approaches for aligning the ID column using CSS, but I haven’t made much progress with the image display issue.</p>\n"^^ . + . + "Its quite old - its 2013 and yes 32 bit"^^ . + . + . + . + . + "0"^^ . + . + "<p>I am working on a WprdPress/WooCommerce plugin feature where specific Customers are shown only a subset of Products.<br />\nThe user has a meta data field with an array of post ids corresponding to the allowed Products.</p>\n<p>I am trying to hook into the main query:</p>\n<pre><code>add_action( 'pre_get_posts', 'customprefix_pre_get_posts' );\n\nfunction customprefix_pre_get_posts( $query )\n{\n $user = wp_get_current_user();\n\n if ( $query-&gt;is_main_query() &amp;&amp; is_product_category() )\n {\n /** @var array $allowed Post IDs */\n $allowed = customprefix_get_allowed_products_per_user( $user );\n\n $query-&gt;set( 'post__in', $allowed );\n }\n}\n</code></pre>\n<p>I have tried many different combinations of how to add the <code>post__in</code> clause to the query including <code>$query-&gt;query_vars['post__in'] = $allowed</code> and others. I have tried adding <code>$query-&gt;parse_query_vars()</code> as well with no success.</p>\n<p>While diving further into the <code>get_posts()</code> function in <code>WP_Query</code> it appears that my change to the Query is returned correctly (by reference) from the <code>pre_get_posts</code> hook. The next line: <code>$q = $this-&gt;fill_query_vars( $q );</code> somehow looses my custom <code>post__in</code> field.</p>\n<p>Most of the documentation for <code>WP_Query</code> and <code>post__in</code> revolve around creating a new query, not modifying the main query.</p>\n<p>Edit Per request:\n$allowed = [1234,1235,1236,1237]</p>\n"^^ . + "0"^^ . + "What is actually the question: Are you looking for a migration strategy from encrypted passwords to hashed ones or do you want to keep the encryption (maybe because of the old data) and are looking for an alternative to the deprecated *mcrypt*?"^^ . + . + "2"^^ . + . + . + . + "Laravel session values are deleted immediately (Laravel 12)"^^ . + . + . + "1"^^ . + "<p>We are running FPM 8 under php version 8.2.27.</p>\n<p>Configuration:</p>\n<pre><code>pm = dynamic\npm.max_children = 500\npm.start_severs = 32\npm.min_spare_servers = 32\npm.max_spare_servers = 64\npm.max_requests = 1000\n</code></pre>\n<p>We have noticed that under initial start, FPM runs smoothly. Over time the master process seems to increase in its CPU usage despite the amount of children remaining the same or not changing much at all. We have been trying to figure out the issue with fpm. Whether its a problem with configuration or something else. We don't have any scripts hanging when this occurs, until the master process crosses a certain &quot;line&quot;.</p>\n<p>Main issue occurs after Master Process hits over 90% cpu usage of a single core (roughly 24% of all core usage). More master processes start spawning and despawning, and fpm seems to continuously create children while terminating them at the same time. These children don't seem to be used for anything. This eventually causes a crash or hang. Logs contain no useful information outside of fpm being unable to write to stdout.</p>\n<p>The following is from monit, shortly before FPM started to hang.</p>\n<pre><code>Process 'php-fpm8'\n\nstatus OK\nmonitoring status Monitored\nmonitoring mode active\non reboot start\npid 2977861\nparent pid 1\nuid 0\neffective uid 0\ngid 0\nuptime 1d 0h 9m\nthreads 1\nchildren 50\ncpu 98.4%\ncpu total 98.9%\nmemory 0.8% [375.9 MB]\nmemory total 25.5% [11.9 GB]\nsecurity attribute kernel\nfiledescriptors 69 [6.7% of 1024 limit]\ntotal filedescriptors 351\nread bytes 21.2 kB/s [601.1 GB total]\ndisk read bytes 0 B/s [19.2 GB total]\ndisk read operations 55.3 reads/s [175652524 reads total]\nwrite bytes 0 B/s [53.3 GB total]\ndisk write bytes 0 B/s [915.9 MB total]\ndisk write operations 5.0 writes/s [14306972 writes total]\ndata collected Fri, 07 Mar 2025 09:32:53\n</code></pre>\n"^^ . + . + . + . + . + . + "<p>As @Bademeister mentions it is not recommended, and as many times I tried to inject the S3 directly to Symfony Service container I failed.</p>\n<p>But there are cases that using S3 directly is far more preferable such as:</p>\n<ul>\n<li>refactoring spagheti code.</li>\n<li>Strict policies (eg in banking software) about dependencies and libraries.</li>\n<li>Have a maintainable way to access s3 without needed <em>extra</em> 3rd party libraries beyond aws sdk.</li>\n<li>Accessing s3 actions directly</li>\n<li>...</li>\n</ul>\n<p>Therefore, I made a proxy object (applying <a href="https://en.wikipedia.org/wiki/Proxy_pattern" rel="nofollow noreferrer">Proxy Pattern</a>) using the magic method <code>__call</code> in order to forward any method call towards to actual S3:</p>\n<pre><code>namespace App\\Services;\n\nuse Aws\\S3\\S3Client;\n\nclass S3Service\n{\n private S3Client $s3Client;\n\n public function __construct(array $config=[])\n {\n $this-&gt;s3Client = new S3Client($config);\n }\n\n public function __call($method, $arguments)\n {\n return call_user_func_array([$this-&gt;s3Client, $method], $arguments);\n }\n}\n</code></pre>\n<p>Then upon services.yaml you can do:</p>\n<pre><code> App\\Services\\S3Service:\n public: true\n arguments:\n - version: 'latest'\n region: '%env(AWS_REGION)%'\n endpoint: 'http://s3:9000'\n use_path_style_endpoint: true\n credentials:\n key: '%env(S3_CLIENT_KEY)%'\n secret: '%env(S3_CLIENT_SECRET)%'\n</code></pre>\n<p>Afterward, upon the command you can use the <code>App\\Services\\S3Service</code> as you would use the <code>Aws\\S3\\S3Client</code>:</p>\n<pre><code>namespace App\\Command;\n\nuse App\\Services\\S3Service;\nuse Symfony\\Component\\Console\\Attribute\\AsCommand;\nuse Symfony\\Component\\Console\\Command\\Command;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\n\n#[AsCommand(\n name: 'test:s3',\n description: 'Add a short description for your command',\n)]\nclass TestS3Command extends Command\n{\n public function __construct(private S3Service $s3Client)\n {\n parent::__construct();\n }\n\n protected function configure(): void\n {\n }\n\n protected function execute(InputInterface $input, OutputInterface $output): int\n {\n \n $bucketName = 'test'; // Replace with your actual bucket name\n $objectKey = 'example.txt'; // The key (file name) in S3\n $text = &quot;Hello&quot;;\n\n try {\n $this-&gt;s3Client-&gt;putObject([\n 'Bucket' =&gt; $bucketName,\n 'Key' =&gt; $objectKey,\n 'Body' =&gt; $text,\n 'ContentType' =&gt; 'text/plain',\n ]);\n\n $output-&gt;writeln(&quot;File uploaded successfully to s3://{$bucketName}/{$objectKey}&quot;);\n return Command::SUCCESS;\n } catch (\\Exception $e) {\n $output-&gt;writeln(&quot;&lt;error&gt;Upload failed: {$e-&gt;getMessage()}&lt;/error&gt;&quot;);\n return Command::FAILURE;\n }\n\n return Command::SUCCESS;\n }\n}\n</code></pre>\n<p>That allows me to use the underlying S3 methods and bypassing the error that Symfony's service container throws.</p>\n<p>But there's a downside that your IDE may not type hint any method compared on using the S3Client directly.</p>\n<hr />\n<h1>Enhancement</h1>\n<p>If you want the methdods from the S3Client to be typehinted in your IDE, you can make <code>S3Service</code> implement the <code>Aws\\S3\\S3ClientInterface</code>:</p>\n<pre><code>namespace App\\Services;\n\nuse Aws\\CommandInterface;\nuse Aws\\S3\\S3Client;\nuse Aws\\S3\\S3ClientInterface;\n\nclass S3Service implements S3ClientInterface\n{\n private S3Client $s3Client;\n\n public function __construct(array $config = [])\n {\n $this-&gt;s3Client = new S3Client($config);\n }\n\n public function __call($name, $arguments)\n {\n return call_user_func_array([$this-&gt;s3Client, $name], $arguments);\n }\n\n public function getConfig($option = null)\n {\n return $this-&gt;s3Client-&gt;getConfig($option);\n }\n\n public function getHandlerList()\n {\n return $this-&gt;s3Client-&gt;getHandlerList();\n }\n\n public function getIterator($name, array $args = [])\n {\n return $this-&gt;s3Client-&gt;getIterator($name, $args);\n }\n\n public function getPaginator($name, array $args = [])\n {\n return $this-&gt;s3Client-&gt;getPaginator($name, $args);\n }\n\n public function waitUntil($name, array $args = [])\n {\n return $this-&gt;s3Client-&gt;waitUntil($name, $args);\n }\n\n public function getWaiter($name, array $args = [])\n {\n return $this-&gt;s3Client-&gt;getWaiter($name, $args);\n }\n\n public function createPresignedRequest(CommandInterface $command, $expires, array $options = [])\n {\n return $this-&gt;s3Client-&gt;createPresignedRequest($command, $expires, $options);\n }\n\n public function getObjectUrl($bucket, $key)\n {\n return $this-&gt;s3Client-&gt;getObjectUrl($bucket, $key);\n }\n\n public function doesBucketExist($bucket)\n {\n return $this-&gt;s3Client-&gt;doesBucketExist($bucket);\n }\n\n public function doesBucketExistV2($bucket, $accept403)\n {\n return $this-&gt;s3Client-&gt;doesBucketExistV2($bucket, $accept403);\n }\n\n public function doesObjectExist($bucket, $key, array $options = [])\n {\n return $this-&gt;s3Client-&gt;doesObjectExist($bucket, $key, $options);\n }\n\n public function doesObjectExistV2($bucket, $key, $includeDeleteMarkers = false, array $options = [])\n {\n return $this-&gt;s3Client-&gt;doesObjectExistV2($bucket, $key, $includeDeleteMarkers, $options);\n }\n\n public function registerStreamWrapper()\n {\n $this-&gt;s3Client-&gt;registerStreamWrapper();\n }\n\n public function registerStreamWrapperV2()\n {\n $this-&gt;s3Client-&gt;registerStreamWrapperV2();\n }\n\n public function deleteMatchingObjects($bucket, $prefix = '', $regex = '', array $options = [])\n {\n $this-&gt;s3Client-&gt;deleteMatchingObjects($bucket, $prefix, $regex, $options);\n }\n\n public function deleteMatchingObjectsAsync($bucket, $prefix = '', $regex = '', array $options = [])\n {\n return $this-&gt;s3Client-&gt;deleteMatchingObjectsAsync($bucket, $prefix, $regex, $options);\n }\n\n public function upload($bucket, $key, $body, $acl = 'private', array $options = [])\n {\n return $this-&gt;s3Client-&gt;upload($bucket, $key, $body, $acl, $options);\n }\n\n public function uploadAsync($bucket, $key, $body, $acl = 'private', array $options = [])\n {\n return $this-&gt;s3Client-&gt;uploadAsync($bucket, $key, $body, $acl, $options);\n }\n\n public function copy($fromBucket, $fromKey, $destBucket, $destKey, $acl = 'private', array $options = [])\n {\n return $this-&gt;s3Client-&gt;copy($fromBucket, $fromKey, $destBucket, $destKey, $acl, $options);\n }\n\n public function copyAsync($fromBucket, $fromKey, $destBucket, $destKey, $acl = 'private', array $options = [])\n {\n return $this-&gt;s3Client-&gt;copyAsync($fromBucket, $fromKey, $destBucket, $destKey, $acl, $options);\n }\n\n public function uploadDirectory($directory, $bucket, $keyPrefix = null, array $options = [])\n {\n $this-&gt;s3Client-&gt;uploadDirectory($directory, $bucket, $keyPrefix, $options);\n }\n\n public function uploadDirectoryAsync($directory, $bucket, $keyPrefix = null, array $options = [])\n {\n return $this-&gt;s3Client-&gt;uploadDirectoryAsync($directory, $bucket, $keyPrefix, $options);\n }\n\n public function downloadBucket($directory, $bucket, $keyPrefix = '', array $options = [])\n {\n $this-&gt;s3Client-&gt;downloadBucket($directory, $bucket, $keyPrefix, $options);\n }\n\n public function downloadBucketAsync($directory, $bucket, $keyPrefix = '', array $options = [])\n {\n return $this-&gt;s3Client-&gt;downloadBucketAsync($directory, $bucket, $keyPrefix, $options);\n }\n\n public function determineBucketRegion($bucketName)\n {\n return $this-&gt;s3Client-&gt;determineBucketRegion($bucketName);\n }\n\n public function determineBucketRegionAsync($bucketName)\n {\n return $this-&gt;s3Client-&gt;determineBucketRegionAsync($bucketName);\n }\n\n public function getCommand($name, array $args = [])\n {\n return $this-&gt;s3Client-&gt;getCommand($name,$args);\n }\n\n public function execute(CommandInterface $command)\n {\n return $this-&gt;s3Client-&gt;execute($command);\n }\n\n public function executeAsync(CommandInterface $command)\n {\n return $this-&gt;s3Client-&gt;executeAsync($command);\n }\n\n public function getCredentials()\n {\n return $this-&gt;s3Client-&gt;getCredentials();\n }\n\n public function getRegion()\n {\n return $this-&gt;s3Client-&gt;getRegion();\n }\n\n public function getEndpoint()\n {\n return $this-&gt;s3Client-&gt;getEndpoint();\n }\n\n public function getApi()\n {\n return $this-&gt;s3Client-&gt;getApi();\n }\n}\n</code></pre>\n<p>Then upon <code>services.yaml</code> set an alias for the <code>Aws\\S3\\S3ClientInterface</code>:</p>\n<pre><code>services:\n\n # ALIAS interface as a Service\n Aws\\S3\\S3ClientInterface:\n alias: App\\Services\\S3Service\n public: true\n\n\n App\\Services\\S3Service:\n public: true\n arguments:\n - version: 'latest'\n region: '%env(AWS_REGION)%'\n endpoint: 'http://s3:9000'\n use_path_style_endpoint: true\n credentials:\n key: '%env(S3_CLIENT_KEY)%'\n secret: '%env(S3_CLIENT_SECRET)%'\n\n</code></pre>\n"^^ . + "1"^^ . + . + "When you see strpos @ 1 in XHProf's output, it means that the profiling data is showing the performance metrics (like execution time, memory usage, etc.) for the strpos function call at that particular point in the code."^^ . + . + . + . + . + "0"^^ . + . + "2"^^ . + "0"^^ . + "4"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + "2"^^ . + . + . + "1"^^ . + "0"^^ . + . + "<p>I'm trying to put a Polylang language switcher in PHP to appear in the header of a webpage with a shortcode. I get the switcher where I insert the shortcode, but also appears at the top of the webpage. It seems that it prints twice. I'm doing something wrong, but I don't know what it is.</p>\n<pre><code>&lt;?php\nfunction switcher() {\n $message = pll_the_languages( array( 'hide_current' =&gt; 1 ) );\n return $message;\n}\nadd_shortcode( 'switcher_shortcode', 'switcher' );\n?&gt;\n</code></pre>\n<p>My guess is that this line <code>pll_the_languages( array( 'hide_current' =&gt; 1 ) )</code> prints the first switcher and the &quot;return&quot; prints the second switcher. If I delete the <code>return</code> the switcher only appears at the top of the webpage, but I need the switcher where I put the shortcode.</p>\n"^^ . + . + . + . + "What is the total number of balls? If it's not too high, your method looks good enough to me."^^ . + "Try the line `$date = date('y-m-d h:i:s', time());` wrapped this way: `error_log($date = date('y-m-d h:i:s', time()));` If it logs, the error is afterwards, if it does not log, the error is earlier. Rinse and repeat. Right now I don't see you log anything in your script, despite you say you alreay managed to activate logging. But then you actually need to log as well (and apropos 500: The webservers log should also have some diagnostics,)"^^ . + . + "oauth"^^ . + . + . + . + "I added the data for the image. Trying to add it here but put it above."^^ . + . + "3"^^ . + . + . + . + . + . + . + . + . + "Here is the link: https://i.ibb.co/hNJpkxW/code.jpg\n\nAdditionally: I am using livewire 3. This code (GuideForm) is a form object. My parent class is RecipeWizard. I hope everything is clear for you, let me know If you'll need more info (and I also forgot to debug image storing, I'll do it a little bit later)\n- thank you very much for help"^^ . + "shouldn't it be `s:6:"skills"`? it may be possible to extract the data using sql, but you'd have to provide a whole lot more examples to show what all kind of values you are dealing with"^^ . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + . + "How to Use Attributes Default Display Order for get_available_variations() Loop on Product Page?"^^ . + "I am using an apache server."^^ . + . + . + . + "-1"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "YITH Wishlist AJAX Request Failing – result: false in Response"^^ . + . + "1"^^ . + . + . + "<p>Ok the issue was the path, that is the correct one: <code>'./../react/controllers'</code></p>\n"^^ . + . + "0"^^ . + . + . + "1"^^ . + "I removed the API request to check and moved the IP check into the java code itself for testing, basically I hard-coded the hostname which it needed to check if the incoming hostname matches that since then I wouldn't need to wait for the API to respond.\nBut that also gave me some troubles as addr.getHostName(); and contains() in an if statement still caused the script to take too long sometimes so I removed it temporarily. \nAfter I removed the addr.getHostName() check completely, the script works perfectly. I'm not sure why it still times out even with hard-coded values."^^ . + . + "<p>I have a website built using the LAMP stack, i am trying to convert the UI to nextjs, the website is running on a dedicated bare metal server, is there a way for me to access the backend from the nextjs app which will be hosted somewhere else e.g. on netlify</p>\n"^^ . + . + . + "1"^^ . + . + "Your question is closed as a duplicate of one which explains the possible causes of the exact error message you've reported, and how to solve it. In what way would you not consider that to be a solution? If you think the cause of your "headers already sent" error somehow differs from all the causes and explanations already clearly documented in the answers to that post, and in many other places online, please [edit] your post to explain how your scenario is different/unique and therefore requires fresh answers."^^ . + . + . + "<p>it doesn't matter if you register again even if never logged in. registering the same user results in a failure in the body payload validation:</p>\n<pre><code>'email' =&gt; ['required', 'string', 'lowercase', 'email', 'max:255', 'unique:'.User::class],\n</code></pre>\n<p>as you can see the email must be unique.\nIn addition i would recomend to return a 201 status code for successfully created resources in the database. Try with a response like this, to handle request meant for json responses and for webapp navigation:</p>\n<pre><code>return $request-&gt;wantsJson()\n ? new JsonResponse([], 201) \n : redirect($this-&gt;redirectPath());\n\n</code></pre>\n"^^ . + . + . + . + "The first part of the code populated the 1st menu just fine the 2nd part of the code does not populate the 2nd menu"^^ . + . + "rest"^^ . + . + . + . + "1"^^ . + . + "<p>Finally solved it.</p>\n<p>To generate transcripts of an audio from a live source (e.g online radio, e.t.c) using Google cloud speech-to-text API V2 &amp; PHP.</p>\n<p>Follow the installation requirements on the google documentation page and then use this code below.</p>\n<pre><code>&lt;?php\n\nuse Google\\ApiCore\\ApiException;\nuse Google\\ApiCore\\BidiStream;\nuse Google\\Cloud\\Speech\\V2\\AudioEncoding;\nuse Google\\Cloud\\Speech\\V2\\AutoDetectDecodingConfig;\nuse Google\\Cloud\\Speech\\V2\\Client\\SpeechClient;\nuse Google\\Cloud\\Speech\\V2\\ExplicitDecodingConfig;\nuse Google\\Cloud\\Speech\\V2\\RecognitionConfig;\nuse Google\\Cloud\\Speech\\V2\\RecognitionFeatures;\nuse Google\\Cloud\\Speech\\V2\\StreamingRecognitionConfig;\nuse Google\\Cloud\\Speech\\V2\\StreamingRecognizeRequest;\n\n$projectId = &quot;xxx-4551&quot;;\nputenv('GOOGLE_APPLICATION_CREDENTIALS=' . __DIR__ . '/xxx-4551-be3eb805f1d7.json');\n\n$ffmpegInUrl = 'https://npr-ice.streamguys1.com/live.mp3';\n$ffmpegCommand = implode(' ', [\n 'ffmpeg', '-user_agent', 'FFmpeg', '-re', '-i', escapeshellarg($ffmpegInUrl),\n '-acodec', 'pcm_s16le', '-ac', '1', '-ar', '16000', '-f', 'wav', 'pipe:1'\n]);\n$handle = popen($ffmpegCommand, &quot;r&quot;);\n\ntry {\n $client = new SpeechClient(['transport' =&gt; 'grpc', 'credentials' =&gt; json_decode(file_get_contents(getenv('GOOGLE_APPLICATION_CREDENTIALS')), true)]);\n} catch (Exception $e) {\n echo 'Error: ' . $e-&gt;getMessage();\n exit;\n}\n\ntry {\n $recognitionConfig = (new RecognitionConfig())\n -&gt;setAutoDecodingConfig(new AutoDetectDecodingConfig())\n -&gt;setLanguageCodes(['en-US'], ['en-UK'])\n -&gt;setModel('long');\n} catch (Exception $e) {\n echo 'Error: ' . $e-&gt;getMessage();\n exit;\n}\n\ntry {\n $streamConfig = (new StreamingRecognitionConfig())\n -&gt;setConfig($recognitionConfig);\n} catch (Exception $e) {\n echo 'Error: ' . $e-&gt;getMessage();\n exit;\n}\ntry {\n $configRequest = (new StreamingRecognizeRequest())\n -&gt;setRecognizer(&quot;projects/$projectId/locations/global/recognizers/_&quot;)\n -&gt;setStreamingConfig($streamConfig);\n} catch (Exception $e) {\n echo 'Error: ' . $e-&gt;getMessage();\n exit;\n}\n\n$stream = $client-&gt;streamingRecognize();\n$stream-&gt;write($configRequest);\n\nwhile (!feof($handle)) {\n $chunk = fread($handle, 4096);\n if ($chunk !== false &amp;&amp; strlen($chunk) &gt; 0) {\n print_r('length_chunk_in');\n try {\n print_r('length_chunk_try: ' . strlen($chunk));\n $request = (new StreamingRecognizeRequest())\n -&gt;setAudio($chunk);\n $stream-&gt;write($request);\n } catch (Exception $e) {\n var_dump('length_chunk_fail: ' . $e-&gt;getMessage());\n }\n } else {\n var_dump('length_chunk_null : ' . $handle);\n }\n}\n\n\ntry {\n print_r('try_processing');\n foreach ($stream-&gt;closeWriteAndReadAll() as $response) {\n print_r('processing');\n foreach ($response-&gt;getResults() as $result) {\n foreach ($result-&gt;getAlternatives() as $alternative) {\n $trans = $alternative-&gt;getTranscript();\n mysqli_query($conn, &quot;INSERT INTO transcriptions (transcript) VALUES ('$trans')&quot;);\n }\n }\n }\n} catch (Google\\ApiCore\\ApiException $e) {\n if (strpos($e-&gt;getMessage(), &quot;Stream timed out&quot;) !== false) {\n echo &quot;Stream closed properly.\\n&quot;;\n } else {\n throw $e;\n }\n} finally {\n\n}\n\npclose($handle);\n$client-&gt;close();\n</code></pre>\n"^^ . + "2"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "Modify the Default Price In Cart Totals Based on Custom Tax Class"^^ . + . + . + . + "Add a progressive fee based on WooCommerce cart total weight"^^ . + "1"^^ . + "take a picture and upload it to 'https://imgbb.com/' And give me image url"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + "<p>I am working on a blogging application in Laravel 8.</p>\n<p>In the form I use for editing articles, I have a multiple-select element.</p>\n<p>I want the form to show the tags that have been selected. For this purpose, I did the following in the view:</p>\n<pre><code>&lt;label for=&quot;tags&quot; class=&quot;col-md-12&quot;&gt;{{ __('Tags') }}&lt;/label&gt;\n\n@php\n $selected = explode(&quot;,&quot;, $tags);\n@endphp\n\n&lt;select name=&quot;tags[]&quot; id=&quot;tags&quot; class=&quot;form-control&quot; multiple=&quot;multiple&quot;&gt;\n @foreach ($tags as $tag)\n &lt;option value=&quot;{{ $tag-&gt;id }}&quot; {{ (in_array($tag-&gt;id, $selected)) ? 'selected' : '' }}&gt;{{ $tag-&gt;name }}&lt;/option&gt;\n @endforeach\n&lt;/select&gt;\n</code></pre>\n<p>In the controller, I have:</p>\n<pre><code>public function edit($id)\n {\n $article = Article::find($id);\n return view(\n 'dashboard/edit-article',\n [\n 'categories' =&gt; $this-&gt;categories(),\n 'tags' =&gt; $this-&gt;tags(),\n 'article' =&gt; $article\n ]\n );\n }\n\npublic function update(Request $request, $id)\n{\n $validator = Validator::make($request-&gt;all(), $this-&gt;rules, $this-&gt;messages);\n\n if ($validator-&gt;fails()) {\n return redirect()-&gt;back()-&gt;withErrors($validator-&gt;errors())-&gt;withInput();\n }\n\n $fields = $validator-&gt;validated();\n $article = Article::find($id);\n\n // If a new image is uploaded, set it as the article image\n // Otherwise, set the old image...\n if (isset($request-&gt;image)) {\n $imageName = md5(time()) . Auth::user()-&gt;id . '.' . $request-&gt;image-&gt;extension();\n $request-&gt;image-&gt;move(public_path('images/articles'), $imageName);\n } else {\n $imageName = $article-&gt;image;\n }\n\n $article-&gt;title = $request-&gt;get('title');\n $article-&gt;short_description = $request-&gt;get('short_description');\n $article-&gt;category_id = $request-&gt;get('category_id');\n $article-&gt;featured = $request-&gt;has('featured');\n $article-&gt;image = $request-&gt;get('image') == 'default.jpg' ? 'default.jpg' : $imageName;\n $article-&gt;content = $request-&gt;get('content');\n // Save changes to the article\n $article-&gt;save();\n //Attach tags to article\n if ($request-&gt;has('tags')) {\n $article-&gt;tags()-&gt;attach($request-&gt;tags);\n }\n\n return redirect()-&gt;route('dashboard.articles')-&gt;with('success', 'The article titled &quot;' . $article-&gt;title . '&quot; was updated');\n}\n</code></pre>\n<p>For a reason I have not been able to spot, this does not work. That means the article's tags are not selected in the <code>&lt;select&gt;</code> element.</p>\n<p>Where is my mistake?</p>\n"^^ . + . + . + . + "<p>Idle connection is established successfully with a callback for the new email, but when sending an email to that connected email from another email and being successfully added to the <code>INBOX</code> folder but callback was not fired.</p>\n<pre><code>namespace App\\Console\\Commands;\n\nuse Illuminate\\Console\\Command;\nuse Webklex\\PHPIMAP\\ClientManager;\nuse Webklex\\PHPIMAP\\Exceptions\\ConnectionFailedException;\nuse Webklex\\PHPIMAP\\Exceptions\\FolderFetchingException;\nuse Webklex\\PHPIMAP\\Message;\n\nclass ImapIdleTest extends Command\n{\n protected $signature = 'imap:test-idle';\n protected $description = 'Test raw IMAP IDLE using Webklex/php-imap directly';\n\n public function handle()\n {\n $this-&gt;info(&quot; Connecting to Gmail via IMAP...&quot;);\n\n $clientManager = new ClientManager();\n\n $client = $clientManager-&gt;make([\n 'host' =&gt; 'imap.gmail.com',\n 'port' =&gt; 993,\n 'encryption' =&gt; 'ssl', // or 'tls' if using 587\n 'validate_cert' =&gt; true,\n 'username' =&gt; 'my_email@gmail.com',\n 'password' =&gt; 'App password', // App Password, not Gmail password\n 'protocol' =&gt; 'imap'\n ]);\n\n try {\n $client-&gt;connect();\n $this-&gt;info(&quot;✅ Connected.&quot;);\n } catch (ConnectionFailedException $e) {\n $this-&gt;error(&quot;❌ Connection failed: &quot; . $e-&gt;getMessage());\n return 1;\n }\n\n try {\n $folder = $client-&gt;getFolder('INBOX');\n } catch (FolderFetchingException $e) {\n $this-&gt;error(&quot;❌ Folder error: &quot; . $e-&gt;getMessage());\n return 1;\n }\n\n $this-&gt;info(&quot; Listening for new messages via IDLE...&quot;);\n\n try {\n $folder-&gt;idle(function (Message $message) {\n echo &quot;\\n New message: &quot; . $message-&gt;getSubject() . &quot;\\n&quot;;\n });\n } catch (ConnectionFailedException $e) {\n $this-&gt;error(&quot;❌ IDLE failed: &quot; . $e-&gt;getMessage());\n }\n }\n}\n</code></pre>\n<p>When a new email is received in the INBOX, it would echo in the terminal &quot; New message: &quot; with the subject of the new email.</p>\n<p>I also tried idling manually to the gmail imap servers using <code>openssl s_client -connect imap.gmail.com:993 -crlf</code>. After that, I logged in using <code>a LOGIN my_email@gmail.com &quot;my app password&quot;</code> which would give you success message. using <code>a SELECT INBOX</code> to select inbox and then <code>a IDLE</code> to open an idle connection. When sending a new email, it would print a number that I guess is the number of unread emails.</p>\n<p><img src="https://github.com/user-attachments/assets/ed1194ee-f737-4f6d-a9f0-8ef45731d299" alt="Image" /></p>\n"^^ . + . + . + "<p>I'm experiencing a weird issue with a PHP script that was working fine until my server was migrated to <strong>CloudLinux v9.5.0 with cPanel version 126.0.9</strong>.</p>\n<p>In the example below, I'm using Postman to send raw JSON body data. The issue occurs only when using the GET method—if I use POST, PUT, or PATCH, I can retrieve the data and decode it successfully.</p>\n<p>I've attached two screenshots (I had to hide the URL):</p>\n<ol>\n<li>GET request → file_get_contents('php://input') returns NULL.</li>\n</ol>\n<p><img src="https://i.sstatic.net/IYT7lqTW.png" alt="GET" /></p>\n<ol start="2">\n<li>POST request → The data is successfully retrieved and decoded.</li>\n</ol>\n<p><img src="https://i.sstatic.net/Cb3nROUr.png" alt="POST" /></p>\n<p>Here’s a sample extract of my PHP script:</p>\n<pre><code>&lt;?php\necho strtoupper($_SERVER['REQUEST_METHOD']) . &quot;\\n\\n\\n&quot;;\n\n$data = json_decode(file_get_contents('php://input'), true);\n\nvar_dump($data);\n?&gt;\n</code></pre>\n<p>Issue:</p>\n<ul>\n<li>Before migration: The script worked fine with GET requests.</li>\n<li>After migration: php://input is returning NULL when using GET.</li>\n<li>POST, PUT, PATCH work fine.</li>\n</ul>\n<p><strong>Possible Causes &amp; Questions:</strong></p>\n<ol>\n<li><p>Is there a server configuration change in CloudLinux v9.5.0 that prevents GET requests from having a body?</p>\n</li>\n<li><p>Are there any mod_security rules or PHP settings that could be stripping request bodies from GET requests?</p>\n</li>\n<li><p>Should I be using $_GET instead of php://input for GET requests? (I prefer keeping the body format consistent across methods.)</p>\n</li>\n<li><p>Is there a workaround to allow GET requests to contain JSON body data?</p>\n</li>\n</ol>\n<p>Would appreciate any insights or solutions to this issue. Thanks in advance!</p>\n"^^ . + "<p>I'm working on a PHP application using <strong>FastRoute</strong> for routing, and I’m experiencing an issue when trying to access the detail page of a specific debate. The list of debates works fine, but when I try to access a specific debate, I get a <strong>404 page not found</strong> error.</p>\n<h3>Here’s the situation:</h3>\n<ul>\n<li>The route <code>/debats</code> (or <code>/</code>) lists all the debates, and that works perfectly fine.</li>\n<li>But when I try to access a specific debate by clicking on the link (e.g., <code>/debatArena/debat/1</code>), it returns a <strong>404 error</strong>.</li>\n</ul>\n<p>I suspect the issue might be related to how I handle the <code>basePath</code> and URL cleaning in my code, but I’m not sure what exactly is wrong.</p>\n<h3>Here’s the relevant code in my <code>index.php</code>:</h3>\n<pre class="lang-php prettyprint-override"><code>require_once __DIR__ . '/../../vendor/autoload.php';\n\nuse FastRoute\\RouteCollector;\nuse function FastRoute\\simpleDispatcher;\nuse Controllers\\DebatController;\n\n// Define routes\n$dispatcher = simpleDispatcher(function (RouteCollector $r) {\n $r-&gt;get('/', 'Controllers\\DebatController@listDebats'); // List all debates\n $r-&gt;get('/debats', 'Controllers\\DebatController@listDebats'); // Another route for listing debates\n $r-&gt;get('/debat/{id:\\d+}', 'Controllers\\DebatController@viewDebat'); // View a specific debate\n});\n\n// Get the requested URL\n$httpMethod = $_SERVER['REQUEST_METHOD'];\n$basePath = '/debatArena'; // The base path for the app\n\n// Clean the URL\n$uri = $_SERVER['REQUEST_URI'];\n$uri = strtok($uri, '?'); // Remove query string\nif (strpos($uri, $basePath) === 0) {\n $uri = substr($uri, strlen($basePath));\n}\n\n// Debugging output\nvar_dump(&quot;Original URL: $uri&quot;);\n\n// Dispatch the request\n$routeInfo = $dispatcher-&gt;dispatch($httpMethod, $uri);\n\nswitch ($routeInfo[0]) {\n case FastRoute\\Dispatcher::NOT_FOUND:\n http_response_code(404);\n echo &quot;Page not found&quot;;\n break;\n\n case FastRoute\\Dispatcher::METHOD_NOT_ALLOWED:\n http_response_code(405);\n echo &quot;Method not allowed&quot;;\n break;\n\n case FastRoute\\Dispatcher::FOUND:\n $handler = $routeInfo[1];\n $vars = $routeInfo[2];\n\n // Instantiate the controller\n [$class, $method] = explode('@', $handler);\n $controllerInstance = new $class($pdo);\n\n // Call the controller method\n call_user_func_array([$controllerInstance, $method], $vars);\n break;\n}\n\n### Here's the code for the debats_list.php (the page showing all debates):\n\n// Example: debats_list.php (just a simple version)\n&lt;?php foreach ($debats as $debat): ?&gt;\n &lt;div&gt;\n &lt;h2&gt;&lt;?php echo $debat-&gt;getTitle(); ?&gt;&lt;/h2&gt;\n &lt;p&gt;&lt;?php echo $debat-&gt;getDescription(); ?&gt;&lt;/p&gt;\n &lt;a href=&quot;/debatArena/debat/&lt;?php echo $debat-&gt;getId(); ?&gt;&quot;&gt;View debate&lt;/a&gt;\n &lt;/div&gt;\n&lt;?php endforeach; ?&gt;\n\n\n\nWhat I'm trying to achieve:\n\n I have a list of debates, and I can navigate to each specific debate using links such as /debatArena/debat/1.\n However, when I try to access a specific debate, I get a 404 error.\n\nWhat I've tried so far:\n\n I've ensured that the routes are defined correctly.\n I’ve tried cleaning the URL by removing the basePath and other extra parts like /src/web/.\n The list of debates works, but the problem happens only when trying to access a specific debate.\n\nHas anyone encountered a similar issue with FastRoute in a PHP app, and how can I fix this issue to properly display the debate details?\n\nThanks in advance for your help!\n</code></pre>\n"^^ . + "pagination"^^ . + . + "Yeah. Thanks for your input, much appreciated."^^ . + . + "1"^^ . + "The error is pretty explicit. You are setting a field to null that cannot be null, per your own database definition. We cannot see the db definition or even the db fixtures, but the solution seems clear enough: either accept `null` for "semester", or set a value to "semester_id"."^^ . + . + "0"^^ . + "Like at line 1818 of the version at https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wpdb.php#L1818 ? As the 3 parameters are strings, perhaps truncating them with a `substr(…, 0, 999)` would have allowed dumping the error (and let it crash, but at least we would have the start of that strange 60 MB string, be it the query or the caller with context)."^^ . + . + . + . + "https://ideone.com/Jg5DMl - what does not work? Well, you do need to add the `u` flag just because you work with Unicode strings."^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "<p>I was wondering if something in php or webserver settings can modify the php function require?</p>\n<p>I do get this in error log:</p>\n<pre class="lang-none prettyprint-override"><code>PHP Fatal error: Uncaught Error: Failed opening required '/www/wp-includes/class-wp-session-tokens.phegistry.php' (include_path='.') in /www/wp-settings.php:207\nStack trace:\n#0 /www/wp-config.php(155): require_once()\n#1 /www/wp-load.php(50): require_once('...')\n#2 /www/wp-blog-header.php(13): require_once('...')\n#3 /www/index.php(17): require('...')\n#4 {main}\n thrown in /www/wp-settings.php on line 207\n</code></pre>\n<p>And when I go look in the file /www/wp-settings.php line 207 then I see the code:</p>\n<pre><code>require ABSPATH . WPINC . '/class-wp-session-tokens.php';\n</code></pre>\n<p>So there is no wrong code. I don't understand, I'm thinking someone can access my files and did override the require function. But strangely this is not the first require in WordPress.</p>\n<p>Question 1: How is this possible?<br />\nQuestion 2: What to do extra than changing ftp password?<br />\nQuestion 3: How to prevent the website from going down in the future?</p>\n<p>I understand there is no clear answer.</p>\n<p>I already changed the ftp password in case someone has access.</p>\n"^^ . + "<p>Thanks to the comments from @Mike Kinghan, I turned my attention to the zlib installation, which I had done last week (or maybe week before) as a dependency for GD/PHP.</p>\n<p>I had previously installed zlib-1.3.1 from source and, I thought from the package, but looking at the contents of /usr/local/lib it seems I installed a zip library from the package by mistake.</p>\n<p>Doing:</p>\n<pre><code>root@dev: # pkg search zlib\nlinux-c7-zlib-devel-1.2.7 Zlib headers (Linux CentOS 7.9.2009)\nlua51-lzlib-0.4.3_1 Lua bindings to the ZLib compression library\nlua51-zlib-1.2_1 Simple streaming interface to zlib for the Lua Programming Language\nlua52-lzlib-0.4.3_1 Lua bindings to the ZLib compression library\nlzlib-1.14_1 In-memory LZMA compression and decompression library\np5-Compress-Raw-Zlib-2.213 Low-Level Interface to zlib compression library\np5-IO-Zlib-1.15 IO:: style interface to Compress::Zlib\np5-POE-Filter-Zlib-2.04 POE filter wrapped around Compress::Zlib\nphp81-zlib-8.1.31 The zlib shared extension for php\nphp82-zlib-8.2.27 The zlib shared extension for php\nphp83-zlib-8.3.15 The zlib shared extension for php\nphp84-zlib-8.4.2 The zlib shared extension for php\npy311-zlib-ng-0.5.1 Python bindings for the zlib-ng library\nrubygem-zlib-3.2.1 Ruby interface for the zlib compression/decompression library\nzlib-ng-2.2.4 Fork of the zlib data compression library\n</code></pre>\n<p>I saw the php84-zlib-8.4.2 so installed that and it worked!</p>\n<p>I now have these files (which was pretty much what I had before) but with the addition of libz.a which is the only one dated this week, and this was the first one it failed on, so assume this was what fixed it.</p>\n<pre><code>root@dev: # dir /usr/local/lib/*z*\nlrwxr-xr-x 1 root wheel 24 Feb 7 19:42 /usr/local/lib/libharfbuzz-gobject.so -&gt; libharfbuzz-gobject.so.0\nlrwxr-xr-x 1 root wheel 32 Feb 7 19:42 /usr/local/lib/libharfbuzz-gobject.so.0 -&gt; libharfbuzz-gobject.so.0.61001.0\n-rwxr-xr-x 1 root wheel 118864 Feb 7 19:42 /usr/local/lib/libharfbuzz-gobject.so.0.61001.0\nlrwxr-xr-x 1 root wheel 23 Feb 7 19:42 /usr/local/lib/libharfbuzz-subset.so -&gt; libharfbuzz-subset.so.0\nlrwxr-xr-x 1 root wheel 31 Feb 7 19:42 /usr/local/lib/libharfbuzz-subset.so.0 -&gt; libharfbuzz-subset.so.0.61001.0\n-rwxr-xr-x 1 root wheel 1281168 Feb 7 19:42 /usr/local/lib/libharfbuzz-subset.so.0.61001.0\nlrwxr-xr-x 1 root wheel 16 Feb 7 19:42 /usr/local/lib/libharfbuzz.so -&gt; libharfbuzz.so.0\nlrwxr-xr-x 1 root wheel 24 Feb 7 19:42 /usr/local/lib/libharfbuzz.so.0 -&gt; libharfbuzz.so.0.61001.0\n-rwxr-xr-x 1 root wheel 1185872 Feb 7 19:42 /usr/local/lib/libharfbuzz.so.0.61001.0\n-rw-r--r-- 1 root wheel 78048 Jan 30 01:55 /usr/local/lib/liblz.a\nlrwxr-xr-x 1 root wheel 13 Jan 30 01:55 /usr/local/lib/liblz.so -&gt; liblz.so.1.14\nlrwxr-xr-x 1 root wheel 13 Jan 30 01:55 /usr/local/lib/liblz.so.1 -&gt; liblz.so.1.14\n-rwxr-xr-x 1 root wheel 70496 Jan 30 01:55 /usr/local/lib/liblz.so.1.14\n-rw-r--r-- 1 root wheel 198144 Jan 30 01:18 /usr/local/lib/liblz4.a\nlrwxr-xr-x 1 root wheel 11 Jan 30 01:18 /usr/local/lib/liblz4.so -&gt; liblz4.so.1\nlrwxr-xr-x 1 root wheel 16 Jan 30 01:18 /usr/local/lib/liblz4.so.1 -&gt; liblz4.so.1.10.0\n-rwxr-xr-x 1 root wheel 173192 Jan 30 01:18 /usr/local/lib/liblz4.so.1.10.0\n-rw-r--r-- 1 root wheel 179444 Feb 19 12:10 /usr/local/lib/libz.a\nlrwxr-xr-x 1 root wheel 11 Jan 30 02:15 /usr/local/lib/libzip.so -&gt; libzip.so.5\nlrwxr-xr-x 1 root wheel 13 Jan 30 02:15 /usr/local/lib/libzip.so.5 -&gt; libzip.so.5.5\n-rwxr-xr-x 1 root wheel 127176 Jan 30 02:15 /usr/local/lib/libzip.so.5.5\n-rw-r--r-- 1 root wheel 1010218 Jan 30 01:20 /usr/local/lib/libzstd.a\nlrwxr-xr-x 1 root wheel 16 Jan 30 01:20 /usr/local/lib/libzstd.so -&gt; libzstd.so.1.5.6\nlrwxr-xr-x 1 root wheel 16 Jan 30 01:20 /usr/local/lib/libzstd.so.1 -&gt; libzstd.so.1.5.6\n-r-xr-xr-x 1 root wheel 794952 Jan 30 01:20 /usr/local/lib/libzstd.so.1.5.6\n \n</code></pre>\n"^^ . + . + . + "Replace your `^/(wp-admin|wp-login\\.php)` regular expression with `^/wp-(?:admin/.*|login)\\.php$`. If this helps, I will write an answer with the explanation how this affects nginx behavior."^^ . + . + . + . + . + . + "0"^^ . + "2"^^ . + "homebrew"^^ . + . + . + "1"^^ . + . + "0"^^ . + . + . + "I've edited the post, I included every code that will be related to the problem. Thanks a lot!"^^ . + "<p>Here's how I got it done without any Javascript, JQuery or Ajax:</p>\n<p>The way to implement is to use the <code>&lt;meta http-equiv=&quot;refresh&quot; content=&quot;&lt;Time In Seconds&gt;;URL=newurl.com&quot;&gt;</code> tag. The <code>&lt;Time In Seconds&gt;</code> is a parameter to be included in that tag.</p>\n<p>The <code>&lt;meta http-equiv=&quot;refresh&quot;</code> tag can be placed anywhere in the code file - Not necessarily at the top, not necessarily at the bottom, just anywhere you wish to place it.</p>\n<p>The beauty of this tag is that it does NOT stop the execution of the code at itself. It will still execute ALL the code (<strong>including that below it</strong>) till the <code>&lt;Time In Seconds&gt;</code> remains a non-zero value.</p>\n<p>And it will itself get executed ONLY when the <code>&lt;Time In Seconds&gt;</code> value lapses.</p>\n<p>Hence, the way to get it going is to use a PHP parameter for <code>$remainingtime</code> in seconds, and have it updated to the remaining survey time each time a question of the survey is answered by the user.</p>\n<pre><code>&lt;meta http-equiv=&quot;refresh&quot; content=&quot;'.&lt;?php echo $remainingtime; ?&gt;.';URL=submitbeforetimeend.php&quot; /&gt;\n</code></pre>\n<p>Essentially, if the survey is to be completed in 20 minutes max, then start with 1200 as $remainingtime for Q1.\nIf user takes 50 seconds to answer Q1, update remaining time in the same/next form page for Q2 to 1950, and so on.</p>\n<p>If the user finishes only Q15 by the time that <code>$remainingtime</code> reaches zero, then the meta tag statement will get executed, and it will get redirected to <code>URL=submitbeforetimeend.php</code>.\nThis page will have the function to record the users' answers upto Q15, which serves the purpose without use of any client-side script.</p>\n<p>No Javascript, JQuery or Ajax. All user input remains hidden &amp; secure in PHP or whatever variables.</p>\n"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "<p>I have the following JS file embedded on multiple pages:</p>\n<pre><code>&lt;script src=&quot;&lt;?= $baseUrl?&gt;/js/cms-functions.js&quot;&gt;&lt;/script&gt;\n</code></pre>\n<p>Within the embedded JS file, dynamic urls are created:</p>\n<pre><code>let albumURL = `${o.baseUrl}/category-1/` + encodeURI(albumTitle + &quot;?album_id=&quot; + albumId);\n</code></pre>\n<p>Is there a reliable method to pass the <strong>/category-1/</strong> segment of the dynamic url as a variable via the <strong>script src</strong> tags?</p>\n"^^ . + "0"^^ . + "divi-theme"^^ . + . + "[This question](https://stackoverflow.com/questions/6149985/send-string-as-a-file-using-curl-and-php) shows how to do it with `curl`. I don't know how applicable this is to Symfony."^^ . + . + . + . + . + "0"^^ . + . + . + "1"^^ . + . + . + . + "nextcloud"^^ . + "3"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + "1"^^ . + "0"^^ . + "0"^^ . + "This means that you should rewrite your function to use enums instead of any string value."^^ . + . + . + . + "0"^^ . + "I don't know your server, so I can't tell exactly what's going on, however, it is clear that you're not actually getting your static files. It's not a MIME-problem. You get some sort of place-holder HTML file. I would try to start again, clean, without any .htaccess, and see if you can get the static files. Then slowly add in your things again and see when the static files change. Then you know what causes it."^^ . + "0"^^ . + "How to correctly structure a request for PhonePe Auto-Debit API (/v3/recurring/debit/init)?"^^ . + . + . + . + "availability"^^ . + "<p>I have been trying to install Memcache in my Laravel project and I have been having some issues. I am currently using XAMPP along with it and I am currently using PHP 8.2.12 ZTS. I downloaded the matching php_memcached.dll for 8.2 thread safe. I placed it in the extension, added the extension in php.ini and it showed me this error:</p>\n<blockquote>\n<p>Warning: PHP Startup: Unable to load dynamic library\n'php_memcached.dll' (tried: C:\\xampp\\php\\ext\\php_memcached.dll (The\nspecified module could not be found),\nC:\\xampp\\php\\ext\\php_php_memcached.dll.dll (The specified module could\nnot be found)) in Unknown on line 0</p>\n<p>In cache.php line 65:</p>\n<p>Class &quot;Memcached&quot; not found</p>\n</blockquote>\n<p>I then tried to put the libmemcached.dll inside the php folder and then in the System32. I got the same results and then I saw somewhere that I should put it in SysWow64, so I tried it. I still got the same result.</p>\n<p>Any help is appreciated!</p>\n"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + "To avoid that UAC issue, install xampp to the `c:` drive root instead. I had xampp installed to `c:\\xampp`, to be outside of UAC control."^^ . + "What's your server flavor ?"^^ . + "Any of these functions could be causing the problem. updateUserCredits, sendStyledMessage, makeRequest etc.\nI recommend timing the operation of each of these functions."^^ . + . + "0"^^ . + "0"^^ . + . + "<p>to register metavalues and retrieve them in the api, you can use this function :<br />\n<a href="https://developer.wordpress.org/reference/functions/register_meta/" rel="nofollow noreferrer">https://developer.wordpress.org/reference/functions/register_meta/</a></p>\n<p>it could be something like that :</p>\n<pre><code>$post_type_code = &quot;vehica_car&quot;;\n\n$metas = [\n &quot;price&quot;,\n &quot;model&quot;,\n &quot;year&quot;,\n &quot;mileage&quot;,\n &quot;fuel_type&quot;,\n &quot;transmission&quot;,\n &quot;condition&quot;,\n];\n\n\nforeach ($metas as $m) {\n \n $complete_name = &quot;vehica_$m&quot;;\n \n register_meta(&quot;post&quot;, $complete_name, [\n &quot;object_subtype&quot; =&gt; $post_type_code,\n &quot;show_in_rest&quot; =&gt; TRUE,\n ]);\n \n}\n</code></pre>\n"^^ . + . + "2"^^ . + . + . + "try `$groupingline = collect($linedata)->groupBy('id')->toArray();`"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + "mediawiki"^^ . + "Any reason you don't use php's dedicated Soap client? https://www.php.net/manual/en/book.soap.php"^^ . + . + . + . + . + "0"^^ . + "kubernetes"^^ . + . + . + . + "<p>I create session and session values are deleted when I refresh the page. I make the user login and when I refresh the page, auth()-&gt;user() returns me NULL value as if there is no one logged in. When I FILE the session driver value, it does not write anything to any file in the storage folder. When I make the driver value database, it does not write anything to the sessions table in the database.</p>\n<p><strong>I built my project over Docker.</strong></p>\n<p><strong>Operating System: Windows</strong></p>\n<p><strong>Laravel version: 12</strong></p>\n<p><strong>PHP version: 8.4</strong></p>\n<p>Laravel Session Enviroment:</p>\n<p><code>SESSION_DRIVER=database SESSION_LIFETIME=1400 SESSION_ENCRYPT=false SESSION_DOMAIN=null SESSION_SECURE_COOKIE=false</code></p>\n<p>If I give an example\nI can get the value when I use a code like this</p>\n<p><code>session([‘test’ =&gt; 123]);</code></p>\n<p><code>dd(session(‘test’));</code></p>\n<p>Then replace these codes, i.e.</p>\n<p><code>dd(session(‘test’));</code></p>\n<p><code>session([‘test’ =&gt; 123]);</code></p>\n<p>I get the NULL value when I use it.</p>\n<p>My dockerfile is like this:</p>\n<pre class="lang-none prettyprint-override"><code>\nWORKDIR /var/www/html\n\nCOPY . /var/www/html\n\n######## Composer.phar ########\nRUN curl -s https://getcomposer.org/installer | php \\\n # move composer into a bin directory you control:\n &amp;&amp; mv composer.phar /usr/local/bin/composer \\\n # double check composer works\n &amp;&amp; composer about\n\nRUN php -m &amp;&amp; echo &quot;=============================================&quot;\n\nRUN apt-get update &amp;&amp; apt-get install -y \\\n libpng-dev \\\n libxml2-dev \\\n libxslt-dev \\\n libzip-dev \\\n libsodium-dev\n\nRUN docker-php-ext-install \\\n exif \\\n opcache \\\n pcntl \\\n pdo_mysql \\\n zip \\\n sodium \\\n sockets\n\nRUN apt-get update &amp;&amp; \\\napt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev &amp;&amp; \\\ndocker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/\nRUN docker-php-ext-install gd\n\nRUN chmod -R 775 /var/www/html\nRUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache\n\n# Expose port 8001 and start php-fpm server\nEXPOSE 8001\nCMD [&quot;php-fpm&quot;]\n</code></pre>\n<p>The web part in my docker-compose.yml file is like this</p>\n<pre><code> web:\n build:\n context: .\n dockerfile: Dockerfile\n container_name: crypto\n working_dir: /var/www/html\n tty: true\n restart: unless-stopped\n volumes:\n - ./:/var/www/html\n networks:\n - crypto```\n\n\nCan you help me, please?\n</code></pre>\n"^^ . + "0"^^ . + "Add Star Rating Above WordPress Comments & Hide After Rating"^^ . + . + . + "We expect you to provide in your question a real code attempt with clear details and explanations, but not to pick up some existing code saying that it doesn't work for your case. Note that stack overflow is not a free coding service."^^ . + . + . + "how to response only 204 code status with no body message"^^ . + "0"^^ . + . + . + "Why would an extra backslash get added to php form input?"^^ . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + "1"^^ . + "How to Add a Box Shadow to an Image in Dompdf?"^^ . + . + . + "0"^^ . + . + . + "P.S. I'd argue your table structure isn't fully normalised. Unless I'm mistaken, each team should belong to a specific club, yes? If so then the Teams table should contain a ClubID column, and that would be a foreign key to the Clubs table. And then your Games table should not include any Club IDs - instead you'd join games -> teams -> clubs to get the club name."^^ . + "0"^^ . + . + . + . + . + "<p>I am able to create a module with two columns, <code>c1</code> and <code>c2</code> in my example, but get the dreaded</p>\n<blockquote>\n<p>Drupal\\Core\\Entity\\Query\\QueryException: 'my_2c' not found in Drupal\\Core\\Entity\\Query\\Sql\\Tables-&gt;ensureEntityTable() (line 373 of core/lib/Drupal/Core/Entity/Query/Sql/Tables.php).</p>\n</blockquote>\n<p>when I try to add it with <code>demo2c_entity_base_field_info()</code>.</p>\n<p>Complete enough code follows.</p>\n<p>My <code>demo2c.info.yml</code>.</p>\n<pre><code>name: Demo With Two Column Field Type\ntype: module\ndescription: Fails with hook_entity_base_field_info().\ncore_version_requirement: ^11.0\npackage: Demo\n</code></pre>\n<p>The <code>src/Plugin/Field/FieldType/Demo2CType.php</code> file.</p>\n<pre><code>&lt;?php\n\nnamespace Drupal\\demo2c\\Plugin\\Field\\FieldType ;\n\nuse Drupal\\Core\\Field\\FieldItemBase ;\nuse Drupal\\Core\\Field\\FieldStorageDefinitionInterface ;\nuse Drupal\\Core\\TypedData\\DataDefinition ;\n\n/**\n * A field type with two integer columns.\n *\n * @FieldType(\n * id = &quot;demo2c_field_type&quot;,\n * label = @Translation( &quot;Demo Two Column Field Type&quot; ),\n * module = &quot;demo2c&quot;,\n * description = @Translation( &quot;Fails when added with hook_entity_base_field_info().&quot; ),\n * default_widget = &quot;demo2c_field_widget&quot;,\n * default_formatter = &quot;demo2c_field_formatter&quot;\n * )\n */\nclass Demo2CType extends FieldItemBase {\n\n /**\n * {@inheritdoc}\n */\n public static function schema( FieldStorageDefinitionInterface $field_definition ) {\n return [ 'columns' =&gt; [ 'c1' =&gt; [ 'type' =&gt; 'int',\n 'size' =&gt; 'normal',\n 'not null' =&gt; FALSE ],\n 'c2' =&gt; [ 'type' =&gt; 'int',\n 'size' =&gt; 'normal',\n 'not null' =&gt; FALSE ] ] ] ;\n }\n\n /**\n * {@inheritdoc}\n */\n public function isEmpty() {\n return $this-&gt;get( 'c1' )-&gt;getValue() === NULL\n &amp;&amp; $this-&gt;get( 'c2' )-&gt;getValue() === NULL ;\n }\n\n /**\n * {@inheritdoc}\n */\n public static function propertyDefinitions( FieldStorageDefinitionInterface $field_definition ) {\n $prop[ 'c1' ] = DataDefinition::create( 'integer' )-&gt;setLabel( t( 'Column One' ) ) ;\n $prop[ 'c2' ] = DataDefinition::create( 'integer' )-&gt;setLabel( t( 'Column Two' ) ) ;\n return $prop ;\n }\n\n}\n</code></pre>\n<p>The <code>src/Plugin/Field/FieldWidget/Demo2CWidget.php</code> file.</p>\n<pre><code>&lt;?php\n\nnamespace Drupal\\demo2c\\Plugin\\Field\\FieldWidget ;\n\nuse Drupal\\Core\\Field\\FieldItemListInterface ;\nuse Drupal\\Core\\Field\\WidgetBase ;\nuse Drupal\\Core\\Form\\FormStateInterface ;\n\n/**\n * A field widget with two integer columns.\n *\n * @FieldWidget(\n * id = &quot;demo2c_field_widget&quot;,\n * label = @Translation( &quot;Demo Two Column Field Widget&quot; ),\n * module = &quot;demo2c&quot;,\n * field_types = { &quot;demo2c_field_type&quot; }\n * )\n */\nclass Demo2CWidget extends WidgetBase {\n\n /**\n * {@inheritdoc}\n */\n public function formElement( FieldItemListInterface $items,\n $delta,\n array $element,\n array &amp;$form,\n FormStateInterface $form_state ) {\n\n $element += [ '#type' =&gt; 'fieldset' ] ;\n\n $element[ 'c1' ] = [ '#type' =&gt; 'number',\n '#default_value' =&gt; $items-&gt;get( $delta )-&gt;get( 'c1' )-&gt;getValue() ?? 0,\n '#title' =&gt; $this-&gt;t( &quot;Column One&quot; ) ] ;\n $element[ 'c2' ] = [ '#type' =&gt; 'number',\n '#default_value' =&gt; $items-&gt;get( $delta )-&gt;get( 'c2' )-&gt;getValue() ?? 0,\n '#title' =&gt; $this-&gt;t( &quot;Column Two&quot; ) ] ;\n\n return $element ;\n }\n}\n</code></pre>\n<p>And the <code>src/Plugin/Field/FieldFormatter/Demo2CFormatter.php</code> file.</p>\n<pre><code>&lt;?php\n\nnamespace Drupal\\demo2c\\Plugin\\Field\\FieldFormatter ;\n\nuse Drupal\\Core\\Field\\FormatterBase ;\nuse Drupal\\Core\\Field\\FieldItemListInterface ;\n\n/**\n * A field formatter with two integer columns.\n *\n * @FieldFormatter(\n * id = &quot;demo2c_field_formatter&quot;,\n * module = &quot;demo2c&quot;,\n * label = @Translation( &quot;Demo Two Column Field Formatter&quot; ),\n * field_types = { &quot;demo2c_field_type&quot; }\n * )\n */\nclass Demo2CFormatter extends FormatterBase {\n\n /**\n * {@inheritdoc}\n */\n public function viewElements( FieldItemListInterface $items, $langcade ) {\n $elements = [] ;\n\n foreach( $items as $delta =&gt; $item ) {\n $c1 = $item-&gt;get( 'c1' )-&gt;getValue() ;\n $c2 = $item-&gt;get( 'c2' )-&gt;getValue() ;\n\n $elements[ $delta ] = [ '#markup' =&gt; &quot;Column one: $c1, column two: $c2.&quot; ] ;\n }\n\n return $elements ;\n }\n}\n</code></pre>\n<p>At this point, I am able to manually attach the field to users, and save the settings using Drupal's regular configuration/editing interface.</p>\n<p>However, when I add the following in <code>demo2c.module</code> I get the error at the top, on save.</p>\n<pre><code>&lt;?php\n\nuse Drupal\\Core\\Entity\\EntityTypeInterface;\nuse Drupal\\Core\\Field\\BaseFieldDefinition;\n\nfunction demo2c_entity_base_field_info( EntityTypeInterface $entity_type ) {\n if ( $entity_type-&gt;id() === 'user' ) {\n\n $fields[ 'my_2c' ] = BaseFieldDefinition::create( 'demo2c_field_type' )\n -&gt;setLabel( t( 'My Demo Two Column Field' ) )\n -&gt;setDescription( t( &quot;Doesn't work.&quot; ) )\n -&gt;addConstraint( 'UniqueField' )\n -&gt;setDisplayOptions( 'form', [ 'weight' =&gt; -1 ] ) ;\n\n return $fields ;\n }\n}\n</code></pre>\n<p>What am I missing to make this work in the <code>hook_entity_base_field_info()</code>?</p>\n"^^ . + . + "Adding ATUM location in PDF Invoices & Packing Slips for WooComerce"^^ . + . + . + . + "`i just get a error`...what's the error? If you want us to help you with an error, you need to tell us what it is and which line of code threw it! See also [ask] and how to make a [mre] of your issue. You can [edit] your question. Thanks."^^ . + "Is it possible to retrieve submitted form data not recorded in MySQL table?"^^ . + . + . + . + . + . + "permalinks"^^ . + "1"^^ . + . + "java"^^ . + "0"^^ . + . + "<p>Remove the <code>try_files $uri =404;</code> directive from your <code>/wp-admin</code> and <code>/wp-login.php</code> location block. This will allow Nginx to pass the request to PHP-FPM</p>\n<pre><code>map $http_x_forwarded_for $block_access {\n default 1;\n XXX.XXX.XXX.XXX 0; # allowed ip\n include /etc/nginx/conf.d/IPv4.conf.tmp; # uptimerobot\n}\n\nupstream wordpress {\n server ip-XXX-XX-XX-XXX.us-west-2.compute.internal:80;\n}\n\nserver {\n listen 80;\n listen [::]:80;\n server_name nerodata.com;\n\n include /etc/nginx/conf.d/CloudflareIPv4.conf.tmp; # cloudflare\n deny all;\n\n root /usr/share/nginx/my_website;\n index index.php;\n\n fastcgi_buffers 16 16k;\n fastcgi_buffer_size 32k;\n\n location ~ ^/(wp-admin|wp-login\\.php) {\n if ($block_access) {\n return 403;\n }\n\n fastcgi_pass unix:/run/php-fpm/www.sock;\n fastcgi_index index.php;\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n include fastcgi_params;\n }\n\n location = /favicon.ico {\n log_not_found off;\n access_log off;\n }\n\n location = /robots.txt {\n allow all;\n log_not_found off;\n access_log off;\n }\n\n location / {\n try_files $uri $uri/ /index.php?q=$uri&amp;$args;\n }\n\n location ~ \\.php$ {\n try_files $uri =404;\n fastcgi_pass unix:/run/php-fpm/www.sock;\n fastcgi_index index.php;\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n include fastcgi_params;\n }\n\n location ~* \\.(js|css|png|jpg|jpeg|gif|ico|svg)$ {\n expires max;\n log_not_found off;\n }\n}\n</code></pre>\n"^^ . + . + . + "4"^^ . + . + "0"^^ . + "<p>I'm trying to create a code snippet that will allow me to hide a menu item if a user has already posted at least 1 of a specific post type. I have this:</p>\n<pre><code>function hide_specific_menu_item($items, $args) {\n $user_id = get_current_user_id(); //get the user_id\n $post_type = &quot;student&quot;; // define the post type\n $posts = count_user_posts( $user_id, $post_type ); //count user's posts\n \n if($posts &gt; 0){\n foreach ($items as $key =&gt; $item) {\n if ($item-&gt;title === 'Add Student') { //hide the menu item\n unset($items[$key]);\n }\n }\n }\n \n return $items;\n}\n\nadd_filter('wp_nav_menu_objects', 'hide_specific_menu_item', 10, 2);\n</code></pre>\n<p>But the above isn't working.</p>\n<p>I would greatly appreciate it if someone could help me figure out where I'm going wrong.</p>\n"^^ . + . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + "caddy"^^ . + . + . + "Have you tried adding an `@var` docblock for `Auth::user()` to type-hint it as a `User` model?"^^ . + "2"^^ . + "<p>I'm implementing multi-tenancy in my Laravel 11 application, so I need a <code>tenant_id</code> column in the <code>password_reset_tokens</code> table. I've created a <strong>custom <code>PasswordBrokerManager</code></strong> and a <strong>custom <code>TenantAwareDatabaseTokenRepository</code></strong>, but Laravel still uses the default <code>DatabaseTokenRepository</code>—so the <code>tenant_id</code> never gets inserted.</p>\n<h3>1. <code>config/auth.php</code></h3>\n<pre><code>return [\n 'defaults' =&gt; [\n 'guard' =&gt; env('AUTH_GUARD', 'web'),\n 'passwords' =&gt; env('AUTH_PASSWORD_BROKER', 'users'),\n ],\n 'guards' =&gt; [\n 'web' =&gt; [\n 'driver' =&gt; 'session',\n 'provider' =&gt; 'users',\n ],\n ],\n 'providers' =&gt; [\n 'users' =&gt; [\n 'driver' =&gt; 'eloquent',\n 'model' =&gt; App\\Models\\User::class,\n ],\n ],\n 'passwords' =&gt; [\n 'users' =&gt; [\n 'driver' =&gt; 'custom', // I made sure to set this\n 'provider' =&gt; 'users',\n 'table' =&gt; 'password_reset_tokens',\n 'expire' =&gt; 60,\n 'throttle' =&gt; 60,\n ],\n ],\n];\n</code></pre>\n<p>I ran <code>php artisan config:clear &amp;&amp; php artisan cache:clear</code> and verified with <code>dd(config('auth.passwords.users'))</code> that it shows <code>&quot;driver&quot; =&gt; &quot;custom&quot;</code>.</p>\n<h3>2. <code>AppServiceProvider</code></h3>\n<pre><code>&lt;?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Support\\ServiceProvider;\nuse Illuminate\\Auth\\Passwords\\PasswordBrokerManager;\nuse App\\Extensions\\CustomPasswordBrokerManager;\nuse Illuminate\\Support\\Facades\\Log;\n\nclass AppServiceProvider extends ServiceProvider\n{\n public function register(): void\n {\n Log::debug('AppServiceProvider: register() is being called...');\n\n // Bind my custom password broker manager\n $this-&gt;app-&gt;singleton(PasswordBrokerManager::class, function ($app) {\n Log::debug('Binding CustomPasswordBrokerManager...');\n return new CustomPasswordBrokerManager($app);\n });\n }\n\n public function boot(): void\n {\n Log::debug('AppServiceProvider: boot() is being called...');\n }\n}\n</code></pre>\n<p>The logs for <code>AppServiceProvider</code> show up, but when I trigger a password reset, my custom code is ignored.</p>\n<h3>3. <code>CustomPasswordBrokerManager</code></h3>\n<pre><code>&lt;?php\n\nnamespace App\\Extensions;\n\nuse Illuminate\\Auth\\Passwords\\PasswordBrokerManager;\nuse Illuminate\\Auth\\Passwords\\TokenRepositoryInterface;\nuse App\\Repositories\\TenantAwareDatabaseTokenRepository;\nuse App\\Models\\Tenant;\nuse Illuminate\\Support\\Facades\\Log;\nuse RuntimeException;\n\nclass CustomPasswordBrokerManager extends PasswordBrokerManager\n{\n public function __construct($app)\n {\n Log::debug('CustomPasswordBrokerManager: constructor called!');\n parent::__construct($app);\n }\n\n protected function createTokenRepository(array $config): TokenRepositoryInterface\n {\n Log::debug('CustomPasswordBrokerManager: createTokenRepository called! driver=' . ($config['driver'] ?? ''));\n\n // 1) DB connection\n $connection = $this-&gt;app['db']-&gt;connection($config['connection'] ?? null);\n\n // 2) Table name\n $table = $config['table'];\n\n // 3) Laravel app key\n $hashKey = $this-&gt;app['config']['app.key'];\n\n // 4) Expiry &amp; throttle\n $expire = $config['expire'];\n $throttle = $config['throttle'] ?? 60;\n\n // 5) Current tenant\n $tenant = Tenant::current();\n if (! $tenant || ! $tenant-&gt;id) {\n throw new RuntimeException('No tenant found. Tenant ID cannot be null.');\n }\n\n // 6) Return custom repository\n return new TenantAwareDatabaseTokenRepository(\n $connection,\n $this-&gt;app['hash'],\n $table,\n $hashKey,\n $expire,\n $throttle,\n $tenant-&gt;id\n );\n }\n}\n</code></pre>\n<p>I <strong>never</strong> see the “createTokenRepository called!” log in my <code>laravel.log</code>, meaning Laravel won’t enter this code.</p>\n<h3>4. <code>TenantAwareDatabaseTokenRepository</code></h3>\n<pre><code>&lt;?php\n\nnamespace App\\Repositories;\n\nuse Illuminate\\Auth\\Passwords\\DatabaseTokenRepository;\nuse Illuminate\\Contracts\\Auth\\CanResetPassword as CanResetPasswordContract;\nuse Illuminate\\Contracts\\Hashing\\Hasher;\nuse Illuminate\\Database\\ConnectionInterface;\nuse Illuminate\\Support\\Carbon;\n\nclass TenantAwareDatabaseTokenRepository extends DatabaseTokenRepository\n{\n protected mixed $tenantId;\n\n public function __construct(\n ConnectionInterface $connection,\n Hasher $hasher,\n string $table,\n string $hashKey,\n int $expires = 60,\n int $throttle = 60,\n mixed $tenantId = null\n ) {\n parent::__construct($connection, $hasher, $table, $hashKey, $expires, $throttle);\n $this-&gt;tenantId = $tenantId;\n }\n\n protected function getPayload($email, $token): array\n {\n return [\n 'email' =&gt; $email,\n 'tenant_id' =&gt; $this-&gt;tenantId,\n 'token' =&gt; $this-&gt;getHasher()-&gt;make($token),\n 'created_at' =&gt; Carbon::now(),\n ];\n }\n}\n</code></pre>\n<p>This class includes <code>tenant_id</code> in the insert, but Laravel keeps using the default <code>DatabaseTokenRepository</code>.</p>\n<h3>5. Error &amp; Stack Trace</h3>\n<p>When I request a password reset, I get:</p>\n<pre><code>SQLSTATE[HY000]: General error: 1364 Field 'tenant_id' doesn't have a default value\nIlluminate\\Auth\\Passwords\\DatabaseTokenRepository-&gt;create()\n</code></pre>\n<p>It shows <code>DatabaseTokenRepository</code> is being called, not <code>TenantAwareDatabaseTokenRepository</code>.</p>\n<h3>6. Controller Snippet</h3>\n<pre><code>public function store(Request $request): Responsable\n{\n $request-&gt;validate(['email' =&gt; 'required|email']);\n\n $status = $this-&gt;broker()-&gt;sendResetLink($request-&gt;only('email'));\n\n // ...\n}\n\nprotected function broker(): PasswordBroker\n{\n return Password::broker(config('fortify.passwords')); \n // config('fortify.passwords') is &quot;users&quot;\n}\n</code></pre>\n<h3>7. Things I Tried</h3>\n<ul>\n<li>Double-checked <code>'driver' =&gt; 'custom'</code> in <code>config/auth.php</code>.</li>\n<li>Ran <code>php artisan config:clear &amp;&amp; php artisan cache:clear</code>.</li>\n<li>Logged in <code>CustomPasswordBrokerManager::createTokenRepository()</code>, but it never fires.</li>\n<li>Confirmed <code>'passwords' =&gt; 'users'</code> in <code>config/fortify.php</code>.</li>\n<li>Verified logs in <code>AppServiceProvider</code> do show up.</li>\n</ul>\n<h3>8. Environment</h3>\n<ul>\n<li><strong>Laravel</strong>: 11.x</li>\n<li><strong>PHP</strong>: 8.3</li>\n<li><strong>MySQL/MariaDB</strong></li>\n<li><strong>Jetstream + Fortify</strong></li>\n</ul>\n<hr />\n<h2><strong>Question</strong></h2>\n<p><strong>How do I ensure Laravel actually uses my <code>CustomPasswordBrokerManager</code> and <code>TenantAwareDatabaseTokenRepository</code> instead of defaulting to <code>DatabaseTokenRepository</code>?</strong> Any help is appreciated.</p>\n"^^ . + . + . + "4"^^ . + "0"^^ . + . + "<p>So I'm making a website similar to an ecommerce platform and I'm trying to apply pagination for a specific page on my website but for some reason it's stuck on the navbar. I tried searching for solutions and using AI but nothing helps.</p>\n<p>I want my pagination to be at the bottom of my container div.</p>\n<p>here is the code of my blade file:</p>\n<pre><code> &lt;style&gt;\n .container {\n position: relative;\n max-width: 1400px;\n margin-top: 100px;\n margin: 0 auto;\n padding: 20px;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n }\n\n .search-bar {\n display: flex;\n gap: 10px;\n margin-bottom: 30px;\n }\n\n .search-bar input {\n flex: 1;\n padding: 10px 15px;\n border: 1px solid #ddd;\n border-radius: 5px;\n font-size: 16px;\n }\n\n .search-bar button {\n padding: 10px 20px;\n background-color: #109908;\n color: white;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n font-size: 16px;\n }\n\n .search-bar button:hover {\n background-color: #0c7206;\n }\n\n .product-grid { \n flex: 1;\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));\n gap: 20px;\n margin-top: 20px;\n margin-bottom: 30px;\n }\n\n .card {\n margin-bottom: 20px;\n box-shadow: 0 4px 8px rgba(16, 153, 8, 0.3);\n width: 100%;\n height: 320px;\n overflow: hidden;\n border-radius: 10px;\n background-color: white;\n padding: 20px 20px 0px 20px;\n transition: background-color 0.3s ease;\n }\n\n .card:hover {\n background-color: #65E55E;\n }\n\n .card img {\n width: 100%;\n height: 180px;\n object-fit: cover;\n display: block;\n margin: 0 auto;\n border-radius: 10px;\n }\n\n .card-content {\n padding: 0px;\n height: 120px;\n display: flex;\n flex-direction: column;\n gap: 5px;\n }\n\n .product-name {\n font-size: 18px;\n font-family: 'Montserrat', sans-serif;\n margin: 0;\n color: #333;\n line-height: 1.4;\n height: 25px;\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n }\n\n .price-container {\n display: flex;\n align-items: baseline;\n margin: 0;\n }\n\n .price {\n font-size: 24px;\n font-family: 'Montserrat-Black', sans-serif;\n margin: 0;\n color: #333;\n }\n\n .unit {\n font-size: 12px;\n color: #666;\n }\n\n .rating {\n display: flex;\n align-items: center;\n gap: 5px;\n margin: 0;\n }\n\n .rating-value {\n font-weight: bold;\n color: #333;\n font-size: 16px;\n }\n\n .rating-count {\n color: #666;\n font-size: 14px;\n }\n\n .content-wrapper {\n flex: 1;\n display: flex;\n flex-direction: column;\n }\n\n .pagination {\n margin-top: auto;\n padding: 20px 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-top: 1px solid #eee;\n }\n\n &lt;/style&gt;\n\n&lt;div class=&quot;container&quot;&gt;\n &lt;div class=&quot;content-wrapper&quot;&gt;\n &lt;div class=&quot;search-bar&quot;&gt;\n &lt;form action=&quot;{{ route('shop') }}&quot; method=&quot;GET&quot; class=&quot;d-flex w-100&quot;&gt;\n &lt;input type=&quot;text&quot; name=&quot;search&quot; placeholder=&quot;Search products...&quot; value=&quot;{{ request('search') }}&quot;&gt;\n &lt;button type=&quot;submit&quot;&gt;Search&lt;/button&gt;\n &lt;/form&gt;\n &lt;/div&gt;\n\n &lt;div class=&quot;product-grid&quot;&gt;\n @foreach($products as $product)\n &lt;div class=&quot;card&quot;&gt;\n &lt;a href=&quot;{{ route('products.details', $product-&gt;slug) }}&quot; style=&quot;text-decoration: none; color: inherit;&quot;&gt;\n &lt;img src=&quot;{{ asset('images/' . $product-&gt;image) }}&quot; alt=&quot;{{ $product-&gt;name }}&quot;&gt;\n &lt;div class=&quot;card-content&quot;&gt;\n &lt;div style=&quot;display: flex; align-items: center; justify-content: space-between;&quot;&gt;\n &lt;span class=&quot;product-name&quot;&gt;{{ $product-&gt;name }}&lt;/span&gt;\n &lt;/div&gt;\n &lt;div class=&quot;price-container&quot;&gt;\n &lt;p class=&quot;price&quot;&gt;₱{{ $product-&gt;price }}&lt;/p&gt;\n &lt;span class=&quot;unit&quot;&gt;per kilogram&lt;/span&gt;\n &lt;/div&gt;\n &lt;div class=&quot;rating&quot;&gt;\n @php\n $rating = $product-&gt;reviews-&gt;avg('rating') ?? 0;\n $rating = number_format($rating, 1);\n @endphp\n &lt;span class=&quot;rating-value&quot;&gt;\n &lt;i class=&quot;fa-solid fa-star&quot;&gt;&lt;/i&gt;\n {{ $rating }}\n &lt;/span&gt;\n &lt;span class=&quot;rating-count&quot;&gt;({{ $product-&gt;reviews-&gt;count() }} reviews)&lt;/span&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/a&gt;\n &lt;/div&gt;\n @endforeach\n &lt;/div&gt;\n\n &lt;/div&gt; &lt;!-- End of content-wrapper --&gt;\n\n &lt;!-- Move pagination outside content-wrapper --&gt;\n &lt;div class=&quot;pagination&quot;&gt;\n {{ $products-&gt;links() }}\n &lt;/div&gt;\n\n&lt;/div&gt;\n</code></pre>\n"^^ . + "Thanks for the tip—that is definitely a bit out of my development wheelhouse unfortunately, but good to know if I ever wanted to pursue.\nSo I know, do you think if I were to turn back on the compatibility mode to sync the data to the WP posts storage (still just seems redundant to me) that this code would work?"^^ . + "0"^^ . + . + . + "How to search for a specific message with Webklex/PHPIMAP?"^^ . + . + "only `web` middleware applied for this route, I have check using this command `php artisan route:list -v`"^^ . + . + . + "I can see that. But my point was that you don't need to do that, because you can configure PHP to do it automatically for you, without needing to write any code, _and_ retain the flexibility to log those errors to a file instead when you need to (e.g. in a live environment). If you explicitly hard-code the echoing of the error to the output stream then you remove that flexibility and give yourself a potential security problem into the bargain, not to mention wasting time writing your own code to achieve something that the system can do for you automatically"^^ . + "0"^^ . + "0"^^ . + . + . + "python-venv"^^ . + . + "0"^^ . + . + . + . + . + . + "<p>I am trying to implement Yajra datatables in my new Laravel 12 project but it is not rendering any data and I also don't see any ajax call in network.</p>\n<p>Here are my configurations.</p>\n<blockquote>\n<p>composer.json <code>&quot;yajra/laravel-datatables&quot;: &quot;^12&quot; </code></p>\n</blockquote>\n<blockquote>\n<p>package.json</p>\n</blockquote>\n<pre><code>&quot;devDependencies&quot;: {\n &quot;laravel-datatables-vite&quot;: &quot;^0.6.1&quot;,\n ...\n}\n</code></pre>\n<blockquote>\n<p>app.scss</p>\n</blockquote>\n<pre><code>// Fonts\n@import url('https://fonts.bunny.net/css?family=Nunito');\n// Variables\n@import 'variables';\n\n// Bootstrap\n@import 'bootstrap/scss/bootstrap';\n\n// DataTables\n@import 'bootstrap-icons/font/bootstrap-icons.css';\n@import &quot;datatables.net-bs5/css/dataTables.bootstrap5.min.css&quot;;\n@import &quot;datatables.net-buttons-bs5/css/buttons.bootstrap5.min.css&quot;;\n@import 'datatables.net-select-bs5/css/select.bootstrap5.css';\n</code></pre>\n<blockquote>\n<p>app.js <code>import 'laravel-datatables-vite';</code></p>\n</blockquote>\n<blockquote>\n<p>controller</p>\n</blockquote>\n<pre><code>public function index(UsersDataTable $dataTable)\n{\n return $dataTable-&gt;render('users.index');\n} \n</code></pre>\n<blockquote>\n<p>UsersDatatable.php</p>\n</blockquote>\n<pre><code>public function dataTable(QueryBuilder $query): EloquentDataTable\n{\n return (new EloquentDataTable($query))\n -&gt;setRowId('id');\n}\n\npublic function query(User $model): QueryBuilder\n{\n return $model-&gt;newQuery()-&gt;with('roles');\n}\n\npublic function html(): HtmlBuilder\n{\n return $this-&gt;builder()\n -&gt;setTableId('users-table')\n -&gt;columns($this-&gt;getColumns())\n -&gt;minifiedAjax()\n -&gt;orderBy(1)\n -&gt;selectStyleSingle()\n -&gt;buttons([\n Button::make('excel'),\n Button::make('csv'),\n Button::make('pdf'),\n Button::make('print'),\n Button::make('reset'),\n Button::make('reload')\n ]);\n}\n\npublic function getColumns(): array\n{\n return [\n Column::make('id')-&gt;title('ID'),\n Column::make('name')-&gt;title('Name'),\n Column::make('email')-&gt;title('Email'),\n Column::computed('roles')-&gt;title('Roles'),\n Column::make('created_at')-&gt;title('Created At'),\n Column::make('updated_at')-&gt;title('Updated At'),\n ];\n}\n</code></pre>\n<blockquote>\n<p>index.blade.php</p>\n</blockquote>\n<pre><code>&lt;x-layouts.app&gt;\n &lt;div class=&quot;container&quot;&gt;\n &lt;h2&gt;User Management&lt;/h2&gt;\n {{ $dataTable-&gt;table() }}\n &lt;/div&gt;\n&lt;/x-layouts.app&gt;\n\n@push('scripts')\n {{ $dataTable-&gt;scripts() }}\n@endpush\n</code></pre>\n<p><strong>Issue</strong></p>\n<p>The table is rendered with column names, but no data is displayed, and there are no AJAX calls in the network tab. Here’s what the table looks like:</p>\n<p><a href="https://i.sstatic.net/AJQNyWh8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/AJQNyWh8.png" alt="Datatable View" /></a></p>\n<p><strong>What I’ve Tried</strong></p>\n<ul>\n<li><p>Verified that the @stack('scripts') directive is present in my layout.</p>\n</li>\n<li><p>Checked for JavaScript errors in the console (none found).</p>\n</li>\n<li><p>Cleared Laravel cache using <code>php artisan cache:clear</code>, <code>php artisan view:clear</code>, etc.</p>\n</li>\n</ul>\n"^^ . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + "prestashop"^^ . + "0"^^ . + . + . + . + . + . + . + "1"^^ . + . + "0"^^ . + . + "@symfony/ux-react: "./react/controllers" This file can not be found, please check it for typos or update it if the file got moved"^^ . + . + "3"^^ . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + "1"^^ . + "0"^^ . + "hi, yeah I actually have it in my .htaccess. but still having the same problem, even created a new inbound rule in firewall for port 80 and 8000. I can only access the login page but if I try to log in I get error 404."^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "1"^^ . + "<p>My WordPress plugin is <strong>Network Only</strong> plugin and all my local tests on WordPress Multisite only, Since WordPress 6.7, I start to receive (Function _load_textdomain_just_in_time was called incorrectly) notice.</p>\n<p>I moved the translation code from '<strong>plugins_loaded</strong>' action to '<strong>init</strong>' with very low priority but nothing help, finally, I created a single-site for test and I found that the plugin working properly without notices, and this notice only appears in WordPress Multisite.</p>\n<p>I tried a lot and even moved the translation code from classes to the main <strong>.php</strong> file, but still generates that notice.</p>\n<p>Because of the plugin working only in a certain site (determined by the user in a constant), I tried to check current blog using (<strong>get_current_blog_id</strong>) to ensure that the translation code triggered only in the correct site, But nothing help.</p>\n<p>Here's my situation:</p>\n<p><strong>My Directories:</strong></p>\n<pre><code>- pascalplugin\n -- languages\n -- pascalplugin-en_US.mo\n -- pascalplugin-en_US.po\n -- pascalplugin.pot\n -- pascalplugin.php\n</code></pre>\n<p><strong>pascalplugin.php</strong></p>\n<pre class="lang-php prettyprint-override"><code>/**\n * Plugin Name: PascalPlugin\n * Version: 1.0.0\n * Domain Path: /languages/\n * Text Domain: pascalplugin\n * Tested up to: 6.7\n * Requires at least: 5.9\n * Requires PHP: 7.0\n * Network: true\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n die( 'You cannot access plugin\\'s files directly' );\n}\n\nif( !defined('PASCALPLUGIN_TEXTDOMAIN') ) {\n define( 'PASCALPLUGIN_TEXTDOMAIN', 'pascalplugin' );\n}\n\nif (!defined('PASCALPLUGIN__FILE__')) {\n define( 'PASCALPLUGIN__FILE__', __FILE__ );\n}\n\nadd_action('init', '__init_load_textdomain', 1);\nfunction __init_load_textdomain() {\n $dir = wp_normalize_path(dirname(PASCALPLUGIN__FILE__));\n $basename = plugin_basename(PASCALPLUGIN__FILE__);\n $basepath = trailingslashit(dirname($basename));\n $lang_dir = trailingslashit($basepath . 'languages');\n\n // Echo working properly and output &quot;pascalplugin/languages/&quot;\n echo $lang_dir;\n\n load_plugin_textdomain(PASCALPLUGIN_TEXTDOMAIN, false, $lang_dir);\n}\n</code></pre>\n"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + "<p>My php version is 8.4.3, it does list mbstring as installed.\nI also installed all the other dependencies including all recommendations I could find on the internet</p>\n<p>Apache2 error log:</p>\n<blockquote>\n<p>[Tue Feb 11 11:37:56.141489 2025] [php:error] [pid 141712] [client\n172.69.68.31:22010] PHP Fatal error: Uncaught Error: Call to undefined function mb_strpos() in\n/usr/share/phpmyadmin/libraries/classes/Url.php:263\\nStack trace:\\n#0\n/usr/share/phpmyadmin/libraries/classes/Url.php(213):\nPhpMyAdmin\\Url::getArgSeparator()\\n#1\n/usr/share/phpmyadmin/libraries/classes/Url.php(176):\nPhpMyAdmin\\Url::getCommonRaw()\\n#2\n/usr/share/phpmyadmin/libraries/classes/Core.php(752):\nPhpMyAdmin\\Url::getCommon()\\n#3\n/usr/share/phpmyadmin/libraries/classes/Core.php(339):\nPhpMyAdmin\\Core::linkURL()\\n#4\n/usr/share/phpmyadmin/libraries/classes/Core.php(366):\nPhpMyAdmin\\Core::getPHPDocLink()\\n#5\n/usr/share/phpmyadmin/libraries/classes/Core.php(994):\nPhpMyAdmin\\Core::warnMissingExtension()\\n#6\n/usr/share/phpmyadmin/libraries/common.inc.php(131):\nPhpMyAdmin\\Core::checkExtensions()\\n#7\n/usr/share/phpmyadmin/index.php(15): require_once('...')\\n#8 {main}\\n\nthrown in /usr/share/phpmyadmin/libraries/classes/Url.php on line 263</p>\n</blockquote>\n<p>Tried reinstalling phpmyadmin, enabling mbstring in php.ini and installed dependencies recommended on the internet.</p>\n<p>I followed the Digital ocean guide step by step for my first install of phpmyadmin (they say to use apt install which install version 5.1.1 not the up to date one)</p>\n<p>UPDATE:</p>\n<p>When i run the index.php file in phpmyadmin folder i get the following errors: PHP Warning: Module &quot;mbstring&quot; is already loaded in Unknown on line 0</p>\n<p>UPDATE:</p>\n<p>Fixed the blank page by installing the lastest version of phpmyadmin manually instead of using apt install which only install 5.1.1. I followed this guide for manual install: <a href="https://rushiinfotech.in/install-phpmyadmin-on-ubuntu/" rel="nofollow noreferrer">https://rushiinfotech.in/install-phpmyadmin-on-ubuntu/</a></p>\n<p>Now when I try to use mysql it says:\nERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)</p>\n<p>I tried while allowing password and using sql password provided by default on my vps but it did not work</p>\n"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + "1"^^ . + "3"^^ . + . + . + . + . + "<p><strong>SOLVED</strong></p>\n<p>I've use the PUBLIC_ACCESS to make the login and register page accesable without login. This in working now</p>\n<pre><code> access_control:\n - { path: ^/login, roles: PUBLIC_ACCESS }\n - { path: ^/logout, roles: PUBLIC_ACCESS }\n - { path: ^/register, roles: PUBLIC_ACCESS }\n\n - { path: ^/, roles: IS_AUTHENTICATED_FULLY }\n</code></pre>\n"^^ . + "<p>I am using some arrays in a PHP script.\nMy idea is to declare the arrays as static, to avoid that every call of the class has to be create the arrays new.</p>\n<pre class="lang-php prettyprint-override"><code>class ID3\n{ \n static $tableBR =\n [\n [11.025, 12.000, 8.000, null],\n [null, null, null, null],\n [22.050, 24.000, 168.000, null],\n [44.100, 48.000, 32.000, null]\n ];\n}\n</code></pre>\n<p>Is my assumption right?</p>\n<p>If I declare them as static arrays, are then the arrays already included into the script?</p>\n"^^ . + "1"^^ . + . + . + "0"^^ . + . + "1"^^ . + "2"^^ . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + "root@dev:/usr/local/dev_build_sources/php-8.4.3 # PKG_CONFIG_PATH=/usr/local/lib/pkgconfig pkg-config --modversion libjpeg\nPKG_CONFIG_PATH=/usr/local/lib/pkgconfig: Command not found."^^ . + . + . + . + . + "3"^^ . + "<p>If I have initialized an object, somewhere, Idk how to do this, so, somewhere</p>\n<pre><code>$sharedObject = new sharedClass();\n</code></pre>\n<p>Supposing I have two routes in\nweb.php:</p>\n<pre><code>Route::get('/page1', function(){\n $sharedObject-&gt;setFoo('newVal');\n return $sharedObject-&gt;getFoo();\n});\n\nRoute::get('/page2', function(){\n return $sharedObject-&gt;getFoo();\n});\n</code></pre>\n<p>So, is there a way to achieve this functionality, I just want to access the properties I had set in the original instantiation of an object, through another route?</p>\n"^^ . + . + "I should have clarified, add the queries to the question. It's easier for us to help if we see the original `args` and the load more/AJAX `args`"^^ . + . + "0"^^ . + . + . + . + . + . + . + "BTW, `[^\\w]` can be simplified to `\\W`"^^ . + . + . + . + . + . + . + . + "<p>I am working on a Laravel(v9) Breeze project using Inertia.js and Vue.js. My project runs on two different ports:</p>\n<p>Laravel backend (php artisan serve) → http://localhost:8000\nVue.js frontend (npm run dev) → http://localhost:5173</p>\n<p>I want to use ngrok to make both backend and frontend accessible publicly. However, since the free version of ngrok only allows one session at a time, I tried defining multiple tunnels in ngrok.yml and running ngrok start --all, but I got the following error:</p>\n<pre><code>ERROR: Error reading configuration file 'C:\\Users\\MyUser\\AppData\\Local/ngrok/ngrok.yml': YAML parsing error: yaml: line 5: did not find expected key\n</code></pre>\n<p>Here’s my ngrok.yml configuration:</p>\n<pre><code>version: &quot;3&quot;\nauthtoken: NGROK_AUTH_TOKEN\n\ntunnels:\n backend:\n proto: http\n addr: 8000\n frontend:\n proto: http\n addr: 5173\n</code></pre>\n<p>Any guidance would be greatly appreciated. Thanks!</p>\n"^^ . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + "Check if file exists on remote server (by using PHP)"^^ . + "0"^^ . + "<h3>You cannot bind just arbitrary SQL.</h3>\n<p>The point of prepared statements is that they deal only with <em>data literals</em>. Or, simply put, with SQL <em>strings</em> and <em>numbers</em>. As you already learned, binding entire SQL query (or some SQL clause or even a table name) results in having that SQL bound verbatim, not executed. Which is exactly how it should be.</p>\n<p>The simplest solution for your current problem would be to just execute that extra query beforehand, get its result and use it in the existing code without making any changes in it.</p>\n<p>While in general, in order to add an SQL part based on a condition, you have to add that condition in your PHP code when constructing the SQL query. In this case it is advised to collect all parameters into array. Something like this:</p>\n<pre><code>$sql = &quot;REPLACE INTO devices (id, type, labels, graphical, technical) \n VALUES (:id, :type, :label, :graphical&quot;;\n$params = [\n 'type' =&gt; $devdata[&quot;type&quot;],\n 'label' =&gt; $label,\n 'graphical' =&gt; $graphical,\n];\n\nif (some condition) {\n $sql .= &quot;(SELECT technical FROM devices WHERE id = :id)&quot;;\n $params['id'] = $devid,\n} else {\n $sql .= &quot;:technical&quot;;\n $params['technical'] = $technical;\n}\n$sql .= &quot;)&quot;;\n\n$stmt = $db-&gt;prepare($sql);\n$stmt-&gt;execute($params);\n</code></pre>\n"^^ . + . + . + "Yeah, me neither. That was just an explanation. I also flagged the post here for moderator attention, the use of LLM to assist with content creation on SO is banned."^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + "Check if a string contains a substring from an array of substrings and return that substring"^^ . + . + "Thanks for the update of your question. There are two very similar PHP script in your Github page: `convert.php` and `image.php`. Before I take a closer look, which one should I be looking at? Also, you really should be including that code in your question here, as code, not use a link to Github. The reason is that your Github page might change, which means that anyone reading your question, and the possible answers, cannot make sense of it anymore."^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + "My solution and that by The fourth bird are equally fast. Both take an average of 0.17 ms over several iterations. Since both The fourth bird's and Tim Biegeleisen's approach use a loop, I did not consider them as valid answers. Oliver's solution only takes an average of 5 ns (or 0.005 ms) once the $area_lookup array has been established (which can be done once and then hardcoded). I haven't tested michmackusa's code, but since it copies the approach from Oliver's answer, I assume it will be equally fast. I accept Oliver's anwer, since it is the first of the two that don't require a loop."^^ . + . + . + "<p>I'm looking for a way to automate the &quot;merging&quot; of two classes in PhpStorm, essentially removing a parent class from a <code>grandparent-&gt;parent-&gt;child</code> chain.</p>\n<p>For example, here's my initial set of 3 classes:</p>\n<pre class="lang-php prettyprint-override"><code>// the grandparent class\nclass A {\n // ... \n}\n\n\n// my parent class\nclass B extends A {\n\n public function foo()\n { \n // ...\n }\n\n public function getAge(string $name): int {\n return 10;\n }\n}\n\n// my child class\nclass C extends B {\n\n public function getAge(string $name): int {\n if ($name === 'Bob') {\n return 99;\n }\n\n return parent::getAge($name);\n }\n\n public function bar()\n { \n // ...\n }\n}\n</code></pre>\n<p>And here is my desired result, eliminating the <code>B</code> class</p>\n<pre class="lang-php prettyprint-override"><code>// the grandparent class remains unchanged\nclass A {\n // ... \n}\n\n// the parent B class is eliminated\n\n// child class extends the &quot;grandparent&quot; now\nclass C extends A {\n\n // method pushed down from parent to child\n public function foo()\n {\n // ...\n }\n\n // method kept as-is in child\n public function bar()\n {\n // ...\n }\n\n // merge of child and parent methods\n public function getAge(string $name): int {\n\n // logic as-is from child\n if ($name === 'Bob') {\n return 99;\n }\n\n // parent::getAge() replaced with actual logic from parent\n return 10;\n }\n\n}\n</code></pre>\n<p>Is there a way to do this refactor automatically in PhpStorm (either natively, or via a plugin)?</p>\n"^^ . + "I might have it fixed, will post solution when I'm sure."^^ . + . + . + . + . + "1"^^ . + "Oh that's cool, I never knew that site existed. Weird that their site gives me a bunch of errors when its works perfectly on my end https://3v4l.org/XL8HO"^^ . + . + "Laravel 11 - Web routes $request→user() and Auth::user() getting null"^^ . + "0"^^ . + "0"^^ . + "python"^^ . + "`with what sort of tokenRequestContext?` if you're signing in on behalf of a user, which it sounds like you are, then you use an `AuthorizationCodeContext`, as per https://github.com/microsoftgraph/msgraph-sdk-php/tree/main?tab=readme-ov-file#create-a-token-request-context . As per the linked documentation at https://learn.microsoft.com/en-us/graph/auth-v2-user?context=graph%2Fapi%2F1.0&view=graph-rest-1.0&tabs=http#parameters the `tenant` value can be one of several values to indicate the scope of who can sign in to your app. It can be a specific tenant ID, or a wider value."^^ . + "0"^^ . + . + . + "1"^^ . + . + "1"^^ . + . + "0"^^ . + "<p>There are multiple mistakes in your code and it can be simplified.</p>\n<p>Note: You should always <a href="https://stackoverflow.com/questions/32266155/definewp-debug-true-does-not-show-errors/32266386#32266386">enable WP Debug</a> when testing, to get error logs.</p>\n<p>Try the following instead:</p>\n<pre class="lang-php prettyprint-override"><code>function role_change_notify( $user_id, $old_user_data ) {\n $user_data = get_user_by( 'id', $user_id ); // Get current user data\n\n // Check for previous 'pending' and current 'pro' user roles\n if( in_array( 'pending', $old_user_data-&gt;roles ) &amp;&amp; in_array( 'pro', $user_data-&gt;roles ) ) {\n $to = $user_data-&gt;user_email; \n $subject = &quot;Votre nouveau compte Professionel&quot;;\n $message = &quot;Bonjour, félicitation ! Votre compte professionnel est désormais accessible.\n\n {customer_details}\n\n L'équipe&quot;;\n\n wp_mail( $to, $subject, $message);\n }\n}\n</code></pre>\n<p>It should work.</p>\n<p><strong>Note:</strong></p>\n<p>I removed the 3rd function argument, as it's not really needed. You will use the function like:</p>\n<pre class="lang-php prettyprint-override"><code>role_change_notify( $user_id, $old_user_data );\n</code></pre>\n"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + "I think this question needs to be [edit]ed. This question can be re-phrased as "why do 2 different regular expresions return different results". Why do you expect them to be the same? Explain what you believe should be matched in the first and the second. You also mention this happens in more than just Python."^^ . + "*"Cannot load Xdebug - it was already loaded"* Sounds like you may have this sort of line more than once in your php.ini -- `zend_extension = /usr/lib/php/20180731/xdebug.so` -- double check that (likely in another file -- use `php --ini` to see which config files are in use)."^^ . + . + . + "0"^^ . + . + . + . + "<p>I am working on multilingualism using the <code>mcamara</code> library</p>\n<p>This is what I did:\nIn the laravellocalization.php file\nI activated the Arabic and English languages</p>\n<p>In the boostrab/app.php file, I added the middleware as shown in the library itself</p>\n<pre><code>-&gt;withMiddleware(function (Middleware $middleware) {\n $middleware-&gt;alias([\n /**** OTHER MIDDLEWARE ALIASES ****/\n 'localize' =&gt; \\Mcamara\\LaravelLocalization\\Middleware\\LaravelLocalizationRoutes::class,\n 'localizationRedirect' =&gt; \\Mcamara\\LaravelLocalization\\Middleware\\LaravelLocalizationRedirectFilter::class,\n 'localeSessionRedirect' =&gt; \\Mcamara\\LaravelLocalization\\Middleware\\LocaleSessionRedirect::class,\n 'localeCookieRedirect' =&gt; \\Mcamara\\LaravelLocalization\\Middleware\\LocaleCookieRedirect::class,\n 'localeViewPath' =&gt; \\Mcamara\\LaravelLocalization\\Middleware\\LaravelLocalizationViewPath::class,\n ]);\n })\n</code></pre>\n<p>In the routes/web.php file</p>\n<pre><code>Route::prefix(LaravelLocalization::setLocale())\n-&gt;middleware([ 'localeSessionRedirect', \n 'localizationRedirect', \n 'localeViewPath',\n 'localeCookieRedirect'])\n-&gt;group(function(){\nRoute::get('create_offer',[OfferController::class,'create']);\n\n});\n</code></pre>\n<p>In the lang/ar/message.php file</p>\n<pre><code>'name_required' =&gt; 'الاسم مطلوب',\n'next' =&gt; 'Next &amp;raquo;',\n</code></pre>\n<p>In the lang/en/message/php file</p>\n<pre><code>'name_required' =&gt; 'The Name Required',\n'next' =&gt; 'Next &amp;raquo;',\n</code></pre>\n<p>In the controller file</p>\n<pre><code>class OfferController extends Controller\n{\n public function store(Request $request){\n $rq = $request-&gt;validate([\n 'name'=&gt;'required|unique:offers',\n 'price'=&gt;'required',\n 'details'=&gt;'required'\n ],\n [\n 'name.required'=&gt;__('message.name_required')\n ]);\n $inserted = Offer::create(\n \n $rq\n );\n return redirect()-&gt;back()-&gt;with(['message' =&gt; 'تم اضافة العرض بنجاح']);\n \n }\n\n public function create(){\n return view('offers.create');\n }\n}\n</code></pre>\n<p>In the blade file</p>\n<pre><code>@foreach(LaravelLocalization::getSupportedLocales() as $localeCode =&gt; $properties)\n &lt;li class=&quot;nav-item&quot;&gt;\n &lt;a class=&quot;nav-link&quot; rel=&quot;alternate&quot; hreflang=&quot;{{ $localeCode }}&quot; href=&quot;{{ LaravelLocalization::getLocalizedURL($localeCode, null, [], true) }}&quot;&gt;{{ $properties['native'] }}&lt;/a&gt;\n &lt;/li&gt;\n @endforeach\n</code></pre>\n<p>What I expect is that when I press the English language button, the language is converted to English, and when I press the Arabic language button, it is converted to Arabic.\n<a href="https://i.sstatic.net/f5VdXOd6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/f5VdXOd6.png" alt="An image to illustrate what is happening" /></a></p>\n<p>Expected when pressing the <code>english</code> button:\nThe word <code>الاسم مطلوب</code> has been changed from Arabic to English\nBut this did not happen. What happens when you press the English button, the word remains the same in Arabic\nI don't know how to solve this problem</p>\n"^^ . + . + . + . + "@AustinDuling inside the bootstrap directory I only have a folder named cache, with permissions 777. The bootstrap folder also has permissions 777. Maybe I need to execute a command to create the folder storage?"^^ . + . + "1"^^ . + . + "Update your question please, if you want to get more chances to have some answer. Don't hesitate to include screenshots, more details or related debugging log, if it helps to clarify things."^^ . + . + "2"^^ . + "1"^^ . + "You are probably looking for the PHP internals book and [this chapter](https://www.phpinternalsbook.com/php7/zvals.html) in particular"^^ . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + "<p>I think the provider you want to override is <code>auth.password</code> (<a href="https://github.com/laravel/framework/blob/11.x/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php#L27-L29" rel="nofollow noreferrer">Github</a>):</p>\n<pre class="lang-php prettyprint-override"><code>$this-&gt;app-&gt;singleton('auth.password', function ($app) {\n Log::debug('Binding CustomPasswordBrokerManager...');\n return new CustomPasswordBrokerManager($app);\n});\n</code></pre>\n"^^ . + . + . + "2"^^ . + . + . + . + "lampp"^^ . + . + . + . + "That's why I suggested something like Private Packagist so you can have version of the packages/apps (and then use something like `Composer\\InstalledVersions::getVersion()`). Or maybe let them define a version (or feature flags) as a container parameter that the other bundles could fetch to act accordingly (in a compiler pass I guess, as I'm not sure you could fetch them from the bundle extension) ?"^^ . + "0"^^ . + . + "What's wrong with having to press the `$` key? I know, you probably came from a language where variables don't start with `$`, but you will get used to it. When starting a new language you have to leave old habits behind you and adopt new ones."^^ . + . + "I don't have any other .htaccess files in subfolders. Json files are blocked, but then also in subfolders. I only want to block project configuration files in the root, for security reasons. Yes all pages are php and the js uses a HTML element with id="content" to display the js pages (that is how Vaadin works for some reason). So it is an almost empty php doc and then components written in JS are loaded in according to the routing. For example the route { path: "/tickets.php/:id", component: "ticket-component" } works when the hotlinks are updated to tickets.php/4509 instead of tickets/4509."^^ . + . + . + . + . + "0"^^ . + "0"^^ . + "<p>I have a .htaccess file like so:</p>\n<pre><code>#protect config files\n&lt;FilesMatch &quot;\\.(env|json|lock|xml|yml|htaccess|gitignore|gitattributes)$&quot;&gt;\nOrder Allow,Deny\nDeny from all\nRequire all denied\n&lt;/FilesMatch&gt;\n&lt;IfModule mod_rewrite.c&gt;\n RewriteEngine On\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteRule ^([^\\.]+)$ $1.php [NC,L]\n&lt;/IfModule&gt;\n&lt;filesMatch &quot;\\.(html|css|js)$&quot;&gt;\n AddDefaultCharset UTF-8\n&lt;/filesMatch&gt;\n&lt;filesMatch &quot;\\.(css|js)$&quot;&gt;\n FileETag MTime Size\n&lt;/filesMatch&gt;\nErrorDocument 304 /error_pages/304.php \nErrorDocument 400 /error_pages/400.php \nErrorDocument 401 /error_pages/401.php \nErrorDocument 403 /error_pages/403.php \nErrorDocument 404 /error_pages/404.php \nErrorDocument 409 /error_pages/409.php \nErrorDocument 410 /error_pages/410.php \nErrorDocument 500 /error_pages/500.php\n&lt;IfModule mod_expires.c&gt;\n ExpiresActive On\n # Fonts\n ExpiresByType font/ttf &quot;access plus 1 year&quot;\n ExpiresByType font/otf &quot;access plus 1 year&quot;\n ExpiresByType font/woff &quot;access plus 1 year&quot;\n ExpiresByType font/woff2 &quot;access plus 1 year&quot;\n # Images\n ExpiresByType image/jpg &quot;access plus 1 year&quot;\n ExpiresByType image/jpeg &quot;access plus 1 year&quot;\n ExpiresByType image/gif &quot;access plus 1 year&quot;\n ExpiresByType image/png &quot;access plus 1 year&quot;\n ExpiresByType image/x-icon &quot;access plus 6 year&quot;\n # CSS, JavaScript\n ExpiresByType text/css &quot;access plus 6 month&quot;\n ExpiresByType application/javascript &quot;access plus 6 month&quot;\n ExpiresByType application/x-javascript &quot;access plus 6 month&quot;\n ExpiresByType application/x-shockwave-flash &quot;access plus 6 month&quot;\n # Other\n ExpiresByType application/pdf &quot;access plus 6 month&quot;\n ExpiresDefault &quot;access plus 10 days&quot;\n&lt;/IfModule&gt;\n&lt;IfModule mod_headers.c&gt;\n # Jaar Public\n &lt;FilesMatch &quot;\\.(jpg|jpeg|png|gif|svg|webp|ico|ttf|woff|woff2|JPG|JPEG|PNG|GIF|SVG|WEBP|ICO|TTF|WOFF|WOFF2)$&quot;&gt;\n Header set Cache-Control &quot;max-age=31536000, public&quot;\n &lt;/FilesMatch&gt;\n\n # Jaar\n &lt;FilesMatch &quot;\\.(js|css|swf)$&quot;&gt;\n Header set Cache-Control &quot;max-age=31536000&quot;\n &lt;/FilesMatch&gt;\n&lt;/IfModule&gt;\n# Disable directory browsing\nOptions All -Indexes\n</code></pre>\n<p>How can I still access json files in a subfolder? Some part of i18n is in a subfolder called assets and is now not loaded in because of the first directive.\nAs I am a front-end person I don't know a lot about Apache.\nI also have problem with the JS routing from Vaadin (see: <a href="https://github.com/vaadin/router" rel="nofollow noreferrer">Vaadin/Router</a>)\nOn reload of a link within the page like so: /page/123 it doesn't load, instead returning a 404. When returning to /page it works as intended.\nI have found that /page.php/123 works as intended if configured so.\nIs it possible to hide the .php extension, but still request the page.php with the /123 URI?</p>\n"^^ . + . + "-1"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + "constants"^^ . + . + . + . + "unicode"^^ . + "0"^^ . + . + . + . + . + . + . + "in laravel cloud log it doesn't say anything. project api other api are working but this one is not."^^ . + . + "Caddy php_fastcgi give no result"^^ . + "<p>i want to compare data from my database with new customer input. I do some modifications and somewhere is something wrong:</p>\n<pre><code>$result = &quot;Südendstr. 13 a&quot;;\n$healthy = array(&quot; &quot;);\n$yummy = array(&quot;&quot;);\n$result = strval(strtolower(str_replace($healthy, $yummy, $result)));\n$healthy = array(&quot;strasse&quot;, &quot;straße&quot;,&quot;.&quot;, &quot;str&quot; );\n$yummy = array(&quot;str. &quot;, &quot;str. &quot;, &quot;&quot;, &quot;str. &quot;);\n$result = strval(strtolower(str_replace($healthy, $yummy, $result)));\n\n$_customer['customer']['adress'] = &quot;Südendstrasse&quot;;\n$healthy = array(&quot; &quot;);\n$yummy = array(&quot;&quot;);\n$_customer['customer']['adress'] = strval(strtolower(str_replace($healthy, $yummy, $_customer['customer']['adress'] )));\n$healthy = array(&quot;strasse&quot;, &quot;straße&quot;,&quot;.&quot;, &quot;str&quot; );\n$yummy = array(&quot;str. &quot;, &quot;str. &quot;, &quot;&quot;, &quot;str. &quot;);\n$_customer['customer']['adress'] = strval(str_replace($healthy, $yummy, $_customer['customer']['adress'] ));\n</code></pre>\n<p>The values are: $result = «südendstr. 13a»\nand $_customer['customer']['adress'] = «südendstr.»</p>\n<pre><code>$_strpos_1 = strpos($result, strval($_customer['customer']['adress']));\n$_strpos_2 = strpos($_customer['customer']['adress'], $result);\n</code></pre>\n<p>both return false.</p>\n"^^ . + . + "You can execute commands from within PHP: [exec()](https://www.php.net/manual/en/function.exec.php). But you need a means to authenticate the user. I want to stress that giving anyone access to a web form, to change a password, could be a real security risk when not properly implemented. This is more difficult, to get right, than you might think. Users are _not_ security oriented and may choose passwords like "qwerty123", "passw0rd", "1q2w3e4r" or worse. A hacker may try to brute force your interface. This is not something you should attempt when inexperienced and when security is important."^^ . + "I figured out a bit more - composer is looking for the path to the COMPOSER_CAFILE. \nI do have a certificate registered with git, so I set the path to the directory, then the private key file, then the public key file and all I get is A valid CA certificate file is required tor SSL/TLS."^^ . + "0"^^ . + "I already solved my problem THanks."^^ . + . + . + . + . + . + . + . + "<p>For a webshop i build in wordpress/flatsome/woocommerce there is a compliance limitation for the maximum amount of 10 weedseeds a customer can order (yess i'm from Holland haha..).\nThere are 5 seeds in a package so there is a maximum of 2 packages in a order.</p>\n<p>I have defined some code in functions.php to handle this, but it work's almost fine only when i open the cart i can increase the amount of a weedseeds-product with the +button to 3 or higher.\nIn the mini-cart(pop-up cart) it works good allready instead!</p>\n<p>actual code:\ntheme editor-&gt; childtheme selected:</p>\n<pre><code>&lt;?php\n// Add custom Theme Functions here\n//\n function limit_weedseeds_to_two_packages( $passed, $product_id, $quantity, $variation_id = '', $variations = '' ) {\n $limit = 2; // Set the limit to 2 packages\n $weedseeds_category = 'seeds-wietzaadjes'; // actual category slug\n \n $total_quantity = get_total_weedseeds_quantity();\n\n // Check if the total quantity of weedseeds exceeds the limit\n if ( $total_quantity + $quantity &gt; $limit ) {\n wc_add_notice( sprintf( 'Je mag maximaal %d verpakkingen wiedzaadjes per bestelling kopen.', $limit ), 'error' );\n return false;\n }\n\n return $passed;\n}\nadd_filter( 'woocommerce_add_to_cart_validation', 'limit_weedseeds_to_two_packages', 10, 5 );\n\n\n\n\nfunction limit_weedseeds_quantity_in_cart( $passed, $cart_item_key, $values, $quantity ) {\n $limit = 2; // Set the limit to 2 packages\n $weedseeds_category = 'seeds-wietzaadjes'; // actual category slug\n \n $total_quantity = get_total_weedseeds_quantity();\n\n // Check if the total quantity of weedseeds exceeds the limit\n if ( $total_quantity + $quantity - $values['quantity'] &gt; $limit ) {\n wc_add_notice( sprintf( 'Je mag maximaal %d verpakkingen wiedzaadjes per bestelling kopen.', $limit ), 'error' );\n return false;\n }\n\n return $passed;\n}\nadd_filter( 'woocommerce_update_cart_validation', 'limit_weedseeds_quantity_in_cart', 10, 4 );\n\n\n\n\nfunction check_weedseeds_limit_before_checkout() {\n $limit = 2; // Set the limit to 2 packages\n $weedseeds_category = 'seeds-wietzaadjes'; // actual category slug\n\n $total_quantity = get_total_weedseeds_quantity();\n\n // Check if the total quantity of weedseeds exceeds the limit\n if ( $total_quantity &gt; $limit ) {\n wc_add_notice( sprintf( 'Je mag maximaal %d verpakkingen wiedzaadjes per bestelling kopen.', $limit ), 'error' );\n }\n}\nadd_action( 'woocommerce_check_cart_items', 'check_weedseeds_limit_before_checkout' );\n\n\n\n\nfunction get_total_weedseeds_quantity() {\n $weedseeds_category = 'seeds-wietzaadjes'; // actual category slug\n $cart = WC()-&gt;cart-&gt;get_cart();\n $total_quantity = 0;\n\n // Loop through the cart items\n foreach ( $cart as $cart_item ) {\n // Check if the cart item belongs to the weedseeds category\n if ( has_term( $weedseeds_category, 'product_cat', $cart_item['product_id'] ) ) {\n $total_quantity += $cart_item['quantity'];\n }\n }\n\n return $total_quantity;\n}\n</code></pre>\n<p>So the first function is working correct:</p>\n<pre><code>add_filter( 'woocommerce_add_to_cart_validation', 'limit_weedseeds_to_two_packages', 10, 5 );\n</code></pre>\n<hr />\n<p>The problem i think logically has to be in the second function:</p>\n<pre><code>add_filter( 'woocommerce_update_cart_validation', 'limit_weedseeds_quantity_in_cart', 10, 4 );\n</code></pre>\n<hr />\n<p>The second end 3rd function both give the notice/errormessage in frontend but don't prevent the increasing of product amount.</p>\n"^^ . + . + . + "Getting PHP Version from Bash script not working"^^ . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "Thank you! I tried this out and it seems to cut the process time by about 50-75% most of the time."^^ . + . + . + . + "-1"^^ . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + "PHPMailer not sending HTML emails"^^ . + "Tried it and it doesn't seem to work, as my laravel may be a subsequent upload to the container of the\n\nI'd prefer that permissions be granted automatically under the /var/www/html directory."^^ . + . + . + "0"^^ . + "Well, thanks for sticking with me @Chris Haas. I had had similar ideas so it's worth a look at my latest update which is all quite bizarre. I believe the 'cound not be found' error is a misreport. Ther eis some problem loading php_openssl.dll that is being incorrectly logged as 'cound not be found'. Check out my browser v CLI and 'cunning plan' results documented above"^^ . + . + "You are looking for a magic fix for something that is load related. Using pconnect is a way of lowering tcp socket connections in use. It is not a magic fix for running out of available sockets. There are os level configuration limits you can adjust (if available memory exists) that can at best help you "prove" this, but you can't get past the physical limitations of the number of sockets available in the host os. Since docker depends on the host OS, the actual limits are a function of host os limits. In macos for example, it's about 16k (total) close to your 15k observation eh?"^^ . + . + "You have to clarify in your question the technical details. Abstract terms like "Problem" or "Help" do not suffice nor are they helpful for getting better feedback/answers. Additionally I removed the greeting phrases as they are obsolete on Stackoverflow. Let me know if you think you can benefit from more guidance or there are any show stoppers for you to detail on your problem."^^ . + "-1"^^ . + "0"^^ . + . + . + . + . + . + "2"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + "`Is there a way to bind a query as a variable in a prepared statement, and have it executed?`...aside from the obvious security problem this could cause, I can't see why you'd ever want/need to. The text of the SELECT isn't going to be dynamic, only the :id parameter would be. So just hard-code it along with the rest of the query, and parameterise the ID bit."^^ . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "<p>If you're on Laravel 8+, update your <code>web.php</code> route like this instead of <code>'DiscussionController@showForDistrict'</code>.</p>\n<pre><code>Route::get('/{slug}/discussion', [DiscussionController::class, 'showForDistrict'])-&gt;name('district_discussion');\n</code></pre>\n<p>Starting from Laravel 8, Laravel requires controllers' fully qualified class name (FQCN) because of improved route namespace handling.</p>\n"^^ . + . + "0"^^ . + "image-processing"^^ . + . + . + . + "1"^^ . + "0"^^ . + "2"^^ . + . + . + "That's a lot of code for a simple date validation. Also, are you sure your problem is directly related to Excel itself? Finally, Laravel 7 is EOL since four years - please update your application to ensure that you're not facing any problem that was resolved in the meantime"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + "@ADyson If it is so imperative to escape values, why isn't it inbuilt (e.g. into the shell)?!? There could be a flag for the rare cases when one doesn't want to escape values. If humans are so dangerously forgetful, I don't understand why it is even possible to not do as you all say."^^ . + . + . + . + . + . + "sonarqube-scan"^^ . + . + "2"^^ . + "<p>Can't you just do something like</p>\n<pre class="lang-php prettyprint-override"><code> public function subjectable(): ?MorphTo\n {\n\n if (in_array($this-&gt;subject, ['shop', 'merchant'])) {\n return $this-&gt;morphTo(__FUNCTION__, 'subject', 'subject_id');\n }\n\n return null;\n }\n</code></pre>\n"^^ . + . + . + "1"^^ . + "Please learn to use prepared statements. While in this case, you are safe from SQL injection, it's just a coincidence. Please find a better learning resource if it teaches you to write code this way."^^ . + . + "git alias for php not completely working in windows"^^ . + "<p>I have a plugin that filters items, but I want to be able to set the limit in the plugin options.</p>\n<p>I added a flexform field, I just need to be able to bring that value into my repository php where the query is made?</p>\n<p>So I can set the limit <code>$query-&gt;setLimit($mylimit);</code></p>\n<p>I have read the documentation about it <a href="https://docs.typo3.org/permalink/t3coreapi:read-flexforms-php" rel="nofollow noreferrer">here</a> but am a bit lost on how to do it.</p>\n"^^ . + . + . + . + "Is there a quick shortcut or alternative to select a multi-line statement (like echo) from start to end in VS Code?"^^ . + . + . + . + "1"^^ . + "Follow up question: https://stackoverflow.com/questions/79469924/how-to-resolve-module-version-mismatch-for-pecl-extension"^^ . + "sap-ase"^^ . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + . + "1"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "You can't know if the file exists on a remote server unless that server tells you so. Any endpoint you might call, even if it resembles a file, may be generated by the server on the go."^^ . + . + . + . + "3"^^ . + . + "3"^^ . + "0"^^ . + "Do you get any errors?"^^ . + "When I run the project, there is the error: `Method Illuminate\\Database\\Eloquent\\Collection::orderBy does not exist.`. If i set `$lastNumber = 0;` and run again, I get the error `Too few arguments to function Illuminate\\Database\\Eloquent\\Builder::find(), 0 passed in`. If I set the other variable to zero `$lastColumn = 0;` the page loads and does not complain about `$count` missing. You need to fix these other errors, which are out of scope of _this_ particular question. If you need more help, post new questions about each issue."^^ . + . + "1"^^ . + "php-8.1"^^ . + "1"^^ . + . + "3"^^ . + . + . + . + "What does "is jamble" mean? It's not clear what the question/problem is."^^ . + . + "2"^^ . + . + "1"^^ . + . + "May I know how the code would look like?\nI am very sorry, i am just new to php"^^ . + . + . + . + "<p>PHP version: 8.4</p>\n<p>FreeScout version: 1.8.173</p>\n<p>Hello!</p>\n<p>I face this problem with sending notification emails with Freescout to users since updateing PHP:</p>\n<pre><code> htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated (View: /home/.../helpdesk/resources/views/emails/user/notification.blade.php) {&quot;exception&quot;:&quot;[object] (ErrorException(code: 0): htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated (View: /home/.../helpdesk/resources/views/emails/user/notification.blade.php) at /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/Support/helpers.php:580, ErrorException(code: 0): htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated at /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/Support/helpers.php:580)\n[stacktrace]\n#0 /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(45): Illuminate\\\\View\\\\Engines\\\\CompilerEngine-&gt;handleViewException(Object(ErrorException), 0)\n#1 /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(59): Illuminate\\\\View\\\\Engines\\\\PhpEngine-&gt;evaluatePath('/home/acc1210/p...', Array)\n#2 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/View/View.php(137): Illuminate\\\\View\\\\Engines\\\\CompilerEngine-&gt;get('/home/acc1210/p...', Array)\n#3 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/View/View.php(120): Illuminate\\\\View\\\\View-&gt;getContents()\n#4 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/View/View.php(85): Illuminate\\\\View\\\\View-&gt;renderContents()\n#5 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Mail/Mailer.php(328): Illuminate\\\\View\\\\View-&gt;render()\n#6 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Mail/Mailer.php(301): Illuminate\\\\Mail\\\\Mailer-&gt;renderView('emails/user/not...', Array)\n#7 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Mail/Mailer.php(218): Illuminate\\\\Mail\\\\Mailer-&gt;addContent(Object(Illuminate\\\\Mail\\\\Message), 'emails/user/not...', 'emails/user/not...', NULL, Array)\n#8 /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(119): Illuminate\\\\Mail\\\\Mailer-&gt;send('emails/user/not...', Array, Object(Closure))\n#9 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Mail/Mailer.php(250): Illuminate\\\\Mail\\\\Mailable-&gt;send(Object(Illuminate\\\\Mail\\\\Mailer))\n#10 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Mail/Mailer.php(205): Illuminate\\\\Mail\\\\Mailer-&gt;sendMailable(Object(App\\\\Mail\\\\UserNotification))\n#11 /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/Mail/PendingMail.php(99): Illuminate\\\\Mail\\\\Mailer-&gt;send(Object(App\\\\Mail\\\\UserNotification))\n#12 /home/.../helpdesk/app/Jobs/SendNotificationToUsers.php(148): Illuminate\\\\Mail\\\\PendingMail-&gt;send(Object(App\\\\Mail\\\\UserNotification))\n#13 [internal function]: App\\\\Jobs\\\\SendNotificationToUsers-&gt;handle()\n#14 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(28): call_user_func_array(Array, Array)\n#15 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\\\\Container\\\\BoundMethod::Illuminate\\\\Container\\\\{closure}()\n#16 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(27): Illuminate\\\\Container\\\\BoundMethod::callBoundMethod(Object(Illuminate\\\\Foundation\\\\Application), Array, Object(Closure))\n#17 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\\\\Container\\\\BoundMethod::call(Object(Illuminate\\\\Foundation\\\\Application), Array, Array, NULL)\n#18 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\\\\Container\\\\Container-&gt;call(Array)\n#19 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(114): Illuminate\\\\Bus\\\\Dispatcher-&gt;Illuminate\\\\Bus\\\\{closure}(Object(App\\\\Jobs\\\\SendNotificationToUsers))\n#20 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\\\\Pipeline\\\\Pipeline-&gt;Illuminate\\\\Pipeline\\\\{closure}(Object(App\\\\Jobs\\\\SendNotificationToUsers))\n#21 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\\\\Pipeline\\\\Pipeline-&gt;then(Object(Closure))\n#22 /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(48): Illuminate\\\\Bus\\\\Dispatcher-&gt;dispatchNow(Object(App\\\\Jobs\\\\SendNotificationToUsers), false)\n#23 /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(76): Illuminate\\\\Queue\\\\CallQueuedHandler-&gt;call(Object(Illuminate\\\\Queue\\\\Jobs\\\\DatabaseJob), Array)\n#24 /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(320): Illuminate\\\\Queue\\\\Jobs\\\\Job-&gt;fire()\n#25 /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(270): Illuminate\\\\Queue\\\\Worker-&gt;process('database', Object(Illuminate\\\\Queue\\\\Jobs\\\\DatabaseJob), Object(Illuminate\\\\Queue\\\\WorkerOptions))\n#26 /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(114): Illuminate\\\\Queue\\\\Worker-&gt;runJob(Object(Illuminate\\\\Queue\\\\Jobs\\\\DatabaseJob), 'database', Object(Illuminate\\\\Queue\\\\WorkerOptions))\n#27 /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(100): Illuminate\\\\Queue\\\\Worker-&gt;daemon('database', 'emails,default,...', Object(Illuminate\\\\Queue\\\\WorkerOptions))\n#28 /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(84): Illuminate\\\\Queue\\\\Console\\\\WorkCommand-&gt;runWorker('database', 'emails,default,...')\n#29 [internal function]: Illuminate\\\\Queue\\\\Console\\\\WorkCommand-&gt;handle()\n#30 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(28): call_user_func_array(Array, Array)\n#31 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\\\\Container\\\\BoundMethod::Illuminate\\\\Container\\\\{closure}()\n#32 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(27): Illuminate\\\\Container\\\\BoundMethod::callBoundMethod(Object(Illuminate\\\\Foundation\\\\Application), Array, Object(Closure))\n#33 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\\\\Container\\\\BoundMethod::call(Object(Illuminate\\\\Foundation\\\\Application), Array, Array, NULL)\n#34 /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\\\\Container\\\\Container-&gt;call(Array)\n#35 /home/.../helpdesk/overrides/symfony/console/Command/Command.php(255): Illuminate\\\\Console\\\\Command-&gt;execute(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArrayInput), Object(Illuminate\\\\Console\\\\OutputStyle))\n#36 /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Symfony\\\\Component\\\\Console\\\\Command\\\\Command-&gt;run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArrayInput), Object(Illuminate\\\\Console\\\\OutputStyle))\n#37 /home/.../helpdesk/overrides/symfony/console/Application.php(992): Illuminate\\\\Console\\\\Command-&gt;run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArrayInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\StreamOutput))\n#38 /home/.../helpdesk/overrides/symfony/console/Application.php(255): Symfony\\\\Component\\\\Console\\\\Application-&gt;doRunCommand(Object(Illuminate\\\\Queue\\\\Console\\\\WorkCommand), Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArrayInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\StreamOutput))\n#39 /home/.../helpdesk/overrides/symfony/console/Application.php(148): Symfony\\\\Component\\\\Console\\\\Application-&gt;doRun(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArrayInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\StreamOutput))\n#40 /home/.../helpdesk/overrides/laravel/framework/src/Illuminate/Console/Application.php(88): Symfony\\\\Component\\\\Console\\\\Application-&gt;run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArrayInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\StreamOutput))\n#41 /home/.../helpdesk/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(121): Illuminate\\\\Console\\\\Application-&gt;run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArrayInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\StreamOutput))\n#42 /home/.../helpdesk/public/artisan_schedule_runner.php(133): Illuminate\\\\Foundation\\\\Console\\\\Kernel-&gt;handle(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArrayInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\StreamOutput))\n#43 {main}\n&quot;}\n</code></pre>\n<p>Can anyone please help me or guide me how to resolve this issue on my system?</p>\n"^^ . + . + . + . + "translate"^^ . + "@MarkusZeller Sort of. In my opinion, the documentation for this particular language feature is quite messy. It focuses heavily on `statics`, with only a brief mention of the non-static method calls you referred to. But it is what it is."^^ . + . + . + . + . + "1"^^ . + . + . + "Keep Getting a 504 Error When I Run It On A Live Server"^^ . + . + "<p>In my Dockerfile for <strong>php8.4-fpm</strong> i am installing <strong>IMAP package</strong> with the following commands:</p>\n<pre><code>FROM php:8.4-fpm\n[...]\nRUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl &amp;&amp; \\\n docker-php-ext-install imap\n</code></pre>\n<p>But got an error:</p>\n<pre><code>process &quot;/bin/sh -c docker-php-ext-configure imap --with-kerberos --with-imap-ssl&quot; did not complete successfully: exit code: 1\n</code></pre>\n<p>How to solve it?</p>\n"^^ . + "100% .. those 2 lines which is the initial; HP: 0 is always followed by the line containing killed by."^^ . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + "Thanks for the reaction, Dyson, It does not have to be 100% waterproof, but I did see this a lot as a European when I visited American website. Now it would be helpful if we could do this on a page level with a specific url in stead of the entire site."^^ . + . + "1"^^ . + . + "0"^^ . + . + "0"^^ . + . + "tooltip"^^ . + . + "Add information on the communication between the server to the client, it is not necessarily connected solely to the memcached."^^ . + "0"^^ . + "I'll just leave this alone, then? Will there be a time that this error will 'magically' disappear?"^^ . + . + . + . + . + . + "403 Forbidden Error for Laravel Storage Images on Live Server (Works Locally)"^^ . + "2"^^ . + . + "1"^^ . + . + . + . + "<p>I am working on a blogging application in Laravel 8.</p>\n<p>There is the option to add tags to articles. There is a many-to-many relationship between articles and tags. I have an article_tag pivot table.</p>\n<p>In the <code>Tag</code> model I have:</p>\n<pre><code>class Tag extends Model\n{\n use HasFactory;\n\n protected $fillable = ['name'];\n\n public function articles()\n {\n return $this-&gt;belongsToMany(Article::class);\n } \n}\n</code></pre>\n<p>To the <code>Article</code> model I have added the <code>tags()</code> method</p>\n<pre><code>public function tags()\n{\n return $this-&gt;belongsToMany(Tag::class)-&gt;as('tags');\n}\n</code></pre>\n<p>I the ArticleController controller I have the two methods for editing and updating an article:</p>\n<pre><code>public function edit($id)\n {\n $article = Article::find($id);\n return view(\n 'dashboard/edit-article',\n [\n 'categories' =&gt; $this-&gt;categories(),\n 'tags' =&gt; $this-&gt;tags(),\n 'selected_tags' =&gt; $this-&gt;tags()-&gt;pluck('id')-&gt;toArray(),\n 'article' =&gt; $article\n ]\n );\n }\n\n public function update(Request $request, $id)\n {\n $validator = Validator::make($request-&gt;all(), $this-&gt;rules, $this-&gt;messages);\n\n if ($validator-&gt;fails()) {\n return redirect()-&gt;back()-&gt;withErrors($validator-&gt;errors())-&gt;withInput();\n }\n\n $fields = $validator-&gt;validated();\n $article = Article::find($id);\n\n // If a new image is uploaded, set it as the article image\n // Otherwise, set the old image...\n if (isset($request-&gt;image)) {\n $imageName = md5(time()) . Auth::user()-&gt;id . '.' . $request-&gt;image-&gt;extension();\n $request-&gt;image-&gt;move(public_path('images/articles'), $imageName);\n } else {\n $imageName = $article-&gt;image;\n }\n\n $article-&gt;title = $request-&gt;get('title');\n $article-&gt;short_description = $request-&gt;get('short_description');\n $article-&gt;category_id = $request-&gt;get('category_id');\n $article-&gt;tags[] = $request-&gt;get('tags[]');\n $article-&gt;featured = $request-&gt;has('featured');\n $article-&gt;image = $request-&gt;get('image') == 'default.jpg' ? 'default.jpg' : $imageName;\n $article-&gt;content = $request-&gt;get('content');\n // Save changes to the article\n $article-&gt;save();\n //Attach tags to article\n if ($request-&gt;has('tags')) {\n $article-&gt;tags()-&gt;attach($request-&gt;tags);\n }\n\n return redirect()-&gt;route('dashboard.articles')-&gt;with('success', 'The article titled &quot;' . $article-&gt;title . '&quot; was updated');\n }\n</code></pre>\n<p>The form for editing an article:</p>\n<pre><code>&lt;form method=&quot;POST&quot; action=&quot;{{ route('dashboard.articles.update', [$article-&gt;id]) }}&quot; enctype=&quot;multipart/form-data&quot;\n novalidate&gt;\n @csrf\n &lt;div class=&quot;row mb-2&quot;&gt;\n &lt;label for=&quot;title&quot; class=&quot;col-md-12&quot;&gt;{{ __('Title') }}&lt;/label&gt;\n\n &lt;div class=&quot;col-md-12 @error('title') has-error @enderror&quot;&gt;\n &lt;input id=&quot;title&quot; type=&quot;text&quot; placeholder=&quot;Title&quot;\n class=&quot;form-control @error('title') is-invalid @enderror&quot; name=&quot;title&quot;\n value=&quot;{{ old('title', $article-&gt;title) }}&quot; autocomplete=&quot;title&quot; autofocus&gt;\n\n @error('title')\n &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;\n &lt;strong&gt;{{ $message }}&lt;/strong&gt;\n &lt;/span&gt;\n @enderror\n &lt;/div&gt;\n &lt;/div&gt;\n\n &lt;div class=&quot;row mb-2&quot;&gt;\n &lt;label for=&quot;short_description&quot; class=&quot;col-md-12&quot;&gt;{{ __('Short description') }}&lt;/label&gt;\n\n &lt;div class=&quot;col-md-12 @error('short_description') has-error @enderror&quot;&gt;\n &lt;input id=&quot;short_description&quot; type=&quot;text&quot; placeholder=&quot;Short description&quot;\n class=&quot;form-control @error('short_description') is-invalid @enderror&quot; name=&quot;short_description&quot;\n value=&quot;{{ old('short_description', $article-&gt;short_description) }}&quot; autocomplete=&quot;short_description&quot;\n autofocus&gt;\n\n @error('short_description')\n &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;\n &lt;strong&gt;{{ $message }}&lt;/strong&gt;\n &lt;/span&gt;\n @enderror\n &lt;/div&gt;\n &lt;/div&gt;\n\n &lt;div class=&quot;row mb-2&quot;&gt;\n &lt;label for=&quot;category&quot; class=&quot;col-md-12&quot;&gt;{{ __('Category') }}&lt;/label&gt;\n\n &lt;div class=&quot;col-md-12 @error('category_id') has-error @enderror&quot;&gt;\n\n &lt;select name=&quot;category_id&quot; id=&quot;category&quot; class=&quot;form-control @error('category_id') is-invalid @enderror&quot;&gt;\n &lt;option value=&quot;0&quot;&gt;Pick a category&lt;/option&gt;\n @foreach ($categories as $category)\n &lt;option value=&quot;{{ $category-&gt;id }}&quot;\n {{ $category-&gt;id == $article-&gt;category-&gt;id ? 'selected' : '' }}&gt;{{ $category-&gt;name }}&lt;/option&gt;\n @endforeach\n &lt;/select&gt;\n\n @error('category_id')\n &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;\n &lt;strong&gt;{{ $message }}&lt;/strong&gt;\n &lt;/span&gt;\n @enderror\n &lt;/div&gt;\n &lt;/div&gt;\n\n &lt;div class=&quot;row mb-2&quot;&gt;\n &lt;label for=&quot;tags&quot; class=&quot;col-md-12&quot;&gt;{{ __('Tags') }}&lt;/label&gt;\n\n &lt;select name=&quot;tags[]&quot; id=&quot;tags&quot; class=&quot;form-control&quot; multiple=&quot;multiple&quot;&gt;\n @foreach ($tags as $tag)\n &lt;option value=&quot;{{ $tag-&gt;id }}&quot; {{ in_array($tag-&gt;id, $selected_tags) ? 'selected' : '' }}&gt;\n {{ $tag-&gt;name }}&lt;/option&gt;\n @endforeach\n &lt;/select&gt;\n &lt;/div&gt;\n\n &lt;div class=&quot;row mb-2&quot;&gt;\n &lt;div class=&quot;col-md-12 d-flex align-items-center switch-toggle&quot;&gt;\n &lt;p class=&quot;mb-0 me-3&quot;&gt;Featured article?&lt;/p&gt;\n &lt;input class=&quot;mt-1&quot; type=&quot;checkbox&quot; id=&quot;featured&quot; name=&quot;featured&quot; value=&quot;featured&quot;\n {{ old('featured', $article-&gt;featured) ? 'checked' : '' }}&gt;\n &lt;label class=&quot;px-1&quot; for=&quot;featured&quot;&gt;{{ __('Toggle') }}&lt;/label&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n\n &lt;div class=&quot;row mb-2&quot;&gt;\n &lt;label for=&quot;image&quot; class=&quot;col-md-12&quot;&gt;{{ __('Article image') }}&lt;/label&gt;\n\n &lt;div class=&quot;col-md-12 post-image @error('image') has-error @enderror&quot;&gt;\n &lt;input type=&quot;file&quot; value=&quot;{{ old('image', $article-&gt;image) }}&quot; name=&quot;image&quot; id=&quot;file&quot;\n class=&quot;file-upload-btn&quot;&gt;\n\n @error('image')\n &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;\n &lt;strong&gt;{{ $message }}&lt;/strong&gt;\n &lt;/span&gt;\n @enderror\n &lt;/div&gt;\n &lt;/div&gt;\n\n &lt;div class=&quot;row mb-2&quot;&gt;\n &lt;label for=&quot;content&quot; class=&quot;col-md-12&quot;&gt;{{ __('Content') }}&lt;/label&gt;\n\n &lt;div class=&quot;col-md-12 @error('content') has-error @enderror&quot;&gt;\n\n &lt;textarea name=&quot;content&quot; id=&quot;content&quot; class=&quot;form-control @error('content') is-invalid @enderror&quot;\n placeholder=&quot;Content&quot; cols=&quot;30&quot; rows=&quot;6&quot;&gt;{{ old('content', $article-&gt;content) }}&lt;/textarea&gt;\n\n @error('content')\n &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;\n &lt;strong&gt;{{ $message }}&lt;/strong&gt;\n &lt;/span&gt;\n @enderror\n &lt;/div&gt;\n &lt;/div&gt;\n\n &lt;div class=&quot;row mb-0&quot;&gt;\n &lt;div class=&quot;col-md-12&quot;&gt;\n &lt;button type=&quot;submit&quot; class=&quot;w-100 btn btn-primary&quot;&gt;\n {{ __('Update') }}\n &lt;/button&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n&lt;/form&gt;\n</code></pre>\n<p>For a reason I have not been able to spot, the update method fails with the error below:</p>\n<pre><code>Integrity constraint violation: 1062 Duplicate entry '306-1' for key 'PRIMARY' (SQL: insert into `article_tag` (`article_id`, `tag_id`) \n</code></pre>\n<p>Where is my mistake?</p>\n"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + "2"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + "Why would you want to do this? You can't use a php variable without the $ in the code, so you always have to type it anyway. Actually it's probably a good thing that you do, then the suggestions you get at that time will always be variables, and not something less relevant at that moment."^^ . + . + "everything works except for logout. The login and registration functions work fine, but logging out does not seem to invalidate the token properly"^^ . + . + "1"^^ . + . + . + . + . + "0"^^ . + "<h2><strong>Reason</strong></h2>\n<p>The pre-rendered view is generated ONCE during execution of the <code>down</code> command in console, NOT during an actual HTTP request from user. So, when view is rendered, there is NO access to an HTTP request object or its headers, like <code>Accept-Language</code>. Finally, the resulting file contains ONLY static content that is served as-is for all requests when maintenance mode is active.</p>\n<h2><strong>Solution</strong> <em>(trick)</em></h2>\n<p>Instead of relying on a pre-rendered view, you can use Laravel's default maintenance mode behavior without <code>--render</code> option.</p>\n<p>If maintenance mode is detected, a <code>MaintenanceModeException</code> is thrown, and exception handler renders <strong>errors/503.blade.php</strong> view dynamically for that request.</p>\n<p>So you can implement your stuff in your <strong>resources/views/errors/503.blade.php</strong> view:</p>\n<pre><code>@php\n $_supportedLanguages = ['en', 'fa'];\n $_preferredLanguage = request()-&gt;getPreferredLanguage($_supportedLanguages );\n app()-&gt;setLocale($_preferredLanguage );\n@endphp\n\n&lt;h1&gt;@lang('Maintenance_Mode')&lt;/h1&gt;&lt;br/&gt;\n@lang('we_are_currently_performing_maintenance')\n</code></pre>\n<p>Don't forget to fill translation files in <strong>resources/lang/</strong></p>\n"^^ . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + "Manual changes via WordPress REST API are not applied"^^ . + "I don't see why you need to call NumberController::checkBid after you delete all the data and know you don't have anything to check? maybe update your if to `if ($data->isNotEmpty())`"^^ . + "The error is pretty self explanatory"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + "2"^^ . + . + . + "<p>To call a function belonging to the same instance of a class use the <code>$this</code> instance variable and the &quot;object operator&quot; (or more commonly know as &quot;arrow operator&quot;) to access a function.</p>\n<p>E.g. <code>$this-&gt;count(1);</code></p>\n<p>After looking at your code the <code>undefined variable</code> problem is caused by displaying the <code>index</code> view but not passing the <code>$count</code> variable in the data, so either change these lines</p>\n<pre class="lang-none prettyprint-override"><code>return view('index', ['numbers' =&gt; $numbers]);\n</code></pre>\n<p>to</p>\n<pre class="lang-none prettyprint-override"><code>return view('index', ['numbers' =&gt; $numbers, 'count' =&gt; null]);\n</code></pre>\n<p>or change the view to use</p>\n<pre class="lang-none prettyprint-override"><code>@if (isset($count))\n</code></pre>\n<p>When passing data to views it's common to use the function <code>compact()</code>, which takes a series of string arguments which are the names of local variables. It returns an array keyed by the names, with the values assigned from local variables with the same name. So in your controller you can use</p>\n<pre class="lang-none prettyprint-override"><code>return view('index', compact('numbers', 'count'));\n</code></pre>\n<p>Assuming you have defined both variables in the controller function.</p>\n"^^ . + "Yeah, it is somewhat like a man page. You really need to read and understand every sentence, else it confuses."^^ . + . + . + "@bobblebubble your solution worked perfectly and is 40% more efficient than mine! I used it like `\\\\b(?:(?:xxg|xxl|xxs)|([^0-9])\\\\1+)\\\\b(*SKIP)(*F)|([^0-9])\\\\2+/` and worked pretty great! If you post your regex as an answr I will be glad to accept it."^^ . + . + "According to https://stackoverflow.com/tags/system.data.sqlite/info, _"System.Data.SQLite is an ADO.NET provider for the SQLite embedded database"_. https://system.data.sqlite.org/src/doc/trunk/www/index.wiki says the same thing. Is your question referring to a different piece of software? Or have you perhaps just misunderstood something."^^ . + "1"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + "That "log line" format looks pretty consistent - so use `preg_split` to split on that? https://3v4l.org/nVdGI (Status at the end might not always be `Success`, I'm guessing? Then either list alternatives, or use something more generic in that part.)"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + "Your error is specifically triggering on `select * from sessions`... Did you restart your server, clear your config cache (if you've run `php artisan cache:config` at all), etc.? Unless you're manually running that SQL in your project, you should no longer be getting the same error."^^ . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + . + "1"^^ . + . + "Performance Regression with Imagick between PHP 7.2 and 8.2"^^ . + . + "0"^^ . + . + "The linked Q&A wasn't present when I made my post. Perhaps a more helpful question would be how to short Stackoverflow stock at this point, if it's turned into Wikipedia or Reddit."^^ . + . + "PHP Curl Fails To Connect to SFTP Server"^^ . + . + . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + "PHP response is escaping HTML characters and not rendering the frontend, but works fine in local / dev environment"^^ . + . + "0"^^ . + . + . + . + . + . + "-3"^^ . + . + "1"^^ . + . + . + . + . + . + "<p>here is the settings.json file on vscodium</p>\n<pre class="lang-json prettyprint-override"><code>{&quot;php.executables&quot;: {&quot;v8.3.17&quot;: &quot;/usr/bin/php&quot;}}\n</code></pre>\n<p>when I try to run it:</p>\n<pre><code>\\[Error: spawn php ENOENT\nat ChildProcess.\\_handle.onexit (node:internal/child_process:285:19)\nat onErrorNT (node:internal/child_process:483:16)\nat process.processTicksAndRejections (node:internal/process/task_queues:82:21)\\] {\nerrno: -2,\ncode: 'ENOENT',\nsyscall: 'spawn php',\npath: 'php',\nspawnargs: \\[\n'-dxdebug.mode=off',\n'/home/kudo/Documents/php learning/index.php'\n\\]\n}\n</code></pre>\n<p>I am on fedora. php is installed. version: 8.3.17</p>\n"^^ . + "0"^^ . + . + "0"^^ . + "<p>Given that you're able to connect to <code>host.docker.internal</code>, which means your service is listening and accessible (ie. no firewall issues), I can think of two possible solutions:</p>\n<h4>1) Ensure host network driver is enabled</h4>\n<p>It may be the case that you have to enable host networking manually via the Docker Desktop app. The host network-mode was only supported on Linux host machines (ie. not support on Mac) until Docker 4.34. (<a href="https://docs.docker.com/desktop/release-notes/#4340" rel="nofollow noreferrer">release notes</a>). Setting the network mode to host on a version before this <a href="https://medium.com/@lailadahi/getting-around-dockers-host-network-limitation-on-mac-9e4e6bfee44b" rel="nofollow noreferrer">silently fails</a> so may not have been apparent.</p>\n<p>From the <a href="https://docs.docker.com/engine/network/drivers/host/" rel="nofollow noreferrer">Docker docs</a>:</p>\n<blockquote>\n<p>The host networking driver is supported on Docker Engine (Linux only) and Docker Desktop version 4.34 and later.</p>\n</blockquote>\n<p>If you're running a version of Docker Desktop that's earlier than 4.34, then you'll have to update.</p>\n<p>Once you're sure your Docker Desktop version is &gt;=4.34, then you can <a href="https://docs.docker.com/engine/network/drivers/host/#docker-desktop" rel="nofollow noreferrer">enable host networking</a>:</p>\n<blockquote>\n<ol>\n<li>Sign in to your Docker account in Docker Desktop.</li>\n<li>Navigate to Settings.</li>\n<li>Under the Resources tab, select Network.</li>\n<li>Check the Enable host networking option.</li>\n<li>Select Apply and restart.</li>\n</ol>\n</blockquote>\n<h4>2) Supply external URL as environment variable</h4>\n<p>Alternatively, if you want to avoid using the host network mode due to its <a href="https://docs.docker.com/engine/network/drivers/host/#limitations" rel="nofollow noreferrer">limitations</a> or security concerns, you may opt to pass in a URL as an environment variable to be read by your container/PHP application. This eliminates the needs for hardcoding your URL in your application and also has the benefit of allowing it to be configured independently per-environment.</p>\n<p>You could, for example, supply the URL for this environment like so:</p>\n<pre class="lang-yaml prettyprint-override"><code># docker-compose-env.yml\n...\nservices:\n my-php-service:\n ...\n environment:\n OIDC_URL: host.docker.internal\n</code></pre>\n<p>In PHP, you can use the <code>getenv</code> function (<a href="https://www.php.net/manual/en/function.getenv.php" rel="nofollow noreferrer">docs</a>) to read an environment variable.</p>\n<pre><code>$oidc_url = getenv('OIDC_URL');\n$oidc = new OpenIDConnectClient(&quot;{$oidc_url}:5001&quot;,\n 'ClientIDHere',\n 'ClientSecretHere');\n</code></pre>\n"^^ . + "<p>I want to add an option to select a term for a product. For this, I thought it would be a good idea to add a field to the attribute itself to indicate if it should be treated as an option. If the value is 'yes,' I want to display the field on the term.</p>\n<p><a href="https://i.sstatic.net/VKYuLMth.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/VKYuLMth.png" alt="enter image description here" /></a></p>\n<p>For the first part I found the code on stackoverflow but I am not able to find the second part.</p>\n<pre><code>// Add the dropdown to the product attributes page\nfunction my_edit_wc_attribute_pr_addon_field() {\n $id = isset( $_GET['edit'] ) ? absint( $_GET['edit'] ) : 0;\n $value = $id ? get_option( &quot;wc_attribute_pr_addon_field-$id&quot; ) : '';\n ?&gt;\n &lt;tr class=&quot;form-field&quot;&gt;\n &lt;th scope=&quot;row&quot; valign=&quot;top&quot;&gt;\n &lt;label for=&quot;my-pr_addon_field&quot;&gt;Product addon&lt;/label&gt;\n &lt;/th&gt;\n &lt;td&gt;\n &lt;select name=&quot;pr_addon_field&quot; id=&quot;pr_addon_field&quot;&gt;\n &lt;option value=&quot;no&quot; &lt;?php selected( $value, 'no' ); ?&gt;&gt;No&lt;/option&gt;\n &lt;option value=&quot;yes&quot; &lt;?php selected( $value, 'yes' ); ?&gt;&gt;Yes&lt;/option&gt;\n &lt;/select&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php\n}\nadd_action( 'woocommerce_after_add_attribute_fields', 'my_edit_wc_attribute_pr_addon_field' );\nadd_action( 'woocommerce_after_edit_attribute_fields', 'my_edit_wc_attribute_pr_addon_field' );\n\nfunction my_save_wc_attribute_pr_addon_field( $id ) {\n if ( is_admin() &amp;&amp; isset( $_POST['pr_addon_field'] ) ) {\n $option = &quot;wc_attribute_pr_addon_field-$id&quot;;\n update_option( $option, sanitize_text_field( $_POST['pr_addon_field'] ) );\n }\n}\nadd_action( 'woocommerce_attribute_added', 'my_save_wc_attribute_pr_addon_field' );\nadd_action( 'woocommerce_attribute_updated', 'my_save_wc_attribute_pr_addon_field' );\n\nadd_action( 'woocommerce_attribute_deleted', function ( $id ) {\n delete_option( &quot;wc_attribute_pr_addon_field-$id&quot; );\n} );\n</code></pre>\n"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "-1"^^ . + . + . + "2"^^ . + "Laravel 11 how to configure email encoding?"^^ . + . + . + . + . + . + . + . + "It is important to know the difference between `"Andr\\xc3\\xa9"` and `'Andr\\xc3\\xa9'`"^^ . + "If I understand your real intention --- then you can for sure write a code editor to do what you want (provided that you know how to write it). For example <?php $car1=10; .... then when you type `ca` the editor shows all the previously declared variables such as $car1, $car2, $carry, $carpenter so that you can pick... But I wonder whether picking the correct variable from the list will be faster (or slower ?) than simply type it AGAIN. (please think why most code editors do not have this similar feature ??)"^^ . + . + "0"^^ . + "1"^^ . + "You can try to show the new one in client side, using javascript"^^ . + . + "-3"^^ . + . + . + . + . + . + . + "3"^^ . + "How can I detect if a property is write-only using reflection?"^^ . + . + . + . + . + . + "0"^^ . + . + "https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors [edit]"^^ . + . + . + . + . + "Maybe you should be thinking about things like hakre mentioned, or even blockchain stuff. Depends how serious you are I guess. Dunno if people like docusign have published information on how they secure their data...what research have you done?"^^ . + . + . + . + "1"^^ . + "1"^^ . + . + . + "hi @C3roe I use default settings for these ones: \n\n```lang-php\n\ndefine('K_COOKIE_DOMAIN', ''); define('K_COOKIE_PATH', '/'); define('K_COOKIE_SECURE', true); define('K_COOKIE_HTTPONLY', true); define('K_COOKIE_SAMESITE', 'Strict'); define('K_COOKIE_EXPIRE', K_SECONDS_IN_DAY); \n\n```"^^ . + . + . + . + . + . + "0"^^ . + . + . + "2"^^ . + . + "Why do my session variables disappear after calling session_regenerate_id(true)?"^^ . + . + "0"^^ . + . + "Just to challenge the precision again: whether something is "available within the HasExtendedPermissions trait" is not something you can ever directly observe - code never actually runs in the context of a trait, it runs in the context of a class that has that trait pasted into it. So my question remains: what is the *observed behaviour* that you weren't expecting (error message, unexpected output, etc)? It would be helpful to [edit] in a full [mre] - at the moment, there's a lot of implied logic in yet more traits we can't see, and it's unclear if those are actually relevant to the problem."^^ . + "1"^^ . + "Please share how your answer is related to the given problem. Any explanation can help others to understand and learn from it. The original code didn't even use static functions, so what's the need to add them in an answer?"^^ . + . + . + . + "4"^^ . + . + . + . + . + "I wrote it here `$chroot = public_path();\n$pdf = \\Barryvdh\\DomPDF\\Facade\\Pdf::loadHTML($content)->setOptions(['chroot' => $chroot, 'isRemoteEnabled'=>true]);`"^^ . + . + "@halfer had a hunch that was the issue. Glad I could help you uncover it!"^^ . + . + . + . + "Are static arrays already in the script"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + . + "0"^^ . + "good. Let me know if you need more help. I will try to help you.."^^ . + "1"^^ . + . + . + . + . + . + . + . + . + . + "Yes i restarted apache2 service."^^ . + . + . + "Can you give the debug `$_POST` what you are getting after form post"^^ . + . + "1"^^ . + . + . + . + "0"^^ . + "And please format your code readably. Clearly, putting it on a single line isn't remotely readable, and I'm sure you didn't write it like that originally. Present it in a way _you_ would like to be able to look at and analyse, if you'd never seen that code before. The more effort you put into making your question clear, the more likely people can understand and answer it, and help you. See also [ask]. Please [edit] your post."^^ . + "0"^^ . + "0"^^ . + . + "@ÁlvaroGonzález Yes, I know that the deprecations come from old/unmaintained packages. I will make PRs for the maintained ones and fork the rest.\nStill, I don't understand why the deprecations are being displayed on STDOUT."^^ . + . + "0"^^ . + "`$this->id` wouldn't be known if you did `Employee::with('salary')`; you haven't loaded any rows from the DB yet, so `$this->id` would be `null`. You could try to use `join()` syntax for this, i.e. `->whereColumn('employee_id', 'joined_table.employee_id')`, but I have no idea how that would look for your query... It might just be easier to add a method `getSalary()` that checks `return $this->salary ? $this->salary : Salary::orderBy('start_date', 'ASC')->first();` (or similar). You'd then still simply call `Employee::with('salary')->get()`, but when trying to access it, use `$emp->getSalary()`"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + "Laravel 12 relation MorphTo with unknown type value"^^ . + . + . + "0"^^ . + . + "1"^^ . + "<p>I think there is a misunderstanding how <strong>Open ID Connect</strong> works.</p>\n<p>To log out the User from your application, you have to destroy the session.</p>\n<p>In PHP you can do it with</p>\n<pre><code>session_destroy();\n</code></pre>\n<p>This will destroy the session in your application, or Resource Provider (RP), but not the user Session on Keycloak, the Identity Provider for your application.</p>\n<p>If you really want to log off the user from Keycloak, you have to redirect him to Logout End-Point of Keycloack immediately after destroying the local session, for example with:</p>\n<pre><code>header (&quot;Location: $logout_url&quot;);\n</code></pre>\n<p>PS: The keycloak should be configured to accept logout requests too.</p>\n"^^ . + "2"^^ . + . + . + . + . + . + . + . + . + "rating"^^ . + . + . + . + . + "worker"^^ . + . + "2"^^ . + "0"^^ . + . + . + . + "<p>I'm using a Raspberry Pi 4, PHP 8 and the GPIO PHP library. The following code throws an error:</p>\n<pre class="lang-php prettyprint-override"><code>require 'vendor/autoload.php';\nrequire_once 'vendor/autoload.php';\n\nuse PiPHP\\GPIO\\GPIO;\nuse PiPHP\\GPIO\\Pin\\InputPinInterface;\nuse PiPHP\\GPIO\\Pin\\OutputPinInterface;\n\n$gpio = new GPIO();\n$buttonPin = $gpio-&gt;getInputPin(3);\n</code></pre>\n<p>The error is:</p>\n<pre><code>PHP Fatal error: Uncaught RuntimeException: fwrite(): Write of 1 bytes failed with errno=22 Invalid argument\nStack trace:\n#0 .../piphp/gpio/src/FileSystem/FileSystem.php(46): PiPHP\\GPIO\\FileSystem\\FileSystem-&gt;exceptionIfFalse()\n#1 .../piphp/gpio/src/Pin/Pin.php(165): PiPHP\\GPIO\\FileSystem\\FileSystem-&gt;putContents()\n#2 .../piphp/gpio/src/Pin/Pin.php(62): PiPHP\\GPIO\\Pin\\Pin-&gt;writePinNumberToFile()\n#3 .../piphp/gpio/src/Pin/Pin.php(43): PiPHP\\GPIO\\Pin\\Pin-&gt;export()\n#4 .../piphp/gpio/src/Pin/InputPin.php(19): PiPHP\\GPIO\\Pin\\Pin-&gt;__construct()\n#5 .../piphp/gpio/src/GPIO.php(34): PiPHP\\GPIO\\Pin\\InputPin-&gt;__construct()\n#6 station.php(11): PiPHP\\GPIO\\GPIO-&gt;getInputPin()\n#7 {main} thrown in .../piphp/gpio/src/FileSystem/FileSystem.php on line 55\n</code></pre>\n<p>Is it because I'm using PHP 8? If so, how can I downgrade?</p>\n"^^ . + "Have you done any proper debugging on this? Your description makes me think you probably haven't - but why not?? Anyway I expect `if(isset($_POST['submit'])){` will return `false`, because the FormData constructor doesn't serialize buttons by default, and you haven't provided an value for the `submitter` argument - therefore no `submit` parameter will have been sent to the server, and those `$_POST["submit"]` won't be set. Even if you didn't know this already, basic testing of your code should have revealed it. More info: https://developer.mozilla.org/en-US/docs/Web/API/FormData/FormData"^^ . + . + . + . + . + "2"^^ . + "1"^^ . + "@RaghavendraN, exactly I just saw that and while I was posting this as solution I saw your comment, I am literally banging my head against the wall. Can you please post that as a answer so that I can accept."^^ . + . + . + "Since you did tag this with Laravel, the built-in [HTTP client](https://laravel.com/docs/11.x/http-client) may simplify things for you."^^ . + "Upvoted as possibly the only non regex answer I have seen you give."^^ . + "Either way you really don't need this code anyway. This: https://www.php.net/manual/en/mysqli.execute-query.php is built in and already does the same job, probably more efficiently."^^ . + . + "1"^^ . + "0"^^ . + "3"^^ . + "*"would you just use prepared statement"* There are no parameters in the query, so a prepared statement would be pointless here."^^ . + . + . + . + "This is documented: **All objects created by the same anonymous class declaration are instances of that very class.** That comment is followed by an example that's similar to your code."^^ . + . + . + "2"^^ . + "0"^^ . + "There will be a message _somewhere_, because a 500 error on its own is fairly meaningless. It just tells you that the server crashed and couldn't continue. It gives no clues about _why_ it crashed. If there's nothing in PHP or Laravel logs then perhaps it's a webserver config issue or something. Or if it was triggered from an AJAX request, use the browser's Network tool to check for the raw response to that request, in case the response body contains useful info. We can't give you a sokution when we don't know what the specific problem is - you will have to investigate it more thoroughly."^^ . + . + "It is a application i have been brought into unfortunately, i have plans to update but we have more pressing issues first."^^ . + . + . + . + . + "1"^^ . + . + "<p>I am new to backend ,but I plan to have back end that can handle ~100k concurrent connections. I found that PHP-swoole is much faster than others , eg node-js. For database part, based on web search , NOSQL ScyllaDB is the fastest and can handle too many requests and data at same time.. .. this is the good part.\nNow , I have installed ScyllaDB into my Ubunto server, it works fine from command propmpt. But when need to call from remote devices, like mobile phones, I have to set backend server. I assume i have to install a driver frist, which should be Cassandra to enable PHP to connect with ScyllaDB. when I install , i get below error :</p>\n<pre><code>root@srv613969:/xxxxx sudo pecl install cassandra\npecl/cassandra requires PHP (version &gt;= 5.6.0, version &lt;= 7.1.99), installed version is 8.3.6\nNo valid packages found\n</code></pre>\n<p>I have PHP 8.3.which seems to be not supported by Cassandra.</p>\n<p>Question : is my approach correct , are there any other alternatives , eg node-js , java,.. etc. which is better.</p>\n<p>Thanks..</p>\n"^^ . + . + . + . + "When you say "loops forever", do you mean that you are being flooded with `error_log` messages (a true loop), or that the code just never exits?"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + "Hi, please provide more information about the problem."^^ . + . + "laravel-relations"^^ . + "0"^^ . + . + . + "4"^^ . + . + . + . + "@PanagiotisKanavos it seems kinda weird that timestamp precision solves anything. Could it be more luck than something else?"^^ . + . + . + "<p>Perhaps someone here has an idea in which direction I should look..</p>\n<p>A migration has been completed for a week now and one of the web applications occasionally returns incorrect responses. We did not have this phenomenon on the old environment (but we ran on older software, both Windows Server, IIS, PHP and MSSQL) and the codebase is the same as on the old environment.</p>\n<p>1 x (PHP) website/web application\n2 x main 'customers' who use the (PHP) website, each with its own set of users.\n2 x MSSQL (2022) databases, where the website chooses which database belongs to which 'customer' during login and based on that also chooses the database user (who only has rights to the 'customer's own database') for retrieving/writing data and continues to use it for the rest of the session.</p>\n<p>Very occasionally (no pattern found yet) a user suddenly gets a response (view) back that does not belong to the screen, and that contains data that does not belong to the database to which the database user has access.</p>\n<p>My suspicion is that this goes wrong somewhere in the IIS / PHP (FastCGI) combination, because this is very incidental and the user has (tested) no rights to the other database - even after a refresh/F5 the user then sees the correct response.</p>\n<p>The application has its own application pool, with max work processes value 1; does that have anything to do with it?</p>\n<p>Is this a familiar phenomenon to anyone or does anyone happen to have an idea where to start looking?</p>\n<p>The old environment was still running on IIS 8.5 and PHP 7.4 - falling back is not an option since we can (finally) run new software.</p>\n<p>Current software; Windows Server 2022 Standard (64bit)\nIIS 10.0.20348.1\nPHP 8.2.12 NTS x64 (via FastCGI)</p>\n<p>Thanks!</p>\n<p>I looked at the max worker processes which are set to 1, but i don't dare to change this in the production environnement; But thats the place i ned to change something, because i can not replicate the issue on my development environnement</p>\n"^^ . + "0"^^ . + . + . + "Laravel 11 + Firebase Firestore: Service Account File Not Readable & Server Stops Responding"^^ . + . + . + "And by the way, isn't it a little strange that `Dom\\HtmlDocument` class requires disabling the namespace manually? It's understandable for generic XML, but HTML?"^^ . + . + . + . + . + . + . + "laravel-5"^^ . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "Are you sure this is in any way related to PHP? If you called wkhtmltopdf without PHP, does it work different?"^^ . + . + . + . + . + . + "1"^^ . + "1"^^ . + . + "0"^^ . + . + . + . + "`$dataBag->set('data', $order);` - shouldn't you be passing this under the identifier `order` instead of `data`?"^^ . + . + "Check the error output. The stream is already incomplete when it hits the Google API, this smells like a timeout problem. Are you making use of temporary files? If not, that could probably help: First stream to a temporary stream handle and check ffmpegs exit status. If it is non-zero it likely failed. Then rewind the temporary handle and use it to "stream on"."^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + "How to Handle Integrity Constraint Violation for Concurrent Duplicate Requests in Laravel API?"^^ . + . + "@TimBiegeleisen Unless I'm missing something, I don't see how it could give a wrong match. If the 4-digit prefix is a valid area code, then you have found the result (longer prefixes will never be valid codes, so testing them before won't change the result)."^^ . + "<p>You must pass the <code>Request</code> class in your <code>add</code> method.</p>\n<p>So it would look like this.</p>\n<pre><code>use Illuminate\\Http\\Request;\n\npublic function add(Request $request){\n $request-&gt;validate([\n 'name' =&gt; 'required|string|max:50',\n 'email' =&gt; 'required|string|email|max:50|unique:tblmember,Email',\n ]);\n $newid = DB::table('tblmember')-&gt;insertGetId([\n 'name' =&gt; $request-&gt;name,\n 'email' =&gt; $request-&gt;email,\n ]);\n return response()-&gt;json(['message' =&gt; 'Member added successfully', 'MemberID' =&gt; $newid], 201);\n}\n</code></pre>\n<p>This is mentioned <a href="https://laravel.com/docs/12.x/requests#accessing-the-request" rel="nofollow noreferrer">here in the laravel docs</a>.</p>\n<p>Without the <code>Request</code> class, laravel won't know how to inject your `$request` variable, and causes the error you posted.</p>\n<p>Hope this helps,</p>\n<p>Regards</p>\n"^^ . + "0"^^ . + . + "0"^^ . + . + . + "Thank you so much. This pointed out that if you try to use the CCS 5.1 you need to load the previous version of 5.0.0.16254 and then load the 5.1.1.18992 without uninstalling the previous version. It has a bunch of files that the new one does not install."^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "<p>I would like to send via POST a value to a PHP script. Would this be the way to go about it? I know there is something not quite right because when I click on the dropdown, nothing changes. I believe the error is in the JS, though I'm not quite sure where as I am unfamiliar with JS. I looked at the console for errors and it does not show any.</p>\n<p>The PHP file is called testing.php. There is a dropdown box where the user can select a value. Under that is a default output of &quot;Nope, nothing yet&quot;. When the user selects a value from the dropdown then that value is POSTed back to the same page. The PHP script then sees that there was a post, and does some math based on a value it pulls from the get_adjuster_from_db() function.</p>\n<pre><code>&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js&quot;&gt;&lt;/script&gt;\n&lt;script&gt;\n\n$(document).ready(function() \n{\n $(&quot;#nList&quot;).change(function() \n {\n $.post(&quot;testing.php&quot;, //Send the value back to the page\n {\n val: $(this).val() //The value of the dropdown\n });\n });\n});\n&lt;/script&gt;\n\n</code></pre>\n<p>And then further down...</p>\n<pre><code>\n&lt;select id = &quot;nList&quot;&gt;\n&lt;option value = &quot;&quot; selected&gt;~~Please chose a value~~&lt;/option&gt;\n&lt;option value = &quot;1&quot;&gt;1&lt;/option&gt;\n&lt;option value = &quot;2&quot;&gt;2&lt;/option&gt;\n&lt;option value = &quot;3&quot;&gt;3&lt;/option&gt;\n&lt;/select&gt;\n&lt;br&gt;\n&lt;p id = &quot;value&quot;&gt;&lt;/p&gt;\n\n&lt;?php\n if ($_SERVER[&quot;REQUEST_METHOD&quot;] == &quot;POST&quot;)\n {\n echo &quot;About to do some math:&lt;br&gt;&quot;; //Just a test-line to print something out\n $dbNumber = get_adjuster_from_db(); //Get multiplier value from the database\n $pn = $_POST[&quot;val&quot;]; //Assign $pn to the posted value\n $npn = $pn * $dbNumber; //Do the math\n echo &quot;&lt;p&gt;&quot; . $pn . &quot; x &quot; . $dbNumber . &quot; = &quot; . $npn . &quot;&lt;/p&gt;&quot;;\n }\n else\n {\n echo &quot;Nope, nothing yet.&quot;;\n }\n?&gt;\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + "@hakre thanks for your time and knowledge! When i download the certificate from https://curl.se/docs/caextract.html i can only find the ## SHA256 hash (wich is different from the generated hash in PHP. Is that the correct one?"^^ . + "2"^^ . + . + . + . + "The correct start and end dates are available via the WC_Booking object that you can get from cart item booking ID…"^^ . + "1"^^ . + . + . + . + . + . + "How to change apache document root in Laragon?"^^ . + . + "password-hash"^^ . + . + "0"^^ . + "2"^^ . + . + . + "0"^^ . + . + . + "There are variable types and type declarations. They don't exactly match. End of story."^^ . + . + "@ ADyson - Yes, it appears that my lack of understanding what the JS code is actually doing is greater than I feared. I was under the impression that AJAX (or jQuery, or other JS's) can POST a variable in the same way that a form's method = POST. I was hoping for an easy thing like that. So if I understand then for my situation, correct me if I'm wrong here, JS captures the value of the Select, sends it via post to a PHP file that then does some work w/ that value, then sends the corresponding data (variable? array?) back for some more JS to work with. I'll have to test around w/ that."^^ . + . + "1"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + "Passing JSON to frontend using Laravel and Blade"^^ . + . + . + . + . + . + . + "fat-free-framework"^^ . + . + . + . + "1"^^ . + . + "A whitelist is a list of pre-defined, permitted values. So if you allow the user to choose a security role for themselves, you must write code to ensure that they cannot choose a role you would not want them to have. The code would check the user's submitted selection to ensure it is only one of the ones on the permitted list (i.e. whitelist)"^^ . + "<p>How to access Slim ServerRequestInterface in Controller.</p>\n<p>Below is my working code</p>\n<p><strong>HomeController</strong></p>\n<pre><code>&lt;?php\nnamespace App\\Controllers;\n\nuse Psr\\Http\\Message\\ResponseInterface as Response;\nuse Psr\\Http\\Message\\ServerRequestInterface as Request;\nuse Slim\\Views\\Twig;\n\n\nclass HomeController extends Controller\n{\n\n public function index(Request $request, Response $response, $args)\n {\n\n return $this-&gt;view($request, 'home', ['name' =&gt; 'text']); // My goal is to remove the $request passed\n }\n}\n</code></pre>\n<p><strong>Controller</strong></p>\n<pre><code>&lt;?php\nnamespace App\\Controllers;\n\nuse Slim\\Psr7\\Factory\\ServerRequestFactory;\nuse Slim\\Views\\Twig;\nuse Psr\\Http\\Message\\ServerRequestInterface as Request;\n\nclass Controller\n{\n\n public function view(Request $request, $tpl, $data)\n {\n\n $response = new \\Slim\\Psr7\\Response(); // I can access response here. So passing response is not required\n\n $view = Twig::fromRequest($request); // I cannot access request here. So I need to pass it\n\n return $view-&gt;render($response, $tpl.'.html', $data);\n }\n}\n</code></pre>\n<p>I tried suggestions from internet and got the error message below</p>\n<blockquote>\n<p>Uncaught Error: Cannot instantiate interface Psr\\Http\\Message\\ServerRequestInterface</p>\n</blockquote>\n<p>or</p>\n<blockquote>\n<p>Fatal error: Uncaught TypeError: Slim\\Views\\Twig::fromRequest(): Argument #1 ($request) must be of type Psr\\Http\\Message\\ServerRequestInterface, string given</p>\n</blockquote>\n<p>Note: this is a working code. All I need is to remove dependency of first argument $request</p>\n<p>I tried to load twig separately as shown in <a href="https://twig.symfony.com/doc/3.x/api.html" rel="nofollow noreferrer">doc</a>. But slim needs the getBody()-&gt;write to be string.</p>\n<p>I tried</p>\n<pre><code>$twig-&gt;fetch($tpl,$data)\n</code></pre>\n<p>but I got an error saying fetch is unknown.</p>\n"^^ . + . + . + . + "0"^^ . + . + "debian"^^ . + . + . + . + "0"^^ . + "@C3roe you see as i had already tried the same and getting the validation message that item_name is invalid. I am newer in shopify and i don't know where the form post request goes."^^ . + "I see https://stackoverflow.com/questions/tagged/delphi+php+encryption - there is quite a culture about it!"^^ . + . + "0"^^ . + . + "1"^^ . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + "How can I display selected options of a multiple select in this Laravel 8 application?"^^ . + . + . + . + . + . + "From https://laravel.com/docs/12.x/configuration#configuration-caching, *"If you execute the `config:cache` command during your deployment process, you should be sure that you are only calling the `env()` function from **within your configuration files**. Once the configuration has been cached, the `.env` file will not be loaded; therefore, the `env()` function will only return external, system level environment variables."* (Emphasis mine)"^^ . + . + "0"^^ . + . + "I have saved the permalinks. The blog and author pages only show if the rewrite slug is written like this: rewrite slug → 'slug' => 'resources/%resource-type%'. So I have just put the resources/ back in and everything seems to be working now. The url is being rewritten so the resources gets removed"^^ . + . + "0"^^ . + . + "<p>I am trying to build a laravel application using docker compose and I keep getting this error. I have tried to change the DB_HOST variable in env file from local host to 127.0.0.1 vice versa but it still doesn't work. I have also tried php artisan config:clear and php:artisan cache:clear multiple times. I have also checked that the server is running but for some reason, it keeps showing connection refused.</p>\n<p>docker-compose.yml</p>\n<pre><code>services:\n web:\n image: app-name:latest\n build:\n target: web\n context: .\n env_file:\n - .env\n ports:\n - &quot;8000:80&quot;\n volumes:\n - .:/var/www/html\n depends_on:\n - db\n \n db:\n platform: &quot;linux/amd64&quot;\n image: mysql:5.7\n env_file:\n - .env\n environment:\n MYSQL_ROOT_PASSWORD: root\n MYSQL_DATABASE: laravel\n MYSQL_USER: laravel\n MYSQL_PASSWORD: secret\n ports:\n - &quot;3307:3306&quot;\n volumes:\n - dbdata:/var/lib/mysql\n\nvolumes:\n dbdata:\n</code></pre>\n<p>.env</p>\n<pre><code>APP_NAME=Laravel\nAPP_ENV=local\nAPP_KEY=base64:XQqm38kup8DjQipdfv18IZavsGd0Rvv0fSvkpe+x0HM=\nAPP_DEBUG=true\nAPP_URL=http://localhost:8000\n\nAPP_LOCALE=en\nAPP_FALLBACK_LOCALE=en\nAPP_FAKER_LOCALE=en_US\n\nAPP_MAINTENANCE_DRIVER=file\n# APP_MAINTENANCE_STORE=database\n\nPHP_CLI_SERVER_WORKERS=4\n\nBCRYPT_ROUNDS=12\n\nLOG_CHANNEL=stack\nLOG_STACK=single\nLOG_DEPRECATIONS_CHANNEL=null\nLOG_LEVEL=debug\n\nDB_CONNECTION=mysql\nDB_PORT=3307\nDB_DATABASE=laravel\nDB_USERNAME=laravel\nDB_PASSWORD=secret\nDB_HOST=db\n\nSESSION_DRIVER=database\nSESSION_LIFETIME=120\nSESSION_ENCRYPT=false\nSESSION_PATH=/\nSESSION_DOMAIN=null\n\nBROADCAST_CONNECTION=log\nFILESYSTEM_DISK=local\nQUEUE_CONNECTION=database\n\nCACHE_STORE=database\n# CACHE_PREFIX=\n\nMEMCACHED_HOST=127.0.0.1\n\nREDIS_CLIENT=phpredis\nREDIS_HOST=127.0.0.1\nREDIS_PASSWORD=null\nREDIS_PORT=6379\n\nMAIL_MAILER=log\nMAIL_SCHEME=null\nMAIL_HOST=127.0.0.1\nMAIL_PORT=2525\nMAIL_USERNAME=null\nMAIL_PASSWORD=null\nMAIL_FROM_ADDRESS=&quot;hello@example.com&quot;\nMAIL_FROM_NAME=&quot;${APP_NAME}&quot;\n\nAWS_ACCESS_KEY_ID=\nAWS_SECRET_ACCESS_KEY=\nAWS_DEFAULT_REGION=us-east-1\nAWS_BUCKET=\nAWS_USE_PATH_STYLE_ENDPOINT=false\n\nVITE_APP_NAME=&quot;${APP_NAME}&quot;\n</code></pre>\n<p>Dockerfile</p>\n<pre><code># Use PHP with Apache as the base image\nFROM php:8.2-apache as web\n\n# Install Additional System Dependencies\nRUN apt-get update &amp;&amp; apt-get install -y \\\n libzip-dev \\\n zip\n\n# Clear cache\nRUN apt-get clean &amp;&amp; rm -rf /var/lib/apt/lists/*\n\n# Enable Apache mod_rewrite for URL rewriting\nRUN a2enmod rewrite\n\n# Install PHP extensions\nRUN docker-php-ext-install pdo_mysql zip\n\n# Configure Apache DocumentRoot to point to Laravel's public directory\n# and update Apache configuration files\nENV APACHE_DOCUMENT_ROOT=/var/www/html/public\nRUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf\nRUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf\n\n# Copy the application code\nCOPY . /var/www/html\n\n# Set the working directory\nWORKDIR /var/www/html\n\n# Install composer\nRUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer\n\n# Install project dependencies\nRUN composer install\n\n# Set permissions\nRUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache\n</code></pre>\n"^^ . + "Well, so far the easiest I've seen (which is in python) is https://github.com/elektito/ih2torrent . Once installed, you can in ih2torrent -d magneturi and, though it takes a few seconds, eventually it tells you the metadata in stdout, which includes the files. It's kind of a pain to use, and slow, but its all I have so far."^^ . + "If it's a memory loop, you should have an out of memory error with a stack trace (assuming you have set up logging properly, which you should). That should give you an idea of what's using up the memory."^^ . + . + "3"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + "I would rather ask, why doing it in PHP at all, instead of just using openssl bash executable"^^ . + "0"^^ . + "1"^^ . + "codeigniter-flashdata"^^ . + . + . + . + . + . + "2"^^ . + . + . + "0"^^ . + "ratchet"^^ . + . + "0"^^ . + . + . + . + . + "As above - while sending a GET with a body is technically possible, it's logically/semantically questionable and goes against usual convention. GET is generally used (as the name suggests) to fetch data from the server, not send large amounts to it (parameters such as those needed to allow the server to filter the output can generally by provided as query params in the URL). What's your use case for sending a GET with a body? As you hinted at yourself, why not just use POST?"^^ . + "How can I with implement ajax based numbered pagination to posts which are displayed via ajax?"^^ . + . + "3"^^ . + . + "There are multiple mistakes in your code attempt… So I have answered below."^^ . + . + "<p>Symfony decides lots of arguments of methods based on php Reflection API.\nAWS SDK is very huge abstraction, where you can pass individual parameters or array of parameters, or have them defined in AWS expected files, etc. Check the <a href="https://github.com/aws/aws-sdk-php/blob/master/src/S3/S3Client.php#L412" rel="nofollow noreferrer">S3Client __construct</a> method and will see it.</p>\n<p>In general that means AWS SDK is not suitable for DI and Symfony services approach.</p>\n<p>What you want to do is install some wrapper around AWS SDK, like <a href="https://github.com/aws/aws-sdk-php-symfony" rel="nofollow noreferrer">AWS Service Provider for Symfony</a></p>\n"^^ . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + "This makes sense. IS_AUTHENTICATED_ANONYMOUSLY was deprecated. I'm still going from 5.4 -> 6.4 so I could still use that."^^ . + . + . + . + . + "Why does PHP 7.3 not support the Null Coalesce assignment ??= operator"^^ . + "looking at the 2 images you posted, it seems you pretend cropping the image, I'd stick to that and not resize it at all: https://codeigniter.com/user_guide/libraries/images.html#cropping-images"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "-1"^^ . + "Thank you very much, I figured it out, I assigned the wrong container all the time.))"^^ . + . + . + "0"^^ . + . + . + "<p>I am trying to replace the vehicle code in the <strong>WHERE</strong> Clause with data that is on the page but I keep failing to declare a variable in the function, can anyone assist please?</p>\n<p>the code (lib.php)</p>\n<pre><code>// (F) GET EVENTS FOR SELECTED PERIOD\n function get ($month, $year) {\n \n // (F1) DATE RANGE CALCULATIONS\n $month = $month&lt;10 ? &quot;0$month&quot; : $month ;\n $daysInMonth = cal_days_in_month(CAL_GREGORIAN, $month, $year);\n $dateYM = &quot;{$year}-{$month}-&quot;;\n $start = $dateYM . &quot;01 00:00:00&quot;;\n $end = $dateYM . $daysInMonth . &quot; 23:59:59&quot;;\n \n // (F2) GET EVENTS\n // s &amp; e : start &amp; end date\n // c &amp; b : text &amp; background color\n // t : event text\n $this-&gt;query(&quot;SELECT * FROM `bookings` WHERE vehicle_id = 'NCV1672' AND (\n (`evt_start` BETWEEN ? AND ?)\n OR (`evt_end` BETWEEN ? AND ?)\n OR (`evt_start` &lt;= ? AND `evt_end` &gt;= ?)\n )&quot;, [$start, $end, $start, $end, $start, $end]);\n $events = [];\n while ($r = $this-&gt;stmt-&gt;fetch()) {\n $events[$r[&quot;vehicle_id&quot;]] = [\n &quot;s&quot; =&gt; $r[&quot;evt_start&quot;], &quot;e&quot; =&gt; $r[&quot;evt_end&quot;],\n &quot;c&quot; =&gt; $r[&quot;evt_color&quot;], &quot;b&quot; =&gt; $r[&quot;evt_bg&quot;],\n &quot;t&quot; =&gt; $r[&quot;evt_text&quot;]\n ];\n }\n\n // (F3) RESULTS\n return count($events)==0 ? false : $events ;\n }\n}\n</code></pre>\n<p>the form data <strong>index.php</strong></p>\n<pre><code>&lt;input class=&quot;form-control&quot; type=&quot;hidden&quot; name=&quot;vehicle_id&quot; value=&quot;&lt;?php echo $row['vehicle_id']; ?&gt;&quot;/&gt;\n</code></pre>\n"^^ . + "<p>I'm writing code that inserts sections of content into a pre-defined Word template using <a href="https://phpword.readthedocs.io/en/latest/templates-processing.html#cloneblock" rel="nofollow noreferrer">PHPWord</a>. I put tags like <strong>${INTRODUCTION}</strong> in my template, and then I use the Template Processors's <em>setValue</em> function to replace these with text.</p>\n<p>Right now, I'm struggling to apply in-template styles and formats though. For example, I have a bullet point list as part of the content. This could be on it's own, or in-between other sections of the content that I'm sending:</p>\n<pre><code>Some paragraph text.\n\n• Point 1\n• Point 2\n\nPotentially some more text.\n\n• Another list\n</code></pre>\n<p>I want to format these bullet points using Word's formatting style, but can't figure out what the best approach is.\nHere is my class that populates the template:</p>\n<pre><code>&lt;?php\n\nnamespace App\\Services;\n\nuse App\\Models\\Model;\nuse PhpOffice\\PhpWord\\Element\\TextRun;\nuse PhpOffice\\PhpWord\\IOFactory;\nuse PhpOffice\\PhpWord\\PhpWord;\nuse PhpOffice\\PhpWord\\Shared\\Html;\nuse PhpOffice\\PhpWord\\TemplateProcessor;\n\nclass ProposalWordExportService\n{\n public function generateWordDocument(Model $model)\n {\n $parsedown = new Parsedown();\n\n // Path to the existing Word template\n\n $templatePath = storage_path($model-&gt;template_path);\n\n if (!file_exists($templatePath)) {\n throw new \\Exception(&quot;Template file not found at: &quot; . $templatePath);\n }\n\n // Load the template\n $templateProcessor = new TemplateProcessor($templatePath);\n\n $content = $model-&gt;content; // note that content is an array containing markdown text\n\n if (is_string($content)) {\n $content = json_decode($content, true);\n }\n\n if (!is_array($content)) {\n throw new \\Exception(&quot;Invalid JSON format in proposal content.&quot;);\n }\n\n $title = $model-&gt;title;\n\n\n $templateProcessor-&gt;setValue('TITLE', $title);\n\n // Loop through content and replace placeholders\n foreach ($content as $key =&gt; $markdownText) {\n\n // Convert Markdown to formatted plain text\n $formattedText = self::convertMarkdownToPlainText($parsedown, $markdownText);\n\n // Join text into a single block for replacement\n $finalText = implode(&quot;\\n&quot;, $formattedText);\n\n // Replace in the template (using uppercase placeholders)\n $placeholder = strtoupper($key);\n $templateProcessor-&gt;setValue($placeholder, $finalText);\n }\n\n // Define the output file name\n $fileName = 'somefile_' . $model-&gt;id . '.docx';\n $filePath = storage_path('app/files/' . $fileName);\n\n // Save the modified document\n $templateProcessor-&gt;saveAs($filePath);\n\n if (!file_exists($filePath)) {\n throw new \\Exception(&quot;Failed to generate Word file.&quot;);\n }\n\n return $fileName;\n }\n\n private static function convertMarkdownToPlainText(Parsedown $parsedown, string $markdownText)\n {\n // Convert Markdown to HTML\n $htmlContent = $parsedown-&gt;text($markdownText);\n\n // Convert headings to uppercase with spacing\n $htmlContent = preg_replace('/&lt;h1&gt;(.*?)&lt;\\/h1&gt;/', &quot;\\n\\n$1n\\n&quot;, $htmlContent);\n $htmlContent = preg_replace('/&lt;h2&gt;(.*?)&lt;\\/h2&gt;/', &quot;\\n\\n$1\\n\\n&quot;, $htmlContent);\n $htmlContent = preg_replace('/&lt;h3&gt;(.*?)&lt;\\/h3&gt;/', &quot;\\n\\n$1\\n\\n&quot;, $htmlContent);\n\n // Convert strong (bold) and emphasis (italic)\n $htmlContent = preg_replace('/&lt;strong&gt;(.*?)&lt;\\/strong&gt;/', '**$1**', $htmlContent);\n $htmlContent = preg_replace('/&lt;em&gt;(.*?)&lt;\\/em&gt;/', '*$1*', $htmlContent);\n\n // Convert unordered lists to bullet points\n $htmlContent = preg_replace('/&lt;li&gt;(.*?)&lt;\\/li&gt;/', &quot;• $1&quot;, $htmlContent);\n $htmlContent = str_replace([&quot;&lt;ul&gt;&quot;, &quot;&lt;/ul&gt;&quot;], &quot;&quot;, $htmlContent);\n\n // Convert paragraphs and line breaks\n $htmlContent = str_replace([&quot;&lt;p&gt;&quot;, &quot;&lt;/p&gt;&quot;], &quot;\\n&quot;, $htmlContent);\n $htmlContent = str_replace([&quot;&lt;br&gt;&quot;, &quot;&lt;br/&gt;&quot;], &quot;\\n&quot;, $htmlContent);\n\n // Strip remaining tags\n $plainText = strip_tags($htmlContent);\n\n // Clean up extra spaces and newlines\n $plainText = preg_replace(&quot;/\\n{3,}/&quot;, &quot;\\n\\n&quot;, trim($plainText));\n\n // Split into lines for better formatting in Word\n return explode(&quot;\\n&quot;, $plainText);\n }\n}\n</code></pre>\n<p>How would I be able to format the content correctly before passing it to PHPWord?</p>\n"^^ . + "1"^^ . + "PHP Socket fails to read server response"^^ . + . + "1"^^ . + . + . + . + . + "2"^^ . + . + . + "0"^^ . + . + . + . + "3"^^ . + "1"^^ . + "0"^^ . + . + . + "0"^^ . + "-2"^^ . + . + . + "1"^^ . + . + . + . + . + "1"^^ . + . + . + "the converter works fine in ver 5.0 but as soon as load 5.1 get the script error above immediately. Compared both the converter.html and the converter.js files from both versions and the .html page is exactly the same. The only addition on the 5.1 .js file is: #include jqFeatures.js and #include FCKEditor.js."^^ . + "sql"^^ . + . + . + "2"^^ . + . + . + . + "2"^^ . + . + . + "@LabibAhmed: That blog post (second link) is created with a LLM, probably even the only reason it exists is spamming serps. Better reference the original documentation instead. And do reference in the first place if you quote. With your answer right now it's not clear which quote references to what. That's bad style and not helpful for the readers."^^ . + . + . + "3"^^ . + . + . + "0"^^ . + . + "3"^^ . + . + "0"^^ . + "Also note that `require` isn't the same as `require_once`, so every time you use `require` the script is included again as if it is new."^^ . + . + "1"^^ . + "0"^^ . + . + . + "Please [edit your question](https://stackoverflow.com/posts/79514545/edit) and include your code as properly formatted text. Images are not helpful for code debugging, as we cannot copy and paste (or otherwise manipulate) your code if it's an image..."^^ . + "<p>long time no see.</p>\n<p>I have been working on my PHP ASN.1 parser and I got 99% of the specification implemented.</p>\n<p>I'm having problems figuring out how the encoding pipeline of ASN.1 works, I know that there are a lot of encoding rules but I don't know if the module is supposed to be encoded or used in conjunction with ASN.1 code that is supposed to be encoded.</p>\n<p>Like for example, if an LDAP client were to send an LDAP server credentials.</p>\n<p>How would I encode the ASN.1 code if I were to send a response back to the LDAP client?</p>\n"^^ . + "1"^^ . + . + . + . + . + "using SOLR export request handler with PHP Solarium"^^ . + "0"^^ . + . + "JWT Authentication returning HTML instead of JSON in WordPress API"^^ . + . + "`If I am right and the code is already injection proof I wonder if it is a tricky question or just an oversight` - you are right. Sadly, we have no means to tell it either. Just stand your ground and maintain this code is already injection proof. OR you can allow tradeoff: add some parameter, such as LIMIT, and so make this code more memory friendly and also injection proof."^^ . + "@shingo "20200930" seems to be the correct value for PHP 8.0: https://github.com/php/php-src/blob/php-8.0.30/Zend/zend_modules.h#L34 (presumably the number is set during the alpha/beta part of the release cycle, not on the .0 release). "20230831" is the value for PHP 8.3: https://github.com/php/php-src/blob/php-8.3.0/Zend/zend_modules.h So the dev headers are _too new_ rather than _too old_."^^ . + "`$amount = ceil($weight) * 2;`"^^ . + . + "2"^^ . + . + . + "pinecone"^^ . + . + . + . + . + "what returns "which php" ?"^^ . + . + . + "mariadb"^^ . + "The thing that stands out to me here is that using "stdClass" feels like "I don't care about types", but using PHPStan feels like the opposite. Does the structure actually vary dynamically, or could you just declare a small `Option` class and then the type would be fully explicit?"^^ . + "0"^^ . + . + . + . + "0"^^ . + "1"^^ . + "<p>The error message you provide <strong>cURL error(28)</strong> indicates a timeout for your request could not be completed withing the allocated time. The reason could be an <strong>invalid URL</strong> path so check the URL path Or you can increase the timeout duration as follows for a 30 second timeout</p>\n<pre><code>$params = [params];\n$url = url('your URL path');\n$response = Http::timeout(30)-&gt;post($url, $params); // for 30 second timeout\n</code></pre>\n<p>If the server takes more time than usual, this will help resolve the issue. Otherwise, check if the <strong>server is available.</strong> If the server is not available, a request timeout can occur.</p>\n"^^ . + . + . + "<p>How do you maintain code that requires an older PHP version? I have multiple PHP projects written in different versions of PHP, including old Laravel projects that I want to maintain.</p>\n<p>I'm using Windows and XAMPP.</p>\n<p>I just uninstall the new XAMPP version and install an older one.</p>\n"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + "3"^^ . + . + . + . + . + "2"^^ . + . + . + "Unable to Update a dropdown value"^^ . + . + "2"^^ . + . + . + "0"^^ . + "0"^^ . + "inside `inedx.php` it's like this:\n\n`require dirname(__DIR__) . '/vendor/autoload.php';`"^^ . + "0"^^ . + . + "Yes, I understand. That's why I suggest: don't chain the requests into a single thread, and don't try to wait for the next API request time within the request. These should be treated as scheduled tasks. If I know that 1 minute is the limit, I can use a 1-minute cron job to call the API query script, and at the end of the script, I'll add a new cron job for the next minute if needed. Of course, it's harder to do this in native PHP, while Symfony and Laravel have such queue lists."^^ . + . + . + . + . + . + . + . + . + "Can you try following this steps? https://stackoverflow.com/a/34173232/10849089"^^ . + "0"^^ . + . + . + "Request is not well-formed, syntactically incorrect, or violates schema"^^ . + . + . + "1"^^ . + . + "0"^^ . + . + "-1"^^ . + . + "<p>As I already recommended you in this answer <a href="https://stackoverflow.com/a/79541099/14605475">https://stackoverflow.com/a/79541099/14605475</a>, avoid to use all() if you are filtering by conditions or fetching with first().</p>\n"^^ . + . + . + . + "0"^^ . + . + . + "<p>I need separate databases for each deployments (tenants).</p>\n<pre><code>public function store(Request $request)\n{\n Log::info(&quot;Starting deployment creation for slug: &quot; . $request-&gt;slug);\n\n // **Validate Input**\n $request-&gt;validate([\n 'tenant_name' =&gt; 'required|string|max:255',\n 'slug' =&gt; 'required|string|max:255|unique:deployments,slug',\n 'contact_email' =&gt; 'required|email|unique:users,email',\n 'contact_number' =&gt; 'required|string|max:20',\n 'address' =&gt; 'required|string|max:500',\n 'country' =&gt; 'required|string|max:100',\n 'language' =&gt; 'required|string|max:10',\n 'subscription_start_date' =&gt; 'required|date',\n 'subscription_end_date' =&gt; 'nullable|date|after_or_equal:subscription_start_date',\n 'password' =&gt; 'required|string|min:8|confirmed',\n ]);\n\n DB::beginTransaction(); // **Ensure rollback in case of failure**\n $tenant = null;\n\n try {\n Log::info(&quot;Creating deployment record in central database...&quot;);\n \n // **Create Tenant Deployment Entry**\n $tenant = Deployment::create([\n 'slug' =&gt; $request-&gt;slug,\n 'database_name' =&gt; 'tenant_' . $request-&gt;slug,\n 'tenant_name' =&gt; $request-&gt;tenant_name,\n 'address' =&gt; $request-&gt;address,\n 'contact_email' =&gt; $request-&gt;contact_email,\n 'contact_number' =&gt; $request-&gt;contact_number,\n 'country' =&gt; $request-&gt;country,\n 'language' =&gt; $request-&gt;language,\n 'subscription_start_date' =&gt; $request-&gt;subscription_start_date,\n 'subscription_end_date' =&gt; $request-&gt;subscription_end_date,\n 'status' =&gt; 'active',\n ]);\n\n Log::info(&quot;Deployment created: &quot; . json_encode($tenant-&gt;toArray()));\n\n // **Automatically Create and Configure Database**\n Log::info(&quot;Initializing tenancy for tenant: &quot; . $tenant-&gt;id);\n tenancy()-&gt;initialize($tenant);\n\n Log::info(&quot;Current Database After Initialization: &quot; . DB::connection()-&gt;getDatabaseName());\n\n // **Run Migrations for New Tenant**\n Log::info(&quot;Running migrations for tenant database: &quot; . $tenant-&gt;database_name);\n Artisan::call('tenants:migrate', ['--tenants' =&gt; [$tenant-&gt;id]]);\n Log::info(&quot;Migrations completed for tenant: &quot; . $tenant-&gt;database_name);\n\n // **Create the Admin User for the New Tenant**\n Log::info(&quot;Creating admin user for tenant: &quot; . $tenant-&gt;id);\n $tenant-&gt;run(function () use ($request) {\n Log::info(&quot;Inside tenant database: &quot; . DB::connection()-&gt;getDatabaseName());\n User::create([\n 'name' =&gt; $request-&gt;tenant_name . ' Admin',\n 'email' =&gt; $request-&gt;contact_email,\n 'password' =&gt; Hash::make($request-&gt;password),\n 'role' =&gt; 1, // Admin role\n ]);\n Log::info(&quot;Admin user created successfully in tenant database.&quot;);\n });\n\n // **Commit Transaction &amp; Reset to Central DB**\n Log::info(&quot;Committing transaction and switching back to central database...&quot;);\n DB::commit();\n tenancy()-&gt;end();\n Log::info(&quot;Deployment completed successfully for: &quot; . $tenant-&gt;id);\n\n return redirect()-&gt;route('deployments.index')-&gt;with('success', 'Deployment created successfully.');\n } catch (Exception $e) {\n // **Rollback on Failure**\n DB::rollBack();\n Log::error(&quot;Error during deployment creation: &quot; . $e-&gt;getMessage());\n\n tenancy()-&gt;end();\n if ($tenant != null) {\n $tenant-&gt;delete(); // Remove failed deployment record\n Log::info(&quot;Rolled back deployment record for: &quot; . $tenant-&gt;id);\n }\n\n return back()-&gt;withErrors(['error' =&gt; 'Error creating deployment: ' . $e-&gt;getMessage()]);\n }\n}\n</code></pre>\n<p>My deployments model:</p>\n<pre><code>&lt;?php\n\nnamespace App\\Models;\n\nuse Stancl\\Tenancy\\Database\\Models\\Tenant as BaseTenant;\nuse Stancl\\Tenancy\\Contracts\\TenantWithDatabase;\nuse Stancl\\Tenancy\\DatabaseConfig;\nuse Stancl\\Tenancy\\Database\\Concerns\\HasDatabase;\nuse Stancl\\Tenancy\\Database\\Concerns\\HasDomains;\nuse Illuminate\\Support\\Str;\n\nclass Deployment extends BaseTenant implements TenantWithDatabase\n{\n use HasDatabase, HasDomains;\n\n protected $table = 'deployments';\n public $incrementing = false; // Prevents Laravel from treating `id` as an auto-increment field\n protected $keyType = 'string'; // Ensures `id` is treated as a string\n\n /**\n * Boot function to generate a UUID automatically\n */\n protected static function boot()\n {\n parent::boot();\n static::creating(function ($model) {\n $model-&gt;id = Str::uuid()-&gt;toString(); // Generates UUID for `id`\n });\n }\n\n /**\n * Define the custom columns stored in the central database.\n */\n public static function getCustomColumns(): array\n {\n return [\n 'id',\n 'slug',\n 'database_name',\n 'tenant_name',\n 'address',\n 'contact_email',\n 'contact_number',\n 'country',\n 'language',\n 'subscription_start_date',\n 'subscription_end_date',\n 'status',\n ];\n }\n \n}\n</code></pre>\n<p>The config/tenancy.php</p>\n<pre><code>&lt;?php\n\ndeclare(strict_types=1);\n\nuse Stancl\\Tenancy\\Database\\Models\\Domain;\nuse Stancl\\Tenancy\\Database\\Models\\Tenant;\n\nreturn [\n 'tenant_model' =&gt; \\App\\Models\\Deployment::class,\n 'id_generator' =&gt; Stancl\\Tenancy\\UUIDGenerator::class,\n\n 'domain_model' =&gt; Domain::class,\n\n /**\n * The list of domains hosting your central app.\n *\n * Only relevant if you're using the domain or subdomain identification middleware.\n */\n 'central_domains' =&gt; [\n env('APP_URL'),\n ],\n\n /**\n * Tenancy bootstrappers are executed when tenancy is initialized.\n * Their responsibility is making Laravel features tenant-aware.\n *\n * To configure their behavior, see the config keys below.\n */\n 'bootstrappers' =&gt; [\n Stancl\\Tenancy\\Bootstrappers\\DatabaseTenancyBootstrapper::class,\n Stancl\\Tenancy\\Bootstrappers\\CacheTenancyBootstrapper::class,\n Stancl\\Tenancy\\Bootstrappers\\FilesystemTenancyBootstrapper::class,\n Stancl\\Tenancy\\Bootstrappers\\QueueTenancyBootstrapper::class,\n // Stancl\\Tenancy\\Bootstrappers\\RedisTenancyBootstrapper::class, // Note: phpredis is needed\n ],\n\n /**\n * Database tenancy config. Used by DatabaseTenancyBootstrapper.\n */\n 'database' =&gt; [\n 'central_connection' =&gt; env('DB_CONNECTION', 'mysql'),\n\n /**\n * Connection used as a &quot;template&quot; for the dynamically created tenant database connection.\n * Note: don't name your template connection tenant. That name is reserved by package.\n */\n 'template_tenant_connection' =&gt; 'tenant',\n\n /**\n * Tenant database names are created like this:\n * prefix + tenant_id + suffix.\n */\n 'prefix' =&gt; 'tenant',\n 'suffix' =&gt; '',\n\n /**\n * TenantDatabaseManagers are classes that handle the creation &amp; deletion of tenant databases.\n */\n 'managers' =&gt; [\n 'sqlite' =&gt; Stancl\\Tenancy\\TenantDatabaseManagers\\SQLiteDatabaseManager::class,\n 'mysql' =&gt; Stancl\\Tenancy\\TenantDatabaseManagers\\MySQLDatabaseManager::class,\n 'pgsql' =&gt; Stancl\\Tenancy\\TenantDatabaseManagers\\PostgreSQLDatabaseManager::class,\n\n /**\n * Use this database manager for MySQL to have a DB user created for each tenant database.\n * You can customize the grants given to these users by changing the $grants property.\n */\n // 'mysql' =&gt; Stancl\\Tenancy\\TenantDatabaseManagers\\PermissionControlledMySQLDatabaseManager::class,\n\n /**\n * Disable the pgsql manager above, and enable the one below if you\n * want to separate tenant DBs by schemas rather than databases.\n */\n // 'pgsql' =&gt; Stancl\\Tenancy\\TenantDatabaseManagers\\PostgreSQLSchemaManager::class, // Separate by schema instead of database\n ],\n ],\n\n /**\n * Cache tenancy config. Used by CacheTenancyBootstrapper.\n *\n * This works for all Cache facade calls, cache() helper\n * calls and direct calls to injected cache stores.\n *\n * Each key in cache will have a tag applied on it. This tag is used to\n * scope the cache both when writing to it and when reading from it.\n *\n * You can clear cache selectively by specifying the tag.\n */\n 'cache' =&gt; [\n 'tag_base' =&gt; 'tenant', // This tag_base, followed by the tenant_id, will form a tag that will be applied on each cache call.\n ],\n\n /**\n * Filesystem tenancy config. Used by FilesystemTenancyBootstrapper.\n * https://tenancyforlaravel.com/docs/v3/tenancy-bootstrappers/#filesystem-tenancy-boostrapper.\n */\n 'filesystem' =&gt; [\n /**\n * Each disk listed in the 'disks' array will be suffixed by the suffix_base, followed by the tenant_id.\n */\n 'suffix_base' =&gt; 'tenant',\n 'disks' =&gt; [\n 'local',\n 'public',\n // 's3',\n ],\n\n /**\n * Use this for local disks.\n *\n * See https://tenancyforlaravel.com/docs/v3/tenancy-bootstrappers/#filesystem-tenancy-boostrapper\n */\n 'root_override' =&gt; [\n // Disks whose roots should be overridden after storage_path() is suffixed.\n 'local' =&gt; '%storage_path%/app/',\n 'public' =&gt; '%storage_path%/app/public/',\n ],\n\n /**\n * Should storage_path() be suffixed.\n *\n * Note: Disabling this will likely break local disk tenancy. Only disable this if you're using an external file storage service like S3.\n *\n * For the vast majority of applications, this feature should be enabled. But in some\n * edge cases, it can cause issues (like using Passport with Vapor - see #196), so\n * you may want to disable this if you are experiencing these edge case issues.\n */\n 'suffix_storage_path' =&gt; true,\n\n /**\n * By default, asset() calls are made multi-tenant too. You can use global_asset() and mix()\n * for global, non-tenant-specific assets. However, you might have some issues when using\n * packages that use asset() calls inside the tenant app. To avoid such issues, you can\n * disable asset() helper tenancy and explicitly use tenant_asset() calls in places\n * where you want to use tenant-specific assets (product images, avatars, etc).\n */\n 'asset_helper_tenancy' =&gt; true,\n ],\n\n /**\n * Redis tenancy config. Used by RedisTenancyBootstrapper.\n *\n * Note: You need phpredis to use Redis tenancy.\n *\n * Note: You don't need to use this if you're using Redis only for cache.\n * Redis tenancy is only relevant if you're making direct Redis calls,\n * either using the Redis facade or by injecting it as a dependency.\n */\n 'redis' =&gt; [\n 'prefix_base' =&gt; 'tenant', // Each key in Redis will be prepended by this prefix_base, followed by the tenant id.\n 'prefixed_connections' =&gt; [ // Redis connections whose keys are prefixed, to separate one tenant's keys from another.\n // 'default',\n ],\n ],\n\n /**\n * Features are classes that provide additional functionality\n * not needed for tenancy to be bootstrapped. They are run\n * regardless of whether tenancy has been initialized.\n *\n * See the documentation page for each class to\n * understand which ones you want to enable.\n */\n 'features' =&gt; [\n // Stancl\\Tenancy\\Features\\UserImpersonation::class,\n // Stancl\\Tenancy\\Features\\TelescopeTags::class,\n // Stancl\\Tenancy\\Features\\UniversalRoutes::class,\n // Stancl\\Tenancy\\Features\\TenantConfig::class, // https://tenancyforlaravel.com/docs/v3/features/tenant-config\n // Stancl\\Tenancy\\Features\\CrossDomainRedirect::class, // https://tenancyforlaravel.com/docs/v3/features/cross-domain-redirect\n // Stancl\\Tenancy\\Features\\ViteBundler::class,\n ],\n\n /**\n * Should tenancy routes be registered.\n *\n * Tenancy routes include tenant asset routes. By default, this route is\n * enabled. But it may be useful to disable them if you use external\n * storage (e.g. S3 / Dropbox) or have a custom asset controller.\n */\n 'routes' =&gt; true,\n\n /**\n * Parameters used by the tenants:migrate command.\n */\n 'migration_parameters' =&gt; [\n '--force' =&gt; true, // This needs to be true to run migrations in production.\n '--path' =&gt; [database_path('migrations/tenant')],\n '--realpath' =&gt; true,\n ],\n\n /**\n * Parameters used by the tenants:seed command.\n */\n 'seeder_parameters' =&gt; [\n '--class' =&gt; 'DatabaseSeeder', // root seeder class\n // '--force' =&gt; true,\n ],\n];\n</code></pre>\n<p>The log output:</p>\n<pre><code>[2025-02-18 13:28:18] local.INFO: Starting deployment creation for slug: moops \n[2025-02-18 13:28:18] local.INFO: Creating deployment record in central database... \n[2025-02-18 13:28:18] local.INFO: Deployment created: {&quot;slug&quot;:&quot;moops&quot;,&quot;database_name&quot;:&quot;tenant_moops&quot;,&quot;tenant_name&quot;:&quot;Moops Design&quot;,&quot;address&quot;:&quot;ABCD&quot;,&quot;contact_email&quot;:&quot;moopscontrol@gmail.com&quot;,&quot;contact_number&quot;:&quot;1234567890&quot;,&quot;country&quot;:&quot;India&quot;,&quot;language&quot;:&quot;English&quot;,&quot;subscription_start_date&quot;:&quot;2025-02-01&quot;,&quot;subscription_end_date&quot;:&quot;2025-02-28&quot;,&quot;status&quot;:&quot;active&quot;,&quot;data&quot;:null,&quot;id&quot;:&quot;f823fb29-45d6-4174-88a2-60ce8a34f589&quot;,&quot;updated_at&quot;:&quot;2025-02-18T13:28:18.000000Z&quot;,&quot;created_at&quot;:&quot;2025-02-18T13:28:18.000000Z&quot;} \n[2025-02-18 13:28:18] local.INFO: Initializing tenancy for tenant: f823fb29-45d6-4174-88a2-60ce8a34f589 \n[2025-02-18 13:28:18] local.INFO: Current Database After Initialization: hirezy \n[2025-02-18 13:28:18] local.INFO: Running migrations for tenant database: tenant_moops \n[2025-02-18 13:28:18] local.ERROR: Error during deployment creation: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists (Connection: mysql, SQL: create table `users` (`id` bigint unsigned not null auto_increment primary key, `name` varchar(255) not null, `email` varchar(255) not null, `email_verified_at` timestamp null, `password` varchar(255) not null, `role` int not null default '2', `active` tinyint(1) not null default '1', `terms_accepted` tinyint(1) not null default '0', `remember_token` varchar(100) null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci') \n[2025-02-18 13:28:18] local.INFO: Rolled back deployment record for: f823fb29-45d6-4174-88a2-60ce8a34f589 \n</code></pre>\n<p>I have mysql and tenant connection defined in config/database.php. tenant has database name set to null to fil it dynamically.</p>\n<p>But the database for the tenant is not created when creating a deployment. I instead get an error that table or view - users already exists. This is because it is trying to run the migration on the central database instead of the tenant database. I can confirm via MySQL command line that the tenant database never gets created.</p>\n"^^ . + . + . + "<p>Looking at your code snippets, I think the issue is with the data fetch from Postgres. Because the <code>$_SESSION['firstname']</code> is set from the fetched row data while <code>$_SESSION['email']</code> is from the earlier assigned variable in this line:</p>\n<p><code>$email = trim($_POST['email']);</code></p>\n<p>To correct it in the fetch instead of:</p>\n<pre><code>if ($row = pg_fetch_assoc($result)) {\n $_SESSION['user_id'] = $row['user_id'];\n $_SESSION['firstname'] = $row['firstname']; // Set firstname in session\n $_SESSION['email'] = $email;\n $_SESSION['logged_in'] = true;\n\n var_dump($_SESSION); // Debugging\n header(&quot;Location: home.php&quot;);\n exit();\n } else {\n echo &quot;Error fetching user data!&quot;;\n }\n</code></pre>\n<p>You should use the while loop:</p>\n<pre><code> while ($row = pg_fetch_assoc($result)) {\n $_SESSION['user_id'] = $row['user_id'];\n $_SESSION['firstname'] = $row['firstname']; // Set firstname in session\n $_SESSION['email'] = $email;\n $_SESSION['logged_in'] = true;\n }\n</code></pre>\n"^^ . + "Add Product brand taxonomy term above product title in WooCommerce"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + . + . + "limesurvey"^^ . + . + "most likely, has the error changed or still the same?"^^ . + . + . + "<p>I have database that is used by both Delphi (XE 10.4 or 11) and PHP (8+) versions and this database has some encrypted data (e.g. for the passwords) who should be handles identically between Delphi and PHP code. E.g. - I should write Delphi and PHP encryption procedures that works identically.</p>\n<p>I opted for the AES (whose generalization Rijndael is) and here is my PHP code:</p>\n<pre><code>&lt;?php\n/**\n * Applies PKCS7 padding to a given string.\n *\n * @param string $data The plaintext data.\n * @param int $blocksize The block size in bytes (default is 16).\n * @return string The padded data.\n */\nfunction pkcs7_pad($data, $blocksize = 16) {\n $pad = $blocksize - (strlen($data) % $blocksize);\n return $data . str_repeat(chr($pad), $pad);\n}\n\n/**\n * Encrypts a plaintext string using AES-128-ECB.\n *\n * The key is hashed with SHA-256 and the first 16 bytes are used.\n * PKCS7 padding is applied to the plaintext before encryption.\n *\n * @param string $plaintext The plaintext to encrypt.\n * @param string $key The encryption key.\n * @return string The encrypted data in Base64 encoding.\n */\nfunction encryptAES($plaintext, $key) {\n // Hash the key with SHA-256 and use the first 16 bytes (AES-128 key length)\n $key = substr(hash('sha256', $key, true), 0, 16);\n\n // Pad the plaintext using PKCS7\n $padded = pkcs7_pad($plaintext);\n\n // Encrypt using AES-128-ECB mode\n $encryptedBytes = openssl_encrypt($padded, 'AES-128-ECB', $key, OPENSSL_RAW_DATA);\n\n // Return the encrypted data as a Base64 encoded string\n return base64_encode($encryptedBytes);\n}\n\n// Example usage with obfuscated test data\n$testKey = &quot;ObfuscatedTestKey123&quot;; // Replace with your actual key\n$testPlaintext = &quot;ObfuscatedTextData&quot;; // Replace with your actual plaintext\n\n$encryptedBase64 = encryptAES($testPlaintext, $testKey);\necho &quot;Encrypted (Base64): &quot; . $encryptedBase64;\n?&gt;\n</code></pre>\n<p>And here is my Delphi code with Lockbox Rijndael:</p>\n<pre><code>unit MainFormU;\n\ninterface\n\nuses\n Winapi.Windows, System.SysUtils, System.Classes, Vcl.Forms, Vcl.StdCtrls,\n LbCipher, LbClass, System.Hash, System.NetEncoding;\n\ntype\n TMainForm = class(TForm)\n btnEncrypt: TButton;\n edtPlainText: TEdit;\n lblEncrypted: TLabel;\n LbRijndael: TLbRijndael; // Place a TLbRijndael component on your form.\n procedure btnEncryptClick(Sender: TObject);\n private\n { Private declarations }\n function PKCS7Pad(const Data: string; BlockSize: Integer): string;\n function BytesToRawString(const Bytes: TBytes): RawByteString;\n public\n { Public declarations }\n end;\n\nvar\n MainForm: TMainForm;\n\nimplementation\n\n{$R *.dfm}\n\nconst\n // Obfuscated test key. Replace with your actual key if needed.\n cKey = 'ObfuscatedTestKey';\n\n{ Applies PKCS7 padding to the input string so that its length is a multiple of BlockSize. }\nfunction TMainForm.PKCS7Pad(const Data: string; BlockSize: Integer): string;\nvar\n PadSize: Integer;\n PadChar: Char;\nbegin\n PadSize := BlockSize - (Length(Data) mod BlockSize);\n PadChar := Char(PadSize);\n Result := Data + StringOfChar(PadChar, PadSize);\nend;\n\n{ Converts a TBytes array to a RawByteString without any encoding conversion. }\nfunction TMainForm.BytesToRawString(const Bytes: TBytes): RawByteString;\nbegin\n SetLength(Result, Length(Bytes));\n if Length(Bytes) &gt; 0 then\n Move(Bytes[0], Result[1], Length(Bytes));\nend;\n\n{ Button click handler: derives a 16-byte key from a SHA-256 hash of cKey,\n applies PKCS7 padding to the plaintext, encrypts using AES-128-ECB (via TLbRijndael),\n and finally Base64-encodes the encrypted data. }\nprocedure TMainForm.btnEncryptClick(Sender: TObject);\nvar\n HashBytes, KeyBytes: TBytes;\n RawKey: RawByteString;\n Plaintext, PaddedPlaintext: string;\n EncryptedRaw: RawByteString;\n EncryptedBase64: string;\nbegin\n // Derive a 16-byte key from the SHA-256 hash of cKey.\n HashBytes := THashSHA2.GetHashBytes(cKey, THashSHA2.TSHA2Version.SHA256);\n SetLength(KeyBytes, 16);\n Move(HashBytes[0], KeyBytes[0], 16);\n RawKey := BytesToRawString(KeyBytes);\n\n // Use the text from the edit control or fallback to an obfuscated test plaintext.\n if edtPlainText.Text = '' then\n Plaintext := 'ObfuscatedPlainText'\n else\n Plaintext := edtPlainText.Text;\n\n // Apply PKCS7 padding to the plaintext.\n PaddedPlaintext := PKCS7Pad(Plaintext, 16);\n\n // Configure TLbRijndael: set ECB mode and assign the derived binary key.\n LbRijndael.CipherMode := cmECB;\n LbRijndael.SetKey(RawKey);\n\n // Encrypt the padded plaintext.\n EncryptedRaw := LbRijndael.EncryptString(PaddedPlaintext);\n\n // Base64 encode the encrypted binary data.\n EncryptedBase64 := TNetEncoding.Base64.Encode(EncryptedRaw);\n\n // Display the Base64-encoded encrypted string.\n lblEncrypted.Caption := EncryptedBase64;\nend;\n\nend.\n</code></pre>\n<p>Unfortunately, the results ar different between PHP and Delphi. I am not sure if I can mape Delphi Rijndael to PHP openssl_ecncrypt. E.g. PHP openssl_encrypt expects the key to be byte array, but Delphi Rijndael expects the key to be string and I am not sure whether my Delphi conversion of bytes to string is the right way to achieve that Rijndael behaves similarly to openssl_encrypt?</p>\n<p>The same is with the result from openssl_encrypt (which is array of bytes) and from Rijndael (which is string). Should I convert the output from Rijndael back into bytes and then the base64_encode to get the string?</p>\n<p>So - can I somehow rewrite Delphi code so, that is funcionality exactly (byte-by-byte, char-by-char) matches my PHP code? Or maybe Delphi Lockbox components are so divergent that this is not possible? I.e. divergent both from the PHP functions and from the AES standards (I guess, PHP's openssl_encrypt conforms to them?)?</p>\n<p>Or maybe I should use completely different Delphi componets to achieve the result that is being received from PHP?</p>\n<p>I am using Lockbox 2.08 version (at least components show me it). But I am not sure if Lockbox 3 is changed the behavior of its components radically?</p>\n"^^ . + . + . + . + . + "<p>I'm generating CSV files that are being written to a directory on the server and I have had issues in the past with UTF-8 not being honoured, so I've got the following line in my code</p>\n<pre class="lang-php prettyprint-override"><code>fprintf($handle, chr(0xEF) . chr(0xBB) . chr(0xBF));\n</code></pre>\n<p>In context</p>\n<pre class="lang-php prettyprint-override"><code>$handle = fopen('files/250304-SUPPLIER-Price-Book-Import_1741052653', 'w');\nfprintf($handle, chr(0xEF) . chr(0xBB) . chr(0xBF));\nfputcsv($handle, array(&quot;PRODCODE&quot;,&quot;Product Description&quot;,3.06,2.25,0,160.00,5.85,0,0,0,0,0,0,160.00,5.85,0,0,15.00,2.59,10.00,2.48,0.01,2.25,&quot;SUPPLIER&quot;,&quot;CODE&quot;,&quot;Supplier Product Description&quot;,1.00,3.06,&quot;Y&quot;,2.25,&quot;CODE&quot;,1.00,2.25,&quot;1/06/2022&quot;,&quot;8/06/2022&quot;,&quot;36.00%&quot;), &quot;,&quot;, '&quot;');\nfclose($handle);\n</code></pre>\n<p>I have also tried the following</p>\n<pre class="lang-php prettyprint-override"><code>fputs($handle, chr(0xEF) . chr(0xBB) . chr(0xBF));\n</code></pre>\n<p>Until last month this has worked great, but suddenly all my CSV files have <code>ZWNBSP</code> added to the start of the first line in the file itself, and I can't work out how to stop that happening.</p>\n<p>If I remove the <code>fprintf</code> and <code>fputs</code> lines it's no longer appearing in there when I open it in Notepad++, but then I lose my UTF-8 support which I need for special character support.</p>\n<p>When the csv files are all generated my script then zips them all on the server in an archive and downloads that zip with all my files in it.</p>\n<p>My clients server is running PHP 7.4.</p>\n"^^ . + . + "Thank you for reply. Can you provide some example code from my provided code snippet in your example given to trigger ajax request and update database?"^^ . + "Please see [official documentation](https://www.php.net/manual/en/language.variables.basics.php) . Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive."^^ . + . + "1"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + "1"^^ . + . + . + . + . + "<p>I'm having an issue with a form element that wont submit when the post request is submitted. I'm populating the elements of the listbox from an array that is prepared from some php code.</p>\n<p>I'm using a similar form on a different page that doesnt have the elements auto populated, but instead uses Javascript to move the elements from another listbox over to this one, and it works fine. It appears something with the php code that populates the elements is causing the issue. Code below:</p>\n<pre><code>&lt;div class=&quot;select-group&quot;&gt;\n &lt;label for=&quot;listbox2&quot;&gt;Assigned to User:&lt;/Label&gt;\n &lt;select name=&quot;assigned-properties[]&quot; id=&quot;listbox2&quot; class=&quot;listbox&quot; multiple&gt;\n &lt;?php foreach ($arrAuthProp as $output) { ?&gt;\n &lt;option value=&quot;&lt;?php echo htmlspecialchars($output['property_id']); ?&gt;&quot;&gt;&lt;?php echo htmlspecialchars($output['prop_dba_name']); ?&gt;&lt;/option&gt;\n &lt;?php }; ?&gt;\n &lt;/select&gt;\n&lt;/div&gt;\n</code></pre>\n<p>The way the code shows up once in the browser is below:</p>\n<p><a href="https://i.sstatic.net/TMQxz0VJ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TMQxz0VJ.png" alt="enter image description here" /></a></p>\n<p>Any idea whats preventing this to be submitted with the rest of the form?</p>\n"^^ . + . + "Trying to understand PHP Garbage Collection"^^ . + "its a valid id, right after the video uploaded, dont worry"^^ . + . + . + . + . + . + "0"^^ . + "0"^^ . + "2"^^ . + "<p>I'm working on <code>wpgraphql2.1.0</code> with acf6 and <code>WPGraphQL for ACF 2.4.1</code> and I need to get a content type named &quot;evenement&quot; (that we'll call events) that I filter based on their date.</p>\n<p>The filtering part is done and works well, I get events based on the field <code>date_de_debut</code> (translated to start_date) which are located in a repeater field <code>dates</code></p>\n<p>I got it working based on this tutorial <a href="https://www.wpgraphql.com/2020/04/14/query-posts-based-on-advanced-custom-field-values-by-registering-a-custom-where-argument" rel="nofollow noreferrer">https://www.wpgraphql.com/2020/04/14/query-posts-based-on-advanced-custom-field-values-by-registering-a-custom-where-argument</a></p>\n<pre><code> add_filter('graphql_post_object_connection_query_args', function ($query_args, $source, $args, $context, $info) {\n\n if($args['where']['futur']) {\n $date = date('Ymd');\n $query_args['meta_query'] = [\n [ // si une des deux condition est respectée\n array(\n 'relation' =&gt; 'OR',\n array( // if start_date in the future AND no end_date\n 'relation' =&gt; 'AND',\n array(\n 'key' =&gt; 'dates_$_date_de_debut',\n 'value' =&gt; $date,\n 'compare' =&gt; '&gt;=',\n ),\n array(\n 'key' =&gt; 'dates_$_date_de_fin',\n 'compare' =&gt; 'NOT EXISTS',\n ),\n ),\n array( // if start_date OR end_date in the future\n 'relation' =&gt; 'OR',\n array(\n 'key' =&gt; 'dates_$_date_de_debut',\n 'compare' =&gt; '&gt;=',\n 'value' =&gt; $date,\n ),\n\n array(\n 'key' =&gt; 'dates_$_date_de_fin',\n 'compare' =&gt; '&gt;=',\n 'value' =&gt; $date,\n ),\n ),\n ),\n ]\n ];\n }\n\n return $query_args;\n}, 10, 5);\n</code></pre>\n<p>Now what I would like to do but struggle to get working is a way to duplicate each of my returned events based on their <code>dates</code> in the repeater field</p>\n<p>What I currently have :</p>\n<pre><code>{\n &quot;title&quot;: &quot;Event1&quot;,\n &quot;fieldsEvenement&quot;: {\n &quot;dates&quot;: [\n {\n &quot;dateDeDebut&quot;: &quot;2025-03-20T00:00:00+00:00&quot;,\n &quot;dateDeFin&quot;: null,\n },\n {\n &quot;dateDeDebut&quot;: &quot;2025-03-21T00:00:00+00:00&quot;,\n &quot;dateDeFin&quot;: &quot;2025-03-26T00:00:00+00:00&quot;,\n }\n ]\n }\n }\n</code></pre>\n<p>What I would like :</p>\n<pre><code>{\n &quot;title&quot;: &quot;Event1&quot;,\n &quot;fieldsEvenement&quot;: {\n &quot;dates&quot;: [\n {\n &quot;dateDeDebut&quot;: &quot;2025-03-20T00:00:00+00:00&quot;,\n &quot;dateDeFin&quot;: null,\n }\n ]\n }\n }\n\n{\n &quot;title&quot;: &quot;Event1&quot;,\n &quot;fieldsEvenement&quot;: {\n &quot;dates&quot;: [\n {\n &quot;dateDeDebut&quot;: &quot;2025-03-21T00:00:00+00:00&quot;,\n &quot;dateDeFin&quot;: &quot;2025-03-26T00:00:00+00:00&quot;,\n }\n ]\n }\n }\n</code></pre>\n"^^ . + "1"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + "2"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + . + "Error : Cannot set properties of null when using recaptcha"^^ . + "_"The script is not accessible via a URL but used internally by the application. By the way, I don't mind if buffering is disabled for the URL using that script"_ - so you got one script A, that is not accessible via URL, and one script B that does get accessed via URL - and includes script A, or what exactly? Then of course you would have to disable output buffering for script B as well."^^ . + . + . + . + "0"^^ . + . + "1"^^ . + . + . + "Unable to load dynamic library 'openssl'"^^ . + "<p>Is there possible to convert Seesion data from Javascript to PHP and vice versa? Something like (I'm not sure about the input format in javascript.):</p>\n<pre><code>&lt;script&gt;\n session.setAttribute(&quot;username&quot;,&quot;John&quot;);\n&lt;/script&gt;\n\n&lt;?php\n echo $_SESSION[&quot;username&quot;]; // it will write &quot;John&quot;\n?&gt;\n</code></pre>\n"^^ . + "Also as a side note, you may wish to use Doctrine's `ObjectExists` validator assuming you are using Docrtine Module of course, for the district_id validation rather than using a callback, https://www.doctrine-project.org/projects/doctrine-module/en/6.3/validator.html."^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + "<p>I am converting an image to use a specific colour palette using PHP. My code is successfully looping through each colour in the source image, and comparing it to the colour palette, and finding the closets colour. However, sometimes I get some odd matches.</p>\n<p>I have found many colour distance equations on StackOverflow (and other resources) but none are returning better matches.</p>\n<p>Here is the palette I'm using:</p>\n<p><a href="https://i.sstatic.net/65kIfcYB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/65kIfcYB.png" alt="enter image description here" /></a></p>\n<p>Here is the palette n a PHP array:</p>\n<pre class="lang-php prettyprint-override"><code>$colours = array(\n '#B3D7D1',\n '#DD982E',\n '#AD6140',\n '#c01111',\n '#F47B30',\n '#E0E0E0',\n '#184632',\n '#A0BCAC',\n '#923978',\n '#F785B1',\n '#61AFFF'\n);\n</code></pre>\n<p>And here is a testing image I am converting:</p>\n<p><a href="https://i.sstatic.net/eA6c6Hyv.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/eA6c6Hyv.png" alt="enter image description here" /></a></p>\n<p>However, a few of the greens are being matched to the dark purple, here is my result:</p>\n<p><a href="https://i.sstatic.net/lLLYMV9F.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lLLYMV9F.png" alt="enter image description here" /></a></p>\n<p>And here is the equation I'm using to calculate colour distance:</p>\n<pre class="lang-php prettyprint-override"><code>$distance = sqrt($delta_r * $delta_r + $delta_g * $delta_g + $delta_b * $delta_b);\n</code></pre>\n<p>Here is the RGB of the colour I'm trying to find a match for and the one my code matches it with:</p>\n<pre><code>Array ( [0] =&gt; 116 [1] =&gt; 136 [2] =&gt; 115 )\nArray ( [0] =&gt; 146 [1] =&gt; 57 [2] =&gt; 120 )\n</code></pre>\n<p>Which returns a distance of 85.</p>\n<p>Just a note, the green that I was expecting to get matched gets a distance of 88.</p>\n<p>Mathematically the dark purple is the closet colour. But visually it's not. Does anyone know of a better equation I can use? Maybe one that considers the overall colour instead of just the individual parts?</p>\n<p>Full code is available here:\n<a href="https://github.com/codeadamca/php-colour-palette/" rel="nofollow noreferrer">https://github.com/codeadamca/php-colour-palette/</a></p>\n"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + "2"^^ . + "0"^^ . + "0"^^ . + "3"^^ . + . + . + . + . + "0"^^ . + "laravel-broadcast"^^ . + . + . + "@hakre take a look at my edited post. Meanwhile, I tried with `static` and it indeed works, why?"^^ . + . + "0"^^ . + "alway the same: Undefined variable $count , i have add to the post the code of the view that show the $count variable."^^ . + . + . + "<p>I have tried to do this myself using information from various sources but am running into issues which makes me think that it isn't the best or more appropriate way to do it.</p>\n<p>I have a form to ask the users Postcode prior to the purchase of a product to ensure the product can be shipping to their area. If covered, the user can proceed to the checkout and for convenience (and security) the shipping Postcode field should be populated with their postcode.</p>\n<p>This code is going into functions.php</p>\n<p><strong>Step 1 - get the postcode and add it to a session variable</strong></p>\n<p>[prior code gets the input - $postcode variable populated]</p>\n<pre><code>// Store the postcode for use later as a session\nsession_start();\n_SESSION[&quot;stored_postcode&quot;] = $postcode;enter code here\n</code></pre>\n<p><strong>Step 2 - get the session variable and populate the shipping_postcode field</strong></p>\n<pre><code>add_action( 'init', 'set_delivery_postcode' );\nfunction set_delivery_postcode() {\nsession_start();\n$delivery_postcode = @$_SESSION[&quot;stored_postcode&quot;];\nWC()-&gt;customer-&gt;set_shipping_postcode( sanitize_text_field( @$_POST['delivery_postcode'] ) );\n}\n</code></pre>\n<p>But, for some reason this is causing an error with the theme and when I tried to login it says a critical error has occurred and I have to login in recovery mode.</p>\n<p>The weird thing is though, it works and is actually populating the Postcode field in the checkout.</p>\n<p>Is there anything obviously wrong with the above?</p>\n<p>Your help is appreciated.</p>\n<p>Rob</p>\n"^^ . + "-1"^^ . + . + . + "2"^^ . + "Which line of code threw the error? You forgot to include the stack trace."^^ . + . + . + . + "0"^^ . + "url-rewriting"^^ . + . + "2"^^ . + . + . + . + . + . + . + . + . + "windows"^^ . + . + . + . + . + "laravel-ui"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + . + "0"^^ . + . + . + "But can I simplify it more like the sku url. Yes you can create custom api in which you can use searchCriteriaBuilder"^^ . + "0"^^ . + "1) database information is only relevant if you accept a solution that works on database kevel. Otherwise, database is irrelevant. 2) It is a common misconception that transactions are for concurrency control. They are not. They ensure that a set of modifications all persist or none of them persist - they are for integrity control. Certain constraints and locks serve as concurrency control. Transactions only determine how long certain database locks are held."^^ . + . + . + "1"^^ . + "`Is it the way $results is made?` that won’t do what you want, but look at/print_r the variable to answer this question look at the type of the top level items :)."^^ . + . + . + . + . + "2"^^ . + "2"^^ . + "0"^^ . + . + . + . + "<p>When creating the player, there was a need to collect auditions. I set up the collection and everything works.</p>\n<p>You need to manually enter the data that is already available.</p>\n<p>I added the following code to functions.php file:</p>\n<pre><code>/**\n * ------------------------------------------------------------------------------------------------\n * Адмінка статистики\n * ------------------------------------------------------------------------------------------------\n */\nfunction theasmart_add_admin_page() {\n add_menu_page(\n 'Аналітика прослуховувань', // Заголовок сторінки\n 'Аналітика казок', // Назва в меню\n 'manage_options', // Права доступу\n 'theasmart-audio-analytics', // Слаг сторінки\n 'theasmart_render_admin_page', // Функція рендеру\n 'dashicons-chart-bar', // Іконка\n 20 // Позиція в меню\n );\n}\nadd_action('admin_menu', 'theasmart_add_admin_page');\n\nfunction theasmart_render_admin_page() {\n $active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'analytics'; // Визначаємо активну вкладку\n\n ?&gt;\n &lt;div class=&quot;wrap&quot;&gt;\n &lt;h1&gt; Аналітика прослуховувань аудіоказок&lt;/h1&gt;\n &lt;h2 class=&quot;nav-tab-wrapper&quot;&gt;\n &lt;a href=&quot;?page=theasmart-audio-analytics&amp;tab=analytics&quot; class=&quot;nav-tab &lt;?php echo $active_tab === 'analytics' ? 'nav-tab-active' : ''; ?&gt;&quot;&gt;Аналітика&lt;/a&gt;\n &lt;a href=&quot;?page=theasmart-audio-analytics&amp;tab=edit&quot; class=&quot;nav-tab &lt;?php echo $active_tab === 'edit' ? 'nav-tab-active' : ''; ?&gt;&quot;&gt;Редагування&lt;/a&gt;\n &lt;a href=&quot;?page=theasmart-audio-analytics&amp;tab=charts&quot; class=&quot;nav-tab &lt;?php echo $active_tab === 'charts' ? 'nav-tab-active' : ''; ?&gt;&quot;&gt;Графіки&lt;/a&gt;\n &lt;/h2&gt;\n\n &lt;?php\n // Виведення контенту залежно від вибраної вкладки\n switch ($active_tab) {\n case 'analytics':\n theasmart_render_analytics_tab();\n break;\n case 'edit':\n theasmart_render_edit_tab();\n break;\n case 'charts':\n theasmart_render_charts_tab();\n break;\n default:\n theasmart_render_analytics_tab();\n break;\n }\n ?&gt;\n &lt;/div&gt;\n &lt;?php\n}\n\n// Функція для відображення вкладки &quot;Аналітика&quot;\nfunction theasmart_render_analytics_tab() {\n ?&gt;\n &lt;table class=&quot;widefat fixed&quot;&gt;\n &lt;thead&gt;\n &lt;tr&gt;\n &lt;th&gt;Назва треку&lt;/th&gt;\n &lt;th&gt;Почали слухати&lt;/th&gt;\n &lt;th&gt;50%&lt;/th&gt;\n &lt;th&gt;80%&lt;/th&gt;\n &lt;th&gt;Прослухано повністю&lt;/th&gt;\n &lt;/tr&gt;\n &lt;/thead&gt;\n &lt;tbody&gt;\n &lt;?php\n $track_ids = [10701, 10702, 10703]; // Список ID треків (можна зробити динамічним)\n\n foreach ($track_ids as $track_id) {\n $track_name = get_the_title($track_id); // Отримуємо назву сторінки за ID\n\n $response = wp_remote_get(&quot;https://thea-smart.com/wp-json/custom/v1/get-listener-stats/{$track_id}&quot;);\n if (is_wp_error($response)) {\n continue;\n }\n\n $stats = json_decode(wp_remote_retrieve_body($response), true);\n ?&gt;\n &lt;tr&gt;\n &lt;td&gt;&lt;?php echo esc_html($track_name ?: 'Невідомий трек'); ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?php echo esc_html($stats['start'] ?? 0); ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?php echo esc_html($stats['50%'] ?? 0); ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?php echo esc_html($stats['80%'] ?? 0); ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?php echo esc_html($stats['completed'] ?? 0); ?&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php\n }\n ?&gt;\n &lt;/tbody&gt;\n &lt;/table&gt;\n &lt;?php\n}\n\n// Функція для відображення вкладки &quot;Редагування&quot;\n// Функція для відображення вкладки &quot;Редагування&quot;\nfunction theasmart_render_edit_tab() {\n $track_ids = [10701, 10702, 10703]; // ID треків\n\n // Обробка форми для збереження\nif ($_SERVER['REQUEST_METHOD'] == 'POST' &amp;&amp; isset($_POST['theasmart_nonce']) &amp;&amp; wp_verify_nonce($_POST['theasmart_nonce'], 'theasmart_save_listener_data')) {\n foreach ($track_ids as $track_id) {\n if (isset($_POST['save_' . $track_id])) {\n $data = [\n 'start' =&gt; isset($_POST['start_' . $track_id]) ? intval($_POST['start_' . $track_id]) : 0,\n '50%' =&gt; isset($_POST['fifty_' . $track_id]) ? intval($_POST['fifty_' . $track_id]) : 0,\n '80%' =&gt; isset($_POST['eighty_' . $track_id]) ? intval($_POST['eighty_' . $track_id]) : 0,\n 'completed' =&gt; isset($_POST['completed_' . $track_id]) ? intval($_POST['completed_' . $track_id]) : 0,\n ];\n\n // Логування даних перед відправкою\n error_log('Data to send: ' . json_encode($data));\n\n // Відправка оновлених даних через API\n $response = wp_remote_post(&quot;https://thea-smart.com/wp-json/custom/v1/update-listener-stats/{$track_id}&quot;, [\n 'body' =&gt; json_encode($data),\n 'headers' =&gt; [\n 'Content-Type' =&gt; 'application/json',\n 'Accept' =&gt; 'application/json'\n ],\n 'method' =&gt; 'POST',\n 'timeout' =&gt; 30 // Додано час очікування\n ]);\n\n // Логування відповіді\n if (is_wp_error($response)) {\n // Детальне логування помилки\n error_log('API Request Error for Track ' . $track_id . ': ' . $response-&gt;get_error_message());\n \n echo '&lt;div class=&quot;error&quot;&gt;&lt;p&gt;Помилка з\\'єднання для треку ' . \n esc_html(get_the_title($track_id)) . ': ' . \n esc_html($response-&gt;get_error_message()) . '&lt;/p&gt;&lt;/div&gt;';\n } else {\n $status_code = wp_remote_retrieve_response_code($response);\n $body = wp_remote_retrieve_body($response);\n \n // Розширене логування відповіді\n error_log('API Response for Track ' . $track_id . ':');\n error_log('Status Code: ' . $status_code);\n error_log('Response Body: ' . $body);\n\n // Розширена перевірка статус-коду\n if ($status_code &gt;= 200 &amp;&amp; $status_code &lt; 300) {\n echo '&lt;div class=&quot;updated&quot;&gt;&lt;p&gt;Дані успішно збережено для треку ' . \n esc_html(get_the_title($track_id)) . '&lt;/p&gt;&lt;/div&gt;';\n } else {\n echo '&lt;div class=&quot;error&quot;&gt;&lt;p&gt;Помилка збереження для треку ' . \n esc_html(get_the_title($track_id)) . ': Код ' . \n esc_html($status_code) . ' - ' . \n esc_html($body) . '&lt;/p&gt;&lt;/div&gt;';\n }\n }\n }\n }\n}\n?&gt;\n\n&lt;h2&gt;Редагування даних прослуховувань&lt;/h2&gt;\n&lt;form method=&quot;post&quot;&gt;\n &lt;?php wp_nonce_field('theasmart_save_listener_data', 'theasmart_nonce'); // CSRF захист ?&gt;\n &lt;table class=&quot;widefat fixed&quot;&gt;\n &lt;thead&gt;\n &lt;tr&gt;\n &lt;th&gt;Назва треку&lt;/th&gt;\n &lt;th&gt;Почали слухати&lt;/th&gt;\n &lt;th&gt;50%&lt;/th&gt;\n &lt;th&gt;80%&lt;/th&gt;\n &lt;th&gt;Прослухано повністю&lt;/th&gt;\n &lt;th&gt;Зберегти&lt;/th&gt;\n &lt;/tr&gt;\n &lt;/thead&gt;\n &lt;tbody&gt;\n &lt;?php\n foreach ($track_ids as $track_id) {\n $track_name = get_the_title($track_id) ?: 'Невідомий трек';\n\n // Отримання статистики через API\n $response = wp_remote_get(&quot;https://thea-smart.com/wp-json/custom/v1/get-listener-stats/{$track_id}&quot;);\n $stats = (!is_wp_error($response)) ? json_decode(wp_remote_retrieve_body($response), true) : [];\n\n $start = esc_attr($stats['start'] ?? 0);\n $fifty = esc_attr($stats['50%'] ?? 0);\n $eighty = esc_attr($stats['80%'] ?? 0);\n $completed = esc_attr($stats['completed'] ?? 0);\n ?&gt;\n &lt;tr&gt;\n &lt;td&gt;&lt;?php echo esc_html($track_name); ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;input type=&quot;number&quot; name=&quot;start_&lt;?php echo esc_attr($track_id); ?&gt;&quot; value=&quot;&lt;?php echo $start; ?&gt;&quot;&gt;&lt;/td&gt;\n &lt;td&gt;&lt;input type=&quot;number&quot; name=&quot;fifty_&lt;?php echo esc_attr($track_id); ?&gt;&quot; value=&quot;&lt;?php echo $fifty; ?&gt;&quot;&gt;&lt;/td&gt;\n &lt;td&gt;&lt;input type=&quot;number&quot; name=&quot;eighty_&lt;?php echo esc_attr($track_id); ?&gt;&quot; value=&quot;&lt;?php echo $eighty; ?&gt;&quot;&gt;&lt;/td&gt;\n &lt;td&gt;&lt;input type=&quot;number&quot; name=&quot;completed_&lt;?php echo esc_attr($track_id); ?&gt;&quot; value=&quot;&lt;?php echo $completed; ?&gt;&quot;&gt;&lt;/td&gt;\n &lt;td&gt;&lt;button type=&quot;submit&quot; name=&quot;save_&lt;?php echo esc_attr($track_id); ?&gt;&quot; class=&quot;button-primary&quot;&gt;Зберегти&lt;/button&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php\n }\n ?&gt;\n &lt;/tbody&gt;\n &lt;/table&gt;\n&lt;/form&gt;\n\n// Функція для відображення вкладки &quot;Графіки&quot;\nfunction theasmart_render_charts_tab() {\n ?&gt;\n &lt;h2&gt;Графіки&lt;/h2&gt;\n &lt;p&gt;Тут ви зможете побачити графіки на основі аналітичних даних.&lt;/p&gt;\n &lt;!-- Тут можна вставити код для графіків, використовуючи бібліотеку, як-от Chart.js --&gt;\n &lt;?php\n}\n\n\n\n// Реєстрація маршруту для REST API\nadd_action('rest_api_init', function () {\n register_rest_route('custom/v1', '/update-listener-stats/(?P&lt;track_id&gt;\\d+)', [\n 'methods' =&gt; 'POST',\n 'callback' =&gt; 'update_listener_stats_callback',\n ]);\n});\n\n// Функція обробника для збереження даних\nfunction update_listener_stats_callback( $data ) {\n // Отримуємо track_id з запиту\n $track_id = $data['track_id'];\n\n // Перевіряємо, чи track_id є коректним\n if ( ! is_numeric($track_id) ) {\n return new WP_REST_Response('Невірний track_id', 400);\n }\n\n // Отримуємо дані з POST-запиту\n $start = isset($_POST['start']) ? intval($_POST['start']) : 0;\n $fifty = isset($_POST['50%']) ? intval($_POST['50%']) : 0;\n $eighty = isset($_POST['80%']) ? intval($_POST['80%']) : 0;\n $completed = isset($_POST['completed']) ? intval($_POST['completed']) : 0;\n\n // Тут можна додати логіку для збереження цих даних у базі або інші операції\n\n // Виведемо успішну відповідь\n return new WP_REST_Response('Дані успішно оновлені для треку ' . $track_id, 200);\n}\n\nadd_action( 'rest_api_init', function () {\n register_rest_route( 'custom/v1', '/update-listener-stats/(?P&lt;track_id&gt;\\d+)', [\n 'methods' =&gt; 'POST',\n 'callback' =&gt; 'handle_update_listener_stats',\n ] );\n} );\n\nfunction handle_update_listener_stats( $data ) {\n $track_id = $data['track_id'];\n $stats = json_decode($data-&gt;get_body(), true);\n\n // Обробка даних і повернення відповіді\n if ($track_id &amp;&amp; $stats) {\n // Логіка оновлення даних у базі або в іншому місці\n return new WP_REST_Response('Data saved successfully', 200);\n } else {\n return new WP_REST_Response('Invalid data', 400);\n }\n}\n</code></pre>\n<p>Analytics works, but editing does not work.\nIt says that changes have been made, but the data does not change.</p>\n"^^ . + . + "php json_encode not present nullable properties"^^ . + . + . + "Perhaps the intermittent nature of the notices is because the code that is deprecated isn't hit on every execution - you'll only get the notice if that bit of code is actually being executed."^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + "1"^^ . + "Or simply [`\\batlan\\b`](https://regex101.com/r/PyCgr7/1)"^^ . + . + "0"^^ . + "2"^^ . + "There's no need to call `strval()` since `strtolower()` always returns a string."^^ . + . + . + "2"^^ . + . + . + . + . + . + . + "@Ben I'd still like to see your prepared input array so I can see if it can be distilled into a branched regex pattern within the character limit. Can you pastebin it into your question? Future readers might like such a solution."^^ . + "0"^^ . + . + . + . + "2"^^ . + . + . + . + "Modify main WordPress query to limit results to a list of possible Post IDs"^^ . + "<pre><code>&lt;?php\n\nnamespace PhpHttpServer\\WebSocket;\n\nuse PhpHttpServer\\Core\\Request;\nuse PhpHttpServer\\Core\\Response;\n\nclass WebSocketServer implements WebSocketHandlerInterface\n{\n private $shmId;\n private $shmSize = 1024; // Size of shared memory block\n private const NEXT_CLIENT_ID_SIZE = 10; // Bytes reserved for next_client_id\n private $clientResources = []; // In-memory mapping of client IDs to resources\n\n public function __construct()\n {\n // Create or open a shared memory block\n $this-&gt;shmId = shmop_open(ftok(__FILE__, 't'), &quot;c&quot;, 0644, $this-&gt;shmSize);\n if (!$this-&gt;shmId) {\n die(&quot;Failed to create shared memory block\\n&quot;);\n }\n\n // Clear shared memory on server start\n $this-&gt;clearSharedMemory();\n }\n\n public function __destruct()\n {\n // Close the shared memory block\n shmop_close($this-&gt;shmId);\n }\n\n /**\n * Clear the shared memory block.\n */\n private function clearSharedMemory()\n {\n shmop_write($this-&gt;shmId, str_repeat(&quot;\\0&quot;, $this-&gt;shmSize), 0);\n echo &quot;Shared memory cleared.\\n&quot;;\n }\n\n /**\n * Get the next client ID from shared memory.\n *\n * @return int The next client ID.\n */\n private function getNextClientId()\n {\n // Read the next_client_id from the reserved space in shared memory\n $nextClientIdData = shmop_read($this-&gt;shmId, 0, self::NEXT_CLIENT_ID_SIZE);\n $nextClientId = (int) rtrim($nextClientIdData, &quot;\\0&quot;);\n\n // If next_client_id is 0 (initial state), set it to 1\n if ($nextClientId === 0) {\n $nextClientId = 1;\n }\n\n // Increment the next_client_id and save it back to shared memory\n $nextClientId++;\n shmop_write($this-&gt;shmId, str_pad($nextClientId, self::NEXT_CLIENT_ID_SIZE, &quot;\\0&quot;), 0);\n\n echo &quot;Assigned new client ID: &quot; . ($nextClientId - 1) . &quot;\\n&quot;;\n return $nextClientId - 1; // Return the current client ID (before incrementing)\n }\n\n /**\n * Perform the WebSocket handshake.\n *\n * @param Request $request The HTTP request.\n * @param Response $response The HTTP response.\n * @return bool True if the handshake was successful, false otherwise.\n */\n public function handshake(Request $request, Response $response)\n {\n // Check if the request is a WebSocket upgrade request\n if (\n $request-&gt;getHeader('Upgrade') !== 'websocket' ||\n strtolower($request-&gt;getHeader('Connection')) !== 'upgrade'\n ) {\n return false;\n }\n\n // Get the WebSocket key from the request\n $secWebSocketKey = $request-&gt;getHeader('Sec-WebSocket-Key');\n if (empty($secWebSocketKey)) {\n return false;\n }\n\n // Generate the WebSocket accept key\n $secWebSocketAccept = base64_encode(sha1($secWebSocketKey . '258EAFA5-E914-47DA-95CA-C5AB0DC85B11', true));\n\n // Set the response headers for the WebSocket handshake\n $response-&gt;setStatusCode(101)\n -&gt;setHeader('Upgrade', 'websocket')\n -&gt;setHeader('Connection', 'Upgrade')\n -&gt;setHeader('Sec-WebSocket-Accept', $secWebSocketAccept);\n\n return true;\n }\n\n /**\n * Handle a WebSocket connection.\n *\n * @param resource $conn The connection resource.\n */\n public function handle($conn)\n {\n echo &quot;WebSocket connection established.\\n&quot;;\n\n // Add the connection to the shared memory\n $clientId = $this-&gt;addClient($conn);\n echo &quot;Client $clientId connected to the server.\\n&quot;;\n\n // Main WebSocket loop\n while (true) {\n // Read a WebSocket frame from the client\n $frame = fread($conn, 8192);\n\n if ($frame === false || $frame === '') {\n echo &quot;WebSocket connection closed by client $clientId.\\n&quot;;\n break;\n }\n\n // Decode the WebSocket frame\n $decodedFrame = $this-&gt;decodeWebSocketFrame($frame);\n\n if ($decodedFrame === null) {\n echo &quot;Invalid WebSocket frame received from client $clientId.\\n&quot;;\n break;\n }\n\n // Log the decoded frame\n echo &quot;Received WebSocket frame from client $clientId:\\n&quot;;\n echo &quot;Opcode: &quot; . $decodedFrame['opcode'] . &quot;\\n&quot;;\n echo &quot;Payload: &quot; . $decodedFrame['payload'] . &quot;\\n&quot;;\n\n // Send a response back to the client\n $responseFrame = $this-&gt;encodeWebSocketFrame(&quot;Server received: &quot; . $decodedFrame['payload']);\n fwrite($conn, $responseFrame);\n echo &quot;Sent response to client $clientId.\\n&quot;;\n\n // Broadcast the message to all clients\n $this-&gt;broadcast($decodedFrame['payload']);\n }\n\n // Remove the connection from the shared memory\n $this-&gt;removeClient($clientId);\n echo &quot;Client $clientId exited the server.\\n&quot;;\n\n // Close the WebSocket connection\n fclose($conn);\n echo &quot;WebSocket connection closed for client $clientId.\\n&quot;;\n }\n\n /**\n * Add a client to the shared memory.\n *\n * @param resource $conn The connection resource.\n * @return int The client ID.\n */\n private function addClient($conn)\n {\n $clientId = $this-&gt;getNextClientId();\n\n // Store the client ID in shared memory\n $clients = $this-&gt;getClients();\n $clients[] = $clientId;\n $this-&gt;saveClients($clients);\n\n // Store the client resource in the in-memory array\n $this-&gt;clientResources[$clientId] = $conn;\n\n echo &quot;New client added. Total clients: &quot; . count($clients) . &quot;\\n&quot;;\n echo &quot;Stored client $clientId in shared memory.\\n&quot;;\n return $clientId;\n }\n\n /**\n * Remove a client from the shared memory.\n *\n * @param int $clientId The client ID.\n */\n private function removeClient($clientId)\n {\n $clients = $this-&gt;getClients();\n $clients = array_filter($clients, function ($id) use ($clientId) {\n return $id !== $clientId;\n });\n $this-&gt;saveClients($clients);\n\n // Remove the client resource from the in-memory array\n unset($this-&gt;clientResources[$clientId]);\n\n echo &quot;Client removed. Total clients: &quot; . count($clients) . &quot;\\n&quot;;\n echo &quot;Removed client $clientId from shared memory.\\n&quot;;\n }\n\n /**\n * Get the list of clients from shared memory.\n *\n * @return array The list of client IDs.\n */\n private function getClients()\n {\n // Read the clients data from shared memory (skip the reserved space for next_client_id)\n $data = shmop_read($this-&gt;shmId, self::NEXT_CLIENT_ID_SIZE, $this-&gt;shmSize - self::NEXT_CLIENT_ID_SIZE);\n $data = rtrim($data, &quot;\\0&quot;);\n\n // Check if the data is empty or invalid\n if (empty($data) || @unserialize($data) === false) {\n echo &quot;No valid clients data found in shared memory.\\n&quot;;\n return [];\n }\n\n $clients = unserialize($data);\n\n // Debugging: Log the deserialized clients array\n echo &quot;Deserialized clients:\\n&quot;;\n print_r($clients);\n\n return $clients;\n }\n\n /**\n * Save the list of clients to shared memory.\n *\n * @param array $clients The list of client IDs.\n */\n private function saveClients($clients)\n {\n $data = serialize($clients);\n\n // Debugging: Log the serialized data\n echo &quot;Serialized data to save:\\n&quot;;\n var_dump($data);\n\n // Write the clients data to shared memory (skip the reserved space for next_client_id)\n shmop_write($this-&gt;shmId, $data, self::NEXT_CLIENT_ID_SIZE);\n echo &quot;Clients saved to shared memory.\\n&quot;;\n }\n\n /**\n * Broadcast a message to all connected clients.\n *\n * @param string $message The message to broadcast.\n */\n public function broadcast($message)\n {\n $clients = $this-&gt;getClients();\n\n echo &quot;Broadcasting message to &quot; . count($clients) . &quot; clients.\\n&quot;;\n\n foreach ($clients as $clientId) {\n if (isset($this-&gt;clientResources[$clientId])) {\n $frame = $this-&gt;encodeWebSocketFrame($message);\n fwrite($this-&gt;clientResources[$clientId], $frame);\n echo &quot;Message broadcasted to client $clientId.\\n&quot;;\n } else {\n echo &quot;Invalid client resource for ID $clientId.\\n&quot;;\n }\n }\n\n echo &quot;Broadcasting done!!\\n&quot;;\n }\n\n /**\n * Decode a WebSocket frame.\n *\n * @param string $frame The WebSocket frame.\n * @return array|null The decoded frame (opcode and payload), or null if the frame is invalid.\n */\n private function decodeWebSocketFrame($frame)\n {\n // Extract the first byte (opcode and flags)\n $firstByte = ord($frame[0]);\n $opcode = $firstByte &amp; 0x0F; // Extract the opcode (lower 4 bits)\n\n // Extract the second byte (mask and payload length)\n $secondByte = ord($frame[1]);\n $isMasked = ($secondByte &amp; 0x80) !== 0; // Check if the frame is masked\n $payloadLength = $secondByte &amp; 0x7F; // Extract the payload length (lower 7 bits)\n\n // Handle extended payload lengths\n $offset = 2;\n if ($payloadLength === 126) {\n $payloadLength = unpack('n', substr($frame, $offset, 2))[1];\n $offset += 2;\n } elseif ($payloadLength === 127) {\n $payloadLength = unpack('J', substr($frame, $offset, 8))[1];\n $offset += 8;\n }\n\n // Extract the masking key (if the frame is masked)\n $maskingKey = '';\n if ($isMasked) {\n $maskingKey = substr($frame, $offset, 4);\n $offset += 4;\n }\n\n // Extract the payload\n $payload = substr($frame, $offset, $payloadLength);\n\n // Unmask the payload (if the frame is masked)\n if ($isMasked) {\n $payload = $this-&gt;unmaskPayload($payload, $maskingKey);\n }\n\n return [\n 'opcode' =&gt; $opcode,\n 'payload' =&gt; $payload,\n ];\n }\n\n /**\n * Unmask a WebSocket payload.\n *\n * @param string $payload The masked payload.\n * @param string $maskingKey The masking key.\n * @return string The unmasked payload.\n */\n private function unmaskPayload($payload, $maskingKey)\n {\n $unmaskedPayload = '';\n for ($i = 0; $i &lt; strlen($payload); $i++) {\n $unmaskedPayload .= $payload[$i] ^ $maskingKey[$i % 4];\n }\n return $unmaskedPayload;\n }\n\n /**\n * Encode a WebSocket frame.\n *\n * @param string $payload The payload to encode.\n * @return string The encoded WebSocket frame.\n */\n private function encodeWebSocketFrame($payload)\n {\n $frame = '';\n $payloadLength = strlen($payload);\n\n // Set the first byte (opcode and flags)\n $frame .= chr(0x81); // 0x81 = text frame (FIN bit set)\n\n // Set the second byte (mask and payload length)\n if ($payloadLength &lt;= 125) {\n $frame .= chr($payloadLength);\n } elseif ($payloadLength &lt;= 65535) {\n $frame .= chr(126) . pack('n', $payloadLength);\n } else {\n $frame .= chr(127) . pack('J', $payloadLength);\n }\n\n // Append the payload\n $frame .= $payload;\n\n return $frame;\n }\n}\n</code></pre>\n<p>I want to broadcast messages to every connected client, but it is just sending to the sender and for all other clients it says Invalid Client Resource. The reason is because each instance of this WebSocket server runs in a different forked process of its parent Server. Hence each instance maintains its own clientResouces[] and most probably storing only one resource in it. that is why When I try to send a message it does not broadcast to other clients. see the server logs below:</p>\n<pre><code>php-http-server$ php public/index.php \nShared memory cleared.\nServer listening on http://0.0.0.0:8080\nNew connection accepted.\nWebSocket handshake successful.\nWebSocket connection established.\nAssigned new client ID: 1\nNo valid clients data found in shared memory.\nSerialized data to save:\nstring(14) &quot;a:1:{i:0;i:1;}&quot;\nClients saved to shared memory.\nNew client added. Total clients: 1\nStored client 1 in shared memory.\nClient 1 connected to the server.\nNew connection accepted.\nWebSocket handshake successful.\nWebSocket connection established.\nAssigned new client ID: 2\nDeserialized clients:\nArray\n(\n [0] =&gt; 1\n)\nSerialized data to save:\nstring(22) &quot;a:2:{i:0;i:1;i:1;i:2;}&quot;\nClients saved to shared memory.\nNew client added. Total clients: 2\nStored client 2 in shared memory.\nClient 2 connected to the server.\nNew connection accepted.\nWebSocket handshake successful.\nWebSocket connection established.\nAssigned new client ID: 3\nDeserialized clients:\nArray\n(\n [0] =&gt; 1\n [1] =&gt; 2\n)\nSerialized data to save:\nstring(30) &quot;a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}&quot;\nClients saved to shared memory.\nNew client added. Total clients: 3\nStored client 3 in shared memory.\nClient 3 connected to the server.\nReceived WebSocket frame from client 3:\nOpcode: 1\nPayload: qq]w\nSent response to client 3.\nDeserialized clients:\nArray\n(\n [0] =&gt; 1\n [1] =&gt; 2\n [2] =&gt; 3\n)\nBroadcasting message to 3 clients.\nInvalid client resource for ID 1.\nInvalid client resource for ID 2.\nMessage broadcasted to client 3.\nBroadcasting done!!\n</code></pre>\n<p>Check Here for full code: <a href="https://github.com/DeveloperKeshavKumar/php-http-sever" rel="nofollow noreferrer">GitHub repository</a><br />\nTo run sample server, use:</p>\n<pre><code>php public/index.php \n</code></pre>\n<p>I am using everything developed in-house and not using any external dependency/library.</p>\n"^^ . + "0"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + "0"^^ . + . + . + . + "I searched 'php-heic-to-jpg-linux-arm64: Permission denied' and there's zero results"^^ . + . + . + . + . + . + "0"^^ . + "As mentioned @Chris Haas, I have a test php script that includes extension_loaded('openssl'). extension_loaded('sockets') and get_loaded_extensions(). OpenSSL reports as not loaded, sockets as loaded and sockets (and GD) included in get_loaded_extensions(), but OpenSSL is missing"^^ . + . + . + . + . + "3"^^ . + . + . + . + "0"^^ . + "<p>In order to get in touch with PHP, I began a little website project from scratch.</p>\n<p>The project steadily grew so that now, I'm refactoring my codebase.</p>\n<p>Up until now, I made use of constants which I use to process HTML forms, e.g. for a web shop:</p>\n<p>The input fields' names are generated by PHP, and there would be a field <code>&lt;input name=&quot;&lt;?= OrderFirstName ?&gt;&quot;&gt;</code>.</p>\n<p>The user input is stored in the <code>$_SESSION</code> by the same key: <code>$_SESSION[OrderFirstName] = $_REQUEST[OrderFirstName]</code>.</p>\n<p>So I ended up with lots of constants in the global namespace, also for other purposes than the web shop, e.g. <code>const StartPage = 'start'; const NewsPage = 'news';</code>.</p>\n<p>To tidy things up, I thought of organizing constants in backed enums:</p>\n<pre><code>enum Pages : string {\n case Start = 'start';\n case News = 'news';\n}\n\nenum Order : string {\n case FirstName = 'firstname';\n // and lots of others …\n}\n</code></pre>\n<p>At first glace, it seemed to be the more readable and maintainable option.</p>\n<p>However, now whenever I access the constants, I need to type <code>Pages::Start-&gt;value</code> instead of <code>StartPage</code>. In <a href="https://stackoverflow.com/a/254543/1900950">another question</a>, a solution was to use an abstract class like so:</p>\n<pre><code>abstract class Pages {\n const Start = 'start';\n const News = 'news';\n}\n</code></pre>\n<p>This lets me write <code>Pages::Start</code> to get the intended string, yet from a design point of view, this seems wrong given that enums now exist in PHP.</p>\n<p>Am I missing something here? The enum solution certainly appears more maintainable to me than a dump of constants in the global namespace, then why is it such hardship to write it out? Funny enough, with all its dynamic typing, PHP won't let me use <code>Pages::Start</code>, because it is not implicitly replaced by the value.</p>\n"^^ . + . + . + "0"^^ . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "<p>You are most probably missing the <a href="https://www.wikiwand.com/en/articles/Byte_order_mark#UTF-16" rel="nofollow noreferrer">Byte Order Mark</a>, which is used to indicate, well, the byte order in UTF-16 strings.</p>\n<p>I struggled to find software that would consume UTF-16, but in the end I just saved the contents to a <code>.txt</code> file and opened it using macOs TextEdit/QuickLook.</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n$output = &quot;\\xe6\\x97\\xa5\\xe6\\x9c\\xac\\xe8\\xaa\\x9e&quot;; // 日本語\n$bom = &quot;\\xFF\\xFE&quot;; // &quot;\\xFF\\xFF&quot; would indicate BE\n$utf16 = $bom . mb_convert_encoding($output, &quot;UTF-16LE&quot;);\n</code></pre>\n"^^ . + "0"^^ . + . + "0"^^ . + . + "JSON.parse takes a string as first argument. From your debugging information it seems like `response` is already parsed as a JSON object. This seems to be due to `header('Content-Type: application/json');`"^^ . + . + . + . + . + "0"^^ . + . + . + . + "<p><strong>Edit: I just noticed that problem is only in Google Chrome. If I tried the same using firefox, I can see the website well. I think some security options in Google Chrome are blocking vite components.\nThanks all for the help. I will leave this edit here for something that can have same problem.</strong></p>\n<p>I'm working on a Laravel project that uses Vite for building static files (with laravel-livewire). I wnat share my project on remote and opened ports on my router 8000 and 5173</p>\n<p>I execute 2 terminals on my visual studio code:</p>\n<p><code>php artisan serve --host=0.0.0.0 --port=8000</code></p>\n<p><code>npm run dev -- --host</code></p>\n<p>I can access to this urls:</p>\n<ul>\n<li><p><a href="http://127.0.0.1:8000/dashboard" rel="nofollow noreferrer">http://127.0.0.1:8000/dashboard</a> -- all works fine</p>\n</li>\n<li><p><a href="http://92.59.195.93:8000/login" rel="nofollow noreferrer">http://92.59.195.93:8000/login</a> -- works but not show (css, js and the vue) client:</p>\n</li>\n</ul>\n<p><a href="https://i.sstatic.net/Z45wVDwm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Z45wVDwm.png" alt="Google Chrome errror when load the urls" /></a></p>\n<p>The URLS in the source shows something like this:</p>\n<pre><code> &lt;script type=&quot;module&quot; src=&quot;http://[::]:5173/@vite/client&quot; data-navigate-track=&quot;reload&quot;&gt;&lt;/script&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;http://[::]:5173/resources/css/app.css&quot; data-navigate-track=&quot;reload&quot; /&gt;&lt;script type=&quot;module&quot; src=&quot;http://[::]:5173/resources/js/app.js&quot; data-navigate-track=&quot;reload&quot;&gt;&lt;/script&gt; &lt;/head&gt;\n &lt;\n</code></pre>\n<p>Anyway, if I go and access in other tab to the url: http://[::]:5173/resources/css/app.css</p>\n<p>I see the content:</p>\n<pre><code>@tailwind base;\n@tailwind components;\n@tailwind utilities;\n</code></pre>\n<p>I tried some configs in the vue.config.js but none works.</p>\n<p>I tried npm run build (maybe to share outside my network is necessary) but this only delete my .hatcess, index.php, favicon.ico and created only public general assets (I restored this states with git because this only make things worse)</p>\n<p>My .env file have this url configs:</p>\n<pre><code>APP_URL=http://public_ip\nVITE_APP_URL=http://public_ip\n</code></pre>\n"^^ . + "0"^^ . + . + . + . + . + "2"^^ . + "Matching text inside single but not multple delimiter characters in a regular expression"^^ . + . + "0"^^ . + . + . + . + "After applying the php.ini change, was webserver restarted?"^^ . + . + . + "<p>I load a CSV-file and post it via Jquery-Ajax to PHP.\nPHP should read out the array values and insert them into a query.\nHow can I get every fifth array value, starting from value number 6, with a for-loop in PHP?</p>\n<pre><code>$csv = $_POST['upload']; // Array from CSV-file\n \nforeach($csv as $row =&gt; $value)\n{\n foreach($value as $position =&gt; $content)\n {\n echo &quot;Content of array-position $position: $content\\n&quot;;\n\n for($startposition = 6, $startposition &lt; length($csv), $startposition += 5)\n {\n // get every fifth value\n }\n }\n}\n</code></pre>\n<p>I already tried various for-loop-tutorials.</p>\n"^^ . + "How to Validate Bitbucket Webhook Signature Using Secret Key?"^^ . + . + . + . + . + . + . + . + . + . + . + "@YourCommonSense if you are going to rely on exceptions (thanks for the advice... irony) first you need to be sure that the mode is enabled. and here it is not, and second, always handle them. throwing unhandled exceptions is the same as not checking the return result."^^ . + . + "@Aquaholic: Looking through the question above a bit more... *"The above will work only when the user reaches a question page only with l sec or less remaining on the timer."* - But then what happens after the refresh? If the timer has more than 1 second then that `if` condition will be false, but when the page refreshes 1 second later then wouldn't that `if` condition be true on that next request? Can you update the question to clarify?"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "1"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + "I personally don't have any experience using Lockbox 2.08 so I'm not sure about this but based on the fact that PHP by default only supports strings of one byte characters I suspect that your use of standard Delphi strings which are composed of double byte characters might be affecting the end result. So you should probably change all of your strings to AnsiString types. Also don't forget about your `cKey` constant (string literal) that in modern Delphi versions will be declared as WideString literal. So your `cKey` does not match the one in PHP."^^ . + "I want the custom post to be site-url/custom-tax/post-name. The above code gives me site-url/resources/custom-tax/post-name. Do you know how to remove the resources from the URL?"^^ . + "2"^^ . + "I think the really important point is that the existing code works as soon as you're logged in. So what's the difference between a logged-in and a non-logged-in user?"^^ . + . + "2"^^ . + . + . + . + . + "Use Service Container"^^ . + "2"^^ . + . + . + "2"^^ . + "You should clarify what `InstalledVersions` is..."^^ . + "<p>Another simple alternative: as you know the dir structure of your own bundle, use <code>dirname($this-&gt;getPath())</code> in any of the bundle methods and then concat it. For example:</p>\n<pre><code>dirname($this-&gt;getPath()).'/axi/mycalendar/';\n</code></pre>\n"^^ . + "1"^^ . + "<p>I discovered through guess an check that if I disable &quot;keyboard-interactive&quot; authentication on the SFTP Host the authentication starts to work correctly.</p>\n<p>Add the line: <code>KbdInteractiveAuthentication no</code> to the sshd_config file.</p>\n<p>I do not know why this works. My thoughts are, php curl is skipping password authentication and jumping to keyboard-interactive. For some reason the password was not recognized coming from this client in the keyboard-interactive method. After disabling the keyboard-interactive the Host logs show the password method is used and accepted. Perhaps keyboard-interactive is broken on this version of OpenSSH, or perhaps it is expecting keyboard codes instead of actual ascii. Would love a full answer but I'm already over budget on this issue so I have to accept this workaround and move on.</p>\n"^^ . + "0"^^ . + . + . + "<p>I have Laravel app. I defined route in <code>routes/web.php</code> like this:</p>\n<pre><code>Route::get('/{slug}/discussion', 'DiscussionController@showForDistrict')-&gt;name('district_discussion');\n</code></pre>\n<p>I have DiscussionController with method showForDistrict like this</p>\n<pre><code>public function showForDistrict($microregion_slug){\n return $microregion_slug;\n}\n</code></pre>\n<p>And finally I have view where I call route() function. But it throws exception <code>Symfony\\Component\\Routing\\Exception\\RouteNotFoundException</code></p>\n<pre><code>&lt;a href=&quot;{{route('district_discussion',['slug' =&gt; $district-&gt;slug])}}&quot;&gt;\n</code></pre>\n<p>It's interesting that routes are presented in <code>php artisan route:list</code> output! I've tried to clean cache <code>php artisan route:clear</code>. What can I try next?</p>\n<p>Update. Even if I comment all my routes, and <code>php artisan route:list</code> doesn't show any routes. My app continue working... May be some cache troubles. But I've cleared cache by different ways.</p>\n"^^ . + . + . + "0"^^ . + . + . + . + . + . + "<p>I'm using WordPress for a personal website. A couple of days ago, I made some basic HTML and CSS changes to one of my pages (such as changing margins and an H3 into an H2), but now, every time I access that page, I get this error (which I only see on this page, none of the others have any issues).</p>\n<p><strong>Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 62914592 bytes) in /www/volleyballandme_311/public/wp-includes/class-wpdb.php on line 1812</strong></p>\n<p>I've tried accessing the <code>wp-config.php</code> file and adding <code>define('WP_MEMORY_LIMIT', '512M');</code> but the error persists. I've also run WP Sweep to clean unused and unnecessary files, but the error persists.</p>\n<p>What are some other things I can do in order to fix this error and visualize the content?\nThanks for your help!</p>\n"^^ . + "Did you try to increase execution time? You can add a command like set_time_limit(300)."^^ . + . + . + "0"^^ . + "@mickmackusa I don't currently have the time to properly implement any of the solutions, but here is the list of all German telephone area codes (as of today), so you can work with it, if you want: https://pastebin.com/NmkeYu5S Thank you for your help here and with my other questions. I greatly appreciate it."^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + "@siggemannen it's because SQL Server handles converting strings to `datetime2` differently (and better) than it does when converting to `datetime`. Sounds like op has an SQL Server instance where `SET DATEFORMAT DMY` is in effect which is where this will make s difference. If you needed to keep `datetime` in the database then another way you could work around this would be to override the `getDateFormat()` method in the Eloquent `Model` to return the date format with a `T` separator between the date and time parts, e.g.: `'Y-m-d\\TH:i:s.v'`"^^ . + "1"^^ . + . + "0"^^ . + "LoicTheAztec nothing changes"^^ . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + "How to get a value of post_meta table when running after_delete_post() in Wordpress?"^^ . + "0"^^ . + "PHP PDO-dblib to Sybase ASE via Parallels Desktop - CLI Connects but Browser Fails"^^ . + "Retrieve data from 3 tables"^^ . + "0"^^ . + . + "Log the actual JSON of your request that is formed, and the entire JSON of the response received. Update your question with this information"^^ . + "0"^^ . + . + "OP said: *"The real array contains a few hundred values"*"^^ . + . + "I don't understand you comments. When I store the comment without doing anything to it, it is stored as the 8 characters & #128512; Should I do that, or should I write code to convert it to the 4 utf8 characters 240, 159, 152, 128? Both will work. But is it better practice to convert?"^^ . + "wordpress-theming"^^ . + . + "Setting partitioned cookies in PHP, by header() maybe?"^^ . + . + "1"^^ . + . + . + . + . + . + "I cannot fix your code, but I can point you to working code, which is how most people learn"^^ . + . + . + "0"^^ . + . + "0"^^ . + "<p>I am trying to display one or more charts using Chart.js and Laravel Livewire. My issue is that the chart isn't displayed, even if the chart object receive data (when I <code>console.log(chart)</code> I can see the correct data)</p>\n<p>I currently don't bother to get actual form data, as I can't even display a chart with dummy data (which was working fine before I tried to introduce Livewire).</p>\n<p>Here is some code:</p>\n<h2>filter-graphs.blade.php (filter view)</h2>\n<pre><code>&lt;div&gt;\n &lt;form wire:submit=&quot;onGraphsChange&quot; class=&quot;text-xl w-3/4 mx-auto&quot;&gt;\n &lt;div class=&quot;flex items-center justify-center&quot;&gt;\n &lt;div class=&quot;mx-4 flex-1 justify-center&quot;&gt;\n &lt;x-input-label for=&quot;graphs&quot; value=&quot;Graphs à afficher&quot; /&gt;\n &lt;select id=&quot;graphs&quot; name=&quot;graphs&quot; multiple=&quot;multiple&quot; class=&quot;mt-1 block w-full py-2 bg-gray-200 text-gray-800 rounded focus:border-[#F73F3A] focus:ring-[#F73F3A]&quot;&gt;\n &lt;option class=&quot;py-1 bg-gray-200 text-gray-800&quot; value=&quot;4&quot;&gt;dummy 1&lt;/option&gt;\n &lt;option class=&quot;py-1 bg-gray-200 text-gray-800&quot; value=&quot;2&quot;&gt;dummy 2&lt;/option&gt;\n &lt;/select&gt;\n &lt;/div&gt;\n &lt;div class=&quot;mx-4 flex-1 justify-center text-center&quot;&gt;\n &lt;button type=&quot;submit&quot; class=&quot;px-4 py-2 border-2 border-gray-800 text-gray-800 rounded hover:text-gray-200 hover:bg-gray-800 hover:cursor-pointer&quot;&gt;Afficher les graphs&lt;/button&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/form&gt;\n&lt;/div&gt;\n</code></pre>\n<h2>FilterGraphs.php (filter component)</h2>\n<pre><code>namespace App\\Livewire;\n\nuse Livewire\\Component;\n\nclass FilterGraphs extends Component\n{\n public $selectedGraphs = null;\n\n public function onGraphsChange()\n {\n $this-&gt;dispatch('graphs-selected', $this-&gt;selectedGraphs);\n }\n\n public function render()\n {\n return view('livewire.filter-graphs');\n }\n}\n</code></pre>\n<h2>display-graphs.blade.php (charts display view)</h2>\n<pre><code>&lt;div class=&quot;flex&quot;&gt;\n &lt;div class=&quot;flex-1 shadow-sm rounded-lg bg-white m-4 p-4&quot;&gt;\n &lt;canvas id=&quot;test-graph&quot;&gt;&lt;/canvas&gt;\n &lt;/div&gt;\n&lt;/div&gt;\n\n&lt;script&gt;\n document.addEventListener('livewire:init', () =&gt; {\n Livewire.on('updateGraphs', (data) =&gt; {\n if(Chart.getChart(&quot;test-graph&quot;))\n Chart.getChart(&quot;test-graph&quot;).destroy();\n\n var ctx = document.getElementById('test-graph').getContext(&quot;2d&quot;);\n var config = {\n type: 'line',\n data: {\n labels: data[0]['labels'],\n datasets: data[0]['datasets']\n },\n options: {\n scales: {\n x: {\n ticks: {\n display: false\n },\n grid: {\n display: false\n }\n }\n },\n plugins: {\n title: {\n display: true,\n text: '',\n }\n },\n animation: false\n }\n };\n\n // myChart.config.options.plugins.title.text = data['title'];\n var myChart = new Chart(ctx, config);\n });\n });\n&lt;/script&gt;\n</code></pre>\n<h2>DisplayGraphs.php (charts display component)</h2>\n<pre><code>namespace App\\Livewire;\n\nuse Livewire\\Component;\n\nuse App\\Models\\History;\n\nclass DisplayGraphs extends Component\n{\n public array $datasets = [];\n public array $labels = [];\n public $graphs;\n\n protected $listeners = [\n 'graphs-selected' =&gt; 'graphsSelected',\n ];\n\n public function graphsSelected($server_service_ids)\n {\n //Get the dummy data\n\n $labels = $dates; // Contains an array of 85 dates as strings\n\n $datasets = [\n [\n 'label' =&gt; 'Temps de réponse (ms)',\n 'backgroundColor' =&gt; 'rgba(247, 63, 58, 0.3)',\n 'borderColor' =&gt; 'rgb(247, 63, 58)',\n 'lineTension' =&gt; 0.5,\n 'pointRadius' =&gt; 2,\n 'fill' =&gt; true,\n 'data' =&gt; $response_times, // Contains an array of 85 int\n ],\n [\n 'label' =&gt; 'Niveau d\\'alerte (ms)',\n 'backgroundColor' =&gt; 'rgba(255, 87, 34, 0.3)',\n 'borderColor' =&gt; 'rgb(255, 87, 35)',\n 'pointRadius' =&gt; 0,\n 'data' =&gt; $alert, // Contains an array of 85 int\n ],\n ];\n\n $this-&gt;dispatch('updateGraphs', [\n 'datasets' =&gt; $datasets,\n 'labels' =&gt; $labels,\n ]);\n }\n\n public function mount()\n {\n $this-&gt;labels = [];\n $this-&gt;datasets = [];\n }\n\n public function render()\n {\n return view('livewire.display-graphs');\n }\n}\n</code></pre>\n<h2>And the view within which I show all that</h2>\n<pre><code>&lt;x-app-layout&gt;\n &lt;x-slot name=&quot;header&quot;&gt;\n &lt;h2 class=&quot;font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight&quot;&gt;\n Title\n &lt;/h2&gt;\n &lt;/x-slot&gt;\n\n &lt;!--Tabs navigation--&gt;\n @include('partials.subnavigation-tabs')\n\n &lt;livewire:filter-graphs /&gt;\n &lt;livewire:display-graphs /&gt;\n&lt;/x-app-layout&gt;\n</code></pre>\n<p>What am I missing here to get the charts to display?\nThanks in advance</p>\n"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "it's params from filter query - I do ajax filter query and get products and query params after adding filters and then this params I send as params for load more query"^^ . + . + "Laravel 11 doesn't have the middleware array anymore to handle Middleware."^^ . + "0"^^ . + . + "<p><code>Example of using both static and non-static methods in the same controller is given below.</code></p>\n<pre><code>class Vehicle {\n public function start() {\n echo &quot;Vehicle started\\n&quot;;\n self::staticTest(1);\n $this-&gt;test(2);\n }\n \n public static function staticTest($num){\n echo &quot;My staic vehicle {$num} \\n&quot;;\n }\n \n public function test($num){\n echo &quot;Simple test vehicle{$num}&quot;;\n }\n}\n</code></pre>\n<p><code>$test = new Vehicle();</code></p>\n<p><code>$test-&gt;start(); </code></p>\n"^^ . + "1"^^ . + . + . + . + . + "0"^^ . + "2"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + "The UTF-8 representation of the BOM is the byte sequence `EF BB BF`. The unicode codepoint ZWNBSP is represented in UTF-8 as the BOM. So this may resolve to "How are you viewing the file and in what encoding?" More info [here](https://en.wikipedia.org/wiki/Byte_order_mark)."^^ . + "0"^^ . + . + . + "1"^^ . + "1"^^ . + . + "0"^^ . + "<p>I have the PHP code that saves all textarea inputs to a text file, except it fuses all consequent messages at the last letter of every input. For instance, if the first textarea content is:</p>\n<pre class="lang-none prettyprint-override"><code>Hello\nHow are you\nGood bye\n</code></pre>\n<p>Then the second textarea content is:</p>\n<pre class="lang-none prettyprint-override"><code>Let me upload this.\nInform me if you receive it.\n</code></pre>\n<p>After submitting both messages, the output text file shows this:</p>\n<pre class="lang-none prettyprint-override"><code>Hello\nHow are you\nGood byeLet me upload this.\nInform me if you receive it.\n</code></pre>\n<p>I need a real help to adjust the PHP file so that it insert a separator (like a horizontal line or <code>*************</code>) at the end of every message with <code>\\n</code>.</p>\n<p>Code:</p>\n<pre><code>&lt;?php \n$filename = 'posts.txt'; \n$msg = (isset($_POST['msg']) ? $_POST['msg'] : null); \n\nif (is_writable($filename)) { \n if (!$handle = fopen($filename, 'a')) { \n echo &quot;Cannot open file ($filename)&quot;; exit; \n } \n\n if (fwrite($handle, $msg) === FALSE) { \n echo &quot;Cannot write to file ($filename)&quot;; exit; \n } \n\n echo &quot;Success, wrote ($msg) to file ($filename)&quot;; fclose($handle); \n} \nelse { \n echo &quot;The file $filename is not writable&quot;; \n} \n?&gt;\n</code></pre>\n<p>Form:</p>\n<pre><code>&lt;form id=&quot;post&quot; name=&quot;post&quot; action=&quot;storeText.php&quot; method=&quot;post&quot;&gt; \n &lt;textarea cols=&quot;x&quot; rows=&quot;x&quot; name=&quot;msg&quot;&gt;&lt;/textarea&gt; \n &lt;input class=&quot;button&quot; type=&quot;submit&quot; value=&quot;POST!&quot;/&gt; \n&lt;/form&gt; \n&lt;div class=&quot;menuItem&quot; &gt; &lt;?=$msg?&gt; &lt;/div&gt;\n</code></pre>\n"^^ . + "0"^^ . + . + . + "Serving React App and WordPress Blog from Same Domain Using CloudFront - WordPress Admin Issues"^^ . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + . + . + . + . + "1"^^ . + . + . + "tailwind-css-4"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "0"^^ . + "Encryption/Obfuscation Methods for WordPress Plugin Source Code"^^ . + . + . + . + . + . + . + "What version of PHP? **Add as update to question text**."^^ . + . + "\n<pre><code>&lt;link rel=&quot;stylesheet&quot; href=&quot;&lt;?php echo base_url(); ?&gt;assets/lte/plugins/select2/css/select2.min.css&quot;&gt;\n&lt;link rel=&quot;stylesheet&quot; href=&quot;&lt;?php echo base_url(); ?&gt;assets/lte/plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css&quot;&gt;\n\n &lt;div class=&quot;form-group&quot;&gt;\n &lt;label&gt;Category&lt;/label&gt;\n &lt;select class=&quot;form-control select2 &quot; name=&quot;category&quot; id=&quot;category&quot; &gt;\n &lt;option value=&quot;&quot;&gt;Select&lt;/option&gt;\n\n &lt;?php\n if (isset($category)) {\n foreach ($category as $cnt) {\n print &quot;&lt;option value='&quot; . $cnt['id'] . &quot;'&gt;&quot; . $cnt['cat_name'] . &quot;&lt;/option&gt;&quot;;\n }\n }\n ?&gt;\n &lt;/select&gt;\n &lt;/div&gt;\n\n&lt;!-- Bootstrap 4 --&gt;\n&lt;script src=&quot;&lt;?php echo base_url(); ?&gt;assets/lte/plugins/bootstrap/js/bootstrap.bundle.min.js&quot;&gt;&lt;/script&gt;\n&lt;!-- Select2 --&gt;\n&lt;script src=&quot;&lt;?php echo base_url(); ?&gt;assets/lte/plugins/select2/js/select2.full.min.js&quot;&gt;&lt;/script&gt;\n\n&lt;script type=&quot;text/javascript&quot;&gt;\n $('#category').select2({\n theme: 'bootstrap4', \n width: '100%', \n placeholder: &quot;Select Category&quot;\n });\n&lt;/script&gt;\n</code></pre>\n"^^ . + . + "2"^^ . + . + . + "<p>Having to go &quot;back to the drawing board&quot; as my <a href="https://stackoverflow.com/questions/79339394/add-search-functionality-within-woocommerce-my-account-orders-page">previous question</a>, although worked, it only worked because of the <code>['post__in']</code> being the order ID.</p>\n<p><strong>Objective:</strong> add a frontend search form for customer to search orders their own orders on the My Account &gt; Orders page.</p>\n<p>This shop has a couple of wholesale accounts that drop ship ordered products. They have a lot of order history in their accounts, and ideally need to be able to search by order number and shipping details (shipping first name, shipping last name, shipping address, etc).</p>\n<p><strong>Disclaimer:</strong> This shop has been fully converted to HPOS and the legacy data deleted and compatibility mode turned off.</p>\n<p>I feel like I'm close, but the following code generates no results no matter what is queried in the form, messaging: &quot;No order has been made yet.&quot;</p>\n<pre><code>function add_search_to_orders() {\n $allowed_roles = array('administrator', 'shop_manager');\n $user = wp_get_current_user();\n $user_roles = (array) $user-&gt;roles;\n\n if (array_intersect($allowed_roles, $user_roles)) {\n $show_clear_link = isset($_GET['search_orders']) &amp;&amp; !empty($_GET['search_orders']);\n echo '&lt;form method=&quot;get&quot; id=&quot;orders-search-form&quot;&gt;\n &lt;input type=&quot;text&quot; name=&quot;search_orders&quot; placeholder=&quot;Search...&quot; value=&quot;' . (isset($_GET['search_orders']) ? esc_attr($_GET['search_orders']) : '') . '&quot; /&gt;\n &lt;button type=&quot;submit&quot;&gt;Search&lt;/button&gt;';\n if ($show_clear_link) {\n echo '&lt;a href=&quot;' . esc_url(remove_query_arg('search_orders')) . '&quot;&gt;Reset Search&lt;/a&gt;';\n }\n echo '&lt;/form&gt;';\n }\n}\n\nadd_action('woocommerce_before_account_orders', 'add_search_to_orders');\n\nadd_filter('woocommerce_my_account_my_orders_query', 'search_orders_query', 10, 1);\nfunction search_orders_query($args) {\n if (isset($_GET['search_orders'])) {\n $search_term = sanitize_text_field($_GET['search_orders']);\n \n $args['meta_query'][] = array(\n 'key' =&gt; 'order_number',\n 'value' =&gt; $search_term,\n 'compare' =&gt; 'LIKE'\n );\n\n $args['meta_query'][] = array(\n 'relation' =&gt; 'OR',\n array(\n 'key' =&gt; 'shipping_first_name',\n 'value' =&gt; $search_term,\n 'compare' =&gt; 'LIKE'\n ),\n array(\n 'key' =&gt; 'shipping_last_name',\n 'value' =&gt; $search_term,\n 'compare' =&gt; 'LIKE'\n )\n );\n\n $args['meta_query']['relation'] = 'OR';\n }\n return $args;\n}\n</code></pre>\n<p>I've added in some user role checks and also a reset search link for good measure.</p>\n<p>How can I get this to show actual results?</p>\n"^^ . + "<p>I need to hide prices throughout a whole woocommerce store but keep the 'add to cart' button and checkout functionality operational (the store is set to complete the order without an online payment, to request a quote for the items in the order).\nI'm using two lines of code to hide the prices in all shop and category pages as well as the single product pages but I can't manage to hide it in the cart and checkout pages.</p>\n<p>Here's my code:</p>\n<pre><code>add_filter( 'woocommerce_is_purchasable', '__return_true' );\nadd_filter( 'woocommerce_get_price_html', '__return_empty_string' );\n</code></pre>\n<p>What can I add to hide the prices in the checkout and cart pages?</p>\n"^^ . + . + . + . + "1"^^ . + "1"^^ . + . + . + . + "0"^^ . + "_"there is no <?php or ?>"_, but there are <?php and ?> in the linked QA."^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + "How to verify/assert that Facebook Pixel track events are actually working using laravel dusk?"^^ . + . + "1"^^ . + . + "0"^^ . + . + . + "Thanks again, sorry but i think i am still missing a piece in this puzzle, my bad. As soon as i want two different version i would have different content in my composer.json for the feature module. Like one could be "company/featureA": "1.0" and the other would be "company/featureA": "dev-beta". While your piece of code (which i never thought about) is ok in PHP, i need to handle exception right before executing code"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + "What actual error are you getting? You don't need an impression, you need some facts"^^ . + "0"^^ . + "<p>I have 24 consecutively numbered variables whose sum I need to evaluate:</p>\n<pre><code>if($t1 + $t2 + $t3 + $t4 + $t5 + $t6\n + $t7 + $t8 + $t9 + $t10 + $t11 + $t12\n + $t13 + $t14 + $t15 + $t16 + $t17 + $t18\n + $t19 + $t20 + $t21 + $t22 + $t23 + $t24\n == 0) { /* do stuff */ }\n</code></pre>\n<p>Is there some way to do this without listing every variable?</p>\n<p>The following works but still seems unnecessarily complicated:</p>\n<pre><code>$sum = 0;\nfor ($i = 1; $i &lt;= 24; $i++) {\n $sum = $sum + ${&quot;t&quot; . $i};\n}\nif($sum == 0) { /* do stuff */ }\n</code></pre>\n"^^ . + "made www-data an exact copy of the working user, did not help either.\nFor fun, I also tried to connect logged on as root, did not work. Tried another user, did not work either.\nSeems to only be working to connect as one specific user and I can't see any differences in the env either (other than home directory).\n\nI also configured apache to run as the working user to see if my php script could connect, but nope."^^ . + . + . + "<p>I'm going to guess for each of your apps you'll need to configure the JAR hive variable.</p>\n<p><a href="https://fatfreeframework.com/3.9/quick-reference#JAR" rel="nofollow noreferrer">https://fatfreeframework.com/3.9/quick-reference#JAR</a></p>\n<h3>JAR</h3>\n<p><strong>Type:</strong> <code>array</code></p>\n<p>Default cookie parameters. Consists of the following options:</p>\n<ul>\n<li><p><code>expire</code> Unix timestamp, when the cookie should expire. Default: <code>0</code></p>\n</li>\n<li><p><code>path</code> The path on the server in which the cookie will be available. Default: <code>'/'</code></p>\n</li>\n<li><p><code>domain</code> The domain that the cookie is available to. Default: <code>$_SERVER['SERVER_NAME']</code> if available, else <code>''</code></p>\n</li>\n<li><p><code>secure</code> Set the cookie when a secure HTTPS connection exists. Default: <code>$_SERVER['HTTPS']=='on'</code></p>\n</li>\n<li><p><code>httponly</code> Make the cookie accessible only through the HTTP protocol. Default: <code>TRUE</code></p>\n</li>\n</ul>\n<p>You can refer to <a href="http://www.php.net/manual/en/function.session-set-cookie-params.php" rel="nofollow noreferrer">session_set_cookie_params() in the PHP Manual</a> for more information.</p>\n<p>You can also <a href="https://youtu.be/a-zTNeDeqU0" rel="nofollow noreferrer">watch a video</a> that goes over using cookies in the Fat-Free Framework.</p>\n"^^ . + . + . + "How to insert multiple rows but different column names in GUI into one header and one detail table by using foreach php html"^^ . + . + "0"^^ . + "@GiacomoM : This is weird. There is no logical reason why exactly *this* should not work when porting a bash to a different platform. Perhaps the answer given by Armali is simply wrong? If you do a `shopt`, does it show the string `expand_aliases` in the output? If it does, your bash should be able to get it set in a script as well. But in your case, I think you didn't put them into the right files. If git itself executes bash code, it will likely do it using a bash child process, and I don't see why such a process should source .bash_profile or .bashrc."^^ . + . + . + . + . + . + "Is possible to spoof HTTP Header Referer value using cURL"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + "1"^^ . + . + . + . + "0"^^ . + "```<div>\n <h1>{{ $count }}</h1>\n \n <button wire:click="increment">+</button>\n \n <button wire:click="decrement">-</button>\n</div>```\n\n```<?php\n\nnamespace App\\Livewire;\n\nuse Livewire\\Component;\n\nclass StepCounter extends Component\n{\n\n public $count = 1;\n\n public function increment()\n {\n $this->count++;\n }\n\n public function decrement()\n {\n $this->count--;\n }\n\n public function render()\n {\n return view('livewire.stepcounter');\n }\n}```\n\n```Route::get('/counter', StepCounter::class);\n```\n\nstill dont work"^^ . + . + . + . + "1"^^ . + "platform.sh"^^ . + "<p>I believe I found the issue.</p>\n<p>When trying to use messages, it first checks if there is a translation available with the message key <code>data.required</code>.</p>\n<p>However, there was a custom translation existing called <code>data.mounted_serial</code> in <code>resources/lang/en/validation.php</code> (referred <a href="https://laravel.com/docs/8.x/validation#quick-customizing-the-error-messages" rel="nofollow noreferrer">here</a> in the laravel doc)</p>\n<pre><code>// resources/lang/en/validation.php\nreturn [\n 'attributes' =&gt; [\n 'data.mounted_serial' =&gt; 'Mounted serial',\n ],\n];\n</code></pre>\n<p>I believe it was looking to it as an array because of the existing entry</p>\n<pre><code>'data' =&gt; [\n 'mounted_serial' =&gt; 'Mounted serial',\n 'required' =&gt; 'error.action.required.data',\n]\n</code></pre>\n<p>By removing the existing translation entry <code>data.mounted_serial</code>, the validation works properly with the given message in <code>messages()</code></p>\n"^^ . + "<p>I want to use password_verify to verify a password form my database. In the php manual it says, you can use it to verify a password created by a hash and the default hash is crypt. So my question is, why does it not work?\nPassword has type &quot;password_hash&quot;</p>\n<pre><code>public function login(string $email, string $password){\n $user = self::fetchLoginCredentials($email);\n if(!$user){\n return false;\n }\n if(password_verify($password, $user['password'])){\n return $user;\n }\n return false;\n}\n\npublic function fetchLoginCredentials(string $email){\n $sql = &quot;SELECT u.id, u.firstname, u.lastname, u.email, u.password,\n r.name as role, i.filename as image_name, i.alt as image_alt\n FROM users as u\n JOIN roles as r on u.role_id = r.id\n LEFT JOIN images as i on profile_pic_id = i.id\n WHERE email = ?&quot;;\n try{\n return $this-&gt;db-&gt;sql_execute($sql, [$email])-&gt;fetch_assoc();\n } catch (\\Exception $e){\n return $e;\n }\n}\n</code></pre>\n<p>These are the sql statements i tried to use</p>\n"^^ . + . + . + "0"^^ . + . + . + "What does this question have to do with PHP or mysqli?"^^ . + "0"^^ . + "I wanted to thank you again. I wish I could show the code I came up with since it is totally different and works perfectly. The whitelist part is what pointed me in the right direction. I used array_combine() to make it work."^^ . + "I'm not really sure. Once you edited it, it was a reasonable question. People don't always revisit questions they've initially downvoted though - it pays to get it as right as possible first time, including adding code if there's code involved. It probably shouldn't be like that, but that's how it is unfortunately."^^ . + "There's a [similar question here](https://stackoverflow.com/questions/53867867/doctrine-query-builder-inner-join-with-subselect) that appears to suggest that subqueries won't work the way you're attempting using Doctrine ORM. Try using the native query builder and see if that helps."^^ . + "<p>I don't understand why this particular regex with PHP is failing:</p>\n<pre><code>&lt;?php\necho preg_replace_callback(\n '/&lt;a(\\\\s[^&gt;]+)* href=&quot;([^&quot;]+)&quot;(\\\\s[^&gt;]+)*&gt;/i',\n function ($matches) {\n print_r($matches);\n return $matches[0];\n },\n '&lt;a href=&quot;http://s.c/&quot; title=&quot; tickets for htt://v.c/e r ad Clown album elease Martian Crisis Unit Elrichan Wavelengt&quot; tar=&quot;&quot;&gt;a&lt;/a&gt;'\n);\n</code></pre>\n<p>When I run the code above, it echoes nothing to terminal.</p>\n<p>But if I delete a single character from somewhere, sometimes the echo will work. For example, if change the word <code>Martian</code> to <code>Martan</code> (ie. drop the letter <code>i</code>), then everything works fine.</p>\n<p>What have I misunderstood about my regex pattern? What is so special about the letter <code>i</code> that would break my regex?</p>\n<hr />\n<p>However, this works fine in javascript:</p>\n<pre><code>'&lt;a href=&quot;http://s.c/&quot; title=&quot; tickets for htt://v.c/e r ad Clown album elease Martian Crisis Unit Elrichan Wavelengt&quot; tar=&quot;&quot;&gt;a&lt;/a&gt;'.match(/&lt;a(\\s[^&gt;]+)* href=&quot;([^&quot;]+)&quot;(\\s[^&gt;]+)*&gt;/i);\n</code></pre>\n<p>The javascript version gives me an array of matches.</p>\n"^^ . + . + . + . + "0"^^ . + "typescript"^^ . + "Not sure if it's just an example, but in your screenshot you're seemingly passing an access token in the body. There's no hard and fast rule but you'll see that most systems pass that kind of thing in a HTTP header, rather than in the request body or the URL. That gives you more flexibility, so - for example - it can travel in a GET request without worrying about request bodies."^^ . + . + "-1"^^ . + "1"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "See: [PR #2119](https://github.com/briannesbitt/Carbon/issues/2119)"^^ . + . + "How to replace a class with a custom class in php?"^^ . + "Say I want to pass the string to a `function foo(string $page)` and I call it by `foo(Pages::Start)`, PHP exits with the info that a `string` was expected, but `Pages` was provided."^^ . + "1"^^ . + . + "Laravel 419 Page Expired on Hosting but Works Locally"^^ . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + "5"^^ . + . + "This does seem like the best option. Split your current package into `lordf/measurement-unit-length` and `lordf/measurement-unit-height` for example, then you can individually use all those packages. If you then implement every part, you'd have a setup equal to your current package, but maintain the flexibility to not include every measurement unit."^^ . + . + . + "1"^^ . + . + . + . + "1"^^ . + . + "Either that or your php script is also outputting unwanted html as well as the json - if so you need to adjust the logic so it doesn't, or move the functionality for generating the json to a separate script"^^ . + . + "<p>I'm working on a Laravel application and need to copy my production database data to my local development environment. I've been struggling to find a secure and scalable way to do this that properly handles table relationships and sensitive data. In my application, I have multiple interconnected tables, including user data and various related tables. For example, one of my tables is <code>user_codes</code>, but I need a solution that works across all tables while maintaining their relationships. I've been trying to use <code>php artisan migrate:fresh --seed</code> with a custom seeder. Here's what I've attempted so far:</p>\n<pre><code>class UserCodesSeeder extends Seeder\n{\n public function run()\n {\n DB::connection('production')-&gt;table('user_codes')-&gt;chunk(1000, function($records) {\n foreach($records as $record) {\n UserCodes::create((array)$record);\n }\n });\n }\n}\n</code></pre>\n<p>Any help would be appreciated. Thank you</p>\n"^^ . + ""rich text" or HTML? These are two very different things. It looks like you're talking about HTML, so please adjust your tags and your question's wording. (You can [edit] your post whenever you need to). See also [ask]. Thanks."^^ . + . + . + . + "How to add an hyperlink to the "sold out" message on Woocommerce single product page?"^^ . + . + . + . + "<p>I am new to working with Laravel, and websockets in general. I checked out the Laravel documentation regarding real time events and don't understand why the problem below occurs.</p>\n<p>I have a database with the basic users table that breeze provides, and a rooms table. A user can create a room, instantly joins it, and then an other user can join with the room code. I am trying to send a message to the user already in the room, when an other user joins, but for some reason nothing seems to make it show up. I am using pusher and I set it up following the guide in the laravel documentation. I see the 'subscribed' events appearing on the pusher debug log, but the message isn't going through. I'm aware that I'm using a private channel, but i set the acces up like this so that should work</p>\n<pre><code>Broadcast::channel('room.{roomID}', function ($user, $roomId) {\n return true;\n});\n</code></pre>\n<p>This is my relevant code, I appriciate the help</p>\n<pre><code>class NewPlayerJoined implements ShouldBroadcast\n{\n use Dispatchable, InteractsWithSockets, SerializesModels;\n\n public $room;\n\n public function __construct(GameRoom $room)\n {\n $this-&gt;room = $room;\n }\n\npublic function broadcastOn(): Channel\n {\n return new PrivateChannel('room.' . $this-&gt;room-&gt;id);\n }\n\n public function broadcastAs(): string\n {\n return 'player-joined';\n }\n}\n\npublic function joinRoom(Request $request)\n {\n$room = GameRoom::where('room_code', $request-&gt;room_code)-&gt;first();\nbroadcast(new NewPlayerJoined($room))-&gt;toOthers();\n\nwindow.Echo.private(`room.${props.room.room_code}`)\n .listen('player-joined', (e) =&gt; {\n console.log('player joined', e)\n })\n</code></pre>\n"^^ . + . + "1"^^ . + "<h3><strong>Solution That Finally Worked:</strong></h3>\n<p>The problem was related to <strong>secure session cookies</strong>. Here’s how I fixed it:</p>\n<ol>\n<li><p>Open the <code>.env</code> file and modify this line:</p>\n<pre><code>SESSION_SECURE_COOKIE=true\n</code></pre>\n<p>And update it to ensure it defaults to <code>false</code>:</p>\n</li>\n<li><p>Open the session configuration file:</p>\n<p><code>config/session.php </code></p>\n<p>Locate this line:</p>\n<pre><code>'secure' =&gt; env('SESSION_SECURE_COOKIE'),\n</code></pre>\n<p>And update it to ensure it defaults to <code>false</code>:</p>\n<pre><code>'secure' =&gt; env('SESSION_SECURE_COOKIE', false), \n</code></pre>\n</li>\n</ol>\n<p>After applying these changes, the login started working properly!</p>\n<p><strong>Why This Happens?</strong></p>\n<p>When <code>SESSION_SECURE_COOKIE</code> is set to <code>true</code>, Laravel forces cookies to be sent only over <strong>HTTPS</strong>. If your hosting environment does not fully support HTTPS or has misconfigurations, the session may not persist correctly, leading to the <strong>419 Page Expired</strong> error.</p>\n<p>I hope this helps anyone facing the same frustrating issue! Let me know if you have any questions. </p>\n"^^ . + "Applying template formatting using PHPWord"^^ . + . + "<p>You may need to ask your hosting provider if you are using a shared hosting to increase your allowed memory or you may need to edit your php.ini file to increase it.</p>\n"^^ . + "1"^^ . + "0"^^ . + . + . + . + . + "How to pass a custom variable to a method in a custom QR Code Generator using Chillerlan QRCode Library?"^^ . + "1"^^ . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + "i want to redirect to home page while page not found (404) in laravel"^^ . + . + . + . + "firebase"^^ . + . + "Unique constraint is the most effective way of preventing duplicate data being inserted. I can't imagine a scenario when mariadb would insert duplicate rows if you have a unique constraint in place. That would be a huge bug!"^^ . + "0"^^ . + . + "@shingo Yes. I was not able to set this in the workspace file, but in the settings I was able to add it."^^ . + "0"^^ . + "0"^^ . + "0"^^ . + "3"^^ . + . + "0"^^ . + . + . + . + . + . + "How to throw an exception if a certain class object is serialized via json_encode?"^^ . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + "0"^^ . + . + . + "<p>my problem : i try to show the image in Laravel using the following code</p>\n<pre><code>\n \n @foreach($data as $dat)\n &lt;p&gt;{{ $dat-&gt;name }}&lt;/p&gt;\n &lt;hr&gt;\n &lt;img src=&quot;{{ Storage::url($dat-&gt;avatar) }}&quot; alt=&quot;&quot;&gt;\n @endforeach \n</code></pre>\n<ul>\n<li><p>i have linked the storage with the public</p>\n</li>\n<li><p>this how i save the image to data base with other data</p>\n</li>\n</ul>\n<pre><code>public function createUser(CreateUserRequest $request){\n \n // dd($request);\n \n if($request-&gt;hasFile('avatar')){\n $image = $request-&gt;avatar;\n $path = Storage::disk('public')-&gt;put('avatar/',$request-&gt;file('avatar'));\n $userData = $request-&gt;all();\n $userData['avatar'] = $path;\n \n User::create($userData);\n return redirect()-&gt;back()-&gt;with('success_message','Success');\n }\n\n User::create($request-&gt;all());\n return redirect()-&gt;back()-&gt;with('success_message','Success');\n }\n</code></pre>\n<ul>\n<li>this is the string saved into data base</li>\n</ul>\n<pre><code>avatar/CU0TjohsMMm9VmmI1T3s1T1vUJkGjnXFlbvWejPT.jpg\n</code></pre>\n<p>the problem that i try the same code on my laptop the image showed correctly while on the pc i don't know what is wrong</p>\n"^^ . + "0"^^ . + "You implemented this as a shortcode, so where & how are you embedding that?"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + "I installed 8.44, set allow_url_fopen=on, extension=openssl in php.ini\nI get the same error"^^ . + . + "0"^^ . + . + "How to access slim request interface inside controller"^^ . + . + "microsoft-copilot"^^ . + . + "Since running node generally requires an extra process on the server (it doesn't integrate directly with Apache, unlike PHP for example) you'll find that many cheap/shared hosting providers don't allow to you run extra services like that. It would have been a good idea to research your deployment and support options, and the capability of your current live environment _before_ developing a whole new feature using a different technology stack than the rest of your deployment."^^ . + "0"^^ . + "1"^^ . + . + . + "@RawSlugs any ides to this. https://stackoverflow.com/questions/79486135/custom-herd-valet-drivers-for-resolving-url-paths-in-vanilla-php-projects"^^ . + "0"^^ . + . + "<p>There is <em>no</em> difference in their visibility. <code>$GLOBALS</code> is a <a href="https://www.php.net/manual/en/language.variables.superglobals.php" rel="nofollow noreferrer">superglobal</a> as well. This means that you can access that <code>$GLOBALS</code> from variable anywhere in your code, in any scope.</p>\n<p>Regarding your confusion, I think you've misunderstood what the documentation is telling you.</p>\n<p>The bit from the documentation of <code>$GLOBALS</code> that you quoted:</p>\n<blockquote>\n<p>$GLOBALS — References all variables available in global scope</p>\n</blockquote>\n<p>isn't talking about the availability of <code>$GLOBALS</code> itself (that's already described in the superglobals documentation).</p>\n<p>Instead it's telling you what the <em>contents</em> of <code>$GLOBALS</code> is. What <code>$GLOBALS</code> <em>contains</em> is all variables which have global scope.</p>\n<p>And the fact that they're referenced by <code>$GLOBALS</code> then gives you a nice way to read them from any scope, not just the global scope (this removes the need for you to write things like <code>global $variable;</code> for every global you want to reference inside a function, for example). Note that as of PHP 8.1, <code>$GLOBALS</code>, global variables cannot be modified via it - so it provides a read-only view of those values.</p>\n"^^ . + . + . + "0"^^ . + . + . + "2"^^ . + . + "Ok. In future if that's the case, please remove your question or post your own answer to it, so that people don't assume you have an unanswered issue and spend their time on it unnecessarily. Thankyou."^^ . + . + . + "tsconfig"^^ . + . + . + . + . + . + . + . + "2"^^ . + "Yes, I didn't create one yet"^^ . + . + "`Route::get('/counter', StepCounter::class);` this is what you need for routing where StepCounter is your livewire class"^^ . + . + . + "0"^^ . + . + "timezone"^^ . + . + . + . + "<p>As per <a href="https://docs.x.com/x-api/posts/manage-tweets/introduction" rel="nofollow noreferrer">the documentation</a>, the endpoint you're trying to call is not permitted to be used by the app-only authentication method you're using. Tweets are posted by / on behalf of users, but an app-only token runs without a user context, so it makes sense logically that it cannot post a tweet.</p>\n<p>You can use Oauth1.0a user context or OAuth 2.0 user context to authenticate to that endpoint, therefore you will need to amend your first cURL request and processes accordingly to your choice.</p>\n"^^ . + . + . + "@FrankHeikens yes, I did this. But still, I would really like to know what causes this. It was working fine and one day it stopped. Is it php 8.3? or Posgres 15?"^^ . + "1"^^ . + . + . + "-2"^^ . + "1"^^ . + "If you know the length of the string $dir then you could use [substr](https://www.php.net/manual/en/function.substr.php) to get the part of the string after the $dir bit."^^ . + "1"^^ . + "How can I safely copy production database data to local environment in Laravel?"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + "FWIW, you can skip the _variable_ `$dummy` by just writing it inline: `$correct = (new Creator())->CreatorFromBar($enum_bar);` But I think the "how can I make it `static`?" part, to avoid the extra constructor call completely, is more important, so won't leave this as an answer."^^ . + "0"^^ . + "0"^^ . + . + . + "There are some real issues toguh, quite appaling. Such as mediumint(8) or SQL injection and you better address them ASAP"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + . + "<p>I'm trying to use the following code to transfer an image file from my website to a Rackspace Cloud Files container:</p>\n<pre><code>$ch = curl_init();\n\ncurl_setopt($ch, CURLOPT_URL, 'https://storage101.dfw1.clouddrive.com/v1/MossoCloudFS/myContainer/myFile.png');\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n\n$cFile = curl_file_create(&quot;myFolder/myFile.png&quot;, 'image/png','testpic');\n$imgdata = array('myimage' =&gt; $cFile);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $imgdata);\n\n$headers = array();\n$headers[] = 'Content-Type: image/png';\n$headers[] = 'X-Auth-Token: '.$myID;\ncurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n$result = curl_exec($ch);\nif (curl_errno($ch)) {\n echo 'Error:' . curl_error($ch);\n}\ncurl_close($ch);\n</code></pre>\n<p>The file transfers and it appears to be the correct size, but it is corrupted. If I open the PNG file in a text editor, I see that it looks almost identical to the original image file but it has some extra text at the top and an extra line of text at the bottom as shown in bold below:</p>\n<p><strong>--------------------------454fae24975d785a</strong>\n<strong>Content-Disposition: attachment; name=&quot;myimage&quot;; filename=&quot;testpic&quot;</strong>\n<strong>Content-Type: image/png</strong></p>\n<p>‰PNG</p>\n<p>IHDR `ï šMÝ pHYs</p>\n<p>šœ\nOiCCPPhotoshop ICC profile xÚSgTSé=÷ÞôBKˆ€”KoR RB‹€‘&amp;*!Jˆ!¡ÙQÁEEÈ ˆŽŽ€ŒQ,Š\nØ ä!¢Žƒ£ˆŠÊûá{£kÖ¼÷æÍþµ×&gt;ç¬ó³Ï À–H3Q5€©BàƒÇÄÆáä.@\n...\n...\n<strong>--------------------------454fae24975d785a--</strong></p>\n<p>Is there a way to send just the PNG image file without injecting this extra text?</p>\n"^^ . + . + . + . + "0"^^ . + "Indeed, there is no concurrency in this code. And it's not clear what "fake request" means."^^ . + "0"^^ . + . + . + . + "Why cmd+click does not open the file when the route uses {{ asset(' in laravel - vscode"^^ . + "1"^^ . + "@YourCommonSense thank you for the example you provided. It is nice to see how things like that get done using current standards. I will use it as a learning opportunity, cuz I am afraid to modify provided code as much considering this and the other task were pretty basic so I don't know if it would be appreciated. By "handling" i meant adding stuff like `if (!$connection){die("Connection error: " . mysqli_connect_error());}` and `if (!$result) {die("SQL query error: " . mysqli_error($connection));}`"^^ . + . + "<p>When i try to install a new laravel project it says Your requirements could not be resolved to an installable set of packages.</p>\n<p>Problem 1\n- Root composer.json requires laravel/framework ^12.0 -&gt; satisfiable by laravel/framework[v12.0.0, v12.0.1, v12.1.0, v12.1.1].\n- laravel/framework[v12.0.0, ..., v12.1.1] require league/flysystem-local ^3.25.1 -&gt; satisfiable by league/flysystem-local[3.25.1, 3.28.0, 3.29.0].\n- league/flysystem-local[3.15.0, ..., 3.29.0] require ext-fileinfo * -&gt; it is missing from your system. Install or enable PHP's fileinfo extension.</p>\n<p>To enable extensions, verify that they are enabled in your .ini files:\n- C:\\Program Files\\php-8.2.26-Win32-vs16-x64\\php.ini\nYou can also run <code>php --ini</code> in a terminal to see which files are used by PHP in CLI mode.\nAlternatively, you can run Composer with <code>--ignore-platform-req=ext-fileinfo</code> to temporarily ignore these required extensions.\nPS C:\\laragon\\www&gt; php --ini\nConfiguration File (php.ini) Path:\nLoaded Configuration File: C:\\Program Files\\php-8.2.26-Win32-vs16-x64\\php.ini\nScan for additional .ini files in: (none)\nAdditional .ini files parsed: (none). How can i solve this error</p>\n"^^ . + . + "0"^^ . + . + . + "2"^^ . + . + . + "1"^^ . + . + . + "I answered this question [on GitHub](https://github.com/PHPMailer/PHPMailer/issues/3135#issuecomment-2645713233)"^^ . + "0"^^ . + . + . + . + . + . + . + "Ah I see, they removed handler as well. Can you please try with singleton and see if it works? \n\n$app->singleton(\n Illuminate\\Contracts\\Debug\\ExceptionHandler::class,\n App\\Exceptions\\CustomHandler::class\n);"^^ . + "1"^^ . + . + . + . + "Please don't post screenshots of textual output, post it as code formatted **text**."^^ . + . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + "file-transfer"^^ . + . + . + . + . + . + "0"^^ . + . + "<p>I have a controller that outputs an image. It's rather simple, ending in:</p>\n<pre class="lang-php prettyprint-override"><code> /** @var SplFileObject $attachment */\n return new BinaryFileResponse($attachment, 200, [\n 'Content-Type' =&gt; $attachment-&gt;getType(),\n 'Content-Length' =&gt; $attachment-&gt;getSize(),\n ]);\n</code></pre>\n<p>PhpStorm in version 2024.3.2.1 shows the following warning in a tooltip:</p>\n<blockquote>\n<p>Symfony: 'file' shortcut can be used</p>\n</blockquote>\n<p>What is this shortcut, and how could it be used here?</p>\n"^^ . + . + "2"^^ . + . + . + "2"^^ . + "<p>I've created the following code in order to include navigation buttons at the top of my Tutor LMS courses. Their purpose is that the user can navigate between courses in a category. However, I can only get the buttons to appear on a 'course' page. It doesn't display on 'lesson' pages for some reason? I wonder if anyone could help? Thank you</p>\n<pre><code> function tutor_navigation_buttons() {\n global $post;\n\n if (!$post) {\n return &quot;No global post object found&quot;;\n }\n\n $post_type = get_post_type($post);\n\n // Adjusted: Check if post type is &quot;courses&quot;, &quot;tutor_lesson&quot;, or &quot;lesson&quot;\n if ($post_type === 'courses') {\n $current_post = $post; // Course page\n } elseif ($post_type === 'lesson') {\n $course_id = get_post_meta($post-&gt;ID, '_tutor_course_id_for_lesson', true);\n if (!$course_id) {\n return &quot;No associated course found for this lesson (Lesson ID: {$post-&gt;ID})&quot;;\n }\n $current_post = get_post($course_id); // Get the parent course\n } else {\n return &quot;Not on a course or lesson page (Detected post type: $post_type)&quot;;\n }\n\n // Extract module number from course title\n $current_title = get_the_title($current_post-&gt;ID);\n if (!preg_match('/Modiwl (\\d+):/', $current_title, $matches)) {\n return &quot;Could not extract module number from: $current_title&quot;;\n }\n\n $current_number = (int) $matches[1];\n $categories = wp_get_post_terms($current_post-&gt;ID, 'course-category', ['fields' =&gt; 'ids']);\n\n // Find Next and Previous Modules\n $next_module = get_adjacent_module($categories, $current_number + 1);\n $prev_module = get_adjacent_module($categories, $current_number - 1);\n\n // Start output\n ob_start();\n echo &quot;&quot;;\n\n if ($prev_module) {\n $prev_link = get_permalink($prev_module-&gt;ID);\n echo &quot;Modiwl blaenorol&quot;;\n }\n\n if ($next_module) {\n $next_link = get_permalink($next_module-&gt;ID);\n echo &quot;Modiwl nesaf&quot;;\n }\n\n echo &quot;&quot;;\n\n return ob_get_clean();\n}\n\nadd_shortcode('tutor_navigation', 'tutor_navigation_buttons');\n\n// Helper function to find the adjacent module by number\nfunction get_adjacent_module($categories, $target_number) {\n $args = [\n 'post_type' =&gt; 'courses',\n 'post_status' =&gt; 'publish',\n 'posts_per_page' =&gt; 1,\n 'tax_query' =&gt; [\n [\n 'taxonomy' =&gt; 'course-category',\n 'field' =&gt; 'id',\n 'terms' =&gt; $categories,\n ],\n ],\n 's' =&gt; &quot;Modiwl $target_number:&quot;,\n ];\n\n $query = new WP_Query($args);\n\n if (!$query-&gt;have_posts()) {\n return null;\n }\n\n return $query-&gt;posts[0];\n}\n</code></pre>\n"^^ . + . + "2"^^ . + "@KIKOSoftware Yes. it's hosted on the same domain. I updated my question."^^ . + "1"^^ . + "`System.data.sqlite is a special kind of sqlite database`...really? Special in what way? Can you provide a link to some documentation which tells us about it? As far as I know Luke is correct, that is just the name of the .NET library which is used to connect to sqlite databases, it is not the database itself. If you think that's wrong please give us the information to explain it."^^ . + . + . + . + . + "You can anchor it: `(?i)^[a-z][a-z '.,-]*$` [see here](https://regex101.com/r/CbkBKu/1)"^^ . + "I had no connections to this port, I checked it like this: netstat -ano | findstr :5000"^^ . + . + "javascript"^^ . + "<p>I solved it with below code.</p>\n<p>I need to install twig</p>\n<p><code>composer require &quot;twig/twig:^3.0&quot;</code></p>\n<p>the load twig into my view</p>\n<pre><code>public function view($tpl, $data)\n {\n\n $response = new \\Slim\\Psr7\\Response();\n\n $loader = new \\Twig\\Loader\\FilesystemLoader(ABSPATH . '/views');\n\n $twig = new \\Twig\\Environment($loader, [\n 'cache' =&gt; false, // ABSPATH.'/cached',\n ]);\n\n $html = $twig-&gt;render($tpl . '.html', $data);\n\n $response-&gt;getBody()-&gt;write($html);\n\n return $response;\n }\n</code></pre>\n<p>Cons:</p>\n<p>The slim functions are not working.</p>\n<pre><code>{{url_for('home')}}\n</code></pre>\n<p>did not work</p>\n"^^ . + . + "0"^^ . + "I have a player in which I collect listening data. Then the data is displayed in the wp admin. It became necessary to manually enter the data into the table. To do this, I created a tab with editing, but I screwed something up and the data is not updated when making changes through the admin. \n\nThis is what the player looks like\n[link](https://thea-smart.com/proyekty/kazky_heroiv_nashoho_chasu/sapsan-nebosvit-i-poglyad-serczya)"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "You are not really giving us a good description of what you are doing, but, unless I am missing something it is quite possible that on your first connection, no cookies are created. Remember when using cURL you are pretending to be a "real boy" i,e a user on a browser. If the first connection to that server created no cookies, then you have to write your code to cope with that possibility"^^ . + . + "xdebug"^^ . + . + "reactjs"^^ . + . + . + "<p>I have set up multiple shipping zones, which have their own shipping methods: flat rate, local pickup (free) and free shipping with a minimum subtotal. Products belonging to &quot;leeggoed&quot; product category, should be excluded from the subtotal calculation used to determine free shipping eligibility.</p>\n<p>Not sure if it is important, but I'm using this code to hide the &quot;Flat rate&quot; when &quot;Free shipping&quot; becomes available:</p>\n<pre class="lang-php prettyprint-override"><code>function hide_shipping_when_free_is_available( $rates, $package ) {\n $new_rates = array();\n foreach ( $rates as $rate_id =&gt; $rate ) {\n // Only modify rates if free_shipping is present.\n if ( 'free_shipping' === $rate-&gt;method_id ) {\n $new_rates[ $rate_id ] = $rate;\n break;\n }\n }\n\n if ( ! empty( $new_rates ) ) {\n //Save local pickup if it's present.\n foreach ( $rates as $rate_id =&gt; $rate ) {\n if ('local_pickup' === $rate-&gt;method_id ) {\n $new_rates[ $rate_id ] = $rate;\n break;\n }\n }\n return $new_rates;\n }\n return $rates;\n}\n\nadd_filter( 'woocommerce_package_rates', 'hide_shipping_when_free_is_available', 10, 2 );\n</code></pre>\n<p>The code I'm currently debugging fails to apply free shipping when the adjusted subtotal reaches the threshold.</p>\n<pre class="lang-php prettyprint-override"><code>add_filter('woocommerce_shipping_free_shipping_is_available', function ($is_available, $package, $shipping_method) {\n $excluded_category = 'leeggoed'; // Category slug to exclude\n $adjusted_total = 0; // Initialize adjusted total\n\n // Step 1: Calculate the cart total excluding &quot;leeggoed&quot; products\n foreach (WC()-&gt;cart-&gt;get_cart() as $cart_item) {\n $product = $cart_item['data'];\n $product_id = $product-&gt;get_id();\n\n // Only count products that are NOT in the &quot;leeggoed&quot; category\n if (!has_term($excluded_category, 'product_cat', $product_id)) {\n $adjusted_total += $cart_item['line_subtotal'];\n }\n }\n\n // Step 2: Retrieve the free shipping threshold for this shipping method\n if (isset($shipping_method-&gt;min_amount)) {\n $free_shipping_min_amount = (float) $shipping_method-&gt;min_amount;\n } else {\n $free_shipping_min_amount = 0; // Default to 0 if no threshold is set\n }\n\n // Step 3: Free shipping is only available if the adjusted total meets the threshold\n return ($adjusted_total &gt;= $free_shipping_min_amount);\n}, 10, 3);\n</code></pre>\n"^^ . + . + "1"^^ . + "2"^^ . + "Yes the methos is all in the same controller NumberController for the Number model"^^ . + "1"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + ""converts all HTML tag names to lowercase by default" - Not really. When you parse source code of any kind, you get an in-memory representation. Getting source code back from that data structure means generating it from scratch."^^ . + . + . + . + "2"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + "1"^^ . + . + "2"^^ . + . + . + . + "0"^^ . + "0"^^ . + "`for ($i = 6; $i < count($array); $i += 5) ...`"^^ . + . + . + "0"^^ . + . + . + "@NicoHaase - like HTML has this meta tag for redirect & refresh, I was wondering if something else is available which can be married to the timer, so that it can work as expected."^^ . + "1"^^ . + . + . + . + . + . + "That's my bad I think I copy pasted a wrong try while trying to figure out what was going on. I believe this is referring to the [documentation](https://laravel.com/docs/8.x/validation#customizing-the-error-messages) which I did try beforehand. My bad on this one I'll edit the OP to reflect proper code example. \nIt's still stuck in error even with the `data.required` in `messages()` however"^^ . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + "Your code needs additions since you are checking for variations. Please see this SO answer on how to [Add a free product when specific products are added to the cart](https://stackoverflow.com/a/76824334/10497022) in WooCommerce, for variations. You can replace the free product ID in the code with your own product. The next thing is to optimize it for the quantity."^^ . + "0"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + "`$image` is null, so there's no object to get a relationship on"^^ . + . + . + . + . + . + "3"^^ . + . + "0"^^ . + . + . + . + . + "1"^^ . + . + "<p>1、env()method can get value from :the command</p>\n<pre><code>putenv('TEST_ENV=333');\n$test = env('TEST_ENV');\n</code></pre>\n<p>2、from the system environment variables,just like .bash_file(macOS)</p>\n<pre><code>export ANDROID_HOME=&quot;/Users/hello/doc/tool/android/SDK&quot;\n\necho env('ANDROID_HOME')\nwill print /Users/hello/doc/tool/android/SDK\n</code></pre>\n<p>3、.env file(If cached will first use cache file)</p>\n<pre><code>.env\n\nAPP_DEBUG=true\nAPP_ENV=local\nAPP_LOCAL=local\n</code></pre>\n"^^ . + . + . + "0"^^ . + "1"^^ . + "0"^^ . + . + . + . + . + "<p>I think you need to use the all method</p>\n<pre><code>public function returnChallenge(Request $request)\n {\n return response()-&gt;json(['challenge' =&gt; $request-&gt;all()['challenge']]);\n }\n\n</code></pre>\n"^^ . + . + "0"^^ . + "<p>I am trying to use the <code>implements</code> of PHP where the parameter is a base/generic type class.</p>\n<p>BaseFormRequest.php</p>\n<pre><code>class BaseFormRequest extends FormRequest\n{\n... methods here\n}\n</code></pre>\n<p>StorePostRequest.php</p>\n<pre><code>class StorePostRequest extends BaseFormRequest\n{\n... methods here\n}\n</code></pre>\n<p>IController.php</p>\n<pre><code>interface IController\n{\n public function store(BaseFormRequest $request);\n}\n</code></pre>\n<pre><code>class PostController extends Controller implements IController\n{\n\n public $service;\n\n public function __construct(PostService $service)\n {\n $this-&gt;service = $service;\n }\n\n public function store(StorePostRequest $request)\n {\n $post = $this-&gt;service-&gt;store($request);\n }\n}\n</code></pre>\n<p>As you can see in the code:</p>\n<ol>\n<li>in StorePostRequest, it extends the BaseFormRequest.</li>\n<li>in the IController, the parameter in store method is type BaseFormRequest.</li>\n<li>in PostController, the parameter in store method is type StorePostRequest.</li>\n</ol>\n<p>I am getting the error</p>\n<pre><code>Declaration of PostController::store(StorePostRequest $request) must be compatible with IController::store(\\App\\Http\\Requests\\BaseFormRequest $request)\n</code></pre>\n<p>What I do know is that</p>\n<ol>\n<li>if I remove the implements IController, the code works as intended</li>\n<li>if I change the PostController@store param to BaseFormRequest, or IController@store param to StorePostRequest the error is fixed, but I cant customize the rules in each model this way.</li>\n</ol>\n<p>Is it not possible to use a generic class in interface so that when I implement it in my controller, I can use the correct class that extends to the generic class?</p>\n"^^ . + . + . + "0"^^ . + . + "You should read the response and verify the issue. Try to `echo $response->getBody();`, or just `print_r` it."^^ . + "<p>I feature a hall of fame on my site dedicated to WWE history. People submit their nominations through a PHP form that passes the data to a MySQL table and the form was working up until recent weeks. At least 2 people submitted nominations recently but I didn't see any new entries to the MySQL table. I tested the form for myself and got a blank page. Is it possible to see the form data in error logs maybe or is it just gone?</p>\n<p>Here's the code for the form:</p>\n<pre><code> &lt;FORM NAME=&quot;input&quot; ACTION=&quot;https://www.justbringingtheraw.com/hof/wweonly.php&quot; METHOD=&quot;post&quot;&gt;\n &lt;P&gt;Username:&lt;BR&gt; &lt;INPUT TYPE=&quot;text&quot; NAME=&quot;username&quot;&gt;&lt;/P&gt;\n &lt;P&gt;Forum:&lt;BR&gt; &lt;INPUT TYPE=&quot;text&quot; NAME=&quot;&quot;&gt;&lt;/P&gt;\n &lt;P&gt;Nominees:&lt;BR&gt; &lt;TEXTAREA NAME=&quot;nominees&quot; ROWS=&quot;10&quot; COLS=&quot;40&quot;&gt;\n &lt;/TEXTAREA&gt;&lt;/P&gt;\n &lt;INPUT TYPE=&quot;submit&quot;VALUE=&quot;Submit&quot;&gt;&lt;INPUT TYPE=&quot;reset&quot; VALUE=&quot;Reset&quot;&gt;\n &lt;/FORM&gt;\n</code></pre>\n"^^ . + . + . + . + "4"^^ . + . + . + . + "wkhtmltopdf options : How to handle Non-English file name across different OS systems"^^ . + . + "2"^^ . + . + "3"^^ . + . + . + . + . + . + "Just a quick follow-up [on my question here](https://stackoverflow.com/questions/79529345/how-to-trace-why-an-awaited-file-write-is-not-working-in-node-22). Your prompter note set me off on a new chain of investigation, and I found a file operation in a JS file that was triggered by an `import`, which meant it ran out of expected order. Oops! Thanks again for your help. (I'll leave the question deleted, as it is effectively Typo/NoRepro now.)"^^ . + . + "Laravel on Hostinger: "Missing Storage Symlink" & symlink() Not Working – Alternative Solutions?"^^ . + . + . + . + "1"^^ . + "How to split a string into chunks of 2, but make the last chunk 3 if it would be 1"^^ . + "Prior related question: https://stackoverflow.com/questions/79469776/how-to-install-runkit7"^^ . + . + . + . + . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "Usually, PHP does not use SSL directly to handle incoming requests. That's part of your webserver (usually Apache or nginx)"^^ . + "0"^^ . + . + "SQLSTATE[HY000] [2002] Connection refused web | web | web | In PDOConnection.php line 27: web | web | SQLSTATE[HY000] [2002] Connection refused"^^ . + . + . + . + . + . + . + . + . + "@jabaa I've seen it argued that duplicates _are_ helpful, as long as they are marked as such, because they widen the range of searches that would lead people to the right answer. In general, I think votes on questions are pretty arbitrary, and voting to _close_ is more helpful than voting _down_, because it comes with specific feedback and consequences. I'm not sure why someone voted this as "needs debugging details" though."^^ . + . + . + "phalcon"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + "2"^^ . + . + . + "1"^^ . + "I would also add that trying to get your ahead around all the extra networking and security stuff needed to make this happen is almost certainly an unnecessary distraction if you're only just learning PHP. Another reason to just get a free hosting account for now."^^ . + "Did you try sending `Content-Type: multipart/form-data` as a header?"^^ . + . + "0"^^ . + "0"^^ . + . + "Thanks, the Unexpected HTTP code: 403, so is that the DeepL server issue or at my end?"^^ . + "How to Validate Imported Dates in Excel to Check for Invalid or Non-Existent Dates"^^ . + . + "`pcre.backtrack_limit` and `pcre.recursion_limit` have nothing to do with the pattern size, so your code [still fails](https://3v4l.org/v8aGt). The pattern size limit is hard-coded in PCRE, you can't change it."^^ . + "How to get all elements inside body with PHP DomDocument"^^ . + . + . + "0"^^ . + . + . + "<p>I'm trying to upload a file to an API, that requires a multipart form upload.</p>\n<p>I don't want to store the file locally (I read it from an S3 bucket using flysystem) but I can'get it to work (always get a 422 error).</p>\n<p>When I store the file locally first, it works:</p>\n<pre><code>// $filecontent is data from Flysystem\n$fileContent = $this-&gt;documentStorage-&gt;read('remote filename.pdf');\n\nfile_put_contents(__DIR__.'/test.pdf', $fileContent);\n$fileHandle = fopen(__DIR__.'/test.pdf', 'rb');\n\n$params = [\n 'body' =&gt; [\n 'bestand' =&gt; $fileHandle\n ],\n];\n\n$response = $this-&gt;createClient()-&gt;request('POST', $url, $params);\n</code></pre>\n<p>I tried skipping the local save with a <code>php://memory</code> and <code>php://temp</code> stream, but that won't work:</p>\n<pre><code>$stream = fopen('php://temp', 'rb+');\nfwrite($stream, $fileContent);\nrewind($stream);\n\n$params = [\n 'body' =&gt; [\n 'bestand' =&gt; $stream\n ],\n ];\n\n$response = $this-&gt;createClient()-&gt;request('POST', $url, $params);\n</code></pre>\n<p>Tried manually making a multipart form, also doesn't work:</p>\n<pre><code>$dp = new DataPart($fileContent);\n$formData = new FormDataPart(['bestand' =&gt; $dp]);\n$preparedHeaders = $formData-&gt;getPreparedHeaders();\n\n$params = [\n 'body' =&gt; $formData-&gt;bodyToString(),\n 'headers' =&gt; [\n trim($preparedHeaders-&gt;toString())\n ],\n];\n\n$response = $this-&gt;createClient()-&gt;request('POST', $url, $params);\n</code></pre>\n"^^ . + "1"^^ . + . + . + "Didn't manage to come up with anything nicer than this, https://3v4l.org/dKVdQ"^^ . + . + . + . + . + . + . + . + "<p>PHP supports special naming, to indicate that multiple fields on form should be mapped into array on PHP side (<a href="https://www.php.net/manual/en/faq.html.php#faq.html.arrays" rel="nofollow noreferrer">https://www.php.net/manual/en/faq.html.php#faq.html.arrays</a>)</p>\n<p>so, in html:</p>\n<pre class="lang-html prettyprint-override"><code>&lt;form&gt;\n &lt;input id=&quot;a1&quot; name=&quot;a[]&quot;&gt;\n &lt;input id=&quot;a2&quot; name=&quot;a[]&quot;&gt;\n &lt;input id=&quot;a3&quot; name=&quot;a[]&quot;&gt;\n&lt;/form&gt;\n</code></pre>\n<p>then in php you can use</p>\n<pre class="lang-php prettyprint-override"><code>$sum = array_sum($_REQUEST['a']);\n</code></pre>\n"^^ . + . + . + "-1"^^ . + "1"^^ . + . + . + "<p>I am trying to run some PHP course projects in my Mac.</p>\n<p>I used XAMP, Homebrew, PHP local server, Docker and I keep getting 403 forbidden errors, I tried to mess with some file permissions but now in Homebrew httpd has some bootstrap errors, and some other errors, the thing is: it's not working.</p>\n<p>My question is: what's the way that people use to develop in this mac environment to run PHP, Apache, MySQL/MariaDB, Composer. I can't find a course to cover all these, just parts of them.</p>\n<p>edit :</p>\n<p>So, I redid everything more carefully.\nI managed to get same error, I don't know how (I managed to solve it).</p>\n<ul>\n<li><p>brew services start httpd\nBootstrap failed: 5: Input/output error Try re-running the command as root for richer errors. Error: Failure while executing; /bin/launchctl bootstrap gui/501 /Users/username/Library/LaunchAgents/homebrew.mxcl.httpd.plist exited with 5.</p>\n</li>\n<li><p>httpd -t\nAH00558: httpd: Could not reliably determine the server's fully qualified domain name, using username-macbook-air.local. Set the 'ServerName' directive globally to suppress this message Syntax OK</p>\n</li>\n<li><p>Here I changed my servername to localhost and errors are gone (httpd.conf)\n=&gt; environment : httpd in homebrew\nNow localhost is accessing my document root directory with the projects in it, it’s working (to access localhost, it sees all folders/files), but I tried to create a .htaccess file to redirect every request to index.php and is not working\nerror log is showing (/opt/homebrew/var/log/httpd/error_log) : AH01630: client denied by server configuration: /Users/username/Code/.htaccess</p>\n</li>\n<li><p>document root has allowoverride all and require all granted</p>\n</li>\n<li><p>httpd.conf : User username / Group staff (Here I didn't do anything more than just changing the names of user and group in that file, I don't know if I should add some Linux command to create the group or something)</p>\n</li>\n<li><p>I added these commands :</p>\n<ul>\n<li>sudo chmod -R 755 /Users/username/Code</li>\n<li>sudo chown -R $(whoami):staff /Users/username/Code</li>\n</ul>\n</li>\n<li><p>LoadModule rewrite_module lib/httpd/modules/mod_rewrite.so is uncommented\n=&gt; Error still exists, so the problem is that the htaccess file isn’t working\n=&gt; LATER EDIT : adding this as htaccess makes it work, I don't understand how but..\nDirectoryIndex index.php</p>\n<p>RewriteEngine On\nRewriteBase /</p>\n<p>RewriteCond %{REQUEST_FILENAME} -f [OR]\nRewriteCond %{REQUEST_FILENAME} -d\nRewriteRule ^ - [L]</p>\n<p>RewriteRule . index.php [L]</p>\n</li>\n</ul>\n<p>=&gt; something is off, I created a new virtualhost with directory at : /Users/user/Code/php/course/course-name/ at phpmvc.localhost and if I access it, it's accessing my /Users/user/Code folder, not the course-name folder.</p>\n<p>ps aux | grep httpd shows my username multiple times and root one time with this at the end : /opt/homebrew/opt/httpd/bin/httpd -D FOREGROUND ls -l (in projects folder) has my username (group staff) with drwxr-xr-x on folders and -rwxr-xr-x@ on files</p>\n"^^ . + . + "in file bootstrap/app.php I defined : ` if ( ! defined("ACCESS_PERMISSION_ADMIN")) { // can do all\n define("ACCESS_PERMISSION_ADMIN", 1); // Admin\n}\nif ( ! defined("ACCESS_PERMISSION_ADMIN_LABEL")) {\n define("ACCESS_PERMISSION_ADMIN_LABEL", 'Admin');\n} `\n Is it correct ?"^^ . + "0"^^ . + . + . + "1"^^ . + "0"^^ . + . + "<p>I have a script I'm building around a PHP transaction to update a couple of tables and insert into another simultaneously and then forward some posted form data on an email and I'm really struggling to figure out the error here. It's a rotator to identify the next in a queue to receive a lead and then update the records and email details over to a user.</p>\n<p>The function seems to work, it does update the various tables and insert a new record into the leads database, and it does email over the lead details, but it throws a 500 internal server error, I have php.ini reporting enabled and working (received plenty of error reports on other scripts for this site) but nothing is being logged. I suspect it is something to do with the Select statement that includes a JOIN and several WHERE arguments.</p>\n<pre><code>\n&lt;?php \n// Include config file\nrequire_once ($_SERVER[&quot;DOCUMENT_ROOT&quot;] . &quot;/partners/includes/config.php&quot;);\n\n$foo = $_POST['test'];\n$type = $_POST['enquiry_type'];\n$firstname = $_POST['first_name'];\n$secondname = $_POST['second_name'];\n$age = $_POST['applicant_age'];\n$number = $_POST['telephone_number'];\n$email = $_POST['email_address'];\n$value = $_POST['house_value'];\n$loan = $_POST['loan_amount'];\n$homeowner = $_POST['homeowner_status'];\n$credit = $_POST['credit_history'];\n$time = $_POST['enquiry_time'];\n\n// Mail header removal\nfunction remove_headers($string) { \n $headers = array(\n &quot;/to\\:/i&quot;,\n &quot;/from\\:/i&quot;,\n &quot;/bcc\\:/i&quot;,\n &quot;/cc\\:/i&quot;,\n &quot;/Content\\-Transfer\\-Encoding\\:/i&quot;,\n &quot;/Content\\-Type\\:/i&quot;,\n &quot;/Mime\\-Version\\:/i&quot; \n ); \n $string = preg_replace($headers, '', $string);\n return strip_tags($string);\n} \n\n// Pick up the cleaned form data\n$foo = remove_headers($_POST['test']);\n$type = remove_headers($_POST['enquiry_type']);\n$firstname = remove_headers($_POST['first_name']);\n$secondname = remove_headers($_POST['second_name']);\n$age = remove_headers($_POST['applicant_age']);\n$number = remove_headers($_POST['telephone_number']);\n$email = remove_headers($_POST['email_address']);\n$value = remove_headers($_POST['house_value']);\n$loan = remove_headers($_POST['loan_amount']);\n$homeowner = remove_headers($_POST['homeowner_status']);\n$credit = remove_headers($_POST['credit_history']);\n$time = remove_headers($_POST['enquiry_time']);\n\n$date = date('y-m-d h:i:s', time());\n$to = &quot;&quot;;\n\n//Test hidden form field for content, assumed spam if completed. \nif (empty($foo)) {\n \nmysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);\n\n// Find users that are switched on, and the firm switched on, then brings the one logged on the longest, and who has waited the most for a lead\n\n$sql_find_email = &quot;SELECT users.username, users.id, users.time_last_lead, users.firm_fca, firms.credit_number FROM users JOIN firms ON firms.main_fca = users.firm_fca WHERE users.switched_on='1' AND firms.credit_number &gt;=10 AND firms.switched_on_firm='1' ORDER BY users.time_last_lead LIMIT 1&quot;; \n\n//Find the next lead recipient\n$find_email_result = mysqli_query($link, $sql_find_email);\n \n$email_to_use = mysqli_fetch_array($find_email_result);\n \n//FCA number of the users firm to enable us to link the charge to the firm \n \n$firm_fca = $email_to_use['firm_fca'];\n \n//Amount of leads credit that firm has remaining \n \n$firm_credit = $email_to_use['credit_number'];\n \n$username = $email_to_use['username'];\n \n//Check if the email array has rows, and if not, forward to Rightmortgageadice.co.uk. Update user with timestamp for last lead issue\nif(mysqli_num_rows($find_email_result) &gt; 0){\n \n $user_id = $email_to_use['id'];\n \n //Timestamp user record to enable auto rotation\n \n $sql_add_lead_timestamp = &quot;UPDATE users SET time_last_lead=? WHERE id =?&quot;;\n \n $sql_update_firm_credit = &quot;UPDATE firms SET credit_number =? WHERE main_fca=?&quot;;\n \n //Create a lead record for invoices\n \n $sql_add_lead_record = &quot;INSERT INTO leads (user_id, firm_fca, lead_type, first_name, second_name, age, tel_number, email_address, house_value, loan_amount, home_owner, credit_history, response_time, time_stamp) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)&quot;;\n\n mysqli_begin_transaction($link);\n\n try {\n $stmt = mysqli_prepare($link, $sql_add_lead_record);\n \n mysqli_stmt_bind_param($stmt, &quot;iisssissiissss&quot;, $param_user_id, $param_firm_fca, $param_lead_type, $param_first_name, $param_second_name, $param_age, $param_tel_number, $param_email_address, $param_house_value, $param_loan_amount, $param_home_owner, $param_credit_history, $param_response_time, $param_time_stamp );\n \n // Set parameters\n \n $param_user_id = $user_id;\n $param_firm_fca = $firm_fca;\n $param_firm_credit = ($firm_credit)-10;\n $param_lead_type = trim($_POST[&quot;enquiry_type&quot;]);\n $param_first_name = trim($_POST[&quot;first_name&quot;]);\n $param_second_name = trim($_POST[&quot;second_name&quot;]);\n $param_age = trim($_POST[&quot;applicant_age&quot;]);\n $param_tel_number = trim($_POST[&quot;telephone_number&quot;]);\n $param_email_address = trim($_POST[&quot;email_address&quot;]);\n $param_house_value = trim($_POST[&quot;house_value&quot;]);\n $param_loan_amount = trim($_POST[&quot;loan_amount&quot;]);\n $param_home_owner = trim($_POST[&quot;homeowner_status&quot;]);\n $param_credit_history = trim($_POST[&quot;credit_history&quot;]);\n $param_response_time = trim($_POST[&quot;enquiry_time&quot;]);\n $param_time_stamp = $date;\n\n $stmt2 = mysqli_prepare($link, $sql_add_lead_timestamp);\n mysqli_stmt_bind_param($stmt2, &quot;ss&quot;, $param_time_stamp, $param_user_id);\n\n $stmt3 = mysqli_prepare($link, $sql_update_firm_credit);\n mysqli_stmt_bind_param($stmt3, &quot;ii&quot;, $param_firm_credit, $param_firm_fca);\n\n // Execute\n mysqli_stmt_execute($stmt);\n mysqli_stmt_execute($stmt2);\n mysqli_stmt_execute($stmt3);\n // set the advisers email if statements execute correctly\n $to = 'example@email.com';\n mysqli_commit($link);\n } catch (mysqli_sql_exception $exception) {\n mysqli_rollback($link);\n throw $exception;\n } \n}\nelse {\n$to = 'example@email.com' ;\n}\n\n \n// Build the email (replace the address in the $to section with your own) \n$subject = &quot;New message AMENDED: $firstname $number&quot;;\n$message = &quot;\n$type\n$username\n$firstname\n$secondname\n$number\n$age\n$email\n$value\n$loan\n$homeowner\n$credit\n$time\n$firm_fca\n$firm_credit\n&quot;;\n$headers = &quot;From:example@email.com&quot;;\n// Send the mail using PHPs mail() function\nmail($to, $subject, $message, $headers);\nmysqli_free_result($find_email_result, $stmt);\nmysqli_close($link);\n// Redirect\nheader(&quot;location: https://www.google.com&quot;);\n}\n//Foo is not empty, must be spam \nelse if (!empty($foo)) {\nheader(&quot;location: https://www.yahoo.com&quot;); \n}\n\n\n?&gt;\n</code></pre>\n<p>I was expecting to get an error report that would give me a clue as to where this is going wrong, but I just get an internal server error warning and cannot figure out why.</p>\n<p>PHP ini is set up and working. The address for the error report is obviously correct on the actual file itself</p>\n<pre><code>error_reporting = E_ALL;\nlog_errors = On;\ndisplay_errors = On;\nerror_log = /php-errors.log; \n</code></pre>\n"^^ . + . + . + . + . + . + . + . + "Thanks for your attention. I tried your code and it works exactly as needed. However it's 30% slower than my original code. I tried executing your code 1 milllion times on this string of example `aabb aaaa cddcc 5555 77.66 pp xxg llx xxl`"^^ . + "1"^^ . + . + "0"^^ . + . + . + "4"^^ . + "3"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + "buffer"^^ . + "<p>Ensure that <code>queryVars</code> is updated correctly after filtering AND Fix pagination in the filtered query.</p>\n<p>First, you can update JavaScript to Reset Pagination After Filtering:</p>\n<pre><code>$.ajax({\n url: woocommerce_params.ajax_url,\n data: filterData,\n method: 'POST',\n success: function(data) {\n productList.html(data.html);\n currentPage = 1;\n queryVars = data.query_vars;\n }\n});\n</code></pre>\n<p>Then Modify the PHP <code>mev_load_more_products</code> function like:</p>\n<pre><code>function mev_load_more_products() {\n $args = json_decode(stripslashes($_POST['query']), true);\n $args['paged'] = isset($_POST['page']) ? $_POST['page'] + 1 : 1;\n $args['post_status'] = 'publish';\n\n // Add tax_query\n if (isset($_POST['filters']) &amp;&amp; isset($_POST['filters']['category'])) {\n $filters = $_POST['filters'];\n if (!isset($args['tax_query'])) {\n $args['tax_query'] = [];\n }\n if (isset($filters['category'])) {\n $args['tax_query'][] = [\n 'taxonomy' =&gt; 'product_cat',\n 'field' =&gt; 'slug',\n 'terms' =&gt; $filters['category'],\n 'operator' =&gt; 'IN',\n ];\n }\n }\n\n $query = new WP_Query($args);\n\n if ($query-&gt;have_posts()) {\n while ($query-&gt;have_posts()) {\n $query-&gt;the_post();\n get_template_part('woocommerce/content', 'product');\n }\n }\n die();\n}\nadd_action('wp_ajax_load_more_products', 'mev_load_more_products');\nadd_action('wp_ajax_nopriv_load_more_products', 'mev_load_more_products');\n</code></pre>\n<p>Finally, make sure you clear the cache every time.</p>\n"^^ . + . + . + . + . + . + . + "I solved the trouble by placing /usr/bin at the beginning of the $PATH variable"^^ . + . + . + "0"^^ . + "`I cant currently edit my OP`...why? You should be able to [edit] anytime"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "0"^^ . + "<p>I have installed PHP Remi on Red Hat 9 . when I am trying to install PHP gd extension for PHP remi 8.3 then getting <code>package php-gd-8.3.17-1.el9.remi.x86_64 from remi-modular requires libgd.so.103()(64bit)</code> error; Same error happen for also remi PHP 8.2.</p>\n<p><strong>Here the error log:</strong></p>\n<pre><code>[xxx@xxx yum.repos.d]$ sudo yum --enablerepo=remi install php-gd\nUpdating Subscription Management repositories.\nUnable to read consumer identity\n\nThis system is not registered with an entitlement server. You can use &quot;rhc&quot; or &quot;subscription-manager&quot; to register.\n\nLast metadata expiration check: 1:24:25 ago on Mon 03 Mar 2025 05:57:44 AM CET.\nError:\n Problem: package php-gd-8.3.17-1.el9.remi.x86_64 from remi-modular requires libgd.so.103()(64bit), but none of the providers can be installed\n - cannot install the best candidate for the job\n - nothing provides libraqm.so.0()(64bit) needed by gd3php-2.3.3-8.el9.remi.x86_64 from remi\n - nothing provides libimagequant.so.0()(64bit) needed by gd3php-2.3.3-8.el9.remi.x86_64 from remi\n - nothing provides libavif.so.14()(64bit) needed by gd3php-2.3.3-8.el9.remi.x86_64 from remi\n - nothing provides libraqm.so.0()(64bit) needed by gd3php-2.3.3-9.el9.remi.x86_64 from remi\n - nothing provides libimagequant.so.0()(64bit) needed by gd3php-2.3.3-9.el9.remi.x86_64 from remi\n - nothing provides libraqm.so.0()(64bit) needed by gd3php-2.3.3-8.el9.remi.x86_64 from remi-safe\n - nothing provides libimagequant.so.0()(64bit) needed by gd3php-2.3.3-8.el9.remi.x86_64 from remi-safe\n - nothing provides libavif.so.14()(64bit) needed by gd3php-2.3.3-8.el9.remi.x86_64 from remi-safe\n - nothing provides libraqm.so.0()(64bit) needed by gd3php-2.3.3-9.el9.remi.x86_64 from remi-safe\n - nothing provides libimagequant.so.0()(64bit) needed by gd3php-2.3.3-9.el9.remi.x86_64 from remi-safe\n(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)\n</code></pre>\n<p>Please note i have multiple version install on this redhat but only one version is active at time</p>\n<pre><code>[xxx@xxxx yum.repos.d]$ sudo dnf module list php\n[sudo] password for abera:\nUpdating Subscription Management repositories.\nUnable to read consumer identity\n\nThis system is not registered with an entitlement server. You can use &quot;rhc&quot; or &quot;subscription-manager&quot; to register.\n\nLast metadata expiration check: 1:46:52 ago on Mon 03 Mar 2025 05:50:52 AM CET.\nRemi's Modular repository for Enterprise Linux 9 - x86_64\nName Stream Profiles Summary\nphp remi-7.4 common [d], devel, minimal PHP scripting language\nphp remi-8.0 common [d], devel, minimal PHP scripting language\nphp remi-8.1 common [d], devel, minimal PHP scripting language\nphp remi-8.2 common [d], devel, minimal PHP scripting language\nphp remi-8.3 [e] common [d] [i], devel, minimal PHP scripting language\nphp remi-8.4 common [d], devel, minimal PHP scripting language\n\nml-rhel9-dev-RHEL 9 x86_64 Appstream\nName Stream Profiles Summary\nphp 8.1 common [d], devel, minimal PHP scripting language\nphp 8.2 common [d], devel, minimal PHP scripting language\n\n</code></pre>\n<p>also, install trying to install some lib using gd error log</p>\n<p>Like:</p>\n<pre><code>sudo dnf search libraqm\nsudo dnf search libimagequant\nsudo dnf search libavif\n</code></pre>\n<p>but same error happen . Can anyone help me to fix the error on PHP remi 8.2 gd extension</p>\n"^^ . + "0"^^ . + "dpkg --print-architecture\namd64\nI think that's the issue"^^ . + . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + . + "1"^^ . + . + "2"^^ . + "1"^^ . + . + . + . + "1"^^ . + "laravel-nova"^^ . + "<p>I have also came up with approach when I am deleting all records (all steps) and inserting them:</p>\n<pre><code>if ($this-&gt;recipeId != 0) {\n GuideStep::where('recipe_id', $recipeId)-&gt;delete();\n}\n GuideStep::insert($groupedSteps);\n</code></pre>\n<p>What do you think?</p>\n"^^ . + "3"^^ . + . + . + "Thanks, this seems to have worked, but getting another issue now, I have updated my question."^^ . + . + "0"^^ . + . + . + . + "Datasource class could not be found"^^ . + "crm"^^ . + "Thanks swawge, however, I had a the fix from all of the above, just did not have time to update this item."^^ . + . + "1"^^ . + "1"^^ . + "<p>If you are loading the posts and pagination via ajax, then your pagination links need have listeners attached to them that make ajax calls of their own. Right now, it appears you are loading normal pagination links, and that's not how your page is designed to work.</p>\n<p>Three steps:</p>\n<ol>\n<li>Add a 'paged' variable to the data object in your ajax call so that this information is passed to your php function.</li>\n<li>Adjust your php function so that it outputs custom pagination links</li>\n<li>Add new javascript that listens for clicks on these links and makes your ajax call with the paged variable set appropriately</li>\n</ol>\n<p>EDIT:\nOn second thought, you don't need step two as you can probably attach your event and gather the page information from the links as they are.</p>\n"^^ . + "<p>I have a model for <code>Product</code> and a related <code>ProductAsset</code> model for images, videos or documents related to the product. What I want to achieve is to let the user upload the main image as a product asset (flag <code>is_primary=true</code>) in the same form as the rest of the information.</p>\n<p>Here is my Product model:</p>\n<pre><code> namespace App\\Models;\n \n use Illuminate\\Database\\Eloquent\\Model;\n \n class Product extends Model\n {\n protected $fillable = [\n 'name',\n 'description',\n 'is_active',\n 'category_id',\n ];\n \n public function menus()\n {\n return $this-&gt;belongsToMany(Catalog::class);\n }\n \n public function category()\n {\n return $this-&gt;belongsTo(Category::class);\n }\n \n public function assets()\n {\n return $this-&gt;hasMany(ProductAsset::class);\n }\n \n public function allergens()\n {\n return $this-&gt;belongsToMany(Allergen::class);\n }\n \n public function mainImage()\n {\n return $this-&gt;assets()-&gt;where('is_primary', true)-&gt;first();\n }\n }\n</code></pre>\n<p>And my ProductAsset model:</p>\n<pre><code> namespace App\\Models;\n \n use Illuminate\\Database\\Eloquent\\Model;\n \n class ProductAsset extends Model\n {\n protected $fillable = [\n 'name',\n 'type',\n 'path',\n 'is_primary',\n 'product_id',\n ];\n \n public function product()\n {\n return $this-&gt;belongsTo(Product::class);\n }\n }\n</code></pre>\n<p>In my Filament/Resources/ProductResource.php, I have the following in the <code>form()</code> method:</p>\n<pre><code> public static function form(Form $form): Form\n {\n return $form\n -&gt;columns(12)\n -&gt;schema([\n Group::make()-&gt;schema([\n FileUpload::make('image')\n -&gt;label('Imagen')\n -&gt;avatar()\n -&gt;placeholder(function ($record) {\n if ($record &amp;&amp; $record-&gt;mainImage()) {\n $main_image = $record-&gt;mainImage();\n $imagePath = asset(&quot;/storage/&quot; . $main_image-&gt;path);\n return &lt;&lt;&lt;HTML\n &lt;img src=&quot;$imagePath&quot; alt=&quot;Imagen principal&quot; class=&quot;cropper-crop-box&quot;&gt;\n HTML;\n }\n })\n -&gt;required(),\n ])\n -&gt;columnSpan(2),\n Group::make()-&gt;schema([\n TextInput::make('name')\n -&gt;label('Nombre')\n -&gt;required(),\n Textarea::make('description')\n -&gt;label('Descripción')\n -&gt;required(),\n Select::make('category_id')\n -&gt;label('Categoría')\n -&gt;relationship(name: 'category', titleAttribute: 'name')\n -&gt;required(),\n Toggle::make('is_active')\n -&gt;default(true)\n -&gt;label('Activo'),\n ])\n -&gt;columnSpan(10),\n ]);\n }\n</code></pre>\n<p>So, in the Filament/Resources/CreateProduct.php I handle the file using the <code>mutateFormDataBeforeCreate()</code> and <code>afterCreate()</code> method:</p>\n<pre><code> protected function mutateFormDataBeforeCreate(array $data): array\n {\n $main_image = $data['image'];\n unset($data['image']);\n\n $this-&gt;creatingProductAsset = $main_image;\n\n return $data;\n }\n\n protected function afterCreate()\n {\n if ($this-&gt;creatingProductAsset) {\n ProductAsset::create([\n 'name' =&gt; 'Imagen principal',\n 'type' =&gt; 'image',\n 'path' =&gt; $this-&gt;creatingProductAsset,\n 'product_id' =&gt; $this-&gt;record-&gt;id,\n 'is_primary' =&gt; true, // \n ]);\n }\n }\n</code></pre>\n<p>So far so good! My image is uploading, and the related record is created successfully.</p>\n<p>Here is the problem: when I enter the view/edit page, it'll show the image as a placeholder but it won't attatch the value to the field. Of course, I won't be able to save changes until I upload a new one. That's logic since I'm showing the actual image as a placeholder instead of loading it into the field's state.</p>\n<p>Now, my question is, how do I bind the already uploaded image as the field value so the record can be updated without uploading a new one? How should I use the <code>-&gt;afterStateHydrated</code> method in the field to link the actual image instead of showing it as a placeholder?</p>\n<p>Than you all in advance!</p>\n"^^ . + . + "0"^^ . + . + . + "With `"rules" => []` in all of these elements, that foreach loop shouldn't iterate at all - the actual variable at run-time must be containing something else."^^ . + "0"^^ . + . + "1"^^ . + . + "0"^^ . + "oop"^^ . + . + . + . + . + . + "@geertjanknapen It does look like it but I couldn't find anything related to it online or while searching in vendors related to validation"^^ . + . + "0"^^ . + "1"^^ . + . + . + "0"^^ . + "0"^^ . + . + "Type should be whatever you need it to be. Varchar should be fine with what you have. The issue most likely somewhere else. Are you getting an error message? Please read [ask] and how to create a [mcve], as we'll need to see your code to help you."^^ . + . + "0"^^ . + . + "3"^^ . + "You could write some code to check that the loading/saving gives the same HTML as the original for all your files (assuming you have only lower-case tags)."^^ . + . + "<p>Use built in php function <a href="https://www.php.net/manual/en/function.checkdate.php" rel="nofollow noreferrer"><code>checkdate()</code></a></p>\n<pre><code>&lt;?php\n$date = explode('-','31-02-2025');\nvardump(checkdate($date[1],$date[0],$date[2]);\n/* bool(false) */\n\nvardump(checkdate(2,28,2025));\n/* 28-02-2025 =&gt; bool(true) */\n</code></pre>\n"^^ . + "<p>I'm developing a Telegram bot using core PHP, and I'm encountering an issue where the bot's /kill command runs indefinitely due to slow responses from an external API.Its take 25sec for two times loop. I need help to handle this situation without using job scheduling and while using a simple JSON file for data storage.</p>\n<pre><code> if (strpos($text, '/kill') === 0 || strpos($text, '.kill') === 0) {\n // Start timing\n $start_time = microtime(true);\n \n $uData = getUser($user_id);\n \n if (!$uData) {\n $error = &quot;✧ ʀᴇɢɪsᴛʀᴀᴛɪᴏɴ ✧\\n\\n&quot;;\n $error .= &quot;⟣ sᴛᴀᴛᴜs : ɴᴏᴛ ʀᴇɢɪsᴛᴇʀᴇᴅ\\n&quot;;\n $error .= &quot;⟣ ᴀᴄᴛɪᴏɴ : ᴜsᴇ /register ғɪʀsᴛ\\n&quot;;\n $error .= &quot;━━━━━━━━━━━━━━━━&quot;;\n \n sendStyledMessage($chat_id, $error, [\n 'inline_keyboard' =&gt; [\n [\n ['text' =&gt; ' ʀᴇɢɪsᴛᴇʀ', 'callback_data' =&gt; 'register'],\n ['text' =&gt; ' ʙᴜʏ ᴄʀᴇᴅɪᴛs', 'url' =&gt; 'https://t.me/'.OWNER_USERNAME]\n ]\n ]\n ], $message_id, 'HTML');\n return true;\n }\n \n try {\n $credits = getUserCredits($user_id);\n if ($credits &lt; 1) {\n $no_credits = &quot;✧ ɴᴏ ᴄʀᴇᴅɪᴛs ✧\\n\\n&quot;;\n $no_credits .= &quot;⟣ sᴛᴀᴛᴜs : ɪɴsᴜғғɪᴄɪᴇɴᴛ ᴄʀᴇᴅɪᴛs\\n&quot;;\n $no_credits .= &quot;⟣ ᴀᴄᴛɪᴏɴ : ʙᴜʏ ᴏʀ ʀᴇᴅᴇᴇᴍ ᴄʀᴇᴅɪᴛs\\n&quot;;\n $no_credits .= &quot;━━━━━━━━━━━━━━━━&quot;;\n \n sendStyledMessage($chat_id, $no_credits, [\n 'inline_keyboard' =&gt; [\n [\n ['text' =&gt; ' ʙᴜʏ ᴄʀᴇᴅɪᴛs', 'url' =&gt; 'https://t.me/'.OWNER_USERNAME]\n ]\n ]\n ], $message_id, 'HTML');\n return true;\n }\n \n $prefix = (strpos($text, '/kill') === 0) ? '/kill ' : '.kill ';\n $card_data = substr($text, strlen($prefix));\n $card_data = trim($card_data);\n \n if (empty($card_data)) {\n $invalid = &quot;✧ ɪɴᴠᴀʟɪᴅ ғᴏʀᴍᴀᴛ ✧\\n\\n&quot;;\n $invalid .= &quot;⟣ sᴛᴀᴛᴜs : ғᴏʀᴍᴀᴛ ᴇʀʀᴏʀ\\n&quot;;\n $invalid .= &quot;⟣ ғᴏʀᴍᴀᴛ : /kill cc|mm|yy|cvv\\n&quot;;\n $invalid .= &quot;━━━━━━━━━━━━━━━━&quot;;\n \n sendStyledMessage($chat_id, $invalid, null, $message_id, 'HTML');\n return true;\n }\n \n // Parse card data from various formats to extract the card number\n $cc = '';\n \n // Remove any text labels like &quot;Card:&quot;, &quot;Exp. month:&quot;, etc.\n $card_data = preg_replace('/Card:?\\s*|Exp\\.?\\s*(?:month|date):?\\s*|Exp\\.?\\s*(?:year):?\\s*|CVV:?\\s*/i', '', $card_data);\n \n // Extract card number from various formats\n if (preg_match('/^(\\d{13,19})\\|/', $card_data, $matches) || \n preg_match('/^(\\d{13,19})\\//', $card_data, $matches) || \n preg_match('/^(\\d{13,19})\\s+/', $card_data, $matches) || \n preg_match('/^(\\d{13,19})$/', $card_data, $matches)) {\n $cc = $matches[1];\n } else {\n // Try to find any 13-19 digit number in the input\n preg_match_all('/\\d+/', $card_data, $numbers);\n foreach ($numbers[0] as $num) {\n if (strlen($num) &gt;= 13 &amp;&amp; strlen($num) &lt;= 19) {\n $cc = $num;\n break;\n }\n }\n }\n \n // Validate extracted card number\n if (empty($cc) || !is_numeric($cc) || strlen($cc) &lt; 13 || strlen($cc) &gt; 19) {\n $invalid_card = &quot;✧ ɪɴᴠᴀʟɪᴅ ᴄᴀʀᴅ ✧\\n\\n&quot;;\n $invalid_card .= &quot;⟣ sᴛᴀᴛᴜs : ɪɴᴠᴀʟɪᴅ ᴄᴀʀᴅ ɴᴜᴍʙᴇʀ\\n&quot;;\n $invalid_card .= &quot;⟣ ʀᴇᴀsᴏɴ : ᴄʜᴇᴄᴋ ᴄᴀʀᴅ ғᴏʀᴍᴀᴛ\\n&quot;;\n $invalid_card .= &quot;━━━━━━━━━━━━━━━━&quot;;\n \n sendStyledMessage($chat_id, $invalid_card, null, $message_id, 'HTML');\n return true;\n }\n \n $delays = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0];\n $random_delay = $delays[array_rand($delays)];\n \n $newBalance = $credits - 1;\n\n \n updateUserCredits($user_id, $newBalance);\n\n $processing_msg = sendStyledMessage($chat_id, &quot;✧ ᴘʀᴏᴄᴇssɪɴɢ ✧\\n\\n⟣ sᴛᴀᴛᴜs : ᴋɪʟʟɪɴɢ ᴄᴀʀᴅ\\n━━━━━━━━━━━━━━━━&quot;, null, $message_id, 'HTML');\n $processing_msg_id = $processing_msg['result']['message_id'];\n \n // First loop - 3 times with random month/year/cvv\n // Set a maximum execution time for the first loop\n $max_first_loop_time = 30; // 30 seconds max for first loop\n $first_loop_start = microtime(true);\n \n for ($i = 1; $i &lt;= 2; $i++) {\n // Check if we've exceeded the maximum time for the first loop\n if (microtime(true) - $first_loop_start &gt; $max_first_loop_time) {\n logDebug(&quot;First loop timeout&quot;, &quot;First loop exceeded maximum time of $max_first_loop_time seconds&quot;);\n break;\n }\n \n $random_month = sprintf(&quot;%02d&quot;, rand(1, 12));\n $random_year = rand(25, 39);\n $random_cvv = sprintf(&quot;%03d&quot;, rand(100, 999));\n \n $ch = curl_init();\n $url = &quot;https://example.com/chk.php&quot;;\n curl_setopt($ch, CURLOPT_URL, $url . &quot;?lista=&quot; . urlencode(&quot;$cc|$random_month|$random_year|$random_cvv&quot;));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n // Add strict timeout to prevent API hanging\n curl_setopt($ch, CURLOPT_TIMEOUT, 10);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n $response = curl_exec($ch);\n \n // Check if the request timed out or had an error\n if (curl_errno($ch)) {\n logDebug(&quot;API Request Error in first loop&quot;, curl_error($ch));\n // Continue to next iteration instead of breaking\n }\n \n $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n \n usleep($random_delay * 1000000);\n }\n \n // Send completion message after first loop\n $end_time = microtime(true);\n $execution_time = round($end_time - $start_time, 2);\n \n // Generate random values for the final display\n $final_month = sprintf(&quot;%02d&quot;, rand(1, 12));\n $final_year = rand(25, 39);\n $final_cvv = sprintf(&quot;%03d&quot;, rand(100, 999));\n\n // Try to delete the processing message, but don't fail if it doesn't work\n try {\n makeRequest('deleteMessage', [\n 'chat_id' =&gt; $chat_id,\n 'message_id' =&gt; $processing_msg_id\n ]);\n } catch (Exception $e) {\n logDebug(&quot;Delete Message Exception&quot;, $e-&gt;getMessage());\n }\n \n $final_text = &quot;✧ ᴄᴀʀᴅ ᴋɪʟʟᴇʀ ✧\\n\\n&quot;;\n $final_text .= &quot;⟣ ᴄᴀʀᴅ : &quot; . $cc . '|' . $final_month . '|' . $final_year . '|' . $final_cvv . &quot;\\n&quot;;\n $final_text .= &quot;⟣ sᴛᴀᴛᴜs : ᴋɪʟʟᴇᴅ\\n&quot;;\n $final_text .= &quot;⟣ ʀᴇsᴘᴏɴsᴇ : sᴜᴄᴄᴇssғᴜʟʟʏ ᴋɪʟʟᴇᴅ\\n&quot;;\n $final_text .= &quot;⟣ ᴛɪᴍᴇ : &quot; . $execution_time . &quot;s\\n\\n&quot;;\n $final_text .= &quot;⌁ ᴋɪʟʟᴇᴅ ʙʏ : @&quot; . $username . &quot;\\n&quot;;\n $final_text .= &quot;━━━━━━━━━━━━━━━━&quot;;\n \n sendStyledMessage($chat_id, $final_text, null, $message_id, 'HTML');\n \n // Second loop - limited to 4 times with timeout protection\n // Set a maximum execution time for the second loop\n $max_second_loop_time = 50; // 50 seconds max for second loop\n $second_loop_start = microtime(true);\n \n for ($i = 1; $i &lt;= 4; $i++) {\n // Check if we've exceeded the maximum time for the second loop\n if (microtime(true) - $second_loop_start &gt; $max_second_loop_time) {\n logDebug(&quot;Second loop timeout&quot;, &quot;Second loop exceeded maximum time of $max_second_loop_time seconds&quot;);\n break;\n }\n \n $random_month = sprintf(&quot;%02d&quot;, rand(1, 12));\n $random_year = rand(25, 39);\n $random_cvv = sprintf(&quot;%03d&quot;, rand(100, 999));\n \n $ch = curl_init();\n $url = &quot;https://example/chk.php&quot;;\n curl_setopt($ch, CURLOPT_URL, $url . &quot;?lista=&quot; . urlencode(&quot;$cc|$random_month|$random_year|$random_cvv&quot;));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n // Add strict timeout to prevent API hanging\n curl_setopt($ch, CURLOPT_TIMEOUT, 10);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n $response = curl_exec($ch);\n \n // Check if the request timed out or had an error\n if (curl_errno($ch)) {\n logDebug(&quot;API Request Error in second loop&quot;, curl_error($ch));\n // Continue to next iteration instead of breaking\n }\n \n curl_close($ch);\n \n // Add a small delay between requests\n usleep($random_delay * 1000000);\n }\n \n return true;\n \n } catch (Exception $e) {\n $error_text = &quot;✧ ᴇʀʀᴏʀ ✧\\n\\n&quot;;\n $error_text .= &quot;⟣ sᴛᴀᴛᴜs : ᴘʀᴏᴄᴇss ғᴀɪʟᴇᴅ\\n&quot;;\n $error_text .= &quot;⟣ ʀᴇᴀsᴏɴ : &quot; . $e-&gt;getMessage() . &quot;\\n&quot;;\n $error_text .= &quot;━━━━━━━━━━━━━━━━&quot;;\n \n sendStyledMessage($chat_id, $error_text, null, $message_id, 'HTML');\n logDebug(&quot;kill Command Exception&quot;, $e-&gt;getMessage());\n return false;\n }\n }\n</code></pre>\n<p>The /kill command in my Telegram bot is designed to loop through an external API to process card data. However, due to slow responses from the API, the loop runs indefinitely, causing the bot to hang. I need a solution to handle this situation without using job scheduling and while using a simple JSON file for data storage.</p>\n"^^ . + . + . + . + . + . + . + . + "3"^^ . + . + . + . + . + "-1"^^ . + "1"^^ . + . + "<p>As well as setting any <em>extension-specific</em> settings in php.ini, you need to tell PHP to <em>load the extension itself</em> using <a href="https://www.php.net/manual/en/ini.core.php#ini.extension" rel="nofollow noreferrer">the <code>extension</code> or <code>zend_extension</code> directives</a>. The first is for &quot;normal&quot; extensions, the second is for those which hook deeply into the engine, such as debuggers.</p>\n<p>The exact naming can vary a bit, but I think the standard names will be:</p>\n<pre><code>; Linux / Unix-like systems\nextension=runkit7.so\n; Windows\nextension=php_runkit7.dll\n</code></pre>\n"^^ . + . + . + . + "No one types in such a URL, it's pointless to assume that. In this case, the route is incorrect. But you can also create a redirect by removing the file extension. If example.com/product exists, you can trim the file extension from example.com/product.php."^^ . + . + . + . + . + "1"^^ . + . + "2"^^ . + . + "Anyway it looks like this data might have been HTML-encoded 3 times - if we decode it enough times we eventually get to the result you're expecting - demo: https://3v4l.org/QkKSu . So maybe the root of this issue is actually multiple re-encoding of the data somewhere - presumably when it's being edited/saved. Of course this is nothing to do with Excel or mysql, or even emojis"^^ . + "Just understanding that each of these projects uses a separate vendor directory in its life cycle should be enough of an argument that this is indeed a redundant waste of disk space, because it is the same set of data. And considering the size of the vendor directory for the entire package, this is an appalling waste. Saying "oh, it's only 5 MB", after all a 1 TB drive is cheap, is not a solution. Just like saying why do you need an engine with more than 30% efficiency, after all fuel is cheap, you can buy 100 liters for pennies."^^ . + . + "...because it only is intended to include global variables, not all variables. Are you asking why the wording is like that, or why that design decision was made? I would say...why would you _want_ a variable that referenced _all_ variables from all scopes? And actually how would that work in practice? If I define a variable in my function, I don't want it also available in another function."^^ . + . + . + . + "0"^^ . + . + . + . + . + . + "-2"^^ . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + "Laravel 12 custom form request is not returning errors, but only status code 500 and redirects to /"^^ . + "<p>I'm attempting to create a fuction that programatically creates a product when a post is created. I can't figure out how to associate the post's thumbnail image with the product image. (If I attach the image to the post content, it will appear in the product description, but that doesn't set it to display in the product grid.)</p>\n<p>I'm a visual artist using Wordpress for both a portfolio archive and an ecommerce platform. It's been ages since I've delved into the wordpress code and WC is even more complicated.</p>\n<p>I'm using code based on this post: <a href="https://stackoverflow.com/questions/56378327/create-a-woocommerce-product-with-the-same-name-when-a-custom-post-type-is-publi">Create a WooCommerce product with the same name when a custom post type is published</a></p>\n<p>This is the current code that is creating and publishing products, but does not associate the image id with the product:</p>\n<pre><code>/* create product on post -- */\n\nadd_action( 'publish_post', 'auto_create_product_from_post', 100, 2 );\nfunction auto_create_product_from_post($id, $post){\n // Create an empty instance of the WC_Product\n $product = new WC_Product_Simple(); // &lt;=== Simple product\n\n $product-&gt;set_name( $post-&gt;post_title );\n $product-&gt;set_status( $post-&gt;post_status );\n $product-&gt;set_description( $post-&gt;post_content ); // (optional)\n $product-&gt;set_short_description( $post-&gt;post_excerpt ); // (optional)\n $product-&gt;set_gallery_image_ids(21741); // sets the 'back of print' example image to product gallery\n// $product-&gt;set_image_id( xxx ?what variable? xxx ); // the part that's stumping me\n\n\n // You can use any available WC_Product methods to set other properties\n // see: https://docs.woocommerce.com/wc-apidocs/class-WC_Product.html\n\n $product-&gt;save(); // Save (publish) new product\n}\n</code></pre>\n<p>I have tried, to no avail:</p>\n<pre><code>$image = get_post_thumbnail_id( $post-&gt;ID );\n</code></pre>\n<pre><code>$image = get_attached_media( 'image', $post-&gt;ID );\n</code></pre>\n<p>WordPress 6.7.2, WooCommerce 9.7.0 on a development site with PHP 8.2.x</p>\n"^^ . + "How did you implement sending large files with that API? This information is totally missing from your question. Some APIs, even on the binary level, do not have support for files of 2GB and greater (singed 32bit integers). Does this really needs to be tagged Nginx?"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + "Freescout email notification sending problem with htmlspecialchars"^^ . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + "0"^^ . + "Or are you saying the opposite - is the image from the front camera too big, so that it fails due to PHP upload size limits?"^^ . + "0"^^ . + "Just another little question. is it right to write the count() method in the number controller or is better to make a new controller for that method?"^^ . + "0"^^ . + "source-code-protection"^^ . + . + "Try encoding non alphanumeric characters except .(dot), _(underscore) and -(hyphen) in client secret."^^ . + . + "1"^^ . + . + "Thanks, I'll give those a shot. The issue with #2 is that that OIDC_URL is used for browser redirects (GET) to the authorize endpoint as well as POST. The browser on my Mac won't take host.docker.internal and point to my other web app. I would either need to configure that somehow or write a wrapper class to change behavior on that library."^^ . + . + "according to [quick benchmark](https://www.programiz.com/online-compiler/4Umikr34VZiGq) - simple sum is 3 times faster"^^ . + "1"^^ . + . + . + "<p>I have this class:</p>\n<pre><code>namespace App\\Infrastructure\\Services;\n\nuse Doctrine\\ORM\\EntityManagerInterface;\n\nuse App\\Entity\\MyModel\n\nclass FetchResultFromDb \n{\n\n public function __construct(public EntityManagerInterface $entityManager)\n {\n }\n\n\n public function getEarliestResult(int $rowNum)\n {\n\n $queryBuilder = $this-&gt;entityManager-&gt;getRepository(MyModel::class)-&gt;createQueryBuilder('m');\n\n return $queryBuilder\n -&gt;from(MyModel::class, 'm')\n -&gt;select('m.id')\n -&gt;orderBy('m.sentTimestamp', 'ASC')\n -&gt;setMaxResults($rowNum)\n -&gt;getQuery()\n -&gt;getResult();\n\n } \n\n}\n</code></pre>\n<p>What I want to achieve is to do a simple select in the table <code>my_model</code>:</p>\n<pre><code>SELECT id from my_model order by sent_timestamp LIMIT :row_num\n</code></pre>\n<p>The Doctrine Entity that is used for the query is:</p>\n<pre><code>namespace App\\Entity;\n\nuse App\\Infrastructure\\Repository\\MailLogRepository;\nuse Doctrine\\DBAL\\Types\\Types;\nuse Doctrine\\ORM\\Mapping as ORM;\n\n#[ORM\\Entity]\n#[ORM\\HasLifecycleCallbacks]\nclass MyModel\n{\n #[ORM\\Id]\n #[ORM\\GeneratedValue]\n #[ORM\\Column]\n private ?int $id = null;\n \n #[ORM\\Column(name:'sent_timestamp',type: Types::DATETIME_IMMUTABLE)]\n private ?\\DateTimeInterface $sentTimestamp = null;\n \n}\n\n</code></pre>\n<p>But the Execution of the <code>getEarliestResult</code> takes ~74 second. Do you know why? This query is simple enough if run as is directly to the database, instead of using query builder, it takes ~ 0.4 seconds for 5020 rows.</p>\n"^^ . + "1"^^ . + "0"^^ . + "2"^^ . + . + . + "1"^^ . + . + "<p>PHP v7.4x-v8x.\nI've seen the code:</p>\n<pre><code>function intToRomanNumeral(int $value) {\n static $nf = new \\NumberFormatter('@numbers=roman', \\NumberFormatter::DECIMAL);\n\n return $nf-&gt;format($value);\n}\n</code></pre>\n<p>How can I make reverse convert from roman to arabic numbers?</p>\n"^^ . + . + . + . + "1"^^ . + . + "0"^^ . + . + . + . + . + "Whoops; totally missed that extra object @Computable; thanks for the fix "^^ . + . + "session"^^ . + "<h3>Laravel Pagination</h3>\n<p>Actually, what you did is a bit strange, but you properly passed the result of <code>paginate()</code> to the view. The <code>links()</code> method doesn't return anything if it's not meaningful: there are too few items, and pagination isn't possible.</p>\n<ul>\n<li><a href="https://laravelplayground.com/#/snippets/2cd24e0e-3831-4117-91b4-3208446a18ec" rel="nofollow noreferrer">Laravel Playground with 21 records and pagination by 5 records</a></li>\n<li><a href="https://laravelplayground.com/#/snippets/44605acc-be1a-4a81-92e8-f40c543e4960" rel="nofollow noreferrer">Laravel Playground with 1 record and pagination by 5 records</a></li>\n</ul>\n<p>If you want to change the functionality, you have the option to manually create a custom paginator. In this case, you need to manipulate the result of the <code>hasPages()</code> function to always return <code>true</code>. With this manipulation, you can override the default behavior and make the paginator believe that it always needs to be displayed because there is always a page.</p>\n<ul>\n<li><a href="https://laravel.com/docs/11.x/pagination#manually-creating-a-paginator" rel="nofollow noreferrer">Manually Creating a Paginator</a> - Laravel 11.x Docs</li>\n<li><a href="https://laravel.com/docs/11.x/pagination#paginator-instance-methods" rel="nofollow noreferrer">Paginator / LengthAwarePaginator Instance Methods</a> - Laravel 11.x Docs</li>\n</ul>\n<p>Alternatively, you have the option to implement a custom paginator appearance, allowing you to override the default if-else statements as well.</p>\n<ul>\n<li><a href="https://laravel.com/docs/11.x/pagination#customizing-the-pagination-view" rel="nofollow noreferrer">Customizing the Pagination View</a> - Laravel 11.x Docs</li>\n</ul>\n<h3>TailwindCSS v4</h3>\n<p>You marked your question as using v4. It's important to note that with TailwindCSS v4, automatic source detection has been implemented, so you no longer need to list every source in the <code>content</code> key of the <code>tailwind.config.js</code>. By default, CSS-first configurations are preferred over the legacy JavaScript-based configuration.</p>\n<ul>\n<li><a href="https://stackoverflow.com/a/79424690/15167500">Automatic Source Detection from TailwindCSS v4</a> - StackOverflow</li>\n</ul>\n<p>It’s important to know that automatic source detection doesn't cover everything. It automatically excludes paths listed in <code>.gitignore</code>.</p>\n<ul>\n<li><a href="https://tailwindcss.com/docs/detecting-classes-in-source-files#setting-your-base-path" rel="nofollow noreferrer">Setting your base path: <code>@import &quot;tailwindcss&quot; source(&quot;../src&quot;);</code></a> - TailwindCSS v4 Docs</li>\n<li><a href="https://tailwindcss.com/docs/detecting-classes-in-source-files#disabling-automatic-detection" rel="nofollow noreferrer">Disable automatic detection: <code>@import &quot;tailwindcss&quot; source(none);</code></a> - TailwindCSS v4 Docs</li>\n</ul>\n<blockquote>\n<h3>Which files are scanned</h3>\n<p>Tailwind will scan every file in your project for class names, <strong>except in the following cases</strong>:</p>\n<ul>\n<li><strong>Files that are in your <code>.gitignore</code> file</strong></li>\n<li>Binary files like images, videos, or zip files</li>\n<li>CSS files</li>\n<li>Common package manager lock files</li>\n</ul>\n</blockquote>\n<p>To include a package located in an extra <code>/vendor</code> or <code>/node_modules</code> folder (which are typically excluded by <code>.gitignore</code>), you need to register it in your CSS file using the <code>@source</code> directive as follows:</p>\n<ul>\n<li><a href="https://tailwindcss.com/docs/functions-and-directives#source-directive" rel="nofollow noreferrer"><code>@source</code> directive</a> - TailwindCSS v4 Docs</li>\n<li><a href="https://laravel.com/docs/12.x/pagination#tailwind-jit" rel="nofollow noreferrer">Tailwind JIT: necessary content for Pagination</a> - Laravel 12.x Docs</li>\n</ul>\n<p>The documentation still shows the v3 JavaScript-based routes, but this can easily be re-coded into the new v4 syntax by using relative path.</p>\n<p><strong>./resources/css/style.css</strong></p>\n<pre class="lang-css prettyprint-override"><code>@import &quot;tailwindcss&quot;;\n\n/* relative path ti pagination views folder */\n@source &quot;./../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views&quot;;\n</code></pre>\n"^^ . + "`paged` is a special internal WordPress variable, however you are trying to use it with your own custom variable. I can't say this for absolute certain, but I wouldn't be surprised if this is confusing WordPress. Try using your own variable for pagination that isn't listed in https://codex.wordpress.org/WordPress_Query_Vars"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "Thanks. I was just looking at the source code of the library. It'll be [this line](https://github.com/PiPHP/GPIO/blob/master/src/FileSystem/FileSystem.php#L43) ultimately. Probably a filesystem permissions error or similar I would guess - the error message isn't terribly helpful really."^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + "1"^^ . + . + . + "I want to do it on the filament, not in Livewire"^^ . + "@Barmar can you show any example? I don't understand exactly how it would work."^^ . + . + . + . + . + "1"^^ . + "0"^^ . + . + "1"^^ . + "FWIW I wrote my own memory efficient O(n^2) shuffler which has performance that is fairly independent of the maximum probability values. It ran in 220ms for 3000 names and maximum probability 20, 2.15s for 10000 names, and 48ms for 1000 names. My laptop is 10 years old though, so It's probably comparable to L.Semis in performance, though I haven't benchmarked his code on it. I rewrote it, almost line for line in c and for 1000 to 10000 names it was 4 to 15 times faster than my PHP respectively. I'm sure further optimisations are possible."^^ . + . + . + . + "0"^^ . + . + "<p>Try <code>ln</code> command</p>\n<p>i.e. <code>ln -s storage/app/public/* public/storage/</code></p>\n"^^ . + . + . + . + "<p>Based on <a href="https://stackoverflow.com/questions/65779013/display-woocommerce-product-dimensions-via-a-shortcode/65779287#65779287">Display WooCommerce Product Dimensions via a Shortcode</a> answer, you can build a shortcode for each defined product dimentions individually.</p>\n<pre><code>use Automattic\\WooCommerce\\Utilities\\I18nUtil;\n\n// For Product Height:\nfunction display_product_formatted_height( $atts ) {\n // Extract shortcode attributes\n extract( shortcode_atts( array(\n 'id' =&gt; get_the_ID(),\n ), $atts, 'product_height' ) );\n\n $product = wc_get_product( $id );\n\n if( ! $product ) {\n return;\n } elseif ( $value = $product-&gt;get_height() ) {\n $unit_label = I18nUtil::get_dimensions_unit_label( get_option( 'woocommerce_dimension_unit' ) );\n return sprintf('&lt;strong&gt;%s&lt;/strong&gt; %s %s', __('Height'), $value, $unit_label);\n }\n}\nadd_shortcode( 'product_height', 'display_product_formatted_height' );\n\n// For Product Width:\nfunction display_product_formatted_width( $atts ) {\n // Extract shortcode attributes\n extract( shortcode_atts( array(\n 'id' =&gt; get_the_ID(),\n ), $atts, 'product_width' ) );\n\n $product = wc_get_product( $id );\n\n if( ! $product ) {\n return;\n } elseif ( $value = $product-&gt;get_width() ) {\n $unit_label = I18nUtil::get_dimensions_unit_label( get_option( 'woocommerce_dimension_unit' ) );\n return sprintf('&lt;strong&gt;%s&lt;/strong&gt; %s %s', __('Width'), $value, $unit_label);\n }\n}\nadd_shortcode( 'product_width', 'display_product_formatted_width' );\n\n// For Product Length:\nfunction display_product_formatted_length( $atts ) {\n // Extract shortcode attributes\n extract( shortcode_atts( array(\n 'id' =&gt; get_the_ID(),\n ), $atts, 'product_length' ) );\n\n $product = wc_get_product( $id );\n\n if( ! $product ) {\n return;\n } elseif ( $value = $product-&gt;get_length() ) {\n $unit_label = I18nUtil::get_dimensions_unit_label( get_option( 'woocommerce_dimension_unit' ) );\n return sprintf('&lt;strong&gt;%s&lt;/strong&gt; %s %s', __('Length'), $value, $unit_label);\n }\n}\nadd_shortcode( 'product_length', 'display_product_formatted_length' );\n</code></pre>\n<p>Code goes in functions.php file of your child theme (or in a plugin). It should work.</p>\n<h5>Shortcode usage examples</h5>\n<p>Without defining the product ID:</p>\n<ul>\n<li>to display product height: <code>[product_height]</code>,</li>\n<li>to display product width: <code>[product_width]</code>,</li>\n<li>to display product length: <code>[product_length]</code>.</li>\n</ul>\n<p>Defining a product ID <em>(here with the product id 38 for example)</em>:</p>\n<ul>\n<li>to display product height: <code>[product_height id=&quot;38&quot;]</code>,</li>\n<li>to display product width: <code>[product_width id=&quot;38&quot;]</code>,</li>\n<li>to display product length: <code>[product_length id=&quot;38&quot;]</code>.</li>\n</ul>\n"^^ . + . + . + . + "0"^^ . + . + "Is it Laravel + InertiaJs + React ? if yes , why you need apis ? for this ? , I guess InertiaJs solves this thing , web.php routes should return your front end view with is react view ? can you please clarify you question , Thanks"^^ . + . + . + "And as I said is "academically" theory. But also it is not that hard to imagine some similar problem when vendor is 2 GB space. So now i should have in my development machine 50x 2 GB so waste 98 GB space, did you called "premature optimisation" now? If no, i could imagine that vendor is now 1 TB. There is no about my problem there is about more abstract problem, don't consider my case, just think about main core of that problem - abstract, like programming - this is why i said is "academically"."^^ . + . + "2"^^ . + . + . + "functional-programming"^^ . + . + . + "0"^^ . + "How do I disable sessions/middleware for Laravel Folio"^^ . + "PHP Startup: Unable to load dynamic library 'pdo_mysql' CLI only, apache OK - FreeBSD"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + "0"^^ . + . + "<p>I am trying to make a room availability chart or calendar, with the expected result as follows:</p>\n<p><a href="https://i.sstatic.net/FyU5pbKV.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/FyU5pbKV.png" alt="Room availability chart" /></a></p>\n<p>Each date has two columns with AM and PM as headers. AM indicates Check-In while PM indicates Check-out. I made this two columns because there will be cases where a room will have a check-out guest and continue with a different check-in guest.</p>\n<p>Now I need to render the table to see the period of guest stays by spanning the cells based on the stay's date and the stay's number of nights.</p>\n<p>Here is my <code>$guest</code> data and the full code:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n// Room data\n$rooms = [\n ['room' =&gt; '1001', 'type' =&gt; 'King'],\n ['room' =&gt; '1002', 'type' =&gt; 'Hollywood'],\n ['room' =&gt; '1003', 'type' =&gt; 'Queen'],\n ['room' =&gt; '1004', 'type' =&gt; 'Queen'],\n ['room' =&gt; '1005', 'type' =&gt; 'Queen'],\n];\n\n// Generate all dates for December 2024\n$dates = [];\n$start = new DateTime('2024-12-01');\n$end = new DateTime('2025-01-01'); // 1 day after the last day of December 2024\n\nwhile ($start &lt; $end) {\n $dates[] = $start-&gt;format('Y-m-d'); // Add date in 'Y-m-d' format\n $start-&gt;add(new DateInterval('P1D')); // Increment by 1 day\n}\n\n// Guest data\n\n $guests = [\n ['room' =&gt; '1001', 'stays' =&gt; [['guest' =&gt; 'Juna', 'checkin' =&gt; '2024-12-05', 'checkout' =&gt; '2024-12-06', 'nights' =&gt; '1']]],\n ['room' =&gt; '1001', 'stays' =&gt; [['guest' =&gt; 'Mila', 'checkin' =&gt; '2024-12-06', 'checkout' =&gt; '2024-12-08', 'nights' =&gt; '2']]],\n ['room' =&gt; '1001', 'stays' =&gt; [['guest' =&gt; 'Tom', 'checkin' =&gt; '2024-12-08', 'checkout' =&gt; '2024-12-12', 'nights' =&gt; '4']]],\n ['room' =&gt; '1001', 'stays' =&gt; [['guest' =&gt; 'Aman', 'checkin' =&gt; '2024-12-01', 'checkout' =&gt; '2024-12-04', 'nights' =&gt; '3']]],\n ['room' =&gt; '1002', 'stays' =&gt; [['guest' =&gt; 'Tina', 'checkin' =&gt; '2024-12-01', 'checkout' =&gt; '2024-12-03', 'nights' =&gt; '2']]],\n ['room' =&gt; '1002', 'stays' =&gt; [['guest' =&gt; 'Dina', 'checkin' =&gt; '2024-12-03', 'checkout' =&gt; '2024-12-06', 'nights' =&gt; '3']]],\n]\n\n?&gt;\n</code></pre>\n<pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n\n&lt;head&gt;\n &lt;meta charset=&quot;UTF-8&quot;&gt;\n &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n &lt;title&gt;Stay Table&lt;/title&gt;\n &lt;style&gt;\n body {\n font-family: Arial, sans-serif;\n margin: 20px;\n }\n\n table {\n width: 800px;\n border-collapse: collapse;\n margin-top: 20px;\n }\n\n th,\n td {\n border: 1px solid #ddd;\n padding: 10px;\n text-align: center;\n width: 80px;\n }\n\n th {\n background-color: #f2f2f2;\n font-weight: bold;\n }\n\n .date-header {\n background-color: #f2f2f2;\n font-weight: bold;\n }\n\n .stay-cell-1 {\n background-color: #e0f7fa;\n }\n\n .stay-cell-2 {\n background-color: #ffebee;\n }\n\n .stay-cell-a,\n .stay-cell-b {\n border: none;\n padding: 0;\n }\n\n .internal-table {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n border-collapse: collapse;\n }\n\n .internal-table td {\n background-color: #80deea;\n height: 25px;\n border: none;\n text-align: center;\n }\n &lt;/style&gt;\n&lt;/head&gt;\n\n&lt;body&gt;\n\n &lt;table&gt;\n &lt;!-- Header Row --&gt;\n &lt;tr&gt;\n &lt;th class=&quot;left-header&quot;&gt;Room&lt;/th&gt;\n &lt;th class=&quot;left-header&quot;&gt;Type&lt;/th&gt;\n &lt;?php foreach ($dates as $date): ?&gt;\n &lt;th class=&quot;date-header&quot; colspan=&quot;2&quot;&gt;&lt;?= date('d-M', strtotime($date)) ?&gt;&lt;/th&gt;\n &lt;?php endforeach; ?&gt;\n &lt;/tr&gt;\n\n &lt;!-- Data Rows --&gt;\n &lt;?php foreach ($rooms as $room): ?&gt;\n &lt;tr&gt;\n &lt;td class=&quot;left-header&quot;&gt;&lt;?= $room['room'] ?&gt;&lt;/td&gt;\n &lt;td class=&quot;left-header&quot;&gt;&lt;?= $room['type'] ?&gt;&lt;/td&gt;\n &lt;?php\n $skipUntil = null;\n foreach ($dates as $date):\n if ($skipUntil &amp;&amp; $date &lt;= $skipUntil) {\n continue;\n }\n $guestCI = '';\n $guestCO = '';\n $colspan = 1;\n $isOccupied = false;\n foreach ($guests as $guest) {\n if ($guest['room'] == $room['room']) {\n foreach ($guest['stays'] as $stay) {\n if ($date == $stay['checkin']) {\n $guestCI = $stay['guest'];\n $colspan = ($stay['nights'] * 2) - 1;\n $skipUntil = date('Y-m-d', strtotime(&quot;$date +&quot; . ($stay['nights'] - 1) . &quot; days&quot;));\n $isOccupied = true;\n }\n if ($date == $stay['checkout']) {\n $guestCO = $stay['guest'];\n $isOccupied = true;\n }\n }\n }\n }\n ?&gt;\n &lt;td class=&quot;stay-cell-1&quot;&gt; &lt;?= $guestCO ?: '&amp;nbsp;' ?&gt; &lt;/td&gt;\n &lt;?php if ($guestCI) : ?&gt;\n &lt;td class=&quot;stay-cell-2&quot; colspan=&quot;&lt;?= $colspan ?&gt;&quot;&gt; &lt;?= $guestCI ?&gt; &lt;/td&gt;\n &lt;?php elseif (!$isOccupied) : ?&gt;\n &lt;td&gt;&amp;nbsp;&lt;/td&gt;\n &lt;?php else: ?&gt;\n &lt;td&gt;&lt;/td&gt;\n &lt;?php endif; ?&gt;\n &lt;?php endforeach; ?&gt;\n &lt;/tr&gt;\n &lt;?php endforeach; ?&gt;\n &lt;/table&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<p>Taking this example: <code>['room' =&gt; '1001', 'stays' =&gt; [['guest' =&gt; 'Aman', 'checkin' =&gt; '2024-12-01', 'checkout' =&gt; '2024-12-04', 'nights' =&gt; '3']]]</code>, the period of stay is supposed to be rendered from 1-Dec PM cell to 4-Dec AM cell.</p>\n<p><a href="https://i.sstatic.net/Qs5JY3fn.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Qs5JY3fn.png" alt="enter image description here" /></a></p>\n<p>How can I achieve the desired outcome where Aman's stay is showing as one entry instead of two as shown in the chart above? And so on for the others (compare this image to the correct display shown in the spreadsheet image at the top of the question).</p>\n<p>If an HTML table is not correct, I am OK if there is another approach.</p>\n"^^ . + . + . + "debugging"^^ . + . + . + . + "1"^^ . + . + "0"^^ . + "4"^^ . + "1"^^ . + . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + "0"^^ . + "Yes, the same 422 error"^^ . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + "`mysqli_free_result` takes only one param and you are passing it two, but I don't really see a reason to use that function at all"^^ . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + . + . + "1"^^ . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + . + "ok good, show how you have implemented the button and your form instead, and show the error you get."^^ . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + "Yes it makes sense. But the problem happens because - according to the sample data you've shown us here - what's saved in the database has been incorrectly encoded multiple times over. The solution to this is to prevent the system from doing that extra encoding. A workaround could be to decode the data 3 times - but I don't know if there are other examples in the database where the data has been encoded a different number of times. Perhaps this is determined by how many times it's been edited, but it's impossible for me to know since I can't see the rest of your application and database."^^ . + . + . + "https"^^ . + "0"^^ . + "2"^^ . + . + . + . + . + . + "`HasPermissions` exists. `HasRoles` includes it and extends the permission-related functionality with role-related features. If you don't need Roles, only Permissions, it would be more efficient to use the `HasPermissions` trait. See: [`Traits/HasRoles` #L17](https://github.com/spatie/laravel-permission/blob/02687346fe01242038a5ef9346696a42eda81250/src/Traits/HasRoles.php#L17) and [`Traits/HasPermissions`](https://github.com/spatie/laravel-permission/blob/02687346fe01242038a5ef9346696a42eda81250/src/Traits/HasPermissions.php)"^^ . + "Thank you for you reply!\nI am not showing the resized picture as large as the original. I show it in smaller container. Resize and Crop, both methods are necessary and i can't skip them. But the quality is obviously poor for the resized image in small container.."^^ . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + "1"^^ . + . + "@ChrisHaas I tried without json_encode(). Here is my php code: `var_dump(simplexml_load_string($xml_string, null, LIBXML_NOCDATA))`. Finally the problem is the same. I got an objects of this XML file but I still can't find attributes: name and id."^^ . + . + "1"^^ . + . + . + "-1"^^ . + . + . + . + . + . + . + . + "<p>This is the OP. I did eventually figure out a work-around that does what I need. I have to run an executable on the server and capture the output in PHP, and parse the text.</p>\n<p>My steps are outlined below for anyone who might find this useful:</p>\n<p>I'm running on a Linux server (ubuntu 24 at the moment) and simply downloaded the pre-compiled linux binary for rqbit: <a href="https://github.com/ikatson/rqbit" rel="nofollow noreferrer">https://github.com/ikatson/rqbit</a> (see the releases). I used version 8.0.0 for amd64. and placed in /usr/bin. You'll need to set appropriate permissions to make sure it can be called from a PHP script.</p>\n<p>Your PHP script would make a call that looks something like this:</p>\n<pre><code>$magnet_uri = 'magnet:?xt=urn:btih:7AAD10A9....blah..blah.../announce';\n$cmd = &quot;timeout 7 rqbit download --list -o /tmp '$magnet_uri' &quot;;\n\n$contents = '';\n$p = proc_open(@$cmd, array(1 =&gt; array('pipe', 'w'), 2 =&gt; array('pipe', 'w')), $io);\n\n// Read output sent to stdout.\nwhile (!feof($io[1])) {\n $contents .= fgets($io[1]);\n }\n// Read output sent to stderr.\nwhile (!feof($io[2])) {\n $contents .= fgets($io[2])\n}\n\nfclose($io[1]);\nfclose($io[2]);\nproc_close($p);\n\n// $contents now contains the output. \n// echo to the screen to check for permission errors, and use fancy regex \n// to get the file list and other metadata about the torrent.\n</code></pre>\n<p>Let me walk through what's happening in <strong>$cmd</strong>:</p>\n<ol>\n<li><p>We assume that $magnet_uri contains the full magnet link for the torrent.</p>\n</li>\n<li><p>The program rqbit sometimes won't actually end, especially if there's goofy stuff going on with the servers, so I start the command with <strong>timeout 7</strong> meaning after 7 seconds, Linux will send a command to kill the process, if it is still going on. I find that if it hasn't loaded within 5 seconds, it's probably a low-quality or even bogus torrent.</p>\n</li>\n<li><p>We give rqbit the command <strong>download</strong> followed by <strong>--list</strong>. Because of this <em>nothing actually gets downloaded.</em> Instead, it just outputs the torrent information, including the file list, to the screen.</p>\n</li>\n<li><p>If we are specifying the <strong>download</strong> command, we still have to tell it an &quot;output&quot; folder, even though we aren't actually downloading anything. <strong>-o /tmp</strong> does that. Don't worry, nothing gets downloaded.</p>\n</li>\n<li><p>Finally, we specify the full magnet uri within single quotes.</p>\n</li>\n<li><p>The rest of the code (proc_open until proc_close) is just about running the program and capturing the output to the $contents variable, which you can then manipulate with preg_match_all to get the files and other metadata you might want.</p>\n</li>\n</ol>\n<p>I hope this helps out others out there!</p>\n"^^ . + . + . + "-4"^^ . + . + "0"^^ . + "Can you try and use `woocommerce_process_registration_errors` filter instead? This filter specifically validates the registration errors before the registration process is completed [see here](https://stackoverflow.com/a/28137600/10497022). Whereas `woocommerce_register_post` only adds validation errors before form submission. It doesn't inherently prevent the registration process from continuing, even if there are validation errors."^^ . + . + . + "You can write a separate function which will return this markup. So you will have your markup in a single place. Ex: `if ($showToAdmin) {$adminFields .= get_field_markup($row);} else {$nonAdminFields .= get_field_markup($row);}`."^^ . + . + . + . + . + . + . + "`phegistry` looks like it might be a typo"^^ . + . + . + . + "0"^^ . + . + . + "And why does your `$baseUrl` have all those backticks in the value? Are they just from your attempt to format the code here, or is that genuinely part of your real code?"^^ . + . + . + . + "-1"^^ . + . + "Problem using define() to enable debug mode"^^ . + "0"^^ . + . + . + "@ProfessorAbronsius I suspect, for the live URL they've posted, it's because it's Cloudflare Pages and that doesn't support PHP (or probably POST requests to anything in its environment, by the looks of it). Why they can't get it working using MAMP is less clear (at least that's the implication, the post seems to conflate the two environments and isn't clear about the actual issue, as already noted)."^^ . + "0"^^ . + . + . + "-2"^^ . + "A more general PHP resource is: [PHP The Right Way](https://phptherightway.com/). Anyway, as you might have notice by now, you shouldn't expect us to deliver you a ready made product you can just blindly download and use. That's not what Stack Overflow is about. See: [What topics can I ask about here?](https://stackoverflow.com/help/on-topic) Your problem is interesting, of course, and I wish you luck finding, or creating, something that does this job."^^ . + . + . + . + . + . + "If a question's title or body is poorly worded, it can be the responsibility of knowledgeable curators to correct terminology/phrasing. If a question shows low-effort, curators may be less willing to help. The dv button's hover text says: `This question does not show any research effort; it is unclear or not the useful`. This question doesn't strike me as one of sloppy/careless questions (which I have seen many of over the years)."^^ . + "_"this is causing an error"_ What is the error? I'm not familiar with woocommerce but I would guess that the session is already started, so you probably don't need to explicitly start the session inside this function, which might lead to a notice about starting the session twice."^^ . + . + . + "0"^^ . + "The error mentions the client which is the app you created in LinkedIn. Maybe you didn't copy the correct id or secret of the client."^^ . + "0"^^ . + . + . + . + "How to let end user change password created by dovecot"^^ . + "api-platform"^^ . + . + . + . + "0"^^ . + "<p>I am using the Heic2Any javascript library to convert .heic files into JPG like this:</p>\n<pre><code>$('#image-input').on('change', function(ev) {\n var blob = ev.target.files[0];\n heic2any({\n blob: blob,\n toType: &quot;image/jpeg&quot;,\n })\n .then(function (resultBlob) {\n \n })\n .catch(function (x) {\n var error = &quot;Error code: &quot; + x.code + &quot; &quot; + x.message;\n console.log(error);\n });\n});\n</code></pre>\n<p>But how do I insert the new jpg image into the input form element or otherwise make it available so I can upload it to a PHP script and access it in $_FILES?</p>\n"^^ . + . + "<p>There are following things you can do :</p>\n<p>1- Redirect Author Archives to Home page :</p>\n<pre><code>function disable_author_archives() {\n if (is_author()) {\n wp_redirect(home_url(), 301);\n exit;\n }\n}\nadd_action('template_redirect', 'disable_author_archives');\n</code></pre>\n<p>2- WordPress may expose usernames in meta generator tags. To resolve this :</p>\n<pre><code>remove_action('wp_head', 'wp_generator');\nremove_action('wp_head', 'rest_output_link_wp_head');\nremove_action('wp_head', 'wp_oembed_add_discovery_links');\n</code></pre>\n<p>3- Your code blocks wp-json/wp/v2/users/1, but usernames can still be exposed via other endpoints, such as:</p>\n<pre><code>/wp-json/wp/v2/posts/ (which may return author details).\n</code></pre>\n<p>To fix this completely hide user data from REST API:</p>\n<pre><code>function remove_user_endpoints( $data, $post, $request ) {\n if (!is_admin()) {\n unset($data-&gt;data['author']);\n }\n return $data;\n}\nadd_filter('rest_prepare_post', 'remove_user_endpoints', 10, 3);\n\nfunction disable_rest_user_query( $response, $user, $request ) {\n return is_admin() ? $response : new WP_Error('rest_forbidden', __('Not allowed'), array('status' =&gt; 403));\n}\nadd_filter('rest_prepare_user', 'disable_rest_user_query', 10, 3);\n</code></pre>\n"^^ . + "<p>you could try adding a &quot;honeypot&quot; field that is hidden to regular visitors, using something like &quot;date of birth&quot;, which the bots will faithfully inserta value into. Then in your function you can discard anything which has a value in that field. I know its not exactly what you were asking but it could be a relatively easy win.</p>\n<p>Also the hook you are using seems to be to validate extra custom fields in the form and return errors. If the bots are still getting through maybe they are using a different vector</p>\n"^^ . + . + "More info [here](https://www.google.com/search?q=IIS+integrated+authentication+2+domains)"^^ . + "docusignapi"^^ . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + "@Shadow You’re absolutely right that a unique constraint prevents duplicate entries, but the issue here isn’t about duplicates being inserted—it's about handling the errors caused by concurrent requests attempting to insert the same data simultaneously."^^ . + . + . + . + . + . + "<p><a href="https://laravel.com/docs/7.x#installation" rel="nofollow noreferrer">Laravel 7.x officially supports PHP 7.2.5 or Higher.</a> No issue in the PHP version but few package not compatible.</p>\n<pre><code>rm -rf vendor\nrm composer.lock \n</code></pre>\n<pre><code>{\n &quot;require&quot;: {\n &quot;php&quot;: &quot;^7.2.5&quot;,\n &quot;fideloper/proxy&quot;: &quot;^4.2&quot;,\n &quot;fruitcake/laravel-cors&quot;: &quot;^1.0&quot;,\n &quot;guzzlehttp/guzzle&quot;: &quot;^6.3&quot;,\n &quot;jenssegers/mongodb&quot;: &quot;^3.6&quot;,\n &quot;laravel/framework&quot;: &quot;^7.30&quot;,\n &quot;laravel/tinker&quot;: &quot;^2.0&quot;,\n &quot;mongodb/mongodb&quot;: &quot;^1.6&quot;\n },\n &quot;require-dev&quot;: {\n &quot;facade/ignition&quot;: &quot;^2.0&quot;,\n &quot;fzaninotto/faker&quot;: &quot;^1.9.1&quot;,\n &quot;mockery/mockery&quot;: &quot;^1.3.1&quot;,\n &quot;nunomaduro/collision&quot;: &quot;^4.1&quot;,\n &quot;phpunit/phpunit&quot;: &quot;^8.5&quot;\n },\n &quot;config&quot;: {\n &quot;optimize-autoloader&quot;: true,\n &quot;preferred-install&quot;: &quot;dist&quot;,\n &quot;sort-packages&quot;: true,\n &quot;platform&quot;: {\n &quot;php&quot;: &quot;7.2.24&quot;\n }\n }\n}\n</code></pre>\n<pre><code># in case if it throws error on composer.lock create empty composer.lock file with { }\ncomposer install \n# composer update # if required\n</code></pre>\n<pre><code>#if mongo is not intalled or outdated. \nsudo pecl install mongodb-1.6.1\n</code></pre>\n"^^ . + "A 404 can also be caused by the code in your controller. You haven't shown us a [minimal, complete, and verifiable example](https://stackoverflow.com/help/mcve) so we can only guess, so that's my guess. You could test if it is related to route or controller by adding `return "foo";` as the first line of your controller method. You could test if it is related to a clash with another route by commenting out all other routes. Maybe you have a typo in action or route name on the form which makes the POST. Without code, we can only guess."^^ . + . + . + . + . + . + "0"^^ . + . + . + "file"^^ . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "1"^^ . + . + . + . + "laminas"^^ . + . + . + . + "1"^^ . + . + "0"^^ . + . + "<p>Assuming the Model's table is named <code>my_model</code>, then the query:</p>\n<pre><code> return $queryBuilder\n -&gt;from(MyModel::class, 'm')\n -&gt;select('m.id')\n -&gt;orderBy('m.sentTimestamp', 'ASC')\n -&gt;setMaxResults($rowNum)\n -&gt;getQuery()\n -&gt;getResult();\n</code></pre>\n<p>Resulting executing a cartesian product of the same table:</p>\n<pre><code>SELECT m0_.id AS id_0 FROM my_model m1_, my_model m0_ ORDER BY m0_.sent_timestamp ASC LIMIT 5000;\n</code></pre>\n<p>This query is ineficient and it is the cause of your long query execution time.</p>\n<p>You can simplify it by removing the call of the <code>getRepository</code> we remove a table reference from the final query.</p>\n<pre><code>\n public function getEarliestResult(int $rowNum)\n {\n\n $queryBuilder = $this-&gt;entityManager-&gt;createQueryBuilder();\n\n return $queryBuilder\n -&gt;from(MyModel::class, 'm')\n -&gt;select('m.id')\n -&gt;orderBy('m.sentTimestamp', 'ASC')\n -&gt;setMaxResults($rowNum)\n -&gt;getQuery()\n -&gt;getResult();\n\n } \n\n</code></pre>\n<p>An alternate approach to acheive this is by removing the from in our built query:</p>\n<pre><code> public function getEarliestResult(int $rowNum)\n {\n\n $queryBuilder = $this-&gt;entityManager-&gt;getRepository(MailLog::class)-&gt;createQueryBuilder('m');\n\n return $queryBuilder\n -&gt;select('m.id')\n -&gt;orderBy('m.sentTimestamp', 'ASC')\n -&gt;setMaxResults($rowNum)\n -&gt;getQuery()\n -&gt;getResult();\n\n } \n\n</code></pre>\n<hr />\n<h1>Diagnosing Similar Results</h1>\n<p>A way to diagnose the issue is by dumping the generated sql whilst developing:</p>\n<pre><code>\n$sql = $queryBuilder\n -&gt;select('m.id')\n -&gt;orderBy('m.sentTimestamp', 'ASC')\n -&gt;setMaxResults($rowNum)\n -&gt;getQuery()\n -&gt;getSQL();\n\nvar_dump($sql);\n\n</code></pre>\n<p>Then execute the generated query upon db and measure the response time</p>\n"^^ . + . + . + . + "3"^^ . + "<p>An <a href="https://learn.microsoft.com/en-us/azure/azure-functions/" rel="nofollow noreferrer">Azure Function</a> would be the correct resource to use for this instead of a WebJob. WebJobs wouldn't be appropriate for this as they are meant to behave like a cronjob; something that executes on a schedule.</p>\n"^^ . + . + . + "flysystem"^^ . + . + . + . + . + . + "0"^^ . + . + "1"^^ . + . + . + . + "1"^^ . + "<p>I am using built-in authentication for login and registration with the following command:</p>\n<p><strong><code>php artisan ui bootstrap --auth</code></strong></p>\n<p>Now, the problem is that I am already logged into my site. When I open another tab and visit the login URL:</p>\n<pre><code>https://localhost/v12-world/login\n</code></pre>\n<p>It redirects me to:</p>\n<pre><code>https://localhost/v12-world/home\n</code></pre>\n<p>But I want to be redirected to:</p>\n<pre><code>\nhttps://localhost/v12-world/admin/cities \n</code></pre>\n<p>I have already added this redirection in the <strong>LoginController</strong>.</p>\n<p>Still having issue...</p>\n<p>I modified the <code>LoginController</code> to change the redirection after login. However, even after making these changes, when I visit the login URL while already logged in, it still redirects to <code>/home</code> instead of <code>/admin/cities</code>.</p>\n<p>I expected the system to detect that I am already logged in and directly redirect me to <code>/admin/cities</code> instead of <code>/home</code>.</p>\n<p>LoginController :</p>\n<pre><code>&lt;?php\n\nnamespace App\\Http\\Controllers\\Auth;\n\nuse App\\Http\\Controllers\\Controller;\nuse Illuminate\\Foundation\\Auth\\AuthenticatesUsers;\n\nclass LoginController extends Controller\n{\n /*\n |--------------------------------------------------------------------------\n | Login Controller\n |--------------------------------------------------------------------------\n |\n | This controller handles authenticating users for the application and\n | redirecting them to your home screen. The controller uses a trait\n | to conveniently provide its functionality to your applications.\n |\n */\n\n use AuthenticatesUsers;\n\n /**\n * Where to redirect users after login.\n *\n * @var string\n */\n protected $redirectTo = '/admin/cities';\n\n /**\n * Create a new controller instance.\n *\n * @return void\n */\n public function __construct()\n {\n $this-&gt;middleware('guest')-&gt;except('logout');\n $this-&gt;middleware('auth')-&gt;only('logout');\n }\n}\n</code></pre>\n"^^ . + . + "Can I refactor a child class to "merge in" it's parent class in PhpStorm?"^^ . + . + . + . + "1"^^ . + "-1"^^ . + "`There is no syntax error in the code`...no, but the error isn't saying that there is. It's saying there's an error in the _data_, meaning it can't parse it as JSON successfully."^^ . + "as i said i am new to php, don't be harsh...but thanks anyway."^^ . + "@ADyson they are right here. Without a strong reason, the data must be saved as is, especially in regard of HTML, is the rule we are enforcing here with much zeal. And this opinionated discussion has nothing to do with the question anyway"^^ . + "If your web server is not running on the standard port 80, you need to tell CI about that. [The CI source shows](https://github.com/codeigniter4/CodeIgniter4/blob/86cf38a16118ff2fcd157c24022ae711b394d1a7/app/Config/App.php#L19) port should be included in your base URL. A 404 at `http://office-inventory/login` is potentially a completely different question (eg maybe you have no `login` route/method/view)."^^ . + "<p>This error is displayed when logging in to phpmyadmin.</p>\n<pre><code>Deprecation Notice in ./libraries/classes/Url.php#221\n\nhttp_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated\n Backtrace\n ./libraries/classes/Url.php#221: http_build_query(\n array,\n NULL,\n string '&amp;',\n )\n ./libraries/classes/Header.php#231: PhpMyAdmin\\Url::getCommonRaw()\n ./libraries/classes/Header.php#282: PhpMyAdmin\\Header-&gt;getJsParams()\n ./libraries/classes/Header.php#214: PhpMyAdmin\\Header-&gt;getJsParamsCode()\n ./libraries/classes/Header.php#142: PhpMyAdmin\\Header-&gt;_addDefaultScripts()\n ./libraries/classes/Response.php#100: PhpMyAdmin\\Header-&gt;__construct()\n ./libraries/classes/Response.php#134: PhpMyAdmin\\Response-&gt;__construct() ./libraries/classes/Plugins/Auth/AuthenticationCookie.php#87: PhpMyAdmin\\Response::getInstance() ./libraries/classes/Plugins/AuthenticationPlugin.php#247: PhpMyAdmin\\Plugins\\Auth\\AuthenticationCookie-&gt;showLoginForm()\n ./libraries/common.inc.php#353: PhpMyAdmin\\Plugins\\AuthenticationPlugin-&gt;authenticate()\n ./index.php#27: require_once(./libraries/common.inc.php)\n Deprecation Notice in ./../../php/Twig/Loader/FilesystemLoader.php#40\n realpath(): Passing null to parameter #1 ($path) of type string is deprecated\n Backtrace\n FilesystemLoader.php#40: realpath(NULL)\n ./libraries/classes/Template.php#61: Twig\\Loader\\FilesystemLoader-&gt;__construct(string 'templates/')\n ./libraries/classes/Template.php#102: PhpMyAdmin\\Template-&gt;__construct(string 'login/header')\n ./libraries/classes/Plugins/Auth/AuthenticationCookie.php#111: PhpMyAdmin\\Template::get(string 'login/header')\n ./libraries/classes/Plugins/AuthenticationPlugin.php#247: PhpMyAdmin\\Plugins\\Auth\\AuthenticationCookie-&gt;showLoginForm()\n ./libraries/common.inc.php#353: PhpMyAdmin\\Plugins\\AuthenticationPlugin-&gt;authenticate()\n ./index.php#27: require_once(./libraries/common.inc.php)\n Deprecation Notice in ./libraries/classes/Url.php#221\n http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated\n Backtrace\n ./libraries/classes/Url.php#221: http_build_query(\n array,\n NULL,\n string '&amp;',\n )\n ./libraries/classes/Url.php#169: PhpMyAdmin\\Url::getCommonRaw(\n array,\n string '?',\n )\n ./libraries/classes/Core.php#749: PhpMyAdmin\\Url::getCommon(array) ./../../../../../../var/lib/phpmyadmin/tmp/twig/91/91211ba25b99b1424ac2dd7e72af0c0b7ef97ed8e59a13e24b13143b76ee353b.php#40: PhpMyAdmin\\Core::linkURL(string 'https://www.phpmyadmin.net/')\n Template.php#407: __TwigTemplate_dd64914d2ea903cb7e97449fb1a49d0d1b0386bce92be9283cbffd5f6c826508-&gt;doDisplay(\n array,\n array,\n )\n Template.php#380: Twig\\Template-&gt;displayWithErrorHandling(\n array,\n array,\n )\n Template.php#392: Twig\\Template-&gt;display(array)\n TemplateWrapper.php#45: Twig\\Template-&gt;render(\n array,\n array,\n )\n ./libraries/classes/Template.php#133: Twig\\TemplateWrapper-&gt;render(array) ./libraries/classes/Plugins/Auth/AuthenticationCookie.php#111: PhpMyAdmin\\Template-&gt;render(array) ./libraries/classes/Plugins/AuthenticationPlugin.php#247: PhpMyAdmin\\Plugins\\Auth\\AuthenticationCookie-&gt;showLoginForm()\n ./libraries/common.inc.php#353: PhpMyAdmin\\Plugins\\AuthenticationPlugin-&gt;authenticate()\n ./index.php#27: require_once(./libraries/common.inc.php)\n Deprecation Notice in ./../../php/Twig/Node/Node.php#161\n Return type of Twig\\Node\\Node::count() should either be compatible with Countable::count(): int, or the\n#[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice\n Backtrace\n autoload.php#369: require(./../../php/Twig/Node/Node.php)\n {closure:/usr/share/php/Twig/autoload.php:6}(string 'Twig\\\\Node\\\\Node')\n TwigFilter.php#150: class_exists(string 'Twig\\\\Node\\\\Node')\n autoload.php#369: require(./../../php/Twig/TwigFilter.php)\n CoreExtension.php#214: {closure:/usr/share/php/Twig/autoload.php:6}(string 'Twig\\\\TwigFilter')\n ExtensionSet.php#433: Twig\\Extension\\CoreExtension-&gt;getFilters()\n ExtensionSet.php#423: Twig\\ExtensionSet-&gt;initExtension()\n ExtensionSet.php#184: Twig\\ExtensionSet-&gt;initExtensions()\n Environment.php#871: Twig\\ExtensionSet-&gt;getFunction(string 'Message_error') ./../../../../../../var/lib/phpmyadmin/tmp/twig/91/91211ba25b99b1424ac2dd7e72af0c0b7ef97ed8e59a13e24b13143b76ee353b.php#55: Twig\\Environment-&gt;getFunction(string 'Message_error')\n Template.php#407: __TwigTemplate_dd64914d2ea903cb7e97449fb1a49d0d1b0386bce92be9283cbffd5f6c826508-&gt;doDisplay(\n array,\n array,\n )\n Template.php#380: Twig\\Template-&gt;displayWithErrorHandling(\n array,\n array,\n )\n Template.php#392: Twig\\Template-&gt;display(array)\n TemplateWrapper.php#45: Twig\\Template-&gt;render(\n array,\n array,\n )\n ./libraries/classes/Template.php#133: Twig\\TemplateWrapper-&gt;render(array) ./libraries/classes/Plugins/Auth/AuthenticationCookie.php#111: PhpMyAdmin\\Template-&gt;render(array) ./libraries/classes/Plugins/AuthenticationPlugin.php#247: PhpMyAdmin\\Plugins\\Auth\\AuthenticationCookie-&gt;showLoginForm()\n ./libraries/common.inc.php#353: PhpMyAdmin\\Plugins\\AuthenticationPlugin-&gt;authenticate()\n ./index.php#27: require_once(./libraries/common.inc.php)\n Deprecation Notice in ./../../php/Twig/Node/Node.php#166\n Return type of Twig\\Node\\Node::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the\n#[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice\n Backtrace\n autoload.php#369: require(./../../php/Twig/Node/Node.php)\n {closure:/usr/share/php/Twig/autoload.php:6}(string 'Twig\\\\Node\\\\Node')\n TwigFilter.php#150: class_exists(string 'Twig\\\\Node\\\\Node')\n autoload.php#369: require(./../../php/Twig/TwigFilter.php)\n CoreExtension.php#214: {closure:/usr/share/php/Twig/autoload.php:6}(string 'Twig\\\\TwigFilter')\n ExtensionSet.php#433: Twig\\Extension\\CoreExtension-&gt;getFilters()\n ExtensionSet.php#423: Twig\\ExtensionSet-&gt;initExtension()\n ExtensionSet.php#184: Twig\\ExtensionSet-&gt;initExtensions()\n Environment.php#871: Twig\\ExtensionSet-&gt;getFunction(string 'Message_error') ./../../../../../../var/lib/phpmyadmin/tmp/twig/91/91211ba25b99b1424ac2dd7e72af0c0b7ef97ed8e59a13e24b13143b76ee353b.php#55: Twig\\Environment-&gt;getFunction(string 'Message_error')\n Template.php#407: __TwigTemplate_dd64914d2ea903cb7e97449fb1a49d0d1b0386bce92be9283cbffd5f6c826508-&gt;doDisplay(\n array,\n array,\n )\n Template.php#380: Twig\\Template-&gt;displayWithErrorHandling(\n array,\n array,\n )\n Template.php#392: Twig\\Template-&gt;display(array)\n TemplateWrapper.php#45: Twig\\Template-&gt;render(\n array,\n array,\n )\n ./libraries/classes/Template.php#133: Twig\\TemplateWrapper-&gt;render(array) ./libraries/classes/Plugins/Auth/AuthenticationCookie.php#111: PhpMyAdmin\\Template-&gt;render(array) ./libraries/classes/Plugins/AuthenticationPlugin.php#247: PhpMyAdmin\\Plugins\\Auth\\AuthenticationCookie-&gt;showLoginForm()\n ./libraries/common.inc.php#353: PhpMyAdmin\\Plugins\\AuthenticationPlugin-&gt;authenticate()\n ./index.php#27: require_once(./libraries/common.inc.php)\n</code></pre>\n<p>And then this one. And I can't do anything.</p>\n<pre><code>Error during session start; please check your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser.\n\nConstant PhpMyAdmin\\E_STRICT is deprecated\n</code></pre>\n<p><a href="https://i.sstatic.net/k6l5m7b8.png" rel="nofollow noreferrer">https://i.sstatic.net/k6l5m7b8.png</a></p>\n"^^ . + . + "1"^^ . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + "`I don't need the JS to do anything other than post the value`...are you sure? From your question you seem to expect that the page you're currently on will then be altered as a result of that $.post operation. It won't - **unless you explicitly write some JS code to do so**. PHP _alone_ isn't enough in this case. When you run an AJAX request, anything that PHP outputs **is returned to your JS code inside a variable**. That output is _not_ sent directly to the page - because the whole point of ajax is to allow you to do asynchronous operations without refreshing the whole page from the server."^^ . + . + . + . + . + . + . + "SAP = SPA I think?"^^ . + . + . + . + "<p>With Laravel Sanctum, we have to set the <code>SANCTUM_STATEFUL_DOMAINS</code> environment variable to specify which domains should be treated as stateful—meaning they rely on sessions and cookies for authentication. Consequently, requests from domains not listed are treated as stateless and do not use these authentication mechanisms, which should theoretically make CSRF attacks irrelevant.</p>\n<p>My question is: Why does Laravel still use a CSRF token in this context? Isn’t the stateful mechanism defined by <code>SANCTUM_STATEFUL_DOMAINS</code> sufficient to protect against CSRF attacks ?</p>\n"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + "2"^^ . + . + "If the array values and probabilities are constant, you could maintain a queue of pre-computed shuffled values in a file/database or whatever, and then just pop off the top when you need to."^^ . + . + . + . + . + . + "Exactly Why does this work this way? (null coalescing operator precedence)"^^ . + "yeah I have access but what is the command to run it?"^^ . + . + . + . + . + . + "Sorry, you are right, you need to add the shared folder path to includePaths. So is the problem solved?"^^ . + . + "How to get correct composer vendor-dir?"^^ . + . + "2"^^ . + "Sending an email notification when a user role is approved in Wordpress"^^ . + . + . + "0"^^ . + "1"^^ . + "<p>I am trying to develop a page in which available appointments are listed. So the students will be able to choose one for foreign language talking exercise. Everything is fine. I get</p>\n<blockquote>\n<p>Undefined variable $showConfirmationModal</p>\n</blockquote>\n<p>error at line <code>@if ($showConfirmationModal) </code>.</p>\n<p>I checked the variable names many times. This is because something else I guess. I also made a &quot;find and replace&quot; for <code>$showConfirmationModal</code>. I get the same error message.</p>\n<p>I used the artisan commands:</p>\n<pre><code>php artisan cache:clear\nphp artisan view:clear\n</code></pre>\n<p>No help.</p>\n<pre><code>&lt;?php\n\nuse App\\Mail\\AppointmentNotificationForStudent;\nuse App\\Mail\\AppointmentNotificationForTeacher;\nuse App\\Models\\TeacherAvailability;\nuse Carbon\\Carbon;\nuse Illuminate\\Support\\Facades\\Auth;\nuse Illuminate\\Support\\Facades\\Mail;\nuse Livewire\\Component;\nuse Masmerise\\Toaster\\Toaster;\n\nnew class extends Component {\n public $showConfirmationModal = false;\n public $selectedAppointmentId = null;\n public $appointments = [];\n\n public function mount()\n {\n $this-&gt;loadAppointments();\n }\n\n public function loadAppointments()\n {\n $this-&gt;appointments = TeacherAvailability::where('date', '&gt;=', now()-&gt;toDateString())\n -&gt;orderBy('date', 'ASC')\n -&gt;orderBy('time_start', 'ASC')\n -&gt;get();\n }\n\n public function confirmSelectAppointment($appointmentId)\n {\n $this-&gt;selectedAppointmentId = $appointmentId;\n $this-&gt;showConfirmationModal = true;\n }\n\n public function selectAppointment()\n {\n $studentId = Auth::id();\n $availability = TeacherAvailability::find($this-&gt;selectedAppointmentId);\n\n if (!$availability) {\n Toaster::error('Appointment not found.');\n return;\n }\n \n $availability-&gt;update([\n 'student_id' =&gt; $studentId,\n 'is_appointment' =&gt; 0,\n ]);\n\n Toaster::success('Randevu başarıyla seçildi!');\n $this-&gt;showConfirmationModal = false;\n\n $student = Auth::user();\n \n $teacher = $availability-&gt;teacher; \n $teacherEmail = $teacher-&gt;email;\n $teacherName = $teacher-&gt;name;\n\n Mail::to($teacherEmail)-&gt;queue(new AppointmentNotificationForTeacher($availability, $teacherEmail, $student, $teacherName));\n Toaster::success('Notification sent to the teacher.');\n\n \n Mail::to($student-&gt;email)-&gt;queue(new AppointmentNotificationForStudent($availability, $student));\n Toaster::success('Appointment information sent you in an e-mail.');\n\n // Populate List\n $this-&gt;loadAppointments();\n }\n};\n?&gt;\n&lt;div&gt;\n &lt;!-- I get error at the line below--&gt;\n @if ($showConfirmationModal) \n &lt;div class=&quot;fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center z-50&quot;&gt;\n ...\n &lt;/div&gt;\n @endif\n\n &lt;!-- Appointment List --&gt;\n &lt;div&gt;\n ...\n ...\n &lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n"^^ . + . + . + . + . + . + "Thanks, but I haven't found a working example of how to do this with PHP cURL. Also, will it search only MY items? that's what I want to do. I don't want to search all items on ebay."^^ . + . + "2"^^ . + . + "1"^^ . + "Also, please don't store passwords using the [obsolete, insecure md5 algorithm](https://www.php.net/manual/en/function.md5.php) - that is another security risk. Learn about PHP's built-in, up-to-date, secure [password hashing and verification functions](https://www.php.net/manual/en/faq.passwords.php) instead. See also [How to use PHP's password_hash to hash and verify passwords](https://stackoverflow.com/questions/30279321/how-to-use-phps-password-hash-to-hash-and-verify-passwords). I wonder if you are learning from a very old and out of date resource."^^ . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + . + "<p>The problem is that you are using a mixed approach: some options are specified in the legacy format <strong>(v2)</strong> and some in the new format <strong>(v3)</strong>. If you are using <code>Chart.js</code> v3 or later, to correctly change the grid color, you need to implement the options object (inside data obj) like this:</p>\n<pre><code>options: {\n plugins: {\n legend: { display: false }\n },\n scales: {\n x: {\n ticks: { color: 'white' },\n grid: { color: 'white' } // vertical line color\n },\n y: {\n ticks: { min: 0, max: 100, color: 'white' },\n grid: { color: 'white' } // horizontal line color\n }\n }\n }\n</code></pre>\n<p>instead of <code>yAxes: [...]</code> / <code>xAxes: [...]</code> <strong>(v2)</strong> -&gt; <code>y: {...}</code> / <code>x: {...}</code> <strong>(v3+)</strong></p>\n<p><code>gridLines.color</code> <strong>(v2)</strong> -&gt; <code>grid.color</code> <strong>(v3)</strong></p>\n<p><code>lineTension</code> <strong>(v2)</strong> -&gt; <code>tension</code> <strong>(v3)</strong></p>\n<h2>If you want to use (v2):</h2>\n<p><code>y: { grid: { color: 'white' } }</code> — this syntax belongs to <code>Chart.js</code> <strong>v3</strong>.\nIn <code>Chart.js</code> <strong>v2</strong>, you need to use <code>yAxes: [{ gridLines: { color: 'white' } }]</code></p>\n<p>You mixed <code>gridLines: { display: false, color: 'white' }</code>, <strong>which conflicts</strong>.\nIf <code>display: false</code>, then color has no meaning because the grid is off.</p>\n<p>Incorrect <code>document.getElementById</code> in <code>new Chart()</code>. In <strong>v2</strong>, you need to pass a Canvas element (<code>document.getElementById(&quot;id&quot;)</code>), <strong>not a string with an ID.</strong>.</p>\n<pre><code>new Chart(document.getElementById(&quot;&lt;?php echo $info['alias'] ?&gt;&quot;), { \n /* `type` obj,`data` obj are the same. `option` obj below. */\n}\n</code></pre>\n<hr />\n<pre><code>options: {\n legend: { display: false },\n scales: {\n yAxes: [{\n ticks: { min: 0, max: 100, fontColor: 'white' },\n gridLines: { color: 'white' }\n }],\n xAxes: [{\n ticks: { fontColor: 'white' },\n gridLines: { color: 'white' }\n }]\n }\n}\n</code></pre>\n"^^ . + "I added the line "export LD_LIBRARY_PATH=/opt/sqlanywhere17/lib64" into the file /etc/apache2/envvars.\n\nWas a suggestion from chatgpt while trying to troubleshoot the issue."^^ . + . + "<p>Issue resolved while I access the app through <a href="http://127.0.0.1:8000/register" rel="nofollow noreferrer">http://127.0.0.1:8000/register</a> after run <code>composer run dev</code>. The issue was there when I access like\nhttp://localhost/myProjectFolder/public/register</p>\n"^^ . + . + . + . + . + . + . + . + . + "3"^^ . + . + . + . + . + . + . + "Also, I think you straight up "delete" all the code that uses the config value `auth.passwords.users.driver` when you replace [createTokenRepository](https://github.com/laravel/framework/blob/11.x/src/Illuminate/Auth/Passwords/PasswordBrokerManager.php#L83-L110). So `'driver' => 'custom'` doesn't really do anything. Though having it documented/commented that you do weird things to the password stuff is probably a good idea, so just a FYI."^^ . + "@Mako Welcome to Stack Overflow.\nPlease take the [tour] to learn how Stack Overflow works and read [ask] on how to improve the quality of your question.\nThen [edit] your question to include your source code as a working [mcve], which can be tested by others to provide an answer faster. Add any information to the question, not as a comment. Also add the actual content you are sending to the question as well."^^ . + "0"^^ . + "laravel-localization"^^ . + . + . + . + . + "<p>Ok, I traced the issue. The issue is in the expression <code>option.textContent</code>, which is used two times in the <strong>tags.js</strong> file. When you retrieve <code>option.textContent</code> it returns entire text content which includes the extra spaces before and after the actual tag text. So your script is not properly pre-selecting the tags, specifically at this line:</p>\n<p><code>option.selected = selectedTags.has(option.textContent)</code></p>\n<p><strong>Solution:</strong></p>\n<p>In place of the expression <code>option.textContent</code>, either use <code>option.textContent.trim()</code> or <code>option.text</code>. You need to replace this in all the places.</p>\n"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "If you plan to deploy multiple projects on the same hosting, the above approach will not work since it is only suitable for a single project. You can organize the folder structure so that each new project is placed within the `public_html` folder as its own directory. However, you will need a separate `.htaccess` file to direct requests to the appropriate project directory."^^ . + . + . + . + "```[xxx@xxxxx yum.repos.d]$ sudo yum install php-gd\n[sudo] password for abera:\nUpdating Subscription Management repositories.\nUnable to read consumer identity\n\nThis system is not registered with an entitlement server. You can use "rhc" or "subscription-manager" to register.\n\nLast metadata expiration check: 2:20:14 ago on Mon 03 Mar 2025 05:50:52 AM CET.\nError:\n Problem: package php-gd-8.3.17-1.el9.remi.x86_64 from remi-modular requires libgd.so.103()(64bit), but none of the providers can be installed\n - cannot install the best candidate for the job\n ````"^^ . + . + . + "it shows "image-icon with the text " Product Image""^^ . + . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + "No firewall set"^^ . + . + "0"^^ . + "jqgrid"^^ . + . + "laravel-validation"^^ . + . + "0"^^ . + . + . + "I have a call to session_destroy() i a previous php file, but i moved it just befor the header redirect.\nI'm redirected to the logout confirmation page, manual clic to confirm, but still not logged out.\nI added the cookie clearing code just befor, and now it works. After the manual confirmation, when i go back to my app, i'm asked to log in. \nIs it a good practice to do this ?"^^ . + . + "2"^^ . + . + "1"^^ . + . + "0"^^ . + "2"^^ . + . + . + . + . + "Drupal 11: How do I use a custom field with multiple values programmatically?"^^ . + . + . + "0"^^ . + . + "0"^^ . + "How to display an ACF field in WooCommerce product category archive pages"^^ . + "What about bin/php script? What I put inside? I mean, the strength of Herd is I can change PHP version and I can use it everywhere (thanks to php.bat script)."^^ . + . + "0"^^ . + . + "1"^^ . + . + . + "I'm wanting to use Tailwind for the pagination. I've added Paginator::useTailwind(); to the boot method in AppServiceProvider.php but it's not working."^^ . + . + "4"^^ . + . + . + "<p>All the sample code I can find for PHP + MS Graph relate to v1 which used a Graph object. Version 2 now uses a GraphServiceClient and the samples on MS make no sense to me at all.\nWhat I want to do is offer the ability for users of my Web Application the ability to store and retrieve documents using OneDrive instead of a database. I have created the multi-tennant application on my account with hopefully the right permissions. And that's as far as I have got.\nI would appreciate if anyone can point me at a site that has sample code using V2 of MS Graph on how to achieve that. I could be just too dumb, but MS seem to have made everything so complex.</p>\n<p>The steps I imagine are as follows assuming I have an iframe where I list the files the user has uploaded to OneDrive thru my app. Metadata of the files are stored and indexed in my own database table. To upload a file they drag-drop a file on the page or browse and upload.</p>\n<ul>\n<li>Step 1: get them to sign into OneDrive as their tenant by calling GraphServiceClient - with what sort of tokenRequestContext? Do I have to provide their tenant ID?</li>\n<li>Step 2: wait for Graph to call the redirectUri, and store the token it provides in users Session variable?</li>\n<li>Step 3: write an entry in the database table with metadata and get\nthe unique ID to the file</li>\n<li>Step 4: Upload the potentially large file by calling\nLargeFileUploadTask, file named with the ID from Step 3 for later retrieval. Does it matter if file size is less than 3mb?</li>\n</ul>\n<p>Presumably steps 1 and 2 can be skipped if the oauth token exists in their session when next they upload a file, or do I do I have to do that anyway to check it hasn't timed out? The bit about maintaining your own InMemoryAccessTokenCache confuses me. Is that required?\nIf I can figure that out, then I guess the download process should be easy.</p>\n"^^ . + . + . + "<p>You can create a middleware to set the session into the array driver like this.</p>\n<pre><code>use Closure;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Config;\nuse Laravel\\Folio\\Folio;\n\npublic function boot(): void\n{\n Folio::path(resource_path('views/pages'))-&gt;middleware([\n '*' =&gt; [\n function (Request $request, Closure $next) {\n Config::set('session.driver', 'array');\n return $next($request);\n },\n ],\n ])-&gt;uri('/');\n}\n</code></pre>\n<p>When you set the <code>session.driver</code> to <code>array</code>, the session will not be persisted <a href="https://laravel.com/docs/11.x/session#configuration:%7E:text=array,not%20be%20persisted." rel="nofollow noreferrer">as mentioned here in the laravel docs</a>.</p>\n<p>This will skip saving the session into your <code>storage/framework/session</code> directory, or into your <code>sessions</code> table (depending on your <code>SESSION_DRIVER</code> environment) which will free up your storage space.</p>\n<p>Hopefully this helps.</p>\n"^^ . + "0"^^ . + "cached views are on storage/framework/views"^^ . + "1"^^ . + "Hmm, perhaps use another shasum utility that can operate independent to PHP and can handle text-mode as you're on windows."^^ . + . + . + . + . + "1"^^ . + "0"^^ . + "<p>I have a problem with redirectResponse on Symfony 7.2. It works fine with Symfony 6.4.</p>\n<p>If I call the redirection directly, everything is OK.If the redirection is called by a form, it does not work.</p>\n<p>Here is an example :</p>\n<pre><code>&lt;?php\n\nnamespace App\\Controller;\n\nuse App\\Form\\TestType;\nuse Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController;\nuse Symfony\\Component\\HttpFoundation\\RedirectResponse;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFoundation\\Response;\nuse Symfony\\Component\\Routing\\Attribute\\Route;\n\nclass TestController extends AbstractController\n{\n #[Route(path: '/redirection', name: 'redirection')]\n public function redirection(): RedirectResponse\n {\n\n return new RedirectResponse('https://example.com');\n\n }\n \n #[Route(path: '/formulaire', name: 'formulaire')]\n public function index(Request $request): RedirectResponse|Response\n {\n $form = $this-&gt;createForm(TestType::class);\n $form-&gt;handleRequest($request);\n if ($form-&gt;isSubmitted() &amp;&amp; $form-&gt;isValid()) {\n return new RedirectResponse('https://example.com');\n }\n\n return $this-&gt;render('test.html.twig', [\n 'form' =&gt; $form,\n ]);\n }\n\n\n}\n</code></pre>\n<p>// The form (a simple submit button).</p>\n<pre><code>&lt;?php\n\nnamespace App\\Form;\n\n\nuse Symfony\\Component\\Form\\AbstractType;\nuse Symfony\\Component\\Form\\Extension\\Core\\Type\\SubmitType;\nuse Symfony\\Component\\Form\\FormBuilderInterface;\nuse Symfony\\Component\\OptionsResolver\\OptionsResolver;\n\nclass TestType extends AbstractType\n{\n public function buildForm(FormBuilderInterface $builder, array $options): void\n {\n $builder\n -&gt;add('submit', SubmitType::class, [])\n ;\n\n }\n\n\n public function configureOptions(OptionsResolver $resolver): void\n {\n $resolver-&gt;setDefaults([\n ]);\n }\n}\n</code></pre>\n<p>If I consult the &quot;/redirection&quot; route, the redirect happens as expected. If I consult the &quot;/formulaire&quot; route, it gets stuck. I have an error message <em>&quot;Cross-Origin Request Blocked: The &quot;Same Origin&quot; policy does not allow viewing the remote resource located at <a href="https://example.com/" rel="nofollow noreferrer">https://example.com/</a>. Reason: The CORS header &quot;Access-Control-Allow-Origin&quot; is missing. Status code: 501.</em>&quot;</p>\n<p>Am I wrong somewhere? Is there a configuration missing somewhere?</p>\n"^^ . + . + . + . + "custom-wordpress-pages"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + "2"^^ . + "4"^^ . + . + . + "0"^^ . + . + "Out of curiosity: how old is your installation of phpMyAdmin? I had to check some versions to finally find a call to `mb_strpos` in the given file on the given line in version 5.1.1 from 2021 which might not be compatible with PHP 8.4?"^^ . + "This question is similar to: [404 Not Found, but route exist in Laravel 5.4](https://stackoverflow.com/questions/43715106/404-not-found-but-route-exist-in-laravel-5-4). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem."^^ . + . + . + . + "json"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "Can a div's content be populated differently, depending on which page a site visitor came from?"^^ . + . + . + . + "0"^^ . + . + "<p>Fixed by disabling features in my VPN related to browser security. (No coincidence that this happened right as my automated tests broke, due to unrelated changes).</p>\n"^^ . + "0"^^ . + "<p>all\nI've followed this link:\n<a href="https://www.linode.com/docs/guides/email-with-postfix-dovecot-and-mysql/" rel="nofollow noreferrer">https://www.linode.com/docs/guides/email-with-postfix-dovecot-and-mysql/</a>\nto setup an email server to host multiple email domains. Everything works fine. I was wondering if anybody knows how to let the email end user to setup their own password when their accounts are created. As it is now, I need to use the command:\n<strong>sudo doveadm pw -s SHA512-CRYPT</strong>\nto create a password for an user and then input the password hash to the sql server. In other words, I want to automate this process of changing password through a webpage or online interface. I don't have much experience of writing encrypted php codes. Is there such software or code snippet already existed ?</p>\n"^^ . + . + . + "1"^^ . + "0"^^ . + "-3"^^ . + . + . + "<p>Instead of running the command directly, wrap it in cmd /C</p>\n<pre><code>exec('cmd /C ver 2&gt;&amp;1', $out, $code);\n</code></pre>\n<p>or you can try escaping it</p>\n<pre><code>exec('ver ^2^&gt;^&amp;1', $out, $code);\n</code></pre>\n<p>or try</p>\n<pre><code>try shell_exec()\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + . + "<p>Below shows code that attempts to create a submit button that has different presentation determined by whether the user in question is sighted or uses a screen-reader to navigate a webpage.</p>\n<pre><code>&lt;span id='button-description' class='screen-reader-only'&gt;Sort items by date&lt;/span&gt;\n&lt;input aria-hidden='true' type='submit' class='classlink' value='&quot;.$string_sortbydate.&quot;' aria-labelledby='button-description' /&gt;\n</code></pre>\n<p>It works mostly right when the screen reader just reads out the page, but it will read the screen-reader only text twice when using NVDA on Google Chrome. Moreover, when I use the Tab key to navigate through the clickable elements of the page, the screen-reader will read both the span text and the input value despite the fact that the latter text is supposed to be hidden.</p>\n<p>Is it just the case that what I am looking to achieve is not possible, or is there an alternative way to achieve what I want that I have not been made aware of yet?</p>\n"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + "<p>I'm struggling to figure out how to attach PHP to this contact form I have, so that people can send me messages. I'm using it from this folder attached to desktop GitHub repository</p>\n<p>The root folder</p>\n<p><img src="https://i.sstatic.net/pzgC4Mcf.png" alt="" /></p>\n<p>This is the HTML I have for the contact form</p>\n<pre><code>&lt;div class=&quot;headingwrapper&quot;&gt;\n &lt;h2&gt;Contact Me&lt;/h2&gt;\n &lt;div class=&quot;line&quot;&gt;&lt;/div&gt;\n &lt;/div&gt;\n\n&lt;!-- Contact Section --&gt; \n&lt;p&gt;\n&lt;section id=&quot;contact&quot;&gt;\n &lt;div class=&quot;container&quot;&gt;\n &lt;div class=&quot;titlesection&quot;&gt;\n \n &lt;/div&gt;\n &lt;form action=&quot;send_email.php&quot; method=&quot;POST&quot;&gt;\n &lt;div class=&quot;contact_columns&quot;&gt;\n &lt;label for=&quot;name&quot;&gt;Name&lt;/label&gt;\n &lt;input class=&quot;u-full-width&quot; type=&quot;text&quot; id=&quot;name&quot; name=&quot;name&quot; style=&quot;width: 50%;&quot; required&gt;\n &lt;/div&gt;\n \n &lt;div class=&quot;contact_columns&quot;&gt;\n &lt;label for=&quot;email&quot; &gt;Email&lt;/label&gt;\n &lt;input class=&quot;u-full-width&quot; type=&quot;email&quot; id=&quot;email&quot; name=&quot;email&quot; style=&quot;width: 50%;&quot; required&gt;\n &lt;/div&gt;\n\n &lt;div class=&quot;contact_columns&quot;&gt;\n &lt;label for=&quot;subject&quot;&gt;Subject&lt;/label&gt;\n &lt;input class=&quot;u-full-width&quot; type=&quot;text&quot; id=&quot;subject&quot; name=&quot;subject&quot; style=&quot;width: 50%;&quot;&gt; \n &lt;/div&gt;\n \n &lt;div class=&quot;contact_message&quot;&gt;\n &lt;label for=&quot;message&quot;&gt;&lt;/label&gt;\n &lt;textarea class=&quot;u-full-message&quot; id=&quot;message&quot; name=&quot;message&quot; required&gt;Message&lt;/textarea&gt;\n &lt;/div&gt;\n &lt;input class=&quot;button-primary&quot; type=&quot;submit&quot; value=&quot;Submit&quot;&gt;\n &lt;/form&gt;\n &lt;/div&gt;\n \n&lt;/section&gt;\n&lt;/p&gt;\n</code></pre>\n<p>And the PHP form I have in my same root folder is:</p>\n<pre><code>&lt;?php\nif ($_SERVER[&quot;REQUEST_METHOD&quot;] == &quot;POST&quot;) {\n $name = $_POST[&quot;name&quot;];\n $email = $_POST[&quot;email&quot;];\n $subject = $_POST[&quot;subject&quot;];\n $message = $_POST[&quot;message&quot;];\n\n $to = &quot;myemail@email.com&quot;; // Replace with your email\n $subject_email = &quot;Contact Form Submission: &quot; . $subject; //added subject from form.\n $body = &quot;Name: $name\\nEmail: $email\\nSubject: $subject\\nMessage: $message&quot;;\n $headers = &quot;From: myemail@email.com&quot;; // Replace with a valid 'from' address\n\n if (mail($to, $subject_email, $body, $headers)) {\n echo &quot;Thank you! Your message has been sent.&quot;;\n } else {\n echo &quot;Sorry, there was an error sending your message.&quot;;\n }\n} else {\n echo &quot;Invalid request.&quot;;\n}\n?&gt;\n</code></pre>\n<p>The myemail@email.com is replaced with my actual email.</p>\n<p>How do I make this work? I use Mac 15.3.1 and have downloaded MAMP but really don't know what to do at all. I also use GitHub desktop repository to update it.</p>\n<p>Here's the website it's for\n<a href="https://art-444-brian-site.pages.dev/" rel="nofollow noreferrer">https://art-444-brian-site.pages.dev/</a></p>\n<p>I've tried looking at <a href="https://www.phptutorial.net/php-tutorial/php-contact-form/" rel="nofollow noreferrer">https://www.phptutorial.net/php-tutorial/php-contact-form/</a> which only gets me more confused. I just want my contact form to send messages to my email.</p>\n"^^ . + "<p>I am a beginner of php and I tried to write a php file to scrape data from internet and display it in the html file through ajax. My problem is: I get no problem when scraping data and storing them in my database in back-end side. Everything is fine.</p>\n<p>But when I try to send data to my html file through ajax, after html send a request to the php file, I receive a warning message which I don't know how to fix it.</p>\n<pre><code>Uncaught SyntaxError: Unexpected token '&lt;', &quot;&lt;br /&gt;\n&lt;b&gt;&quot;... is not valid JSON\n at JSON.parse (&lt;anonymous&gt;)\n at Object.success (index.html:262:17)\n at c (jquery-3.6.0.min.js:2:28327)\n at Object.fireWith [as resolveWith] (jquery-3.6.0.min.js:2:29072)\n at l (jquery-3.6.0.min.js:2:79901)\n at XMLHttpRequest.&lt;anonymous&gt; (jquery-3.6.0.min.js:2:82355)\n</code></pre>\n<p>Here is my php file. I scrape data first and then store them in my database. After that, I retrieve data I need and encode them into JSON. (I am very sure that my php file can run smoothly)</p>\n<pre><code>&lt;?php\n // The codes above scrape data from internet...\n // The codes above scrape data from internet...\n // The codes above scrape data from internet...\n // The codes above scrape data from internet...\n\n\n $link=mysqli_connect(&quot;localhost&quot;,&quot;root&quot;,&quot;A12345678&quot;,&quot;bulletins translator&quot;);\n $arr = array();\n\n $sql = &quot;SELECT * FROM `daily bulletins`&quot;;\n $result = mysqli_query($link, $sql);\n\n while ( $row = mysqli_fetch_row($result) ) \n {\n array_push($arr, $row[0], $row[1], $row[3]);\n }\n echo json_encode($arr,JSON_UNESCAPED_UNICODE);\n $link-&gt;close();\n?&gt;\n</code></pre>\n<p>Here is the output(json object) that I want.<a href="https://i.sstatic.net/V5aeY0th.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/V5aeY0th.png" alt="enter image description here" /></a></p>\n<p>I want to display them in my html file for further usage. The error pops up in the line</p>\n<pre><code>&quot;$.each(JSON.parse(data), function (key, val) &quot;.\n</code></pre>\n<p>And here is my html file.</p>\n<pre><code>&lt;script&gt; \n$(document).ready(function() \n{\n $.ajax(\n {\n type: 'POST',\n url: 'DataProcessor2.php',\n \n success: function(data) \n {\n var bulletin_array = [];\n $.each(JSON.parse(data), function (key, val) \n {\n console.log(val);\n bulletin_array.push(val);\n });\n\n // And the codes continues here...\n // And the codes continues here...\n // And the codes continues here...\n // And the codes continues here...\n }\n });\n}\n&lt;/script&gt;\n</code></pre>\n<p>I google my problem and find a similar case (<a href="https://stackoverflow.com/questions/74937545/uncaught-syntaxerror-unexpected-token-br-when-using-json-parse-on-the">text</a>). Yet, I have tried the suggestion from <a href="https://stackoverflow.com/users/12453755/ninja-work">Ninja Work</a> but the error still persists. I did add &quot;echo json_encode($arr);&quot; at the end of the script but it does not help at all.</p>\n<p>Which step I was wrong and create the problem? Any suggestion would be appreciated.</p>\n"^^ . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + "race-condition"^^ . + "<p>As you are attaching the volume. Your permissions will be lost one your container starts with the volume.</p>\n<p>Have you tried adding those permissions to entrypoint.sh?</p>\n<pre><code>#Your commands..\n\nchown -R www-data:www-data /var/www/html\n\n#...\n</code></pre>\n<blockquote>\n<p>Also one another suggestion that rather than using ubuntu image and installing php and apache. You can directly use php8.2-apache image and it will reduce your image size and build time.</p>\n</blockquote>\n"^^ . + . + "log-viewer"^^ . + . + "0"^^ . + . + "cURL error(28) in laravel when accessing internal php files"^^ . + "0"^^ . + . + "1"^^ . + . + . + . + . + "1"^^ . + "0"^^ . + "Thank you so much. Activating the session and then working with the values correctly from that session is what did the trick for me. I really appreciate your help. \nThis page also helped as it explains more about setting, using and clearing sessions:\nhttps://rajaamanullah.com/how-to-use-woocommerce-sessions-and-cookies/"^^ . + "2"^^ . + . + . + "0"^^ . + "4"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + . + "1"^^ . + . + . + . + . + "0"^^ . + "@DaveSpencer Be aware that Firefox ignores protection, so this script is not very useful anyway."^^ . + "[Why should I not upload images of code/data/errors?](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors). Code, data and logs are text. Provide it as text, please. See also [ask] where this is mentioned. Images of text are not searchable, copyable, or re-usable in answers, examples, research etc. This makes it a lot harder for people to help you by re-using the info to research or solve your problem, and for others with similar issues/errors to find your question. You can [edit] your post. Thanks."^^ . + "<p>I’m using the latest version of WooCommerce with the block-based checkout (i.e., WooCommerce Blocks), and I need to hide the default “Cash on Delivery” (COD) payment method unless the shipping country is German (DE).</p>\n<p>In the classic checkout flow, this could easily be achieved using the woocommerce_available_payment_gateways filter:</p>\n<pre><code>add_filter('woocommerce_available_payment_gateways', 'custom_restrict_cod_for_slovenia');\nfunction custom_restrict_cod_for_slovenia($gateways) {\n if (is_admin()) return $gateways;\n\n if (isset($gateways['cod'])) {\n $shipping_country = WC()-&gt;customer-&gt;get_shipping_country();\n if ($shipping_country !== 'DE') {\n unset($gateways['cod']);\n }\n }\n return $gateways;\n}\n</code></pre>\n<p>This works perfectly in the classic checkout, but it does NOT work in the block-based checkout – the COD method still appears even if the shipping country is not Slovenia, and it doesn’t update dynamically when the user changes the country.</p>\n<p>I’ve also tried hooking into woocommerce_store_api_payment_methods like this:</p>\n<pre><code>add_filter('woocommerce_store_api_payment_methods', 'custom_cod_for_si_only', 10, 2);\nfunction custom_cod_for_si_only($gateways, $request) {\n if (isset($gateways['cod'])) {\n if (\n isset($request['shipping_address']['country']) &amp;&amp;\n $request['shipping_address']['country'] !== 'DE'\n ) {\n unset($gateways['cod']);\n }\n }\n return $gateways;\n}\n</code></pre>\n<p>But even this doesn’t work as expected. The COD payment method still shows up regardless of the selected country, and doesn’t hide dynamically when switching the country at checkout.</p>\n"^^ . + . + . + "1"^^ . + . + "0"^^ . + . + "@MarkusZeller As I see it now, the webhook URL is not being called, even though it is set correctly. It works fine if I open the page directly in the browser."^^ . + "But `public_path()` returns a file system path, not a HTTP URL, right? I suppose you'd have to prefix it with an additional `file://` then, so that it could be validated by the first of those rules. Or use HTTP URLs instead of file system paths to begin with."^^ . + "0"^^ . + . + . + "Why are you using `mysqli_free_result` at all?"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "The response is coming from `admin-ajax.php`. Without the code of that script there's no way to know why you're getting it."^^ . + "0"^^ . + "0"^^ . + "0"^^ . + "@C3roe no error whatsoever in the console"^^ . + . + . + "2"^^ . + . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + "2"^^ . + . + "Pivot 2 tables with year and month column base on date range"^^ . + . + "1"^^ . + . + "0"^^ . + "1"^^ . + . + "@FrankvanPuffelen Yes, that was me thinking as I was wondering because you already answered, and seeing you [asked now as well](https://stackoverflow.com/questions/79477106/how-to-insert-child-node-unique-key-from-my-data?noredirect=1#comment140165318_79477117)"^^ . + "0"^^ . + "1"^^ . + "Woocommerce Order Quantity in Multiples for variable products"^^ . + . + . + . + . + . + . + "Laravel env() function is not reading from .env file"^^ . + . + . + . + "0"^^ . + . + . + "<p>I want to create and save image in upload folder but this work is only done correctly when I directly hit php (upload) file. When using ajax, the success function gives me done but no image upload.</p>\n<p>Here is my ajax..</p>\n<pre class="lang-js prettyprint-override"><code>$(document).ready(function() {\n $(&quot;#form&quot;).on('submit', function(e) {\n e.preventDefault();\n $('.spinner-border').show();\n // Submit the form data to the server using jQuery AJAX\n $.ajax({\n url: &quot;icoup.php&quot;,\n type: &quot;POST&quot;,\n data: new FormData(this),\n contentType: false,\n cache: false,\n processData: false,\n success: function(data) {\n console.log(data);\n $(&quot;.cbox4&quot;).show();\n $('.cbox').hide();\n $('.cbox3').show();\n\n },\n error: function(e) {\n // $(&quot;#err&quot;).html(e).fadeIn();\n }\n });\n });\n});\n</code></pre>\n\n<p>And php</p>\n<pre><code>&lt;?php\nfunction compress_image($s,$d,$q) {\n $info = getimagesize($s);\n if($info['mime']=='image/jpeg'){$image = imagecreatefromjpeg($s);}\n elseif($info['mime']=='image/png'){$image = imagecreatefrompng($s);}\n elseif($info['mime']=='image/gif'){$image = imagecreatefromgif($s);}\n elseif($info['mime']=='image/jpg'){$image = imagecreatefromjpeg($s);}\n imagejpeg($image,$d,$q);\n}\nif(isset($_POST['submit'])){\n $image = $_FILES['file']['tmp_name'];\n $source_image = $image;\n $newname = 'Boxx_'.time();\n $newnumber = rand(100, 1000);\n $fname = $newname.'_'.$newnumber.'.jpeg';\n $destini = 'uploads/'.$fname;\n compress_image($source_image,$destini,60);\n}?&gt; \n</code></pre>\n"^^ . + "2"^^ . + "0"^^ . + . + . + . + "<p>I've been tasked with editing the PHP inside an XML file. I had no idea this was a thing people did, and I wish they didn't, because I don't understand it. So I tried to look it up and I came across <a href="https://stackoverflow.com/questions/5549645/php-code-inside-xml">this question and answer about how to add php to an XML file</a>.</p>\n<p>It seemed like a really promising QA, because the format suggested by the top answer (using &quot;&lt;![CDATA[&quot; and &quot;]]&gt;&quot; around the PHP is exactly what's happening in the xml file I've been tasked to edit.</p>\n<p>But now my question is... How the heck do I run the thing? It obviously can't run just by doing <code>php -S localhost:8000</code>, because it's not php. there is no <code>&lt;?php</code> or <code>?&gt;</code>, so the interpreter wouldn't know what was php and what wasn't.</p>\n<p>Why is there php in the xml file? and what do now that it's already happened?</p>\n<p>Here's a minimal example (not the actual file I'm working with).</p>\n<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;\n&lt;product productid=&quot;blah blah blah&quot; active=&quot;1&quot;&gt;\n &lt;title&gt;blah blah&lt;/title&gt;\n &lt;description&gt;&lt;![CDATA[yadda yadda]]&gt;&lt;/description&gt;\n &lt;version&gt;1.3&lt;/version&gt;\n &lt;url&gt;&lt;![CDATA[http://www.foobar.com/mods/misc.php?do=producthelp&amp;pid=hashbaz]]&gt;&lt;/url&gt;\n &lt;versioncheckurl&gt;&lt;![CDATA[http://www.foobar.com/mods/misc.php?do=productcheck&amp;pid=hashbaz]]&gt;&lt;/versioncheckurl&gt;\n &lt;dependencies&gt;\n &lt;dependency dependencytype=&quot;vbulletin&quot; minversion=&quot;3.5&quot; maxversion=&quot;5.0.0&quot; /&gt;\n &lt;/dependencies&gt;\n &lt;codes&gt;\n &lt;/codes&gt;\n &lt;templates&gt;\n &lt;/templates&gt;\n &lt;stylevardfns&gt;\n &lt;/stylevardfns&gt;\n &lt;stylevars&gt;\n &lt;/stylevars&gt;\n &lt;plugins&gt;\n &lt;plugin active=&quot;1&quot; executionorder=&quot;5&quot;&gt;\n &lt;title&gt;some plugin&lt;/title&gt;\n &lt;hookname&gt;some hook name&lt;/hookname&gt;\n &lt;phpcode&gt;&lt;![CDATA[ echo &quot;and now we're doing php for some reason???&quot; . $qux; ]]&gt;&lt;/phpcode&gt;\n &lt;/plugin&gt;\n &lt;/plugins&gt;\n&lt;/products&gt;\n</code></pre>\n"^^ . + "1"^^ . + "1"^^ . + . + . + . + . + "bittorrent"^^ . + "This question is similar to: [PHP Pass variable to next page](https://stackoverflow.com/questions/871858/php-pass-variable-to-next-page). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem."^^ . + "sorry for that, but can you help me restructure my code?"^^ . + . + "@YourCommonSense\n\n**Fail** as in \n\n`Failed: SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (TESTDB) (severity 9)`"^^ . + . + . + . + . + "Issue with WP_Session_Tokens::destroy() – Nothing happen"^^ . + . + "<p>I've been trying to use my own textract adapter but it doesn't work propertly.\nIt only works the queries that I write in the QueriesConfig section, and my trained adapter doesn't work, my training doesn't work.</p>\n<p>Here is my method.</p>\n<pre><code>public function analyzeDocumentWithAdapter($imageBytes, $queries, $adapterId)\n {\n // dd('Enviando solicitud a Textract con AdapterId:', ['AdapterId' =&gt; $adapterId]);\n\n $result = $this-&gt;textract-&gt;analyzeDocument([\n 'Document' =&gt; [\n 'Bytes' =&gt; $imageBytes,\n ],\n 'FeatureTypes' =&gt; ['QUERIES'],\n 'QueriesConfig' =&gt; [\n 'Queries' =&gt; [\n ['Text' =&gt; 'What is the first name on the dpi?', 'Alias' =&gt; 'first_name'],\n ['Text' =&gt; 'What is the first last name on the dpi?', 'Alias' =&gt; 'first_last_name'],\n ['Text' =&gt; 'What is the second name on the dpi?', 'Alias' =&gt; 'second_name'],\n ['Text' =&gt; 'What is the date of birth?', 'Alias' =&gt; 'birth_date'],\n ['Text' =&gt; 'What is the second last name on the dpi?', 'Alias' =&gt; 'second_last_name'],\n ['Text' =&gt; 'What is the married last name?', 'Alias' =&gt; 'married_last_name'],\n ['Text' =&gt; 'What is the cui?', 'Alias' =&gt; 'cui'],\n ]\n ],\n 'AdapterConfig' =&gt; [\n 'Adapters' =&gt; [\n 'AdapterId' =&gt; $adapterId, // ID del adaptador entrenado,\n 'AdapterVersion' =&gt; '5',\n ]\n \n ],\n ]);\n\n return $result['Blocks'] ?? [];\n }\n</code></pre>\n<p>I've been tying to use my trained adapter, it's meant to be used with photos I upload in an input file in html. And I want to use it.</p>\n"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + "jquery"^^ . + "0"^^ . + "0"^^ . + "1"^^ . + "<p>I just deployed my application to Laravel Cloud, and it’s working great: good performance, all packages work perfectly, and the login on PC works very well. However, on mobile, when logging in, it throws a 419 'Page Expired' error and does not redirect, even after refreshing the page.</p>\n<p>Does anyone have any idea what could be causing this bug that only occurs on mobile?</p>\n<p><a href="https://github.com/laravel/ui" rel="nofollow noreferrer">https://github.com/laravel/ui</a></p>\n<p>I've been reviewing the code, but I can't find the problem.</p>\n"^^ . + "0"^^ . + "I did it this way, replaced `createModelByType()` , but now it tryes to make sql request. \n**SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.dummy_classes' doesn't exist (Connection: mysql, SQL: select * from `dummy_classes` where `dummy_classes`.`id` in (34, 32, 30, 17))**.\nActually if I create table dummy_classes with id field, this gonna work. But I can't do this."^^ . + "As noted, you _could_ open a hole in your router and allow the Internet to hit your personal machine, but... you really shouldn't, pretty much ever. Even if you're an expert at PHP, I wouldn't recommend doing this. Do you actually _need_ the general public to be able to see the page? What are you trying to accomplish? The ability to dev while not at home?"^^ . + . + . + "Interesting. Thank you. Since several area codes can share the same first few digits, but the full area code will be unique, do you think that searching for the longest possible string first with `for($len=6;$len>=4;$len--)` might be faster?"^^ . + . + "1"^^ . + "0"^^ . + "Can i use password_verify if i set the password to type "password_hash" in phpmyadmin"^^ . + . + "I've update the composer file with mongodb as ^1.6 yet I still get the following error running composer install: Problem 1\n - Root composer.json requires mongodb/mongodb ^1.6 -> satisfiable by mongodb/mongodb[1.6.0, ..., v1.x-dev]."^^ . + . + . + "1"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + "https://blog.greglow.com/2018/01/15/sql-newbie-mistake-1-using-float-instead-decimal/"^^ . + . + . + . + "1"^^ . + . + . + . + "1"^^ . + "<p>I have a two-dimensional array that looks something like this:</p>\n<pre><code>Array\n(\n [0] =&gt; Array\n (\n [0] =&gt; 1\n [1] =&gt; John\n [2] =&gt; Smith\n [3] =&gt; 7\n )\n\n [1] =&gt; Array\n (\n [0] =&gt; 2\n [1] =&gt; Robert\n [2] =&gt; Williams\n [3] =&gt; 4\n )\n\n)\n</code></pre>\n<p>I need to combine the row number from the top level (here: <code>0</code> and <code>1</code>) with the value in row 3 of the subordinate array of that row (here: <code>7</code> and <code>4</code>) into a new associative array, so that the new array looks like this:</p>\n<pre><code>Array\n(\n [0] =&gt; 7\n [1] =&gt; 4\n)\n</code></pre>\n<p>Is this possible without looping through each row?</p>\n<pre><code>$new = array();\nforeach($old as $key =&gt; $value){\n $new[$key] = $value[3];\n}\n</code></pre>\n<hr />\n<p>I come from R, where we're taught to use functions (such as <code>z &lt;- sapply(x, quantile)</code>) or vectorized alternatives (such as <code>z &lt;- x - y</code>) instead of loops, but I'm not familiar with PHP so that may not be a concern here.</p>\n"^^ . + "3"^^ . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + "livewire-3"^^ . + . + . + . + "0"^^ . + "I already explained to you that "the valid statement above" DOES work. And it returning 0 only means you provided just same value. Want it to return 1? Provide a different value. As simple as that. Regarding the link, I don't understand what it supposed to mean. You were supposed to provide a WORKING code that demonstrates your problem (being supplied with different value, the update query returns 0 affected rows). But not only you are using identical value but the PHP part is just a pile of random operators that returns a bunch of errors. May be the link is wrong? Please find the right one."^^ . + . + "-1"^^ . + . + "you need to remove "resources/" from the post permalink while keeping it in the taxonomy and archive URLs. Do you want me to do it in my code above?"^^ . + . + . + . + . + . + . + . + "<p>Add CSS based on URL value, if you can not add additional CSS classes:</p>\n<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false" data-babel-preset-react="false" data-babel-preset-ts="false">\r\n<div class="snippet-code">\r\n<pre class="snippet-code-css lang-css prettyprint-override"><code>a[href*="/event/"],\na[href*="/event/"]:visited {\n color: green;\n}\n\na[href*="/people/"],\na[href*="/people/"]:visited {\n color: red;\n}</code></pre>\r\n<pre class="snippet-code-html lang-html prettyprint-override"><code>History is filled with many people and events. &lt;a href="https://example.com/people/henry"&gt;Henry VIII&lt;/a&gt; was once &lt;a href="https://example.com/event/henry-birth"&gt;born&lt;/a&gt;.</code></pre>\r\n</div>\r\n</div>\r\n</p>\n"^^ . + "0"^^ . + "Thanks for your answer, I tried to generate the graph but it does not help very much. Also, according to the docs it should be detected by default but idk why it does not https://psalm.dev/articles/detect-security-vulnerabilities-with-psalm"^^ . + . + . + "0"^^ . + "2"^^ . + . + "4"^^ . + . + . + "<p>I am working within a script to send emails using a template created on my shopware6 admin.</p>\n<p>When I send with order variables like this:</p>\n<pre><code>&lt;p&gt;Order Number: {{ order.orderNumber }}&lt;/p&gt;\n&lt;p&gt;Customer Name: {{ order.orderCustomer.firstName }} {{ order.orderCustomer.lastName }}&lt;/p&gt;\n&lt;p&gt;Delivery Status: {{ order.deliveries.first.stateMachineState.translated.name }}&lt;/p&gt;\n</code></pre>\n<p>In my shopware6 i get this error</p>\n<blockquote>\n<p>[business_events] mail.sent.error [&quot;source&quot; =&gt; &quot;core&quot;,&quot;environment&quot; =&gt; &quot;dev&quot;,&quot;additionalData&quot; =&gt; [&quot;exception&quot; =&gt; &quot;&quot;&quot; Shopware\\Core\\Framework\\Adapter\\Twig\\Exception\\StringTemplateRenderingException: Failed rendering string template using Twig: Variable &quot;order&quot; does not exist in</p>\n</blockquote>\n<p>but without the order variables the mail is sent.</p>\n<p>My belief is that I am passing it correctly as below:</p>\n<pre><code>protected function reminderMail($fname, $email, $order, $context)\n {\n \n $salesChannelConfig = $this-&gt;systemConfigService-&gt;get('core.defaultSalesChannel');\n $salesChannelId = isset($salesChannelConfig['salesChannel'][0]) ? $salesChannelConfig['salesChannel'][0] : null;\n\n $mailTemplate = $this-&gt;mailTemplateRepository-&gt;search(\n (new Criteria(['£££'])), // Search by ID\n $context\n )-&gt;get('£££'); // Get the template by ID\n \n if (!$mailTemplate) {\n throw new \\RuntimeException('Mail template not found');\n }\n\n // dd($order);\n // Prepare the data bag\n $dataBag = new DataBag();\n $recipients = [\n $email =&gt; $fname,\n // Add more recipients as needed\n ];\n $dataBag-&gt;set('recipients', $recipients);\n $dataBag-&gt;set('senderName', 'Your Sender Name');\n $dataBag-&gt;set('contentHtml', $mailTemplate-&gt;getContentHtml());\n $dataBag-&gt;set('contentPlain', $mailTemplate-&gt;getContentPlain());\n $dataBag-&gt;set('subject', $mailTemplate-&gt;getSubject());\n $dataBag-&gt;set('salesChannelId', $salesChannelId);\n \n // Add any additional data you want to pass to the template\n $dataBag-&gt;set('data', $order);\n \n \n // Send the email\n $this-&gt;mailService-&gt;send($dataBag-&gt;all(), $context);\n }\n</code></pre>\n<p>Please help</p>\n"^^ . + "<p>I have also activated safe svg but not working.Can any one help me with this issue. When i am uploading svg icons in backend using icon box it is showing in upload section but not showing in preview mode and front mode. i have added default elementor svg code but still it is not working. can somebody help me with this code it would be great</p>\n<p><a href="https://i.sstatic.net/UmV7VKSE.png" rel="nofollow noreferrer">enter image description here</a></p>\n<pre><code>// Add Your Controll In This Function\nprotected function register_controls() {\n\n $this-&gt;start_controls_section(\n 'section_content',\n [\n 'label' =&gt; esc_html__( 'Content', 'hotelft' ),\n ]\n ); \n\n $this-&gt;add_control(\n 'type',\n [\n 'label' =&gt; esc_html__( 'Type', 'hotelft' ),\n 'type' =&gt; Controls_Manager::SELECT,\n 'options' =&gt; [\n 'v1' =&gt; esc_html__( 'Type 1', 'hotelft' ),\n 'v2' =&gt; esc_html__( 'Type 2', 'hotelft' ),\n ],\n 'default' =&gt; 'v1',\n ]\n );\n\n $this-&gt;add_control(\n 'link_to',\n [\n 'label' =&gt; esc_html__( 'Link', 'hotelft' ),\n 'type' =&gt; Controls_Manager::SELECT,\n 'options' =&gt; [\n 'none' =&gt; esc_html__( 'None', 'hotelft' ),\n 'custom' =&gt; esc_html__( 'Custom URL', 'hotelft' ),\n ],\n 'default' =&gt; 'custom',\n ]\n );\n\n $this-&gt;add_control(\n 'link',\n [\n 'label' =&gt; esc_html__( 'Link', 'hotelft' ),\n 'type' =&gt; Controls_Manager::URL,\n 'dynamic' =&gt; [\n 'active' =&gt; true,\n ],\n 'placeholder' =&gt; esc_html__( 'https://your-link.com', 'hotelft' ),\n 'condition' =&gt; [\n 'link_to' =&gt; 'custom',\n ],\n 'show_label' =&gt; false,\n ]\n );\n\n $this-&gt;add_control(\n 'icon',\n [\n 'label' =&gt; __( 'Icon', 'hotelft' ),\n 'type' =&gt; Controls_Manager::ICONS,\n 'default' =&gt; [\n 'value' =&gt; 'icomoon icomoon-diamond',\n 'library' =&gt; 'icomoon',\n ],\n\n ]\n );\n \n $this-&gt;add_control(\n 'icon',\n [\n 'label' =&gt; __( 'Icon', 'hotelft' ),\n 'type' =&gt; Controls_Manager::ICONS,\n 'label_off' =&gt; esc_html__( 'Off', 'elementor' ),\n 'label_on' =&gt; esc_html__( 'On', 'elementor' ),\n 'condition' =&gt; [\n 'value' =&gt; 'svg',\n 'selected_icon[library]' =&gt; 'svg',\n ],\n 'selectors' =&gt; [\n '{{WRAPPER}} .elementor-icon-wrapper svg' =&gt; 'width: 100%;',\n ],\n ]\n );\n \n $this-&gt;add_control(\n 'title',\n [\n 'label' =&gt; esc_html__( 'Title', 'hotelft' ),\n 'type' =&gt; Controls_Manager::TEXT,\n 'row' =&gt; 5,\n 'default' =&gt; esc_html__('Luxury Amenities','hotelft'),\n ]\n );\n\n $this-&gt;add_control(\n 'description',\n [\n 'label' =&gt; esc_html__( 'Description', 'hotelft' ),\n 'type' =&gt; Controls_Manager::TEXTAREA,\n 'default' =&gt; esc_html__( 'We have chosen luxury facilities for our hotel from reliable reputable brands', 'hotelft' ),\n 'condition' =&gt; [\n 'type' =&gt; 'v1'\n ]\n ]\n );\n\n $this-&gt;add_responsive_control(\n 'align',\n [\n 'label' =&gt; esc_html__( 'Alignment', 'hotelft' ),\n 'type' =&gt; Controls_Manager::CHOOSE,\n 'options' =&gt; [\n 'left' =&gt; [\n 'title' =&gt; esc_html__( 'Left', 'hotelft' ),\n 'icon' =&gt; 'eicon-text-align-left',\n ],\n 'center' =&gt; [\n 'title' =&gt; esc_html__( 'Center', 'hotelft' ),\n 'icon' =&gt; 'eicon-text-align-center',\n ],\n 'right' =&gt; [\n 'title' =&gt; esc_html__( 'Right', 'hotelft' ),\n 'icon' =&gt; 'eicon-text-align-right',\n ],\n ],\n 'selectors' =&gt; [\n '{{WRAPPER}} .ova-card' =&gt; 'text-align: {{VALUE}};',\n '{{WRAPPER}} .ova-card.v2' =&gt; 'text-align: {{VALUE}};',\n ],\n 'separator' =&gt; 'before'\n ]\n );\n\n $this-&gt;end_controls_section();\n\n /* Begin icon Style */\n $this-&gt;start_controls_section(\n 'icon_style',\n [\n 'label' =&gt; esc_html__( 'Icon', 'hotelft' ),\n 'tab' =&gt; Controls_Manager::TAB_STYLE,\n ]\n );\n \n $this-&gt;add_responsive_control(\n 'size_icon',\n [\n 'label' =&gt; esc_html__( 'Size', 'hotelft' ),\n 'type' =&gt; Controls_Manager::SLIDER,\n 'size_units' =&gt; [ 'px'],\n 'range' =&gt; [\n 'px' =&gt; [\n 'min' =&gt; 0,\n 'max' =&gt; 100,\n 'step' =&gt; 1,\n ],\n ],\n 'selectors' =&gt; [\n '{{WRAPPER}} .ova-card .icon i' =&gt; 'font-size: {{SIZE}}{{UNIT}};',\n ],\n ]\n );\n\n $this-&gt;add_control(\n 'icon_color',\n [\n 'label' =&gt; esc_html__( 'Color', 'hotelft' ),\n 'type' =&gt; Controls_Manager::COLOR,\n 'selectors' =&gt; [\n '{{WRAPPER}} .ova-card .icon i' =&gt; 'color: {{VALUE}};',\n ],\n ]\n );\n\n $this-&gt;add_control(\n 'icon_color_hover',\n [\n 'label' =&gt; esc_html__( 'Color Hover', 'hotelft' ),\n 'type' =&gt; Controls_Manager::COLOR,\n 'selectors' =&gt; [\n '{{WRAPPER}} .ova-card:hover .icon i' =&gt; 'color: {{VALUE}};',\n ],\n ]\n );\n\n $this-&gt;add_responsive_control(\n 'icon_padding',\n [\n 'label' =&gt; esc_html__( 'Padding', 'hotelft' ),\n 'type' =&gt; Controls_Manager::DIMENSIONS,\n 'size_units' =&gt; [ 'px', '%', 'em' ],\n 'selectors' =&gt; [\n '{{WRAPPER}} .ova-card .icon' =&gt; 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n ],\n ]\n );\n\n $this-&gt;end_controls_section();\n /* End icon style */\n\n\n \n\n}\n\nprivate function get_link_url( $settings ) {\n\n if ( 'none' === $settings['link_to'] ) {\n return false;\n }\n\n if ( 'custom' === $settings['link_to'] ) {\n if ( empty( $settings['link']['url'] ) ) {\n return false;\n }\n\n return $settings['link'];\n }\n\n return false;\n \n}\n\n// Render Template Here\nprotected function render() {\n\n $settings = $this-&gt;get_settings();\n $type = $settings['type'];\n\n $title = $settings['title'];\n $description = isset( $settings['description'] ) ? $settings['description'] : '';\n $class_icon = $settings['icon']['value'];\n $link = $this-&gt;get_link_url( $settings );\n\n ?&gt;\n\n &lt;?php if(!empty( $link['url'])) : ?&gt;\n &lt;?php $nofollow = ( isset( $link['nofollow'] ) &amp;&amp; $link['nofollow'] ) ? ' rel=&quot;nofollow&quot;' : ''; ?&gt;\n &lt;a href=&quot;&lt;?php echo esc_url( $link['url'] ); ?&gt; &quot; &lt;?php echo ( isset( $link['is_external'] ) &amp;&amp; $link['is_external'] !== '' ) ? ' target=&quot;_blank&quot;' : '' ?&gt; &lt;?php echo esc_attr( $nofollow ); ?&gt;&gt;\n &lt;?php endif; ?&gt;\n\n &lt;div class=&quot;ova-card &lt;?php echo esc_html( $type ); ?&gt;&quot;&gt;\n\n &lt;?php if (!empty( $class_icon )): ?&gt;\n &lt;div class=&quot;icon&quot;&gt;\n &lt;i class=&quot;&lt;?php echo esc_attr( $class_icon ); ?&gt;&quot;&gt;&lt;/i&gt;\n &lt;/div&gt;\n &lt;?php endif;?&gt;\n\n &lt;?php if (!empty( $title )): ?&gt;\n &lt;h3 class=&quot;title&quot;&gt;\n &lt;?php echo esc_html( $title ); ?&gt;\n &lt;/h3&gt;\n &lt;?php endif;?&gt;\n\n &lt;?php if ( $type === 'v1') : ?&gt;\n &lt;?php if (!empty( $description )): ?&gt;\n &lt;p class=&quot;description&quot;&gt;\n &lt;?php echo esc_html( $description ); ?&gt;\n &lt;/p&gt;\n &lt;?php endif;?&gt;\n &lt;?php endif;?&gt;\n \n &lt;/div&gt;\n\n &lt;?php if(!empty( $link['url'])) : ?&gt;\n &lt;/a&gt;\n &lt;?php endif; ?&gt;\n \n &lt;?php\n}\n</code></pre>\n<p>}\n$widgets_manager-&gt;register( new hotelft_Elementor_Card() );</p>\n"^^ . + . + "Why not seperate the classes into smaller packages?"^^ . + "www-data not able to find ODBC drivers"^^ . + . + . + . + . + "@Barmar thanks for your feedback. I forgot I hadn't updated my example to have the original content in there. I have now updated my example code. All the examples I have come across online have the `fprintf()` formatted exactly how I've put it, I didn't even realise. So should this be `fprintf($handle, "s%", chr(0xEF) . chr(0xBB) . chr(0xBF))`?"^^ . + . + "1"^^ . + . + . + "1"^^ . + . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + . + "2"^^ . + . + "2"^^ . + "2"^^ . + "<p>It looks like a dynamic <code>PIVOT</code>, so a possible approach here is a dynamic statement. A simplified example, without the <code>WHERE</code> clause and based on your test data, is the following statement:</p>\n<pre><code>-- Column list\nDECLARE @col nvarchar(MAX)\nSELECT @col = STUFF(\n (\n SELECT CONCAT(N',[', FORMAT(month_year, 'MMM yyyy'), N']')\n FROM (\n SELECT DISTINCT EOMONTH(dateposted) AS month_year\n FROM table1\n ) t\n ORDER BY month_year\n FOR XML PATH(''), TYPE\n ).value('.', 'nvarchar(max)'), 1, 1, ''\n)\n\n-- Dynamic PIVOT\nDECLARE @stm nvarchar(MAX)\nDECLARE @err int\nSET @stm = \n N'SELECT accountname, ' + @col + N', target ' +\n N'FROM ('+\n N'SELECT t1.accountname, t1.amount, t2.target, FORMAT(dateposted, ''MMM yyyy'') AS month_year ' +\n N'FROM table1 t1 ' +\n N'LEFT JOIN table2 t2 ON t1.accountname = t2.accountname ' +\n N') t ' +\n N'PIVOT (SUM(amount) FOR month_year IN (' + @col + ')) p '\nEXEC @err = sp_executesql @stm\nIF @err &lt;&gt; 0 SELECT 'Error' AS Result\n\n</code></pre>\n<p>The next step is to execute this statement with PHP. I'm not sure which driver do you use to connect to SQL Server, but the following example demonstrates the solution with PHP Driver for SQL Server. As an additional note, always try to use parameterized statements to prevent possible SQL injection issues.</p>\n<pre><code>&lt;?php\n$server = 'server\\instance,port';\n$database = 'database';\n$uid = 'uid';\n$pwd = 'pwd';\n\ntry {\n $conn = new PDO(&quot;sqlsrv:server=$server;Database=$database&quot;, $uid, $pwd);\n $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n} catch( PDOException $e ) {\n die( &quot;Error connecting to SQL Server&quot;.$e-&gt;getMessage());\n}\n\ntry {\n\n $tsql = &quot;\n SET NOCOUNT ON\n -- Dates\n DECLARE @date1 datetime\n DECLARE @date2 datetime\n SET @date1 = ?\n SET @date2 = ?\n -- Column list\n DECLARE @col nvarchar(MAX)\n SELECT @col = STUFF(\n (\n SELECT CONCAT(N',[', FORMAT(month_year, 'MMM yyyy'), N']')\n FROM (\n SELECT DISTINCT EOMONTH(dateposted) AS month_year\n FROM table1\n WHERE dateposted BETWEEN @date1 AND @date2\n ) t\n ORDER BY month_year\n FOR XML PATH(''), TYPE\n ).value('.', 'nvarchar(max)'), 1, 1, ''\n )\n -- Dynamic PIVOT\n DECLARE @stm nvarchar(MAX)\n DECLARE @prm nvarchar(MAX)\n DECLARE @err int\n SET @stm = \n N'SELECT accountname, ' + @col + N', target ' +\n N'FROM ('+\n N'SELECT t1.accountname, t1.amount, t2.target, FORMAT(dateposted, ''MMM yyyy'') AS month_year ' +\n N'FROM table1 t1 ' +\n N'LEFT JOIN table2 t2 ON t1.accountname = t2.accountname ' +\n N'WHERE dateposted BETWEEN @date1 AND @date2 ' +\n N') t ' +\n N'PIVOT (SUM(amount) FOR month_year IN (' + @col + ')) p '\n SET @prm = N'@date1 datetime, @date2 datetime'\n EXEC @err = sp_executesql @stm, @prm, @date1, @date2\n IF @err &lt;&gt; 0 SELECT 'Error' AS Result\n &quot;;\n\n $date1 = '20221201';\n $date2 = '20230331';\n $stmt = $conn-&gt;prepare($tsql);\n $stmt-&gt;bindParam(1, $date1, PDO::PARAM_STR);\n $stmt-&gt;bindParam(2, $date2, PDO::PARAM_STR);\n $stmt-&gt;execute();\n while ($row = $stmt-&gt;fetch(PDO::FETCH_ASSOC)) {\n foreach ($row as $name =&gt; $value) {\n echo $name. &quot;: &quot; . $value . &quot;&lt;br&gt;&quot;;\n }\n echo &quot;&lt;br&gt;&quot;;\n }\n \n} catch (PDOException $e) {\n die (&quot;Error executing query. &quot;.$e-&gt;getMessage());\n}\n\n$stmt = null;\n$conn = null;\n?&gt;\n\n</code></pre>\n"^^ . + "2"^^ . + . + . + "@siggemannen *"Money has been deprecated"* Where did you see that?"^^ . + . + "0"^^ . + . + "2"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "Money has been deprecated since probably the fall of soviet union, why would you want to use it in new code?"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + "2"^^ . + . + . + "<p>i'm using laravel backpack and i have a table that has a lot of columns like 10 or more.\nbut in laravel backpack it is not showing them all, it is showing like 7 or 8 and not all (depending on the length of the column laber or data) meaning laravel backpack is limiting what is shwon based on size, i couldn't find how to make it show every column, any help?</p>\n<p>i tried keeping the CRUD::setFromDb(); in the protected function setupListOperation() of my table controller and also tried adding the columns manually using CRUD::addColumn and it is still limiting what is shown.</p>\n"^^ . + . + . + "@hakre thanks, but that was just a silly mistake while creating an example to post in stackoverflow. It's not related."^^ . + . + "2"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + "Ohhh, yeah that seems to have been the problem. I can get start/end date if i do print_r on the $product instead. Thanks!"^^ . + . + . + . + . + . + . + . + . + "Well, 1) it's not actually an error message it's a deprecation notice. Your code hasn't actually stopped working (unless perhaps Laravel has decided to treat it as an exception). But...what bit of the error are you unclear about? Have you researched it at all? Presumably somehwere you're providing a field as part of your email which is null, and you can't pass null to htmlspecialchars - what's it supposed to encode, in that instance? Doesn't make a lot of sense does it. So just add something to test that the data isn't null before trying to send it in an email."^^ . + . + . + . + . + "referrer"^^ . + "2"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + "Regular expression to match part of an optional part of a string"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + "Hi @C3roe, i check disable cache option & reloaded, still no styles"^^ . + . + . + . + . + "@KeyboardCorporation Sure, I'll edit my post"^^ . + . + . + "0"^^ . + . + . + "It's clear that delegation should be applied, but it doesn't work out how to apply it to the current script."^^ . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + "1"^^ . + "Validation error not working for form fields"^^ . + . + . + "3"^^ . + . + "On the contrary, you **shouldn't** use any catch (PDOException $e) to debug queries, PHP is pretty fine language and can report errors already, without any assistance. As of the "unsuccessful" query, [here is a checklist you must follow](https://stackoverflow.com/a/76938055/285587). I know it's long, and only one item will prove useful but still there is no other way than ruling out every possibility."^^ . + . + . + "1"^^ . + . + . + "0"^^ . + "The `$conn` should have the database (schema) included. Are you sure the name of the table is `"schema.table"` or is it just `"table"`?"^^ . + "What's the point in preparing a SQL statement without any parameters?"^^ . + . + . + . + . + "0"^^ . + "RSA encrypting a string with private key - Crypt_RSA replacment"^^ . + . + . + . + "Did you also check through Symfony's Profiler if anything looks suspicious? I would assume that you've tried any working request to that API in any other way, just to ensure that it's not a problem of the API itself?"^^ . + "1"^^ . + "0"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + "0"^^ . + "You need to create database first of all\nthen you need to putt database information in .env file\nthen you need to run php artisan migrate command\nhope after this your issue will be resolve properly"^^ . + "0"^^ . + . + . + . + "3"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + "1"^^ . + "Also you can try with add(), instead of set() -- $this->firestore->collection($collection)->add($data);"^^ . + "This would be a good work around if there is no 'cleaning' part"^^ . + . + . + "1"^^ . + . + "IMO, this does not make any sense as a “fix”, not really answers the questions as posted. If you were able to edit the extending classes, nothing stopped you from simply extending _from a different class_, one that you create."^^ . + "@C3roe I'm using RewriteRule ^(.*)$ index.php?url=$1 [L,QSA] to map to my root index file, so basically I use 1 file to handle all url requests, the URLs (except css, js) are not existent files, just methods in classes, with the classes acting as directory and methods acting as files, so when someone types d/file/ or d/file in the url bar, it loads the same content (duplicate content) so I want 1 url version across all url requests."^^ . + . + "moodle"^^ . + . + . + "2"^^ . + . + "0"^^ . + "0"^^ . + "I am trying to connect to Docusign through my WebApp and my JWT is failing - "kid" invalid"^^ . + . + "0"^^ . + . + "Using `$article->tags()->syncWithoutDetaching($request->tags)` fais. There si no error, but nu update eiher. I must be using it wrong."^^ . + "1"^^ . + . + . + . + "<p>I have issue with PHP Leaf framework database operation which returns &quot;0&quot; instead of last inserted record id.</p>\n<p>My PHP version is 8.2.12.</p>\n<p>There is a code.</p>\n<p><strong>app/routes/__app.php</strong></p>\n<pre><code>app()-&gt;get('/apiv1/test', function () {\n $res = db()\n -&gt;insert('item_schemas')\n -&gt;params([\n 'table_name' =&gt; 'hat',\n 'created_at' =&gt; Carbon::now(),\n 'updated_at' =&gt; null\n ])-&gt;execute();\n\n $itemSchemaId = db()-&gt;lastInsertID();\n\n response()-&gt;json([\n 'itemSchemaId' =&gt; $itemSchemaId,\n 'errors' =&gt; $res ? 'No errors' : db()-&gt;errors(),\n 'res' =&gt; $res\n ]);\n});\n</code></pre>\n<p><strong>public/index.php</strong></p>\n<pre><code>&lt;?php\n\n/*\n|--------------------------------------------------------------------------\n| Switch to root path\n|--------------------------------------------------------------------------\n|\n| Point to the application root directory so leaf can accurately\n| resolve app paths.\n|\n*/\nchdir(dirname(__DIR__));\n\n/*\n|--------------------------------------------------------------------------\n| Register The Auto Loader\n|--------------------------------------------------------------------------\n|\n| Composer provides a convenient, automatically generated class loader\n| for our application. We just need to utilize it! We'll require it\n| into the script here so that we do not have to worry about the\n| loading of any our classes &quot;manually&quot;. Feels great to relax.\n|\n*/\nrequire dirname(__DIR__) . '/vendor/autoload.php';\n\n/*\n|--------------------------------------------------------------------------\n| Bring in (env)\n|--------------------------------------------------------------------------\n|\n| Quickly use our environment variables\n|\n*/\ntry {\n \\Dotenv\\Dotenv::createUnsafeImmutable(dirname(__DIR__))-&gt;load();\n} catch (\\Throwable $th) {\n trigger_error($th);\n}\n\n/*\n|--------------------------------------------------------------------------\n| Load application paths\n|--------------------------------------------------------------------------\n|\n| Decline static file requests back to the PHP built-in webserver\n|\n*/\nif (php_sapi_name() === 'cli-server') {\n $path = realpath(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));\n\n if (is_string($path) &amp;&amp; __FILE__ !== $path &amp;&amp; is_file($path)) {\n return false;\n }\n\n unset($path);\n}\n\n/*\n|--------------------------------------------------------------------------\n| Attach blade view\n|--------------------------------------------------------------------------\n|\n| Templating has been disabled because you chose the MVC for APIs starter.\n| If you want to use blade in your application,\n| you can uncomment the line below.\n|\n*/\n// Leaf\\Config::attachView(\\Leaf\\Blade::class);\n\n/*\n|--------------------------------------------------------------------------\n| Load Leaf configuration\n|--------------------------------------------------------------------------\n|\n| Leaf MVC allows you to customize Leaf and it's modules using\n| configuration files defined in the config folder. This line\n| loads the configuration files and makes them available to\n| your application.\n|\n*/\nLeaf\\Core::loadApplicationConfig();\n\n\n\n\n/*\n|--------------------------------------------------------------------------\n| Sync Leaf Db with ORM and connect\n|--------------------------------------------------------------------------\n|\n| Sync Leaf Db with ORM and connect to the database\n| This allows you to use Leaf Db without having\n| to initialize it in your controllers.\n|\n| If you want to use a different connection from those\n| used in your models, you can remove the line below and\n| add your own connection with:\n| db()-&gt;connect(...)\n|\n| **Uncomment the line below to use Leaf Db**\n| **You don't need this line to use Leaf Auth**\n*/\n\ndb()-&gt;autoConnect();\n\n/*\n|--------------------------------------------------------------------------\n| Load custom libraries\n|--------------------------------------------------------------------------\n|\n| You can load your custom libraries here. If you have\n| anything defined in your lib folder, you can load\n| them here. Simply uncomment the line below.\n|\n*/\n// \\Leaf\\Core::loadLibs();\n\n/*\n|--------------------------------------------------------------------------\n| Run your Leaf MVC application\n|--------------------------------------------------------------------------\n|\n| This line brings in all your routes and starts your application\n|\n*/\n\n\\Leaf\\Core::runApplication();\n</code></pre>\n<p><strong>composer.json</strong></p>\n<pre><code>{\n &quot;name&quot;: &quot;leafs/mvc&quot;,\n &quot;version&quot;: &quot;3.9.1&quot;,\n &quot;description&quot;: &quot;A lightweight PHP MVC framework powered by Leaf&quot;,\n &quot;type&quot;: &quot;library&quot;,\n &quot;keywords&quot;: [\n &quot;framework&quot;,\n &quot;leaf&quot;,\n &quot;leafPHP&quot;,\n &quot;mvc&quot;,\n &quot;leaf mvc&quot;\n ],\n &quot;license&quot;: &quot;MIT&quot;,\n &quot;authors&quot;: [\n {\n &quot;name&quot;: &quot;Michael Darko&quot;,\n &quot;email&quot;: &quot;mickdd22@gmail.com&quot;,\n &quot;homepage&quot;: &quot;https://mychi.netlify.app&quot;,\n &quot;role&quot;: &quot;Maintainer&quot;\n },\n {\n &quot;name&quot;: &quot;Abdulbasit Rubeya&quot;,\n &quot;email&quot;: &quot;abdulbasitsultan4@gmail.com&quot;,\n &quot;homepage&quot;: &quot;https://github.com/ibnsultan&quot;,\n &quot;role&quot;: &quot;Maintainer&quot;\n }\n ],\n &quot;require&quot;: {\n &quot;leafs/blade&quot;: &quot;*&quot;,\n &quot;leafs/mvc-core&quot;: &quot;^1.11&quot;,\n &quot;leafs/leaf&quot;: &quot;^3.7&quot;,\n &quot;leafs/csrf&quot;: &quot;*&quot;,\n &quot;leafs/logger&quot;: &quot;v2.0&quot;,\n &quot;leafs/cors&quot;: &quot;*&quot;,\n &quot;leafs/auth&quot;: &quot;^3.0&quot;,\n &quot;leafs/db&quot;: &quot;*&quot;,\n &quot;leafs/vite&quot;: &quot;^0.3.0&quot;,\n &quot;leafs/form&quot;: &quot;^3.0&quot;,\n &quot;leafs/http&quot;: &quot;^3.0&quot;,\n &quot;leafs/aloe&quot;: &quot;^2.3&quot;,\n &quot;leafs/fs&quot;: &quot;v2.0&quot;\n },\n &quot;require-dev&quot;: {\n &quot;fakerphp/faker&quot;: &quot;^1.16&quot;,\n &quot;leafs/alchemy&quot;: &quot;^2.0&quot;\n },\n &quot;autoload&quot;: {\n &quot;psr-4&quot;: {\n &quot;App\\\\&quot;: &quot;app/&quot;,\n &quot;Tests\\\\&quot;: &quot;tests/&quot;,\n &quot;Config\\\\&quot;: &quot;config/&quot;,\n &quot;App\\\\Http\\\\&quot;: &quot;app/http/&quot;,\n &quot;App\\\\Jobs\\\\&quot;: &quot;app/jobs/&quot;,\n &quot;App\\\\Lang\\\\&quot;: &quot;app/lang/&quot;,\n &quot;App\\\\Mail\\\\&quot;: &quot;app/mail/&quot;,\n &quot;App\\\\Views\\\\&quot;: &quot;app/views/&quot;,\n &quot;App\\\\Utils\\\\&quot;: &quot;app/utils/&quot;,\n &quot;App\\\\Events\\\\&quot;: &quot;app/events/&quot;,\n &quot;App\\\\Models\\\\&quot;: &quot;app/models/&quot;,\n &quot;App\\\\Mailers\\\\&quot;: &quot;app/mailers/&quot;,\n &quot;App\\\\Workers\\\\&quot;: &quot;app/workers/&quot;,\n &quot;App\\\\Console\\\\&quot;: &quot;app/console/&quot;,\n &quot;App\\\\Scripts\\\\&quot;: &quot;app/scripts/&quot;,\n &quot;App\\\\Helpers\\\\&quot;: &quot;app/helpers/&quot;,\n &quot;App\\\\Channels\\\\&quot;: &quot;app/channels/&quot;,\n &quot;App\\\\Services\\\\&quot;: &quot;app/services/&quot;,\n &quot;App\\\\Middleware\\\\&quot;: &quot;app/middleware/&quot;,\n &quot;App\\\\Components\\\\&quot;: &quot;app/components/&quot;,\n &quot;App\\\\Controllers\\\\&quot;: &quot;app/controllers/&quot;,\n &quot;App\\\\Notifications\\\\&quot;: &quot;app/notifications/&quot;,\n &quot;App\\\\Database\\\\Seeds\\\\&quot;: &quot;app/database/seeds/&quot;,\n &quot;App\\\\Database\\\\Schema\\\\&quot;: &quot;app/database/schema/&quot;,\n &quot;App\\\\Database\\\\Factories\\\\&quot;: &quot;app/database/factories/&quot;\n },\n &quot;exclude-from-classmap&quot;: [\n &quot;app/database/migrations&quot;\n ]\n },\n &quot;config&quot;: {\n &quot;optimize-autoloader&quot;: true,\n &quot;sort-packages&quot;: false,\n &quot;allow-plugins&quot;: {\n &quot;pestphp/pest-plugin&quot;: true\n }\n },\n &quot;scripts&quot;: {\n &quot;post-root-package-install&quot;: [\n &quot;@php -r \\&quot;file_exists('.env') || copy('.env.example', '.env');\\&quot;&quot;,\n &quot;@php -r \\&quot;if (file_exists('README2.MD')) {unlink('README.MD'); rename('README2.MD', 'README.MD');}\\&quot;&quot;\n ],\n &quot;post-create-project-cmd&quot;: [\n &quot;@php leaf key:generate&quot;\n ]\n },\n &quot;minimum-stability&quot;: &quot;dev&quot;,\n &quot;prefer-stable&quot;: true\n}\n</code></pre>\n<p><strong>app/database/migrations/2025_03_18_075024_create_item_schema.php</strong></p>\n<pre><code>&lt;?php\n\nuse Leaf\\Database;\nuse Illuminate\\Database\\Schema\\Blueprint;\n\nclass CreateItemSchema extends Database\n{\n /**\n * Run the migrations.\n * @return void\n */\n public function up()\n {\n if (!static::$capsule::schema()-&gt;hasTable('item_schemas')) :\n static::$capsule::schema()-&gt;create('item_schemas', function (Blueprint $table) {\n $table-&gt;id();\n $table-&gt;string('table_name')-&gt;unique();\n $table-&gt;timestamp('created_at')-&gt;nullable();\n $table-&gt;timestamp('updated_at')-&gt;nullable();\n });\n endif;\n }\n\n /**\n * Reverse the migrations.\n * @return void\n */\n public function down()\n {\n static::$capsule::schema()-&gt;dropIfExists('item_schemas');\n }\n}\n</code></pre>\n<p><strong>all composer packages after command</strong></p>\n<p><em>composer show -i</em></p>\n<pre><code>carbonphp/carbon-doctrine-types 2.1.0 Types to use Carbon in Doctrine\ndoctrine/cache 2.2.0 PHP Doctrine Cache library is a popular cache implementation that suppor...\ndoctrine/dbal 3.9.4 Powerful PHP database abstraction layer (DBAL) with many features for da...\ndoctrine/deprecations 1.1.4 A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 loggin...\ndoctrine/event-manager 2.0.1 The Doctrine Event Manager is a simple PHP event system that was built t...\ndoctrine/inflector 2.0.10 PHP Doctrine Inflector is a small library that can perform string manipu...\nfakerphp/faker v1.24.1 Faker is a PHP library that generates fake data for you.\nfirebase/php-jwt v6.11.0 A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Shou...\ngraham-campbell/result-type v1.1.3 An Implementation Of The Result Type\nilluminate/bus v8.83.27 The Illuminate Bus package.\nilluminate/collections v8.83.27 The Illuminate Collections package.\nilluminate/container v8.83.27 The Illuminate Container package.\nilluminate/contracts v8.83.27 The Illuminate Contracts package.\nilluminate/database v8.83.27 The Illuminate Database package.\nilluminate/events v8.83.27 The Illuminate Events package.\nilluminate/filesystem v8.83.27 The Illuminate Filesystem package.\nilluminate/macroable v8.83.27 The Illuminate Macroable package.\nilluminate/pipeline v8.83.27 The Illuminate Pipeline package.\nilluminate/support v8.83.27 The Illuminate Support package.\nilluminate/view v8.83.27 The Illuminate View package.\njenssegers/blade v1.4.0 The standalone version of Laravel's Blade templating engine for use outs...\nleafs/alchemy 2.2 Integrated testing/style fixing tool for your PHP apps\nleafs/aloe 2.5.1 Overpowered command line tool for your leaf apps.\nleafs/anchor v1.6.2 Leaf PHP util module\nleafs/auth v3.4.1 Leaf PHP auth helper\nleafs/blade v4.0 Leaf PHP Framework adaptation of jenssegers/blade package\nleafs/cors v1.2 Leaf PHP cors config\nleafs/csrf v0.5.4 Leaf CSRF security patch for leaf anchor\nleafs/date v2.2 Leaf PHP date module\nleafs/db v4.0.1 Leaf PHP db module.\nleafs/exception v3.6.3 Error handler for leaf (fork of whoops)\nleafs/form v3.2 Simple straightup data validation\nleafs/fs v2.0 Leaf PHP session + flash modules\nleafs/http v3.5 Http abstraction for Leaf PHP\nleafs/leaf v3.12 Elegant PHP for modern developers\nleafs/logger v2.0 Leaf PHP logger utility\nleafs/mvc-core v1.11.1 Core files specific to MVC based leaf frameworks like Leaf MVC and Leaf ...\nleafs/password v1.0 Leaf PHP password helper\nleafs/session v4.0.1 Leaf PHP session + flash modules\nleafs/vite v0.3.0 Server component for Vite\nnesbot/carbon 2.73.0 An API extension for DateTime that supports 281 different languages.\nnikic/php-parser v4.19.4 A PHP parser written in PHP\nphpoption/phpoption 1.9.3 Option Type for PHP\npsr/cache 3.0.0 Common interface for caching libraries\npsr/clock 1.0.0 Common interface for reading the clock.\npsr/container 1.1.2 Common Container Interface (PHP FIG PSR-11)\npsr/log 2.0.0 Common interface for logging libraries\npsr/simple-cache 1.0.1 Common interfaces for simple caching\npsy/psysh v0.11.22 An interactive shell for modern PHP.\nsymfony/console v5.4.47 Eases the creation of beautiful and testable command line interfaces\nsymfony/deprecation-contracts v3.5.1 A generic function and convention to trigger deprecation notices\nsymfony/finder v5.4.45 Finds files and directories via an intuitive fluent interface\nsymfony/polyfill-ctype v1.31.0 Symfony polyfill for ctype functions\nsymfony/polyfill-intl-grapheme v1.31.0 Symfony polyfill for intl's grapheme_* functions\nsymfony/polyfill-intl-normalizer v1.31.0 Symfony polyfill for intl's Normalizer class and related functions\nsymfony/polyfill-mbstring v1.31.0 Symfony polyfill for the Mbstring extension\nsymfony/polyfill-php73 v1.31.0 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions\nsymfony/polyfill-php80 v1.31.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions\nsymfony/process v6.4.19 Executes commands in sub-processes\nsymfony/service-contracts v3.5.1 Generic abstractions related to writing services\nsymfony/string v6.4.15 Provides an object-oriented API to strings and deals with bytes, UTF-8 c...\nsymfony/translation v6.4.19 Provides tools to internationalize your application\nsymfony/translation-contracts v3.5.1 Generic abstractions related to translation\nsymfony/var-dumper v6.4.18 Provides mechanisms for walking through any arbitrary PHP variable\nsymfony/yaml v6.4.18 Loads and dumps YAML files\nvlucas/phpdotenv v5.6.1 Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SE...\nvoku/portable-ascii 1.6.1 Portable ASCII library - performance optimized (ascii) string functions ...\n</code></pre>\n<p>And result is:</p>\n<pre><code>{\n &quot;itemId&quot;: &quot;0&quot;\n}\n</code></pre>\n<p>MySQL connection is established correct and record is inserted to the database, db()-&gt;lastInsertId() should returns valid record Id. Thanks very much for help.</p>\n<p>EDIT:</p>\n<p>Result after var_dump:</p>\n<pre><code>object(PDOStatement)#36 (1) {\n [&quot;queryString&quot;]=&gt;\n string(78) &quot;INSERT INTO item_schemas (table_name,created_at,updated_at) VALUES (?,?,?)&quot;\n}\n</code></pre>\n<p>API result:</p>\n<pre><code>{\n&quot;itemSchemaId&quot;: &quot;0&quot;,\n &quot;errors&quot;: &quot;No errors&quot;,\n &quot;res&quot;: {\n &quot;queryString&quot;: &quot;INSERT INTO item_schemas \n (table_name,created_at,updated_at) VALUES (?,?,?)&quot;\n }\n}\n</code></pre>\n<p>After Explain query:</p>\n<pre><code>&quot;query&quot;: [\n{\n &quot;id&quot;: 1,\n &quot;select_type&quot;: &quot;INSERT&quot;,\n &quot;table&quot;: &quot;item_schemas&quot;,\n &quot;partitions&quot;: null,\n &quot;type&quot;: &quot;ALL&quot;,\n &quot;possible_keys&quot;: null,\n &quot;key&quot;: null,\n &quot;key_len&quot;: null,\n &quot;ref&quot;: null,\n &quot;rows&quot;: null,\n &quot;filtered&quot;: null,\n &quot;Extra&quot;: null\n}\n],\n</code></pre>\n<p>Explain query:</p>\n<pre><code>$query = db()-&gt;query(&quot;EXPLAIN &quot; . &quot;INSERT INTO item_schemas (table_name,created_at,updated_at) VALUES ('glovesssssssssssssssdsssss','2025-03-23 10:29:29',NULL)&quot;)-&gt;all();\n</code></pre>\n<p>Table structure with EXPLAIN:</p>\n<pre><code>{\n&quot;query&quot;: [\n{\n&quot;Field&quot;: &quot;id&quot;,\n&quot;Type&quot;: &quot;bigint(20) unsigned&quot;,\n&quot;Null&quot;: &quot;NO&quot;,\n&quot;Key&quot;: &quot;PRI&quot;,\n&quot;Default&quot;: null,\n&quot;Extra&quot;: &quot;auto_increment&quot;\n},\n{\n&quot;Field&quot;: &quot;table_name&quot;,\n&quot;Type&quot;: &quot;varchar(255)&quot;,\n&quot;Null&quot;: &quot;NO&quot;,\n&quot;Key&quot;: &quot;UNI&quot;,\n&quot;Default&quot;: null,\n&quot;Extra&quot;: &quot;&quot;\n},\n{\n&quot;Field&quot;: &quot;created_at&quot;,\n&quot;Type&quot;: &quot;timestamp&quot;,\n&quot;Null&quot;: &quot;YES&quot;,\n&quot;Key&quot;: &quot;&quot;,\n&quot;Default&quot;: null,\n&quot;Extra&quot;: &quot;&quot;\n},\n{\n&quot;Field&quot;: &quot;updated_at&quot;,\n&quot;Type&quot;: &quot;timestamp&quot;,\n&quot;Null&quot;: &quot;YES&quot;,\n&quot;Key&quot;: &quot;&quot;,\n&quot;Default&quot;: null,\n&quot;Extra&quot;: &quot;&quot;\n}\n}\n</code></pre>\n"^^ . + . + . + . + . + "3"^^ . + "<p>I am facing problems while debugging Laravel project in PhpStorm.\nHere are details.</p>\n<p>PhpStorm version: latest(2024.3.5)\nPhp version: 8.2</p>\n<p>I don't run webserver like apache.\nI run builtin webserver using PhpStorm and setup all necessary packages like xdebug etc.\nI setup Artisan debug in PhpStorm but it doesn't debug properly from web application running in the browser.\nI expect PhpStorm capture the request around the breakpoints from web browser action.\nPlease guide me.\nThanks in advance.</p>\n"^^ . + . + . + "3"^^ . + . + "0"^^ . + "Proper approach to encrypt large files that cannot be completed in a single function call?"^^ . + "0"^^ . + . + "-2"^^ . + "Laravel 11: Custom Password Broker Ignores My Tenant-Aware Repository"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + "3"^^ . + "0"^^ . + . + "twilio-twiml"^^ . + . + "<p>A work around method I thought of was to simply set the limit +1 higher. So if I want 10 I instead set it to 11.</p>\n<p>Then in the fluid template add a condition to avoid rendering the last item:</p>\n<pre><code>&lt;f:for each=&quot;{items}&quot; as=&quot;item&quot; iteration=&quot;i&quot;&gt;\n &lt;f:if condition=&quot;{i.index} &lt; 10&quot;&gt;\n ...\n &lt;/f:if&gt;\n&lt;/f:for&gt;\n</code></pre>\n<p>Elsewhere in the template I can now check the existance of the 11th item and add a class if it doesn't exist:</p>\n<pre><code>{f:if(condition:'!{items.10}', then:'nomore')}\n</code></pre>\n<p>This avoids the need to know the total number.</p>\n"^^ . + . + . + "0"^^ . + "1"^^ . + "I understand eveyones professionalism , especially mentinoning prod enviroment , which is good practive to have an admin startup the server , service, app server etc while debugging.\nIll ask the question directly as adviced by rozsazoltan.\nBut i am a small one person business, and would like the POS app to startup when windows starts , as simple as that.\nin return i would just pop up the broweer and login"^^ . + . + . + "0"^^ . + . + . + . + . + . + "@TomášRejka Well, honestly, this depends on where you want to store this information. It is useful to have this information in the PHP session or even on the user's account (for example, the user switches from one computer to another, let's say after leaving work). If he started shopping, he might like to continue somewhere else. In this case, do AJAX requests to your server, for every action the user does on your shop. If he logs on another computer, he'll get all the history. Bonus: the only "_cookie consent_" needed would be the session cookie, generated by PHP's session handler."^^ . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + "1"^^ . + "<p>When updating a pivot table, you are not expected to use <code>attach()</code>, you should use <code>sync</code> or <code>syncWithoutDetaching</code>.\nThis ensure you do not have duplicate entries.</p>\n<p><a href="https://laravel.com/docs/11.x/eloquent-relationships#syncing-associations" rel="nofollow noreferrer">https://laravel.com/docs/11.x/eloquent-relationships#syncing-associations</a></p>\n"^^ . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + "You need to use `woocommerce_add_cart_item_data` filter hook to add custom cart item data like [in this example](https://stackoverflow.com/questions/52303818/custom-cart-item-price-set-from-product-hidden-input-field-in-woocommerce-3/52304377#52304377)."^^ . + "1"^^ . + . + "0"^^ . + "0"^^ . + "<p>I generate virtual pages (using index.php), which look like this:</p>\n<p>domain.com/died-persons/2024/</p>\n<p>where 'died-persons' is a static page with a table of contents (list of years) and '2024' is a virtual directory (variable) which I manage by a rewrite rule. This works fine whether I'm logged in or not.</p>\n<p>When I try to open paginated pages like this:</p>\n<p>domain.com/died-persons/2024/page/2/</p>\n<p>it only works, when I'm logged in. When I'm logged out, the page isn't found and I get a 404 error.</p>\n<p>In functions.php I have this:</p>\n<pre><code>function year_add_query_vars( $vars ) {\n $vars[] = 'variable';\n return $vars;\n}\nadd_filter( 'query_vars', 'year_add_query_vars' );\n\nadd_rewrite_rule('died-persons/([0-9]{4})[/]page/([0-9]{1,})/?$', 'index.php?variable=$matches[1]&amp;paged=$matches[2]', 'top');\n</code></pre>\n<p>In index.php I have this condition for getting the template:</p>\n<pre><code>if ( preg_match('#died-persons/([0-9]{4})/page/([0-9]{1,})/?$#', $_SERVER['REQUEST_URI'])) { \nget_template_part( 'template-parts/content-personlist' ); \n} \n</code></pre>\n<p>In content-personlist.php I generate the list of items (persons), which I'm getting from an external database.</p>\n<p>I would be happy if someone could help me with this problem. Thanks in advance!</p>\n<p>Andreas</p>\n"^^ . + "<p>You simply use two spaces in the replacement pattern. Put the backreferences where they should be:</p>\n<pre class="lang-php prettyprint-override"><code>preg_replace('/(?:([^0-9,. ])([0-9,.])|([0-9,.])([^0-9,. ]))/','$1$3 $2$4',$que)\n</code></pre>\n<p>However, in your case, I'd replace the consuming patterns with lookarounds and get rid of the backreferences altogether:</p>\n<pre class="lang-php prettyprint-override"><code>preg_replace('/(?&lt;=[^0-9,. ])(?=[0-9,.])|(?&lt;=[0-9,.])(?=[^0-9,. ])/',' ',$que)\n</code></pre>\n<p>Since you do not consume any text, all you need is to use a space in the replacement pattern.</p>\n<p>However, in other scenarios, you might want to use a <a href="https://www.regular-expressions.info/branchreset.html" rel="nofollow noreferrer"><strong>branch reset group</strong></a>:</p>\n<pre class="lang-php prettyprint-override"><code>preg_replace('/(?|([^0-9,. ])([0-9,.])|([0-9,.])([^0-9,. ]))/','$1 $2',$que)\n</code></pre>\n<p>where each alternative shares the same IDs for capturing groups.</p>\n<p>See the<a href="https://3v4l.org/qkGBT" rel="nofollow noreferrer"> PHP demo</a>:</p>\n<pre class="lang-php prettyprint-override"><code>$que = &quot;aa bb33cc 5.po&quot;;\necho preg_replace('/(?&lt;=[^0-9,. ])(?=[0-9,.])|(?&lt;=[0-9,.])(?=[^0-9,. ])/',' ',$que) . PHP_EOL;\necho preg_replace('/(?|([^0-9,. ])([0-9,.])|([0-9,.])([^0-9,. ]))/','$1 $2',$que) . PHP_EOL;\necho preg_replace('/(?:([^0-9,. ])([0-9,.])|([0-9,.])([^0-9,. ]))/','$1$3 $2$4',$que);\n</code></pre>\n<p>All results in <code>aa bb 33 cc 5. po</code>.</p>\n"^^ . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + "3"^^ . + . + "0"^^ . + . + "<p>I'm writing a custom package in my Laravel 11 package. I have the following path to my package: <code>packages/stsonline/sonar</code>. Within this directory I have <code>src</code>. I'm having the following error with my layout file when trying to load up my &quot;/sonar&quot; route:</p>\n<blockquote>\n<p>View [views.layouts.sonar] not found.</p>\n</blockquote>\n<p>These are my files:</p>\n<h3>src/View/Components/SonarLayout.php</h3>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nnamespace Stsonline\\Sonar\\View\\Components;\n\nuse Illuminate\\View\\Component;\n\nclass SonarLayout extends Component\n{\n /**\n * Get the view / contents that represents the component.\n */\n public function render()\n {\n return view('sonar::layouts.sonar');\n }\n}\n</code></pre>\n<h3>resources/views/layouts/sonar.blade.php</h3>\n<pre class="lang-html prettyprint-override"><code>@use('Stsonline\\Sonar\\Facades\\Sonar')\n&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;{{ str_replace('_', '-', app()-&gt;getLocale()) }}&quot;&gt;\n &lt;head&gt;\n &lt;meta charset=&quot;utf-8&quot;&gt;\n &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;\n &lt;title&gt;{{ $title ?? config('app.name', 'Laravel') }}&lt;/title&gt;\n\n {!! Sonar::css() !!}\n @livewireStyles\n\n {!! Sonar::js() !!}\n @livewireScriptConfig\n &lt;/head&gt;\n &lt;body class=&quot;font-sans antialiased&quot;&gt;\n &lt;div class=&quot;lg:min-h-screen lg:flex bg-secondary-100&quot;&gt;\n &lt;main class=&quot;lg:pl-72 lg:flex-1 lg:flex lg:justify-center px-4 pt-6 md:pt-8 pb-4&quot;&gt;\n &lt;div class=&quot;container mx-auto space-y-8 md:px-4 pb-4&quot;&gt;\n {{ $slot }}\n &lt;/div&gt;\n &lt;/main&gt;\n &lt;/div&gt;\n {{-- @livewireScripts --}}\n &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<pre class="lang-html prettyprint-override"><code>@use('Stsonline\\Sonar\\Facades\\Sonar')\n&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;{{ str_replace('_', '-', app()-&gt;getLocale()) }}&quot;&gt;\n &lt;head&gt;\n &lt;meta charset=&quot;utf-8&quot;&gt;\n &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;\n &lt;title&gt;{{ $title ?? config('app.name', 'Laravel') }}&lt;/title&gt;\n\n {!! Sonar::css() !!}\n @livewireStyles\n\n {!! Sonar::js() !!}\n @livewireScriptConfig\n &lt;/head&gt;\n &lt;body class=&quot;font-sans antialiased&quot;&gt;\n &lt;div class=&quot;lg:min-h-screen lg:flex bg-secondary-100&quot;&gt;\n &lt;main class=&quot;lg:pl-72 lg:flex-1 lg:flex lg:justify-center px-4 pt-6 md:pt-8 pb-4&quot;&gt;\n &lt;div class=&quot;container mx-auto space-y-8 md:px-4 pb-4&quot;&gt;\n {{ $slot }}\n &lt;/div&gt;\n &lt;/main&gt;\n &lt;/div&gt;\n {{-- @livewireScripts --}}\n &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<p>This is how I'm loading the component:</p>\n<pre class="lang-php prettyprint-override"><code>$this-&gt;callAfterResolving('blade.compiler', function (BladeCompiler $blade) {\n $blade-&gt;component('Stsonline\\\\Sonar\\\\View\\\\Components\\\\SonarLayout', 'sonar-layout', 'sonar');\n});\n</code></pre>\n<p>My routes are working for the package, and the custom commands</p>\n<p>here's my routes:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nuse Illuminate\\Support\\Facades\\Route;\n\nRoute::name('sonar.page.')-&gt;group(function () {\n Route::view('/', 'sonar::pages.welcome')-&gt;name('welcome');\n});\n</code></pre>\n<p>What am I missing?</p>\n<h3>SonarServiceProvider</h3>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nnamespace Stsonline\\Sonar;\n\nuse Composer\\InstalledVersions;\nuse Illuminate\\Auth\\Events\\Logout;\nuse Illuminate\\Contracts\\Auth\\Access\\Gate;\nuse Illuminate\\Contracts\\Console\\Kernel as ConsoleKernel;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Contracts\\Foundation\\Application;\nuse Illuminate\\Contracts\\Http\\Kernel as HttpKernel;\nuse Illuminate\\Foundation\\Console\\AboutCommand;\nuse Illuminate\\Queue\\Events\\Looping;\nuse Illuminate\\Queue\\Events\\WorkerStopping;\nuse Illuminate\\Support\\Facades\\Route;\nuse Illuminate\\Routing\\Router;\nuse Illuminate\\Support\\ServiceProvider;\nuse Illuminate\\Support\\Str;\nuse Illuminate\\View\\Compilers\\BladeCompiler;\nuse Illuminate\\View\\Factory as ViewFactory;\nuse Livewire\\LivewireManager;\nuse RuntimeException;\n\n/**\n * @internal\n */\nclass SonarServiceProvider extends ServiceProvider\n{\n /**\n * Register any package services.\n */\n public function register(): void\n {\n $this-&gt;mergeConfigFrom(\n __DIR__.'/../config/sonar.php', 'sonar'\n );\n }\n\n /**\n * Bootstrap any package services.\n */\n public function boot(): void\n {\n if ($this-&gt;app-&gt;make('config')-&gt;get('sonar.enabled')) {\n $this-&gt;listenForEvents();\n }\n\n $this-&gt;registerAuthorization();\n $this-&gt;registerRoutes();\n $this-&gt;registerComponents();\n $this-&gt;registerResources();\n $this-&gt;registerPublishing();\n $this-&gt;registerCommands();\n }\n\n /**\n * Register the package authorization.\n */\n protected function registerAuthorization(): void\n {\n $this-&gt;callAfterResolving(Gate::class, function (Gate $gate, Application $app) {\n $gate-&gt;define('viewSonar', fn ($user = null) =&gt; $app-&gt;environment('local'));\n });\n }\n\n /**\n * Register the package routes.\n */\n protected function registerRoutes(): void\n {\n $this-&gt;callAfterResolving('router', function (Router $router, Application $app) {\n if ($app-&gt;make(Sonar::class)-&gt;registersRoutes()) {\n $router-&gt;group([\n 'namespace' =&gt; 'Stsonline\\Sonar\\Http\\Controllers',\n\n 'domain' =&gt; $app-&gt;make('config')-&gt;get('sonar.domain', null),\n 'prefix' =&gt; $app-&gt;make('config')-&gt;get('sonar.path'),\n 'middleware' =&gt; $app-&gt;make('config')-&gt;get('sonar.middleware'),\n ], function () {\n $this-&gt;loadRoutesFrom(__DIR__.'/../routes/sonar.php');\n });\n }\n });\n\n\n }\n\n /**\n * Listen for the events that are relevant to the package.\n */\n protected function listenForEvents(): void\n {\n $this-&gt;app-&gt;booted(function () {\n $this-&gt;callAfterResolving(Dispatcher::class, function (Dispatcher $event, Application $app) {\n $event-&gt;listen(function (Logout $event) use ($app) {\n if ($event-&gt;user === null) {\n return;\n }\n\n // ...\n });\n });\n });\n }\n\n /**\n * Register the package's components.\n */\n protected function registerComponents(): void\n {\n $this-&gt;callAfterResolving('blade.compiler', function (BladeCompiler $blade) {\n $blade-&gt;component('Stsonline\\\\Sonar\\\\View\\\\Components\\\\SonarLayout', 'sonar-layout', 'sonar');\n });\n\n $this-&gt;callAfterResolving('livewire', function (LivewireManager $livewire, Application $app) {\n $middleware = collect($app-&gt;make('config')-&gt;get('sonar.middleware'))\n -&gt;map(fn ($middleware) =&gt; is_string($middleware)\n ? Str::before($middleware, ':')\n : $middleware)\n -&gt;all();\n\n $livewire-&gt;addPersistentMiddleware($middleware);\n });\n }\n\n /**\n * Register the package's resources.\n */\n protected function registerResources(): void\n {\n $this-&gt;loadViewsFrom(__DIR__.'/../resources/views', 'sonar');\n }\n\n /**\n * Register the package's publishable resources.\n */\n protected function registerPublishing(): void\n {\n if ($this-&gt;app-&gt;runningInConsole()) {\n $this-&gt;publishes([\n __DIR__.'/../config/sonar.php' =&gt; config_path('sonar.php'),\n ], ['sonar', 'sonar-config']);\n\n $this-&gt;publishes([\n __DIR__.'/../resources/views/dashboard.blade.php' =&gt; resource_path('views/vendor/sonar/dashboard.blade.php'),\n ], ['sonar', 'sonar-dashboard']);\n\n $method = method_exists($this, 'publishesMigrations') ? 'publishesMigrations' : 'publishes';\n\n $this-&gt;{$method}([\n __DIR__.'/../database/migrations' =&gt; database_path('migrations'),\n ], ['sonar', 'sonar-migrations']);\n }\n }\n\n /**\n * Register the package's commands.\n */\n protected function registerCommands(): void\n {\n if ($this-&gt;app-&gt;runningInConsole()) {\n $this-&gt;commands([\n Commands\\AboutCommand::class,\n ]);\n\n AboutCommand::add('Sonar', fn () =&gt; [\n 'Version' =&gt; InstalledVersions::getPrettyVersion('stsonline/sonar'),\n 'Enabled' =&gt; AboutCommand::format(config('sonar.enabled'), console: fn ($value) =&gt; $value ? '&lt;fg=yellow;options=bold&gt;ENABLED&lt;/&gt;' : 'OFF'),\n ]);\n }\n }\n}\n</code></pre>\n"^^ . + "0"^^ . + "<p>Whatever framework you use, the question is &quot;<em>how do you send a large number of requests to an API with a rate limit without saturating the system (response time, memory, browser limits)?</em>&quot;</p>\n<p>The solution to a complex problem is often to divide it into several simpler problems. This is the case here. If the query is too heavy, it should be divided into several lighter queries.</p>\n<p>Here's how I'd proceed:</p>\n<ol>\n<li>Prepare a PHP Array containing queries divided into several entries.</li>\n</ol>\n<pre><code>&lt;?php\n$requests = [\n ['url' =&gt; 'https://api.example.com/data1', 'method' =&gt; 'GET'],\n ['url' =&gt; 'https://api.example.com/data2', 'method' =&gt; 'POST', 'body' =&gt; json_encode(['key' =&gt; 'value'])],\n // Add more requests as needed\n];\n?&gt;\n</code></pre>\n<ol start="2">\n<li>Convert PHP array to JavaScript array</li>\n</ol>\n<pre><code>&lt;script&gt;\n var requests = &lt;?php echo json_encode($requests); ?&gt;;\n&lt;/script&gt;\n</code></pre>\n<ol start="3">\n<li>Create a Recursive JavaScript Function and send the requests</li>\n</ol>\n<pre><code>&lt;script&gt;\n async function sendRequests(requests, index = 0, count = 0) {\n if (index &gt;= requests.length) {\n console.log('All requests sent. Total requests:', count);\n return;\n }\n\n const request = requests[index];\n const { url, method, body } = request;\n\n try {\n const response = await fetch(url, {\n method: method,\n headers: {\n 'Content-Type': 'application/json'\n },\n body: body || null\n });\n\n const data = await response.json();\n console.log('Response from request', index + 1, ':', data);\n\n // Recursively send the next request\n await sendRequests(requests, index + 1, count + 1);\n } catch (error) {\n console.error('Error sending request', index + 1, ':', error);\n // Optionally, handle the error and decide whether to continue or stop\n await sendRequests(requests, index + 1, count + 1);\n }\n }\n\n // Start sending requests\n sendRequests(requests);\n&lt;/script&gt;\n</code></pre>\n<p>This way if each request doesn't exceed the time/memory limits it'll do the job.</p>\n"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "What is a legitimate way in PHP to test if a third-party site is working?"^^ . + . + "0"^^ . + . + "Maybe you are talking about this endpoint: https://docs-ospc.rackspace.com/cloud-files/v1/storage-api-reference/object-services-operations.html#create-or-update-object ? Is that correct?"^^ . + . + . + "0"^^ . + "cannot execute binary file: Exec format error"^^ . + "Why didn't you check the documentation before? https://laravel.com/docs/12.x/routing#fallback-routes looks pretty much like what you're looking for"^^ . + . + "Could you post the ffmpeg log? To see what actually is the error ffmpeg is showing?"^^ . + . + . + . + . + "0"^^ . + "nextcloud and pihole on same raspberry pi"^^ . + "1"^^ . + . + . + . + "1"^^ . + "2"^^ . + . + "1"^^ . + "`wp_delete_post` calls `delete_metadata_by_mid` to remove the meta data from the database, which also clears the cached meta data. The magic `__get` method that gets invoked when you try to access meta data fields on `WP_POST`, tries to read the meta data from that cache, which it has already been removed from."^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + "<p>There are some mistakes in your last hooked function, try the following instead:</p>\n<pre class="lang-php prettyprint-override"><code>add_filter( 'woocommerce_shipping_free_shipping_is_available', 'enable_free_shipping_for_specific_categories', 10, 3 );\nfunction enable_free_shipping_for_specific_categories( $is_available, $package, $shipping_method ) {\n if ( ! isset($shipping_method-&gt;min_amount) || ! $shipping_method-&gt;min_amount ) return $is_available;\n\n $excl_cat = 'leeggoed';\n $subtotal = 0; // Initializing variable\n\n // Loop through cart items for the current shipping package\n foreach ( $package['contents'] as $item ) {\n if ( ! has_term($excl_cat, 'product_cat', $item['product_id']) ) {\n $subtotal += $item['line_subtotal'];\n }\n }\n return $subtotal &gt;= $shipping_method-&gt;min_amount;\n}\n</code></pre>\n<p>It should work.</p>\n"^^ . + . + "akeneo"^^ . + "nusoap"^^ . + . + . + "Next time, debug your ajax request and PHP code properly - use the browser's Network tool to see what was actually send in the payload, use a PHP debugger or the `var_dump()` command to see what was actually in the `$_POST` array, and to follow the path that the code takes. Not saving the image is only the last step in the process...you needed to understand where it failed _before_ that point, but apparently showed no curiosity about it."^^ . + "Parse a CSV file which may have columns out of the expected order"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + "<p>PHP 8 on Ubuntu.</p>\n<p>I'm trying to write a script that will go into a number of subdirectories and look for a <code>.mp4</code> file, where I can then run some other code with <code>exec()</code> to create thumbnail images of the videos.</p>\n<p>The problem begins where if I do something like this:</p>\n<pre><code>$directory = '.'; // This script lives in the same directory where the sub-directories are\n\n$directories = glob($directory . '/*', GLOB_ONLYDIR);\n\nforeach ($directories as $dir) {\n echo &quot;Directory: $dir\\n&quot;;\n}\n</code></pre>\n<p>I might get the following output:</p>\n<pre><code>Directory: ./Are you ready for something\nDirectory: ./Yet another folder name\nDirectory: ./And one more\n</code></pre>\n<p>All of these directories have spaces in them. If I was then to try and <code>cd</code> into one of those directories:</p>\n<pre><code>foreach ($directories as $dir) {\n echo &quot;Directory: $dir\\n&quot;;\n\n exec('cd ' . $dir . '/');\n}\n</code></pre>\n<p>It will error with</p>\n<pre><code>cd: ./Are: No such file or directory\n</code></pre>\n<p>This is because to <code>cd</code> into that directory I would actually need to do something like this, which adds backslashes where the spaces appear in the directory name</p>\n<pre><code>cd Are\\ you\\ ready\\ for\\ something\\/\n</code></pre>\n<p>The output from <code>glob</code> doesn't contain those backslashes so can't be used directly. Is there any way around this?</p>\n"^^ . + "How to append a clickable link to WooCommerce custom fee name on Checkout?"^^ . + "0"^^ . + "I found the solution . It was my antivir (avast) which blocked me. I desactivated it , the time to install composer. And all is fine now ! I lost several hours !"^^ . + "`#!/bin/sh` and then `exec /c/Users/MyUser/.config/herd/bin/php.bat "$@"` or something like that. (Or in fact you could directly symlink herd/bin/php.bat to `php`...)"^^ . + "That would likely have to be an ajax call or form submit since javascript runs on the client-side."^^ . + "1"^^ . + "fileparsing"^^ . + "Edited, hope it is correct"^^ . + . + "<p>There are some mistakes and missing things in your code: For example, in the 2 validation functions, you need first to check that the current product or item, belongs to your targeted product category.</p>\n<p>If your 2 validation functions work effectively, you don't need the last one.</p>\n<p>Try the following:</p>\n<pre class="lang-php prettyprint-override"><code>// Utility function: Checks a a given product Id belongs to weedseeds category\nfunction has_weedseeds_category( $product_id ) {\n return has_term( 'seeds-wietzaadjes', 'product_cat', $product_id );\n}\n\n// Utility function: Get cart items total quantity for weedseeds items only\nfunction get_cart_total_weedseeds_qty( $item_key = null, $total_qty = 0 ) {\n if ( WC()-&gt;cart-&gt;is_empty() ) return $total_qty;\n\n // Loop through the cart items\n foreach (WC()-&gt;cart-&gt;get_cart() as $cart_item_key =&gt; $cart_item ) {\n // Check if the cart item belongs to the weedseeds category\n if ( has_weedseeds_category( $cart_item['product_id'] ) &amp;&amp; $item_key !== $cart_item_key ) {\n $total_qty += $cart_item['quantity'];\n }\n }\n return $total_qty;\n}\n\n// Utility function: Define the allowed weedseeds limit\nfunction get_weedseeds_limit() {\n return 2; // Set the limit to 2 packages\n}\n\n// Utility function: Add an error notice for weedseeds exceeding limit\nfunction add_error_notice_for_weedseeds_limit() {\n wc_add_notice( sprintf( esc_html__('Je mag maximaal %d verpakkingen wiedzaadjes per bestelling kopen.'), get_weedseeds_limit() ), 'error' );\n}\n\n// Add to cart validation for weedseeds products\nadd_filter( 'woocommerce_add_to_cart_validation', 'add_to_cart_weedseed_limit', 10, 3 );\nfunction add_to_cart_weedseed_limit( $passed, $product_id, $quantity ) {\n // Check that current product belongs to weedseeds category, if not exit.\n if ( ! has_weedseeds_category( $product_id ) ) return $passed;\n\n // Check if the product quantity exceeds the weedseeds limit\n if ( WC()-&gt;cart-&gt;is_empty() &amp;&amp; $quantity &gt; get_weedseeds_limit() ) {\n add_error_notice_for_weedseeds_limit();\n return false;\n }\n // Check if the total weedseeds quantity exceeds the weedseeds limit\n elseif ( ( get_cart_total_weedseeds_qty() + $quantity ) &gt; get_weedseeds_limit() ) {\n add_error_notice_for_weedseeds_limit();\n return false;\n }\n return $passed;\n}\n\n// Update cart validation for weedseeds cart items\nadd_filter( 'woocommerce_update_cart_validation', 'limit_weedseeds_quantity_in_cart', 10, 4 );\nfunction limit_weedseeds_quantity_in_cart( $passed, $cart_item_key, $values, $quantity ) {\n // Check that current cart item belongs to weedseeds category, if not exit.\n if ( ! has_weedseeds_category( $values['product_id'] ) ) return $passed;\n\n // Check if the total quantity of weedseeds exceeds the limit\n if ( ( get_cart_total_weedseeds_qty( $cart_item_key ) + $quantity ) &gt; get_weedseeds_limit() ) {\n add_error_notice_for_weedseeds_limit();\n return false;\n }\n return $passed;\n}\n</code></pre>\n<p>It should work.</p>\n<hr />\n<p>The last revised hooked function, <strong>but unneeded</strong> as it will drop a 2nd error notice:</p>\n<pre class="lang-php prettyprint-override"><code>// Check cart items (not really needed anymore)\nadd_action( 'woocommerce_check_cart_items', 'check_weedseeds_limit_before_checkout' );\nfunction check_weedseeds_limit_before_checkout() {\n // Check if the total quantity of weedseeds exceeds the limit\n if ( get_cart_total_weedseeds_qty() &gt; get_weedseeds_limit() ) {\n add_error_notice_for_weedseeds_limit();\n }\n}\n</code></pre>\n"^^ . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + "I forgot to copy and paste the FROM line into my question. \n\nFROM php:apache\nENV APACHE_DOCUMENT_ROOT=/var/www/html/src\n\n\nand like i said i really don't know what I'm doing. I just followed a tutorial. I will look up the copy command though."^^ . + . + . + . + "@rozsazoltan I want to benchmark array allocation and function call, moving allocation out of loop - does not represent the point, sum of consecutive numbers in memory of course faster than summing 24 variables, my point was that allocation+call is slower, even if you have to perform such function 1 time per user request - it is still time spent for each request and for many requests - it will add up seconds/minutes/hours of wasted CPU/electricity/heat/etc"^^ . + "1"^^ . + "Usually, phone numbers should have a fixed rule, such as the area code length for numbers starting with 0150 being 6 digits. You should only need to read a few specific digits to know the length of the area code."^^ . + . + . + . + "lamp"^^ . + . + "0"^^ . + . + "1"^^ . + "What's your location ? Where are you trying to access this api because in some countries x.com is banned and people use proxies to get the required results i.e. `Pakistan` . So need a little clarification"^^ . + . + "validation"^^ . + . + . + . + . + "-3"^^ . + . + . + "0"^^ . + . + . + . + . + . + ""original instantiation of an object" - not 100% certain I know what you mean. First, you'd have to capture `$sharedObject` with `use` for your functions, although I don't know (one way or another) if that's the recommended pattern for Laravel. Second, you understand that the `setFoo()` in the first route won't have any effect on the `getFoo()` in the second route, right?"^^ . + . + . + "https://stackoverflow.com/search?q=is%3Aq+rijndael+php+delphi"^^ . + . + . + "0"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + . + "Your problem might be the other answer there. Please check. Tip: Request your PHP script directly and view source. Curl on the command-line may help as well for a quick turnaround while troubleshooting."^^ . + . + . + . + . + . + . + "@YourCommonSense You're welcome to change the title. It's not that important."^^ . + . + . + . + "<p>Typed properties without explicit values are <strong>uninitialized</strong>, even properties of nullable types do not have a default null value (You can verify this with <code>var_dump(new User)</code>). Unless the class implements the <code>JsonSerializable</code> interface, uninitialized typed properties will be ignored by <code>json_encode</code> (as well as <code>var_export</code> and <code>get_object_vars</code>). Just give the <code>Email</code> property a value:</p>\n<pre><code>class User {\n public string Name = &quot;John&quot;;\n public ?string Email = null;\n}\n</code></pre>\n"^^ . + . + . + . + "1"^^ . + . + "`a million more lines of code that slow down my project.`...why would that "slow down" your project?? Code only costs time if you actually execute it. If you only use the bits of the library that you actually need, the rest of it just sits there quietly, doing nothing. It might take up a few KB of disk space, but that's a trivial problem nowadays. Your thinking is straight out of the 1980s when every byte counted...that's simply not true any more. The TCO of not using open-source libraries are almost always higher than the costs of using them"^^ . + "0"^^ . + . + "0"^^ . + . + . + "2"^^ . + "You can use `$_SESSION` to store the data and access them in the next form."^^ . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + "1"^^ . + . + . + "1"^^ . + . + "1"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + "`Too few arguments to function displayST()`...anything specific you aren't sure about with this? Did you research the "too few arguments to function" error? As you can see, `displayST(object $pdo, $lastname, $firstname)` expects 3 values to be passed in. but running `displayST()` doesn't pass any values in. So the error is simply highlighting that mismatch."^^ . + . + . + . + "Why can't you use validation ? \n\n 'unique_column' => 'unique:table,column' //Create \n \n 'unique_column' => 'unique:table,column,' . $userId, //Edit"^^ . + . + "2"^^ . + "1"^^ . + . + "Add a custom field to WooCommerce product attribute terms"^^ . + . + "2"^^ . + . + . + "3"^^ . + . + . + "Image in Laravel bug"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + "3"^^ . + "Relevant reading: [PHP append content to a file (reading/writing of a file)](https://stackoverflow.com/q/29874546/2943403) and [How to Append a file and concatenate text in PHP?](https://stackoverflow.com/q/15714766/2943403) and [Not able to append data to a file using php](https://stackoverflow.com/q/29874802/2943403) and [I'm having an issue with PHP and Append File](https://stackoverflow.com/q/55452072/2943403)"^^ . + "1"^^ . + . + . + . + "<p>Your email_verified_at stays null because the verification link likely hits the web.php route with auth:sanctum, which fails since the user isn’t logged in. Remove that route and use only api.php with signed middleware. Simplify verifyEmail like this:</p>\n<pre><code>// api.php\nRoute::get('/email/verify/{id}/{hash}', [AuthController::class, 'verifyEmail'])\n -&gt;middleware('signed')\n -&gt;name('verification.verify');\n\n// AuthController.php\npublic function verifyEmail(EmailVerificationRequest $request)\n{\n $request-&gt;fulfill();\n return response()-&gt;json(['message' =&gt; 'Email verified!']);\n}\n</code></pre>\n<p>Ensure User implements MustVerifyEmail. Test the link (http://localhost:8000/api/email/verify/...)—it should update the field now. Check laravel.log if it doesn’t.</p>\n"^^ . + "0"^^ . + "2"^^ . + . + . + . + . + "0"^^ . + "How to Prevent Authenticated Users from Accessing the Login Page in Laravel 12"^^ . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + "<p>I recently updated nesbot/Carbon from 2.67 to 3.8.6. When running the following piece of code, I used to get a positive value, now I get a negative value. Has the order of operation changed for <code>diffInSeconds()</code>?</p>\n<pre class="lang-php prettyprint-override"><code>$time_before = Carbon::now();\n// &lt;&lt; call that takes 85 s &gt;&gt;\n$time_after = Carbon::now();\n$duration_in_secs = $time_after-&gt;diffInSeconds($time_before);\n</code></pre>\n<p>This gives me:</p>\n<p>Duration: -84.766262 seconds<br />\nbefore:2025-03-02 02:53:35<br />\nafter:2025-03-02 02:55:00</p>\n"^^ . + "1"^^ . + . + "Toast Notification Appears on Every Page After Login Failure in CodeIgniter"^^ . + "Displaying a transaction Fee on WooCommerce Admin Order edit page"^^ . + . + . + . + "wordpress-rest-api"^^ . + "2"^^ . + . + . + "PHP has a built-in function `escapeshellarg()` to handle things like this. `exec('cd ' . escapeshellarg($dir) . '/');`"^^ . + . + . + . + "Wow, the list is pretty long what you did, given this is a simple diagnostic message telling that some HTTPS website did not work with Curl. Some points do not seem related, so you perhaps should elaborate on their rationale and your understanding. And you should formulate a question, because this is a Q&A site, not some forum."^^ . + . + . + . + "The fact that there are multiple question asking for the fastest makes this question not acceptable even when other question have replies. And benchmarking might be a part of programming, but not a _central_ part. The **correct** working is way more important than the speed of it, and only "too slow" (please be more precise than "too slow") **might** be important in programming, but correct working is way more important."^^ . + "1"^^ . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + "you need to define driver"^^ . + "I think that here the basics of both Eloquent and PHP are missing.\n`$lastNumber = Number::latest()->first()?->some_column ?? 0; /* */ $lastColumn = Number::where('column', $column)->first()?->some_column ?? 0;` --- \nBUT you should explain how the table is structured and what you want to achieve.\nTo call a method of the same class use the format `$this->methodName()` as already explained, in any case if the method is not called outside the class define it as *protected* instead of *public*"^^ . + . + . + . + . + . + . + "@ADyson I'm asking what's the reason for saying $GLOBALS are available in global scope, and not saying $GLOBALS are available in all scopes, while a variable that belongs to the $GLOBALS array is available in all scopes, isn't it?"^^ . + "1"^^ . + "@Piemol My examples where chosen to better visualize the chunks. In the real data the chunks may or may not have pairs of digits. One real number from my data is `4292031`, which should become `42 92 031`, another is `999339`, which should become `99 93 39`."^^ . + "@WilliamArcq: _"@hakre I believe MAX_FILE_SIZE is ignored when upload_max_filesize is set."_ This is certainly wrong. While each SAPI implementation may have it's own differences, for common PHP, the manual states different, as the second paragraph following the example I was referring to in the PHP manual should have made clear. See [_Example #1 File Upload Form_ on _POST method uploads_ (php.net)](https://www.php.net/manual/en/features.file-upload.post-method.php#example-484) again for that detail."^^ . + "Yes, `static` properties are only allocated once, no matter how often you instantiate the class. The same is true for `const`, which would be the preferred choice if the array is truly constant. A constant array should be slightly more efficient than a variable static array. The difference is minimal however. Much more can be gained by assuring that [JIT is configured properly and working](https://php.watch/versions/8.0/JIT)."^^ . + . + . + "How to make a background bash script pause while an npm build runs?"^^ . + . + "2"^^ . + . + . + . + . + . + . + . + . + "<p>Middleware can be run before or after the route. It really depends on your middleware code (please include that in your question).</p>\n<p>From the <a href="https://laravel.com/docs/11.x/middleware#middleware-and-responses" rel="nofollow noreferrer">Laravel docs</a>...</p>\n<p>Before</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nnamespace App\\Http\\Middleware;\n\nuse Closure;\nuse Illuminate\\Http\\Request;\nuse Symfony\\Component\\HttpFoundation\\Response;\n\nclass BeforeMiddleware\n\n{\n public function handle(Request $request, Closure $next): Response\n\n {\n // Perform action\n\n return $next($request);\n }\n}\n</code></pre>\n<p>After</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\nnamespace App\\Http\\Middleware;\n\nuse Closure;\nuse Illuminate\\Http\\Request;\nuse Symfony\\Component\\HttpFoundation\\Response;\n\nclass AfterMiddleware\n{\n public function handle(Request $request, Closure $next): Response\n {\n $response = $next($request);\n\n // Perform action\n\n return $response;\n }\n}\n</code></pre>\n<p>Another possible reason:</p>\n<p>If you are using implicit binding in your route, I believe that will get resolved first. If the model isn't found, it won't even try to run the middleware. You could use <a href="https://laravel.com/docs/12.x/routing#parameters-optional-parameters" rel="nofollow noreferrer">optional parameters</a> which will allow the route to be run even if it can't find the model:</p>\n<pre class="lang-php prettyprint-override"><code>// routes/api.php\nRoute::patch('/path/{model?}', [MyController::class, 'update']);\n\n// app/Http/Controllers/MyController.php\npublic function update(?MyModel $model = null, Request $request) {}\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + . + . + . + "@ADyson Thank you so much! That link was exactly what I needed."^^ . + . + . + . + . + . + "-1"^^ . + "How do I add a following api to my Laravel app"^^ . + "1"^^ . + . + "<p>I don't know much about &quot;Polylang&quot; plugin but upon searching &quot;pll_get_post&quot; might do it.</p>\n<p>replace your code with this code and &quot;1&quot; with your thank you page post id.</p>\n<pre><code>add_action( 'wp_footer', 'mycustom_wp_footer' );\nfunction mycustom_wp_footer() {\n if ( function_exists( 'pll_get_post' ) ) {\n // Get the translated Thank You page URL\n\n $page_id = 1; // Replace with the actual Thank You page ID in default language\n $new_thank_you_url = get_permalink( pll_get_post( $page_id ) );\n }\n ?&gt;\n &lt;script&gt;\n document.addEventListener( 'wpcf7mailsent', function( event ) {\n location = &quot;&lt;?php echo esc_url( $new_thank_you_url ); ?&gt;&quot;;\n }, false );\n &lt;/script&gt;\n &lt;?php\n}\n</code></pre>\n<p>Here is the link if you want to study about the function</p>\n<p><a href="https://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/" rel="nofollow noreferrer">https://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/</a></p>\n"^^ . + . + "Maybe some lookarounds `(?i)(?<!\\w)atlan(?!\\w)` https://regex101.com/r/SlyojW/1"^^ . + . + "<blockquote>\n<p>Some of the examples give a before and after version 7.1.</p>\n</blockquote>\n<p>The examples from the <a href="https://www.php.net/manual/en/function.openssl-encrypt.php" rel="nofollow noreferrer"><code>openssl_encrypt()</code></a> documentation implement authenticated encryption (AEAD), once as AES/CBC with an HMAC (before v7.1, Example #2) and once with GCM (after v7.1, Example #1), but as one-step encryption. In addition to confidentiality, AEAD also guarantees authenticity.<br />\nHowever, a truly robust custom implementation of <em>chunkwise</em> AEAD is not trivial (for the requirements, see for instance the listing in the first section of <a href="https://libsodium.gitbook.io/doc/secret-key_cryptography/secretstream" rel="nofollow noreferrer"><em>Encrypted streams and file encryption</em></a>) of the <em>Libsodium</em> documentation), so it is better to use a reliable library. One option for PHP is <a href="https://www.php.net/manual/en/book.sodium.php" rel="nofollow noreferrer"><em>Sodium</em></a>, a <em>Libsodium</em> wrapper. <em>Libsodium</em>/<em>Sodium</em> has a streaming API, see <a href="https://libsodium.gitbook.io/doc/secret-key_cryptography/secretstream" rel="nofollow noreferrer"><em>Encrypted streams and file encryption</em></a> and the <a href="https://www.php.net/manual/en/function.sodium-crypto-secretstream-xchacha20poly1305-init-push.php" rel="nofollow noreferrer"><code>sodium_crypto_secretstream_...</code></a> functions.</p>\n<blockquote>\n<p>Is this approach given in that eight-year-old post still the proper approach?</p>\n</blockquote>\n<p>Your code (or the underlying code from the <a href="https://www.php.net/manual/en/function.openssl-encrypt.php#120141" rel="nofollow noreferrer">example</a>) implements chunk-wise encryption with AES/CBC. The code could be optimized, but in principle it is OK (as long as AEAD is not required for your requirements).</p>\n<p>Regarding the optimizations: The encryption in the current code pads all plaintext chunks and uses the first block of a ciphertext chunk as the IV for the next plaintext chunk. This means that the chunk size from the encryption must be known during decryption so that the same ciphertext chunks can be reconstructed. In addition, the padding of the intermediate chunks is inefficient.</p>\n<p>It would make more sense to decouple the chunk sizes for encryption and decryption. This can be achieved if:</p>\n<ul>\n<li>padding is disabled for all plaintext chunks except the last one,</li>\n<li>the last block (and not the first!) of a ciphertext chunk is used as the IV of the next plaintext chunk for all plaintext chunks with the exception of the first (the first plaintext chunk uses the actual IV),</li>\n<li>a multiple of the block size (16 bytes) is used as the chunk size (which is already the case in the posted code).</li>\n</ul>\n<p>With these requirements, the encryption provides the same ciphertext that an one-step encryption would provide, as can best be seen from the <a href="https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#CBC" rel="nofollow noreferrer">CBC diagram</a>. The necessary code changes are minor.</p>\n<p>One could come up with the idea of extending the code with a MAC to an AEAD. This is possible, but as already mentioned above, it is better to consider an established library for security reasons.</p>\n<blockquote>\n<p>Is it okay to use the first 16 bytes of an encrypted block as the next initialization vector?</p>\n</blockquote>\n<p>In principle, yes, but with regard to the optimization mentioned above, it would make more sense to use the last block of a ciphertext chunk as the IV for the next plaintext chunk.</p>\n<blockquote>\n<p>Is the number of blocks per encryption/decryption important? Should one use the largest size that will fit in the maximum memory allocation or something else?</p>\n</blockquote>\n<p>With your implementation, there is the constraint that the chunk size for decryption depends on that for encryption, which is eliminated with the optimization.</p>\n<p>Apart from this, the selected chunk size will have an impact on performance. I would use a preferably large chunk size (but test this out).</p>\n"^^ . + . + . + . + "<p>I am aware of many very similar questions here and all over the web, but to my surprise all the suggested answers which I tried (at least fifteen) failed to work in my case. Basically, I want to check via PHP if certain files exist on the server of the German Math Olympiad website. I am using two files, and the relevant path, to do the testing: The URL</p>\n<p><a href="https://mathematik-olympiaden.de/moev/index.php?option=com_download&amp;thema=a&amp;format=raw&amp;datei=A40051.pdf" rel="nofollow noreferrer">https://mathematik-olympiaden.de/moev/index.php?option=com_download&amp;thema=a&amp;format=raw&amp;datei=A40051.pdf</a></p>\n<p>does not work. However, if the penultimate digit is changed from &quot;5&quot; to &quot;6&quot;, the URL</p>\n<p><a href="https://mathematik-olympiaden.de/moev/index.php?option=com_download&amp;thema=a&amp;format=raw&amp;datei=A40061.pdf" rel="nofollow noreferrer">https://mathematik-olympiaden.de/moev/index.php?option=com_download&amp;thema=a&amp;format=raw&amp;datei=A40061.pdf</a></p>\n<p>does work. But all the suggested solutions which I found here and elsewhere failed to detect that the first URL is faulty, and I haven't got the faintest clue why that is. One of my attempts based on a suggestion elsewhere was this:</p>\n<pre><code>&lt;?php\n\nfunction FileExists($url) {\n stream_context_set_default(\n array(\n 'http' =&gt; array(\n 'method' =&gt; 'HEAD'\n )\n )\n );\n $headers = get_headers($url, 1);\n $file_found = stristr($headers[0], '200');\n return $file_found;\n}\n\n$url1 = &quot;https://mathematik-olympiaden.de/moev/index.php?option=com_download&amp;thema=a&amp;format=raw&amp;datei=A40051.pdf&quot;;\n\n$url2 = &quot;https://mathematik-olympiaden.de/moev/index.php?option=com_download&amp;thema=a&amp;format=raw&amp;datei=A40061.pdf&quot;;\n\necho FileExists($url1);\necho FileExists($url2);\n?&gt;\n</code></pre>\n<p>However, the code returns &quot;OK&quot; in both cases.</p>\n<p>Can anybody give me a PHP function that is actually able to detect that the first URL is incorrect?</p>\n<p>Thank you.</p>\n"^^ . + "3"^^ . + . + . + "0"^^ . + "0"^^ . + . + "HTTP/1.1 405 Method Not Allowed AJAX php"^^ . + "0"^^ . + "0"^^ . + "Well, assuming the common error, it shows that updating the CA certificates _may_ not have worked. I write _may_ because you have not documented in your question how you did that, so it is a bit of guess. However the error code / message is clear (60), ref: https://curl.se/libcurl/c/libcurl-errors.html#CURLEPEERFAILEDVERIFICATION and you find the curl related download+info here with infos for differences on windows: https://curl.se/docs/caextract.html -- I'd double-check that. When you run `composer diagnose -vvv` composer may also show location of cert paths, which can be helpful for you."^^ . + . + . + . + "5"^^ . + . + . + . + . + "2"^^ . + "0"^^ . + "0"^^ . + "How far up could it be if this is the start of the function's declaration? Is there a way to print out a trace like PHP 8? (Odd enough, this works under PHP 8 with no problem or errors.)"^^ . + . + . + . + "1"^^ . + "fabricjs"^^ . + "Copy first level keys of a 2d array as a new column of each row"^^ . + "1"^^ . + . + . + "In order to help you I need to know which is the version of jqGrid (Guriddo jqGrid or free-jqgrid) used?"^^ . + . + . + "The only way you know who's making the request though is through what's stored in the php session. Apache can't see that. If there was a way to do this how you're thinking, you'd be able to Google it already"^^ . + . + "0"^^ . + . + "<p>I found it! You had to add a condition to tell it that if it finds 2 or more identical objects, you have to delete the relationship and recreate one.</p>\n<p>I'm closing the discussion. Have a nice day.</p>\n<pre><code>public function updateUser($object){\n $userToChange=$object-&gt;users()-&gt;first();\n if (empty($userToChange)) {\n $object-&gt;users()-&gt;save(User::where('id',Auth::user()-&gt;getAuthIdentifier())-&gt;first());\n }elseif($object-&gt;users()-&gt;where('user_id', $userToChange-&gt;id)-&gt;count() &gt;= 1){ //add condition to detect if several identical objects exists\n $object-&gt;users()-&gt;detach($userToChange-&gt;id);\n $object-&gt;users()-&gt;save(User::where('id',Auth::user()-&gt;getAuthIdentifier())-&gt;first());\n }else {\n if(Auth::user()-&gt;getAuthIdentifier()!=$userToChange-&gt;id){\n $object-&gt;users()-&gt;sync(User::where('id',Auth::user()-&gt;getAuthIdentifier())-&gt;first());\n }\n }\n }\n</code></pre>\n"^^ . + "casting"^^ . + . + . + "1"^^ . + "<p>SOLUTION: I have to go up 2 times in the file system.</p>\n<pre><code>require_once __DIR__ . '/../../vendor/autoload.php';\n\n$dotenv = Dotenv::createImmutable(__DIR__ . '/../../'); \n</code></pre>\n<p>(the .env file reaching was problematic too...)</p>\n"^^ . + . + . + "@krisgjika i edit the post with my `php.ini` values see it and if there any thing i done wrong u can tell me"^^ . + "1"^^ . + "<p>I'm using code that redirects to a “Thank You” page after sending a message from Contact Form 7. This code is located in the child theme's functions.php file.</p>\n<pre><code>add_action( 'wp_footer', 'mycustom_wp_footer' );\nfunction mycustom_wp_footer() {\n?&gt;\n &lt;script&gt;\n document.addEventListener( 'wpcf7mailsent', function( event ) {\n location = &quot;//site.com/thank-you/&quot;;\n }, false );\n &lt;/script&gt;\n&lt;?php\n}\n</code></pre>\n<p>This code works, except that there is a Polylang plugin on the site. That's why I have the “Thank you” page in several languages.</p>\n<ul>\n<li>site.com/thank-you/</li>\n<li>site.com/ar/thank-you/</li>\n<li>site.com/zh/thank-you/</li>\n</ul>\n<p>If I switch to Arabic or Chinese, it still redirects to the //site.com/thank-you/ page by default.</p>\n<p>How can I fix this and make the redirect to the “Thank You” page depending on the selected language?</p>\n"^^ . + . + . + . + "0"^^ . + . + . + . + . + "1"^^ . + "0"^^ . + "Though, I did check out the JSON from the request Yajra makes to the backend for the data and the time there is also incorrect so it is not a frontend thing."^^ . + . + . + . + . + "1"^^ . + "This refers to **authenticated** encryption/AEAD, which is only supported from v7.1. The self-implementation of a chunk-wise AEAD is more complex with pitfalls. If you want something like this, *sodium* may be a better option (but applies XChacha20-Poly1305 instead of GCM), see [libsodium](https://libsodium.gitbook.io/doc/secret-key_cryptography/secretstream) and [`sodium_crypto_secretstream_...`](https://www.php.net/manual/de/function.sodium-crypto-secretstream-xchacha20poly1305-init-pull.php)."^^ . + . + "1"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + "0"^^ . + "What parameters does it try to set the session cookie with? Especially the value of `K_COOKIE_DOMAIN` would probably be of interest."^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "1"^^ . + "0"^^ . + "0"^^ . + . + "How to set prefix path for all Zend_Form_Element decorators?"^^ . + . + . + . + . + "Accessing my laravel project on remote networks fail"^^ . + . + "1"^^ . + . + . + . + . + . + . + . + "I can't receive events via reverb on the local network"^^ . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + "Symfony 7 Dynamically creating routes for different hosts"^^ . + . + . + . + . + . + "@Mureinik Edit the main the question, but it is the `$methods_intl[]` line."^^ . + . + . + . + "Still doesnt work: https://www.webpagescreenshot.info/image-url/fW3JzM67V"^^ . + "<p>Your configuration from <code>config/database.php</code> file is not affected by the contents on the <code>.env</code> file because you are not overriding it.</p>\n<p>Your code on <code>config/database.php</code> should look as follows.</p>\n<pre class="lang-php prettyprint-override"><code>'sqlsrv_attendance' =&gt; [\n 'driver' =&gt; 'sqlsrv',\n 'host' =&gt; env('DB_SQLSRV_HOST', '127.0.0.1'),\n 'port' =&gt; env('DB_SQLSRV_PORT', 1433),\n 'database' =&gt; env('DB_SQLSRV_DATABASE', 'dbname'),\n 'username' =&gt; env('DB_SQLSRV_USERNAME', 'user'),\n 'password' =&gt; env('DB_SQLSRV_PASSWORD', 'pass'),\n 'charset' =&gt; 'utf8',\n 'prefix' =&gt; '',\n 'encrypt' =&gt; 'yes',\n 'trust_server_certificate' =&gt; 'true',\n],\n</code></pre>\n"^^ . + . + "<p>if I use</p>\n<pre><code>$TR = $entityManager-&gt;getRepository(Transaction::class);\n $cb = $TR-&gt;createQueryBuilder('t')\n -&gt;select('DATE_FORMAT(t.time, &quot;%d. %m. %y&quot;) AS date')\n -&gt;distinct()\n -&gt;getQuery();\n</code></pre>\n<p>The result query looks like &quot;SELECT DISTINCT DATE_FORMAT(t.time, &quot;%d. %m. %y&quot;) AS date FROM Transaction t&quot; and does not run, since the table name for entity Transaction is transactions.\nI did declare</p>\n<pre><code>#[ORM\\Entity]\n#[ORM\\Table(name: 'transactions')]\n\nclass Transaction\n{...\n</code></pre>\n<p>in the class and also</p>\n<pre><code>$TR = $entityManager-&gt;getRepository(Transaction::class);\n $cb = $TR-&gt;findAll();\n var_dump($cb);\n</code></pre>\n<p>works like expected.</p>\n<p>Any idea what I'm missing? Thanks a lot in advance for any hint!</p>\n<p>Cheers</p>\n"^^ . + "Also Lockbox 2.08 is quite old so may consider using more modern Encryption library. For that I suggest you check [DelphiEncryptionCompendium](https://github.com/MHumm/DelphiEncryptionCompendium/tree/master) which is probably one of the most powerful encryption libraries for Delphi and it supports most of the modern Encryption and Hashing algorithms."^^ . + "2"^^ . + "The message is only stating that there _was_ some error, but gives no details. Check your admin email, as it says there, and/or enable WP debug mode, to first of all figure out _what_ the error actually was."^^ . + . + . + "0"^^ . + . + . + "2"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + "2"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + . + "asn.1"^^ . + . + . + . + . + "1"^^ . + . + . + . + "@IainH, I'm probably at the end of my help with you unfortunately. I dev locally w/ WSL and host mostly with Nginx, so I don't really deal with Apache much anymore. My last thing to try is compare the output of the working CLI `phpinfo()` against the non-working output of the same command using the web SAPI. Look for additional ini files possibly, maybe. Good luck with this!"^^ . + . + . + . + "0"^^ . + . + "3"^^ . + "0"^^ . + . + . + "<p><img src="https://i.sstatic.net/Jp79uQp2.png" alt="enter image description here" />\n<img src="https://i.sstatic.net/KNd4C0Gy.png" alt="enter image description here" /></p>\n<p>If I have a selection in the list box on the registration form, what can I put into type? I'm just a learner student</p>\n<p>if i fill in my registration form i wish it is saved from my database. because when i click register it is not saved from my database. when i click register button the output is &quot;not found&quot;</p>\n"^^ . + "Have you tried adding the `'disable_inarray_validator' => true` option to the community_id form element options?"^^ . + . + "3"^^ . + . + . + . + . + . + "<p>You need first to store token in meta tag or somewhere else and when doing the request you need to send it as specific header. Read the documentation here, <a href="https://laravel.com/docs/12.x/csrf#csrf-x-csrf-token" rel="nofollow noreferrer">https://laravel.com/docs/12.x/csrf#csrf-x-csrf-token</a></p>\n<p>Correct header is &quot;X-CSRF-TOKEN&quot;</p>\n"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + "4"^^ . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + . + "see https://www.php.net/manual/en/ziparchive.statindex.php"^^ . + . + . + . + . + . + "vps"^^ . + "6"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + "0"^^ . + "1"^^ . + "<p>I'm trying to use DTOs for my first time.</p>\n<p>I am using Yii2 and <strong>PHP 7.1</strong> .</p>\n<p>For simplicity my use case can be seen as the following DTOs:</p>\n<pre class="lang-php prettyprint-override"><code>use yii\\base\\Model;\nclass OrderDto extends Model\n{\n /** @var OrderedProductDto[] $orderedProducts */\n protected $orderedProducts;\n\n /** @var integer $orderTaxAmount */\n protected $orderTaxAmount;\n\n /** @var integer $orderTotalAmount */\n protected $orderTotalAmount;\n\n public function rules()\n {\n //my validation rules go here\n }\n}\n\nclass OrderedProductDto extends Model\n{\n /** @var integer $quantity */\n protected $quantity;\n\n /** @var integer $orderedProductName */\n protected $orderedProductName ;\n\n public function rules()\n {\n //my validation rules go here\n }\n}\n</code></pre>\n<p>Now, in my hydrator which converts from an internal <code>Order</code> object into an <code>OrderDto</code>, I would ideally like to do something like:</p>\n<pre class="lang-php prettyprint-override"><code>class ExternalOrderHydrator\n{\n public static function getOrderDtoFromOrder(Order $order)\n {\n /** do stuff to get an $array from $order which looks like\n * ['orderTaxAmount' =&gt; 5, 'orderTotalAmount' =&gt; 100, \n * 'orderedProducts' =&gt; [\n * ['quantity' =&gt; 5, 'orderedProductName' =&gt; 'Product 1'],\n * ],]\n * and then do:\n */\n $orderDto = new OrderDto();\n if (!($orderDto-&gt;load($array) and $orderDto-&gt;validate())) {\n throw new Exception('Something is wrong with provided data.');\n }\n return $orderDto;\n }\n}\n</code></pre>\n<p>The problem with this approach is that I cannot simply pass an array with nested subarrays to <code>$orderDto-&gt;load()</code>, because the <code>orderedProducts</code> field will expect an array of <code>OrderedProductDto</code>. But it feels counterproductive to construct such an array manually before passing it to the DTO.</p>\n<p>So what I'm asking is, is there a way to just pass an array with simple data in nested subarrays to the highest-level DTO, then let all the lower-level DTOs which appear inside the highest level one do the conversion from array to DTO automatically?</p>\n<p>Please bear in mind that I am using Yii2 and PHP 7.1</p>\n"^^ . + . + . + "Laravel Spark Stuck At Subscribe Screen"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + "1"^^ . + "0"^^ . + "I found my failure, it was somewhere else. thx"^^ . + . + "0"^^ . + . + "1"^^ . + . + . + "1"^^ . + "0"^^ . + . + . + "Filament php routes working but any other routes showing 404"^^ . + . + . + "1"^^ . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "1"^^ . + . + . + . + "@BlueDogRanch I updated the answer. I think the best solution for your case is to use the PHP output buffering. Please check the answer. Hope it solves your issue."^^ . + "0"^^ . + . + . + "Can you elaborate on the _default image_ and please provide reference to it? E.g. https://filamentphp.com/docs/3.x/forms/fields/file-upload does not list anything close to a _default image_ if I see it right, so what are you referring to?"^^ . + . + "0"^^ . + . + "1"^^ . + "<p>Uploading files need to be validated, we all agree on this.</p>\n<p>The testers mention that they were either able to successfully upload a file or to at least get a 200 status via</p>\n<pre><code>------WebKitFormBoundaryfRqsDnhE1J8zAPZS\nContent-Disposition: form-data; name=&quot;files[]&quot;; filename=&quot;example.php&quot;\nContent-Type: application/octet-stream\n</code></pre>\n<p>In view of such reports, you absolutely need to double-check whether such a thing is possible and if so, treat at as a priority issue. If not, then respond to the testers that the file was not actually uploaded and maybe fix the response status for the scenario they uncovered.</p>\n<p>The problem with the possibility of uploading executable files is that they may be executed. example.php could contain malicious code which would cause harm on the server if it is ever executed. So it is best to avoid entirely the upload of PHP files, unless that's your explicit goal, which does not seem to be the case as we are speaking about photos.</p>\n<p>Imagine the case when they upload successfully filename.php and it ends up being among your images, like the eggs of the cocoon in foreign nests. In such cases, your server may execute it via cli due to whatever reason (a sloppy sysadmin wants to execute all php files inside a folder that happens to contain your images too, for example) or the hacker may send a GET request to the location where the PHP file was uploaded.</p>\n<p>So this is a real concern. We shouldn't think on whether there is a way to exploit the upload of a PHP file. Instead, we should avoid uploading PHP files if we are to handle image uploads.</p>\n<p>It does not matter whether the request is sent from the UI or from some automated code or the terminal of a witty hacker. What matters is that you <strong>exclude</strong> any possible means to upload executable files while uploading images.</p>\n<p>So if you are unsure on how this can be reproduced, ask the testers about the exact steps they have performed in order to reproduce it.</p>\n<p>A general approach that you can take is to open the Dev Tools of your browser, do a legitimate request, in the Network tab right-click on the request, choose to copy cURL, paste it into a text editor, modify it to be more malicious and then send it via the terminal in order to test. Actually this is how hackers can mimic the use of your UI, so client-side protections on your UI will help direct users to safe use, but some users will choose to step out from the boundaries you defined for them.</p>\n"^^ . + . + . + . + "0"^^ . + "-1"^^ . + . + . + . + . + . + . + "Try with a tenth of max children and see how it goes. Alternatively 10x the amount of memory."^^ . + . + . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + "1"^^ . + . + "<p>So I set up an autoloader in PHP using spl_autoload_register() (and not composer).</p>\n<p>I have made my custom plugin called my-plugin, refer to the <a href="https://i.sstatic.net/Wie9UdGw.png" rel="nofollow noreferrer">attachment for reference of folder structure.</a></p>\n<p>I have learned to include files like autoloader or trait-singleton.php, I need to include it in my main plugin file i.e., in my case my-plugin.php.</p>\n<p>Now when I try to error_log() the parameter spl_autoload_register() accepts, I get a completely different thing.</p>\n<pre><code>&lt;?php\nspl_autoload_register( function ( $class_name ) {\n error_log(&quot;Autoloader received: &quot; . $class_name);\n include $class_name . '.php';\n}\n\n[14-Feb-2025 00:08:23 UTC] Autoloader received: WP_Site_Health\n</code></pre>\n<p>I am unable to complete the autoloader function, the singleton file works great when i include it in the main plugin file.</p>\n<p>How do I implement autoloader for my particular file structure, where most of my files would be located in \\my-plugin\\inc\\classes\\post-types for CPT and \\my-plugin\\inc\\classes\\taxonomies for taxonomies.</p>\n"^^ . + "Ok, but should I change the authentication or the post part?"^^ . + . + . + . + . + "pdf"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + "<p>This works:</p>\n<pre><code> $validation = \\Config\\Services::validation();\n\n $validation-&gt;setRules([\n 'field1' =&gt; 'required|max_length[20]',\n 'array1' =&gt; 'required',\n 'array1.*' =&gt; 'required|numeric',\n 'array1_keys.*' =&gt; 'required|numeric',\n 'array1_count' =&gt; 'required|numeric|greater_than_equal_to[1]|less_than_equal_to[50]'\n ]);\n\n $to_validate = $this-&gt;request-&gt;getPost();\n $to_validate[&quot;array1_keys&quot;] = array_keys($to_validate['array1'] ?? []);\n $to_validate[&quot;array1_count&quot;] = count($to_validate[&quot;array1_keys&quot;]);\n\n if (! $validation-&gt;run($to_validate)) {\n return $this-&gt;failValidationErrors($validation-&gt;getErrors());\n }\n</code></pre>\n<p>That said it is hardly elegant so I will happily upvote a more concise alternative.</p>\n"^^ . + . + "0"^^ . + "Sometimes people use regular expressions to solve every problem they encounter, when there are better solutions possible. Clearly we cannot suggest anything because all we have is a recipe for the regex you want. No example of a "long string" is given, nor any explanation as to why this has to be done thousands of times per minute. OK, I'll admit it, I'm just curious what on earth this regex could be useful for."^^ . + "8"^^ . + "Is your PHP file actually getting parsed by PHP? When you request it directly via your browser address bar - do you get "working", or is your browser offering to download the file?"^^ . + "1"^^ . + "0"^^ . + . + . + . + . + . + . + . + "I'd start by executing that same command via console manually, and checking what errors that might have to report."^^ . + . + "0"^^ . + . + . + "1"^^ . + . + . + "array-key"^^ . + "2"^^ . + ""(...) means that i have now 50 application" - no, why do you think this could be the case? You would still have the same amount of applications, but with a probably higher number of installed packages. What keeps you from installing the seperated packages into the exact same application?"^^ . + . + . + . + "2"^^ . + . + . + . + . + . + . + "1"^^ . + "Sorry for the confusion I meant to say that I have removed the absolute web directory path for the error log in case it was a security issue to post it online. The error log file has recorded lots of error successfully. As for the appache error logs, there is nothing error or similar in the log directory I can find."^^ . + . + "<p>For anyone who has got this issue.\nI got it to work by passing it like this</p>\n<p>Having the template data key and then sending the parameters one by one</p>\n<pre><code>$templateData = [];\n $templateData = [\n 'orderNumber' =&gt; $order-&gt;getOrderNumber(),\n ];\n $this-&gt;mailService-&gt;send($dataBag-&gt;all(), $context, $templateData);\n</code></pre>\n"^^ . + "[Does it answer your question?](https://www.php.net/manual/en/language.references.whatare.php)"^^ . + "PHP script in form crashes on Safari on iOS"^^ . + . + . + . + "what is output of `<td><?php echo htmlspecialchars($product['Image']) ?></td>`?"^^ . + "0"^^ . + . + . + . + "Can you please be more specific with that "fail"? What exactly and how exactly it fails? Not that it seems to be important but just to cut off false trails that will inevitably arise from such a vague description"^^ . + . + . + "1"^^ . + . + . + . + "How I can join using counts using Doctrine"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "https://github.com/php/php-src contains the source code for php"^^ . + "spam-prevention"^^ . + . + "I used $data = $result->fetch_all(MYSQLI_ASSOC);"^^ . + "How to fix file upload in laravel livewire"^^ . + "0"^^ . + "Ur right Rozsazoltan, in fact, its not that i dont want to, its becuase i dont know how to.\ni think ill re-write my question in more details so that it can be clear for you.\ni already apprciate the effort and professional help and advice you provided. its amazing.\nyou prefer i re-write the question again here or ask a new question?"^^ . + . + "Maybe this is interesting: Failed to initialize global composer: Composer could not find the config file: C:/Users/jilco/AppData/Roaming/Composer/composer.json"^^ . + . + "Often you hand a value through your program from start to finish, passing several components in between. Even if right now you have very short ways from input to output/SQL/shell, that may change in the future. Your program may become more complex, introducing several different ways how a value may get into your SQL/shell statement. You may add more values to your `$fruits` array in the future, which may start to contain special characters. Will you remember to add escaping/binding to all the other code then? — Just always use escaping/binding, period. No matter where your values come from."^^ . + . + "0"^^ . + "<p>Your XML-to-array conversion is losing attributes like name=&quot;id&quot; because simplexml_load_string with json_encode/decode flattens them awkwardly. The param node’s name attribute gets dropped, and area levels turn into a numeric array. To grab everything, tweak your approach with SimpleXMLElement directly:</p>\n<pre><code>$xml_string = file_get_contents($path . 'file_xml.xml', LIBXML_NOCDATA);\n$xml = simplexml_load_string($xml_string, null, LIBXML_NOCDATA);\n$result = [];\n\nforeach ($xml-&gt;children() as $node) {\n $result[$node-&gt;getName()] = json_decode(json_encode($node), true);\n // Preserve attributes manually\n foreach ($node-&gt;xpath('.//*[@name]') as $attrNode) {\n $name = (string)$attrNode['name'];\n $result[$node-&gt;getName()]['offert']['param'] = [\n 'value' =&gt; (string)$attrNode,\n 'attributes' =&gt; ['name' =&gt; $name]\n ];\n }\n}\n\nvar_dump($result);\n</code></pre>\n<p>This keeps the name=&quot;id&quot; under param as ['param']['attributes']['name'] =&gt; 'id', and the value 445/443/TS as ['param']['value']. The area levels stay intact too—just access them under location. It’s not perfect (you might need to loop deeper for nested attributes), but it’s closer to the full XML structure you want!</p>\n"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + "1"^^ . + . + . + . + "0"^^ . + . + . + "firebase-cloud-messaging"^^ . + . + . + . + "0"^^ . + . + . + . + . + "I configured the JAR variable for one of my applications. But then I couldn't access variables in the cookie (For example, `$f3->get('COOKIE.sent')` doesn't work)"^^ . + . + "0"^^ . + . + "-4"^^ . + . + . + . + . + . + "1"^^ . + "0"^^ . + "`set -e` is usually a bad idea (see https://mywiki.wooledge.org/BashFAQ/105) and inspecting stderr had already been suggested in comments."^^ . + . + . + "0"^^ . + . + . + . + . + "Cannot login to tcexam via IP instead domain"^^ . + "multisite"^^ . + . + . + . + . + . + . + "-1"^^ . + . + "0"^^ . + "0"^^ . + . + "<p>I have a Laravel API that inserts data into a table where rows must be unique. The table has a unique constraint on two columns. When multiple concurrent or duplicate requests hit the API, MariaDB sometimes throws an Integrity Constraint Violation error due to simultaneous inserts of the same data.</p>\n<pre><code>SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'some_value' for key 'unique_column'\n</code></pre>\n<p>What is the most effective approach to preventing duplicate inserts in Laravel when handling concurrent requests?</p>\n<p><strong>What I Have Tried:</strong></p>\n<p><strong>Try-Catch Block:</strong> Used a try-catch block to handle the exception, but this does not prevent duplicates; it only catches the error.</p>\n<p><strong>Checking Before Insert:</strong> Used Model::where('column', $value)-&gt;exists() before inserting, but this approach is not atomic and still allows race conditions.</p>\n"^^ . + . + "0"^^ . + "I know absolutely nothing about Roblox, so pardon my ignorance. Can you post a link to the documentation for the API(s) you are trying to interact with?"^^ . + . + . + "<p>I'm using vanilla php with no framework to host my application.</p>\n<p>Issue:\nURL: <a href="http://x.test/case-studies" rel="nofollow noreferrer">http://x.test/case-studies</a>\nThis should point to case-studies.php file but doesnt and returns me the index.php file. When I modify the url to point to <a href="http://x.test/case-studies.php" rel="nofollow noreferrer">http://x.test/case-studies.php</a> it works fine but I want it to point to the case-studies.php without the .php extension. I have tried multiple try_files solutions and none have worked.</p>\n<p>herd.config</p>\n<pre><code>server {\n listen 127.0.0.1:80 default_server;\n #listen VALET_LOOPBACK:80; # valet loopback\n root /;\n charset utf-8;\n client_max_body_size 1024M;\n\n\n location /41c270p0-5535-465a-b23e-c269744c1t26/ {\n internal;\n alias /;\n try_files $uri $uri/;\n }\n\n location / {\n rewrite ^ &quot;/Applications/Herd.app/Contents/Resources/valet/server.php&quot; last;\n }\n\n\n location = /favicon.ico { access_log off; log_not_found off; }\n location = /robots.txt { access_log off; log_not_found off; }\n\n access_log off;\n error_log &quot;/Users/jack-brogan/Library/Application Support/Herd/Log/nginx-error.log&quot;;\n\n error_page 404 &quot;/Applications/Herd.app/Contents/Resources/valet/server.php&quot;;\n\n location ~ [^/]\\.php(/|$) {\n fastcgi_split_path_info ^(.+\\.php)(/.+)$;\n fastcgi_pass $herd_sock;\n fastcgi_index &quot;/Applications/Herd.app/Contents/Resources/valet/server.php&quot;;\n fastcgi_param QUERY_STRING $query_string;\n fastcgi_param REQUEST_METHOD $request_method;\n fastcgi_param CONTENT_TYPE $content_type;\n fastcgi_param CONTENT_LENGTH $content_length;\n fastcgi_param SCRIPT_FILENAME $request_filename;\n fastcgi_param SCRIPT_NAME $fastcgi_script_name;\n fastcgi_param REQUEST_URI $request_uri;\n fastcgi_param DOCUMENT_URI $document_uri;\n fastcgi_param DOCUMENT_ROOT $document_root;\n fastcgi_param SERVER_PROTOCOL $server_protocol;\n fastcgi_param GATEWAY_INTERFACE CGI/1.1;\n fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;\n fastcgi_param REMOTE_ADDR $remote_addr;\n fastcgi_param REMOTE_PORT $remote_port;\n fastcgi_param SERVER_ADDR $server_addr;\n fastcgi_param SERVER_PORT $server_port;\n fastcgi_param SERVER_NAME $server_name;\n fastcgi_param HTTPS $https if_not_empty;\n fastcgi_param HERD_HOME &quot;/Users/jack-brogan/Library/Application Support/Herd&quot;;\n fastcgi_param REDIRECT_STATUS 200;\n fastcgi_param HTTP_PROXY &quot;&quot;;\n fastcgi_buffer_size 512k;\n fastcgi_buffers 16 512k;\n fastcgi_param SCRIPT_FILENAME &quot;/Applications/Herd.app/Contents/Resources/valet/server.php&quot;;\n fastcgi_param PATH_INFO $fastcgi_path_info;\n }\n\n location ~ /\\.ht {\n deny all;\n }\n}\n\n</code></pre>\n<p>nginx.conf</p>\n<pre><code>user &quot;jack-brogan&quot; staff;\nworker_processes auto;\n\nevents {\n worker_connections 1024;\n}\n\nhttp {\n \ntypes {\n text/html html htm shtml;\n text/css css;\n text/xml xml;\n image/gif gif;\n image/jpeg jpeg jpg;\n application/javascript js;\n application/atom+xml atom;\n application/rss+xml rss;\n\n text/mathml mml;\n text/plain txt;\n text/vnd.sun.j2me.app-descriptor jad;\n text/vnd.wap.wml wml;\n text/x-component htc;\n\n image/avif avif;\n image/png png;\n image/svg+xml svg svgz;\n image/tiff tif tiff;\n image/vnd.wap.wbmp wbmp;\n image/webp webp;\n image/x-icon ico;\n image/x-jng jng;\n image/x-ms-bmp bmp;\n\n font/woff woff;\n font/woff2 woff2;\n\n application/java-archive jar war ear;\n application/json json;\n application/mac-binhex40 hqx;\n application/msword doc;\n application/pdf pdf;\n application/postscript ps eps ai;\n application/rtf rtf;\n application/vnd.apple.mpegurl m3u8;\n application/vnd.google-earth.kml+xml kml;\n application/vnd.google-earth.kmz kmz;\n application/vnd.ms-excel xls;\n application/vnd.ms-fontobject eot;\n application/vnd.ms-powerpoint ppt;\n application/vnd.oasis.opendocument.graphics odg;\n application/vnd.oasis.opendocument.presentation odp;\n application/vnd.oasis.opendocument.spreadsheet ods;\n application/vnd.oasis.opendocument.text odt;\n application/vnd.openxmlformats-officedocument.presentationml.presentation\n pptx;\n application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\n xlsx;\n application/vnd.openxmlformats-officedocument.wordprocessingml.document\n docx;\n application/vnd.wap.wmlc wmlc;\n application/wasm wasm;\n application/x-7z-compressed 7z;\n application/x-cocoa cco;\n application/x-java-archive-diff jardiff;\n application/x-java-jnlp-file jnlp;\n application/x-makeself run;\n application/x-perl pl pm;\n application/x-pilot prc pdb;\n application/x-rar-compressed rar;\n application/x-redhat-package-manager rpm;\n application/x-sea sea;\n application/x-shockwave-flash swf;\n application/x-stuffit sit;\n application/x-tcl tcl tk;\n application/x-x509-ca-cert der pem crt;\n application/x-xpinstall xpi;\n application/xhtml+xml xhtml;\n application/xspf+xml xspf;\n application/zip zip;\n\n application/octet-stream bin exe dll;\n application/octet-stream deb;\n application/octet-stream dmg;\n application/octet-stream iso img;\n application/octet-stream msi msp msm;\n\n audio/midi mid midi kar;\n audio/mpeg mp3;\n audio/ogg ogg;\n audio/x-m4a m4a;\n audio/x-realaudio ra;\n\n video/3gpp 3gpp 3gp;\n video/mp2t ts;\n video/mp4 mp4;\n video/mpeg mpeg mpg;\n video/quicktime mov;\n video/webm webm;\n video/x-flv flv;\n video/x-m4v m4v;\n video/x-mng mng;\n video/x-ms-asf asx asf;\n video/x-ms-wmv wmv;\n video/x-msvideo avi;\n}\n\n default_type application/octet-stream;\n\n sendfile on;\n keepalive_timeout 65;\n types_hash_max_size 2048;\n\n client_max_body_size 1024M;\n\n server_names_hash_bucket_size 128;\n\n gzip on;\n gzip_comp_level 5;\n gzip_min_length 256;\n gzip_proxied any;\n gzip_vary on;\n gzip_types\n application/atom+xml\n application/javascript\n application/json\n application/rss+xml\n application/vnd.ms-fontobject\n application/x-font-ttf\n application/x-web-app-manifest+json\n application/xhtml+xml\n application/xml\n font/opentype\n image/svg+xml\n image/x-icon\n text/css\n text/plain\n text/x-component;\n \n include &quot;/Applications/Herd.app/Contents/Resources/config/pro/nginx/*.conf&quot;;\n include &quot;/Users/jack-brogan/Library/Application Support/Herd/config/valet/Nginx/*&quot;;\n include herd.conf;\n include &quot;/Applications/Herd.app/Contents/Resources/config/default-sites/*.conf&quot;;\n}\n\n\nI have tried each one of these with no luck.\n\n location / {\n #try_files $uri $uri/ /index.php?$query_string;\n #try_files $uri $uri/ $uri.php /index.php?$args;\n #try_files $uri $uri.php $uri/;\n }\n</code></pre>\n"^^ . + . + . + . + . + "0"^^ . + "<h1>How to bulk import entities with Doctrine ?</h1>\n<h3>Business requirements</h3>\n<p>I am using Doctrine 3 to bulk import a list of entities from a CSV.<br />\nEach row creates 100 entities~ and I flush it each 10 rows.<br />\nAll entities are having a relationship with User (createUser)</p>\n<p>But this is not this easy with the entity manager of Doctrine... For each solution I tried, I got an issue, so I ran out of solution and went here.</p>\n<h3>What I have tried ?</h3>\n<ul>\n<li>Simply flush it<br />\n=&gt; Run out of memory. When flushing entities, the unit of work keeps it in memory.</li>\n<li>Flush it and clear() all<br />\n=&gt; Got error because the user was flushed and no more persisted, the entity is detached.</li>\n</ul>\n<pre><code> [Doctrine\\ORM\\ORMInvalidArgumentException] \n Multiple non-persisted new entities were found through the given association graph\n</code></pre>\n<ul>\n<li>I tried to re-attach it<br />\n=&gt; This feature is no more available</li>\n<li>Flush it and detach() entities one by one excluding user<br />\n=&gt; Doctrine is failing and sometimes, some entities are not detached (This error is very complicated to solve cause of the randomness)</li>\n<li>Flush it, clear all and refresh persisted entities<br />\n=&gt; This is a functional issue, this solution implies to set the user again in authentication system, clearing entities is killing it.</li>\n</ul>\n<p>I could have more functional solutions but this harms the maintainability of the project.</p>\n"^^ . + . + . + . + "Status 500 error which is recording no errors with PHP.ini reporting enabled and the function is working in PHP"^^ . + . + . + . + "2"^^ . + "Yes but sometime it gives all possible combinations in valid_combinations and sometimes it may give 5 combinations as valid. It is not giving same emails as valid emails everytime"^^ . + "<p>Laravel 8 , php 8</p>\n<p>I saw a very strange thing in Laravel and actually in PHP that I can't understand why this is happening in PHP.</p>\n<p>I have two arrays that are almost identical and have only one very small difference. And the result of the operation of adding all the values ​​of the items of each of them is 100. But PHP considers the sum of the values ​​to be 100 for one of the arrays but not for the other. How is this possible?</p>\n<p>Of course, I know a little about PHP_FLOAT_EPSILON l. But it seems that this variable has nothing to do with the problem that arose for me.</p>\n<pre class="lang-php prettyprint-override"><code>$c = [\n 23.3,\n 33.4,\n 43.3,\n];\n$d = [\n 43.3,\n 23.4,\n 33.3,\n];\n\n$ccc = array_sum($c);\n$ddd = array_sum($d);\n\ndump($ccc); // output: 100.0\ndump($ddd); // output: 100.0\n\nif ($ccc != 100) {\n dump('$ccc is not equal to 100');\n} else {\n dump('$ccc is equal to 100'); // This output is displayed.\n}\nif ($ccc != 100.0) {\n dump('$ccc is not equal to 100.0');\n} else {\n dump('$ccc is equal to 100.0'); // This output is displayed.\n}\n\nif ($ddd != 100) {\n dump('$ddd is not equal to 100'); // This output is displayed.\n} else {\n dump('$ddd is equal to 100');\n}\nif ($ddd != 100.0) {\n dump('$ddd is not equal to 100.0'); // This output is displayed.\n} else {\n dump('$ddd is equal to 100.0');\n}\n</code></pre>\n"^^ . + "initialization"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "Perhaps a dulicate of: https://stackoverflow.com/q/48705124/367456 ? Have you checked that Q&A? If not, what is different in your case? Please [edit] your question and share the details."^^ . + . + . + "1"^^ . + . + . + . + "1"^^ . + "Are you sure it is ever called? Have a look in the access.log"^^ . + . + . + . + . + . + . + "<pre><code> &lt;?php\n\nnamespace App\\Services\\Feed;\n\nuse App\\Repositories\\Poll\\PollRepositoryInterface;\nuse App\\Repositories\\Post\\PostRepositoryInterface;\nuse Illuminate\\Http\\Resources\\Json\\AnonymousResourceCollection;\nuse Illuminate\\Pagination\\LengthAwarePaginator;\nuse Illuminate\\Support\\Facades\\Log;\n\nclass FeedService implements FeedServiceInterface\n{\n public function __construct(\n private PostRepositoryInterface $postRepository,\n private PollRepositoryInterface $pollRepository\n ) {}\n\n /** Send all feeds\n *\n * @param array $data The filtered data\n * @return array The feed array\n */\n public function getFeeds(array $data): array\n {\n $page = $data['page'] ?? config('data.pagination.default_page', 1);\n $limit = $data['limit'] ?? config('data.pagination.default_limit', 10);\n\n // Get paginated posts and polls (fetching only required records)\n $posts = $this-&gt;postRepository-&gt;getPosts($data);\n $polls = $this-&gt;pollRepository-&gt;getPolls($data);\n\n // Ensure collections exist and default to empty collections if null\n $postsCollection = isset($posts-&gt;collection) ? collect($posts-&gt;collection) : collect();\n $pollsCollection = isset($polls-&gt;collection) ? collect($polls-&gt;collection) : collect();\n\n // Merge and sort by combined_created_at\n $mergedFeed = $postsCollection-&gt;merge($pollsCollection)\n -&gt;sortByDesc('combined_created_at')\n -&gt;values();\n\n // Paginate the merged feed\n $total = $mergedFeed-&gt;count();\n $paginatedItems = $mergedFeed-&gt;slice(($page - 1) * $limit, $limit)-&gt;values();\n\n // Apply transformations **only on the paginated items**\n $startIndex = ($page - 1) * $limit; // Start index based on pagination\n\n $transformedFeed = $paginatedItems-&gt;map(function ($item) use (&amp;$startIndex, $data) {\n // Ensure JSON is properly decoded as an **object**\n $item-&gt;show_user_details = json_decode($item-&gt;show_user_details, false);\n\n $item-&gt;is_shared = (bool) $item-&gt;is_shared;\n\n // Generate unique ID using type, ID, index, page, and limit\n $uniqueKey = &quot;{$item-&gt;type}-{$item-&gt;id}-{$startIndex}-{$data['page']}-{$data['limit']}&quot;;\n $item-&gt;unique_id = hash('sha256', $uniqueKey);\n\n $startIndex++; // Increment index\n\n return $item; // Ensure transformation is applied\n });\n\n // Create the paginator\n $paginatedFeed = new LengthAwarePaginator(\n $transformedFeed, // Only transformed paginated items\n $total, // Total items count\n $limit, // Items per page\n $page, // Current page\n ['path' =&gt; request()-&gt;url(), 'query' =&gt; request()-&gt;query()] // Maintain query parameters\n );\n\n return [\n 'post' =&gt; $paginatedFeed-&gt;items(), // Extract items directly\n 'pagination' =&gt; [\n 'total' =&gt; $paginatedFeed-&gt;total(),\n 'per_page' =&gt; $paginatedFeed-&gt;perPage(),\n 'current_page' =&gt; $paginatedFeed-&gt;currentPage(),\n 'last_page' =&gt; $paginatedFeed-&gt;lastPage(),\n 'from' =&gt; $paginatedFeed-&gt;firstItem(),\n 'to' =&gt; $paginatedFeed-&gt;lastItem(),\n ],\n ];\n }\n}\n\n /**\n * Send all posts\n *\n * @param array $data The filtered data\n * @return AnonymousResourceCollection The post collection\n */\n public function getPosts(array $data): AnonymousResourceCollection\n {\n $this-&gt;setPaginationAndOrderBy($data);\n\n $postableId = $data[&quot;postable_id&quot;] ?? null;\n $postableType = $data[&quot;postable_type&quot;] ?? null;\n\n $username = $data['username'] ?? null;\n\n // Fetch user ID from username\n $userId = null;\n if ($username) {\n $userId = $this-&gt;user-&gt;where('username', $username)-&gt;value('id');\n }\n\n // Original Posts with Creator's Name\n $originalPosts = $this-&gt;post\n -&gt;select(\n 'posts.*',\n DB::raw('posts.created_at as combined_created_at'),\n DB::raw(&quot;\n CASE \n WHEN posts.postable_type LIKE '%User' THEN users.username\n WHEN posts.postable_type LIKE '%Club' THEN clubs.name\n ELSE NULL\n END as show_user\n &quot;),\n DB::raw(&quot;\n CASE \n WHEN posts.postable_type LIKE '%User' THEN CAST(\n JSON_OBJECT(\n 'id', users.id,\n 'profile_image', users.profile_image,\n 'username', users.username,\n 'email', users.email,\n 'first_name', users.first_name,\n 'last_name', users.last_name,\n 'gender',\n CASE \n WHEN users.gender = 0 THEN 'Male'\n WHEN users.gender = 1 THEN 'Female'\n WHEN users.gender = 2 THEN 'Others'\n ELSE NULL\n END\n ) AS JSON\n )\n WHEN posts.postable_type LIKE '%Club' THEN CAST(\n JSON_OBJECT(\n 'id', clubs.id,\n 'name', clubs.name,\n 'description', clubs.description\n ) AS JSON\n )\n ELSE NULL\n END as show_user_details\n &quot;),\n DB::raw(&quot;FALSE as is_shared&quot;) // Adding is_shared flag\n )\n -&gt;leftJoin('users', function ($join) {\n $join-&gt;on('posts.postable_id', '=', 'users.id')\n -&gt;where('posts.postable_type', 'App\\\\Models\\\\User');\n })\n -&gt;leftJoin('clubs', function ($join) {\n $join-&gt;on('posts.postable_id', '=', 'clubs.id')\n -&gt;where('posts.postable_type', 'App\\\\Models\\\\Club');\n });\n\n // Apply filters for `postable_id` and `postable_type`\n if ($postableId &amp;&amp; $postableType) {\n $originalPosts-&gt;where('posts.postable_id', $postableId)\n -&gt;where('posts.postable_type', $postableType);\n }\n\n // Apply filter for user posts if username exists\n if ($userId) {\n $originalPosts-&gt;where('posts.postable_id', $userId)\n -&gt;where('posts.postable_type', 'App\\\\Models\\\\User');\n }\n\n // Shared Posts with Sharer's Username\n $sharedPosts = $this-&gt;post\n -&gt;select(\n 'posts.*',\n DB::raw('post_shares.created_at as combined_created_at'),\n 'shared_users.username as show_user',\n DB::raw(&quot;\n CAST(\n JSON_OBJECT(\n 'id', shared_users.id,\n 'profile_image', shared_users.profile_image,\n 'username', shared_users.username,\n 'email', shared_users.email,\n 'first_name', shared_users.first_name,\n 'last_name', shared_users.last_name,\n 'gender',\n CASE \n WHEN shared_users.gender = 0 THEN 'Male'\n WHEN shared_users.gender = 1 THEN 'Female'\n WHEN shared_users.gender = 2 THEN 'Others'\n ELSE NULL\n END\n ) AS JSON\n ) as show_user_details\n &quot;),\n DB::raw(&quot;TRUE as is_shared&quot;) // Adding is_shared flag\n )\n -&gt;join('post_shares', 'posts.id', '=', 'post_shares.post_id')\n -&gt;join('users as shared_users', 'post_shares.user_id', '=', 'shared_users.id');\n\n // Apply filter for shared posts if username exists\n if ($userId) {\n $sharedPosts-&gt;where('post_shares.user_id', $userId);\n }\n\n // Combine Original Posts + Shared Posts using UNION\n $posts = $originalPosts\n -&gt;unionAll($sharedPosts)\n -&gt;orderByDesc('combined_created_at')\n // -&gt;paginate($this-&gt;limit, ['*'], 'page', $this-&gt;page);\n -&gt;get();\n\n // $startIndex = ($data['page'] - 1) * $data['limit']; // Start index based on pagination\n\n // // Handles JSON decoding\n // $posts-&gt;transform(function ($post) use ($startIndex, $data) {\n // $post-&gt;show_user_details = json_decode($post-&gt;show_user_details, true);\n // $post-&gt;is_shared = (bool) $post-&gt;is_shared; // Ensure boolean type\n\n // // Generate unique ID using post ID, index, page, and limit\n // $uniqueKey = &quot;{$post-&gt;type}-{$post-&gt;id}-{$startIndex}-{$data['page']}-{$data['limit']}&quot;;\n\n // // Generate unique ID using hash\n // $post-&gt;unique_id = hash('sha256', $uniqueKey);\n\n // $startIndex++; // Increment the index for next post\n\n // return $post;\n // });\n\n // Load default relations\n $posts-&gt;load([\n 'postMedias',\n 'postable',\n 'comments.commentable',\n 'club'\n ]);\n\n return PostResource::collection($posts);\n }\n\n /**\n * Send all polls\n *\n * @param array $data The filtered data\n * @return AnonymousResourceCollection The poll collection\n */\n public function getPolls(array $data): AnonymousResourceCollection\n {\n $this-&gt;setPaginationAndOrderBy($data);\n\n $pollableId = $data['pollable_id'] ?? null;\n $pollableType = $data['pollable_type'] ?? null;\n\n $username = $data['username'] ?? null;\n\n // Fetch user ID from username\n $userId = null;\n if ($username) {\n $userId = $this-&gt;user-&gt;where('username', $username)-&gt;value('id');\n }\n\n // Original Polls with Creator's Name\n $originalPolls = $this-&gt;poll\n -&gt;select(\n 'polls.*',\n DB::raw('polls.created_at as combined_created_at'),\n DB::raw(&quot;\n CASE \n WHEN polls.pollable_type LIKE '%User' THEN users.username\n WHEN polls.pollable_type LIKE '%Admin' THEN admins.name\n WHEN polls.pollable_type LIKE '%Club' THEN clubs.name\n ELSE NULL\n END as show_user\n &quot;),\n DB::raw(&quot;\n CASE \n WHEN polls.pollable_type LIKE '%User' THEN CAST(\n JSON_OBJECT(\n 'id', users.id,\n 'profile_image', users.profile_image,\n 'username', users.username,\n 'email', users.email,\n 'first_name', users.first_name,\n 'last_name', users.last_name,\n 'gender',\n CASE \n WHEN users.gender = 0 THEN 'Male'\n WHEN users.gender = 1 THEN 'Female'\n WHEN users.gender = 2 THEN 'Others'\n ELSE NULL\n END\n ) AS JSON\n )\n WHEN polls.pollable_type LIKE '%Admin' THEN CAST(\n JSON_OBJECT(\n 'id', admins.id,\n 'name', admins.name,\n 'email', admins.email\n ) AS JSON\n )\n WHEN polls.pollable_type LIKE '%Club' THEN CAST(\n JSON_OBJECT(\n 'id', clubs.id,\n 'name', clubs.name,\n 'description', clubs.description\n ) AS JSON\n )\n ELSE NULL\n END as show_user_details\n &quot;),\n DB::raw(&quot;FALSE as is_shared&quot;) // Adding is_shared flag\n )\n -&gt;leftJoin('users', function ($join) {\n $join-&gt;on('polls.pollable_id', '=', 'users.id')\n -&gt;where('polls.pollable_type', 'App\\\\Models\\\\User');\n })\n -&gt;leftJoin('admins', function ($join) {\n $join-&gt;on('polls.pollable_id', '=', 'admins.id')\n -&gt;where('polls.pollable_type', 'App\\\\Models\\\\Admin');\n })\n -&gt;leftJoin('clubs', function ($join) {\n $join-&gt;on('polls.pollable_id', '=', 'clubs.id')\n -&gt;where('polls.pollable_type', 'App\\\\Models\\\\Club');\n });\n\n // Apply filters for `postable_id` and `postable_type`\n if ($pollableId &amp;&amp; $pollableType) {\n $originalPolls-&gt;where('polls.pollable_id', $pollableId)\n -&gt;where('polls.pollable_type', $pollableType);\n }\n\n // Apply filter for user polls if username exists\n if ($userId) {\n $originalPolls-&gt;where('polls.pollable_id', $userId)\n -&gt;where('polls.pollable_type', 'App\\\\Models\\\\User');\n }\n\n // Shared Polls with Sharer's Username\n $sharedPolls = $this-&gt;poll\n -&gt;select(\n 'polls.*',\n DB::raw('poll_shares.created_at as combined_created_at'),\n 'shared_users.username as show_user',\n DB::raw(&quot;\n CAST(\n JSON_OBJECT(\n 'id', shared_users.id,\n 'profile_image', shared_users.profile_image,\n 'username', shared_users.username,\n 'email', shared_users.email,\n 'first_name', shared_users.first_name,\n 'last_name', shared_users.last_name,\n 'gender',\n CASE \n WHEN shared_users.gender = 0 THEN 'Male'\n WHEN shared_users.gender = 1 THEN 'Female'\n WHEN shared_users.gender = 2 THEN 'Others'\n ELSE NULL\n END\n ) AS JSON\n ) as show_user_details\n &quot;),\n DB::raw(&quot;TRUE as is_shared&quot;) // Adding is_shared flag\n )\n -&gt;join('poll_shares', 'polls.id', '=', 'poll_shares.poll_id')\n -&gt;join('users as shared_users', 'poll_shares.user_id', '=', 'shared_users.id');\n\n // Apply filter for shared polls if username exists\n if ($userId) {\n $sharedPolls-&gt;where('poll_shares.user_id', $userId);\n }\n\n // Combine Original Polls + Shared Polls using UNION\n $polls = $originalPolls\n -&gt;unionAll($sharedPolls)\n -&gt;orderByDesc('combined_created_at')\n //-&gt;paginate($this-&gt;limit, ['*'], 'page', $this-&gt;page);\n -&gt;get();\n\n // $startIndex = ($data['page'] - 1) * $data['limit']; // Start index based on pagination\n\n // // Handles JSON decoding\n // $polls-&gt;transform(function ($poll) use ($startIndex, $data) {\n // $poll-&gt;show_user_details = json_decode($poll-&gt;show_user_details, true);\n // $poll-&gt;is_shared = (bool) $poll-&gt;is_shared; // Ensure boolean type\n\n // // Generate unique ID using post ID, index, page, and limit\n // $uniqueKey = &quot;{$poll-&gt;type}-{$poll-&gt;id}-{$startIndex}-{$data['page']}-{$data['limit']}&quot;;\n\n // // Generate unique ID using hash\n // $poll-&gt;unique_id = hash('sha256', $uniqueKey);\n\n // $startIndex++; // Increment the index for next post\n\n // return $poll;\n // });\n\n // Load default relations\n $polls-&gt;load([\n 'pollOptions',\n 'pollable',\n 'comments.commentable',\n 'club',\n ]);\n\n return PollResource::collection($polls);\n }\n</code></pre>\n<p>Here we've an API /feeds?page=1&amp;limit=10 and API response will be sent from the getFeeds function and we're merging the post and poll data and after merging we apply the pagination.\n<strong>In response of the API show_user_details not decoded properly.Instead of is_shared 0 or 1 in response false or true should come. And unique_id is not present in the response</strong></p>\n"^^ . + . + . + "<p>I tried to set up a php debug-session using <em><strong>CodeLite</strong></em> and <em><strong>XDebug</strong></em> following the instructions at:\n<a href="https://docs.codelite.org/debuggers/xdebug/" rel="nofollow noreferrer">https://docs.codelite.org/debuggers/xdebug/</a>\nBut when I try to connect, the output stucks and CodeLite debugging is not startet.</p>\n<p>In the console window, I change to the directory where my &quot;test.php&quot; resides.\nWhen I start the php-web-server by typing the command:</p>\n<pre><code>php -S 127.0.0.1:9000 -t .\n</code></pre>\n<p>I got the response:</p>\n<pre><code>Cannot load Xdebug - it was already loaded\nPHP 7.3.31-1~deb10u7 Development Server started at Tue Feb 11 14:54:42 2025\nListening on http://127.0.0.1:9000\nDocument root is /home/daniel/Dokumente/Code/homepage/test\nPress Ctrl-C to quit.\n</code></pre>\n<p>When I press the &quot;Wait for debugger to connect&quot;-button in CodeLite, I get a message:</p>\n<pre><code>&quot;This project has no file mapping defined. \nThis may result in breakpoints not applied. \nTo fix this, set file mapping from Project-Settings -&gt; Debug.&quot;\n</code></pre>\n<p><a href="https://i.sstatic.net/VYaOfFth.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/VYaOfFth.png" alt="CodeLite file-mapping warning" /></a></p>\n<p>Without CodeLite opened, the browser is able to open the script &quot;test.php&quot;</p>\n<p>When I try to enter the debug session, having the CodeLite warning closed by &quot;OK, Continue to Debug&quot;-button, it seems to stuck in line one, because the browser is pending and the console response is:</p>\n<pre><code>[Tue Feb 11 15:11:16 2025] PHP Warning: Header may not contain NUL bytes in /home/daniel/Dokumente/Code/homepage/test/test.php on line 1\n</code></pre>\n<p>Ctrl + C does no more end the php-server</p>\n<p>The configuration of my php.ini is:</p>\n<pre><code>[XDebug]\nxdebug.remote_enable=1\nzend_extension = /usr/lib/php/20180731/xdebug.so\nxdebug.idekey=&quot;codeliteide&quot;\nxdebug.remote_host=127.0.0.1\nxdebug.remote_port=9000\nxdebug.remote_log = xdebug.log\n</code></pre>\n<p>The xdebug.log:</p>\n<pre><code>[2940] Log opened at 2025-02-11 14:11:16\n[2940] I: Connecting to configured address/port: 127.0.0.1:9000.\n[2940] I: Connected to client. :-)\n[2940] -&gt; &lt;init xmlns=&quot;urn:debugger_protocol_v1&quot; xmlns:xdebug=&quot;https://xdebug.org/dbgp/xdebug&quot; fileuri=&quot;file:///home/daniel/Dokumente/Code/homepage/test/test.php&quot; language=&quot;PHP&quot; xdebug:language_version=&quot;7.3.2-3&quot; protocol_version=&quot;1.0&quot; appid=&quot;2940&quot; idekey=&quot;codeliteide&quot;&gt;&lt;engine version=&quot;2.7.0RC2&quot;&gt;&lt;![CDATA[Xdebug]]&gt;&lt;/engine&gt;&lt;author&gt;&lt;![CDATA[Derick Rethans]]&gt;&lt;/author&gt;&lt;url&gt;&lt;![CDATA[https://xdebug.org]]&gt;&lt;/url&gt;&lt;copyright&gt;&lt;![CDATA[Copyright (c) 2002-2019 by Derick Rethans]]&gt;&lt;/copyright&gt;&lt;/init&gt;\n[2940]\n</code></pre>\n"^^ . + "<p>There are multiple mistakes in your last function, mainly:</p>\n<p>1️⃣ You need to check that you are on checkout page, and that the <code>WC_Cart</code> object is defined.</p>\n<p>2️⃣ Note that <code>WC_Cart</code> <code>get_cart_subtotal()</code> method output the HTML formatted amout. To get the cart subtotal non formatted amount use one of the following:</p>\n<ul>\n<li><code>WC()-&gt;cart-&gt;get_subtotal()</code> <em>(subtotal excluding taxes)</em>,</li>\n<li><code>WC()-&gt;cart-&gt;subtotal</code> <em>(subtotal including taxes)</em>.</li>\n</ul>\n<p>Try the following revised code instead, to avoid the error:</p>\n<pre class="lang-php prettyprint-override"><code>function payment_gateway_disable_on_account( $available_gateways ) {\n // Check that it's on checkout page and that the WC_Cart object is not null\n if ( is_checkout() &amp;&amp; isset(WC()-&gt;cart) &amp;&amp; WC()-&gt;cart ) {\n\n $credit_limit = get_user_meta( get_current_user_id(), 'credit_limit', true );\n\n $amount = floatval( preg_replace( '#[^\\d.]#', '', WC()-&gt;cart-&gt;subtotal ) );\n\n if ( empty( $credit_limit ) ) {\n $credit_limit = 500;\n }\n \n $credit_remaining = $credit_limit - $amount;\n \n if ( isset($available_gateways['cod']) &amp;&amp; ( !wc_current_user_has_role('credit_account') || $credit_remaining &lt; 0 ) ) {\n unset($available_gateways['cod']);\n }\n }\n return $available_gateways;\n}\n\nadd_filter( 'woocommerce_available_payment_gateways', 'payment_gateway_disable_on_account' );\n</code></pre>\n<p>It should work, without throwing an error.</p>\n"^^ . + . + "0"^^ . + "3"^^ . + . + "Hi @Seth Bembeneck, never thought to put anything outside of `public_html` folder, but worth to try"^^ . + . + . + . + "That... doesn't help. I mean the actual message. Going through the stack trace, it's trying to format the error message. It's going through `replaceAttributePlaceholder`, which is replacing `:attribute` with the key of the message."^^ . + "-1"^^ . + . + "2"^^ . + . + "Just to clarify, you are not using a native PHP enum, you should make that clear on the title (maybe add `Botble enum` to the title). Then, you need to add more info, for example, what is the issue with your implementation, how is it not working?"^^ . + . + . + "woocommerce-bookings"^^ . + "0"^^ . + . + "Thank you Sir, here's an error when running it from my ms sql server 2019: Msg 10757, Level 15, State 1, Line 3\nThe function 'STRING_AGG' may not have a WITHIN GROUP clause.\nMsg 102, Level 15, State 1, Line 7\nIncorrect syntax near 't'."^^ . + . + "Updated the code. Thanks"^^ . + . + . + . + . + . + "A 500 could also be due to bad server config. Check if you can execute this code on CLI without any issues. Also put a breakpoint on the first line and see if the debugger starts at all."^^ . + . + . + "httpd.conf"^^ . + "3"^^ . + . + . + . + "1"^^ . + . + "Related: https://stackoverflow.com/q/5809451/457268"^^ . + "Thank you! I benchmarked your code and it's 3x slower in my notebook (however it produces the results I am expecting while my code is not working fully as expected). But I really woud like to know why my regex is not working..."^^ . + . + "0"^^ . + "attributes"^^ . + . + "It shows "memory cache" for these stylesheets, does anything about the behavior change when you check the "disable cache" checkbox, and reload the page with dev tools still opened?"^^ . + "<p>I am running phpUnit tests using Laravel Framework Version 9.52.20. The tests work just fine in my local environment and in my CI/CD pipeline. But when I try to run the same tests in my dev environment it throws this error repeatedly:</p>\n<pre><code>Call to undefined function Illuminate\\Foundation\\laravel_cloud()\n\n at vendor/laravel/framework/src/Illuminate/Foundation/Application.php:237\n 233▕ * @return void\n 234▕ */\n 235▕ protected function registerLaravelCloudServices()\n 236▕ {\n ➜ 237▕ if (! laravel_cloud()) {\n 238▕ return;\n 239▕ }\n 240▕ \n 241▕ $this['events']-&gt;listen(\n</code></pre>\n<p>I can see this function being defined in <code>vendor/laravel/framework/src/Illuminate/Support/helpers.php</code></p>\n<pre><code>if (! function_exists('laravel_cloud')) {\n /**\n * Determine if the application is running on Laravel Cloud.\n *\n * @return bool\n */\n function laravel_cloud()\n {\n return ($_ENV['LARAVEL_CLOUD'] ?? false) === '1' ||\n ($_SERVER['LARAVEL_CLOUD'] ?? false) === '1';\n }\n}\n</code></pre>\n<p>The oddity is that my phpUnit tests run just fine in my local environment and in my CI/CD pipeline. It is only in my separate dev environment that I experience this issue.</p>\n<h2>Additional Information</h2>\n<p>My Tests namespace uses a trait named CreatesApplication() to set up my test environment. Should I manually reference the <code>Illuminate/Support/helpers</code> class in my TestCase class in order to make this function available to the phpUnit tests? I had assumed that the Laravel framework would have automatically included such a dependency. But that doesn't explain why this particular environment has the problem while other identical environments do not.</p>\n<p>Let me know if you have run into this situation also, and how you were able to fix this reference error.</p>\n<h2>Addendum</h2>\n<p>I went into artisan tinker and queried the runtime environment to see if the <code>laravel_cloud</code> function was defined. It said it was:</p>\n<pre><code>~$ php artisan tinker\nPsy Shell v0.12.7 (PHP 8.3.19 — cli) by Justin Hileman\n&gt; function_exists('my_fake_function');\n= false\n\n&gt; function_exists('laravel_cloud');\n= true\n</code></pre>\n<p>It looks like the <code>laravel_cloud</code> function is defined and available to the Laravel engine in general. However, something about my environment is causing the phpUnit runtime to not find that function within the list of global environment functions.</p>\n"^^ . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + "<p>The problem is your middleware is called before authorisation:</p>\n<pre class="lang-php prettyprint-override"><code> Route::get('/log'...)-&gt;middleware('view-logs');\n</code></pre>\n<p>will not work, while this will</p>\n<pre class="lang-php prettyprint-override"><code>Route::group(['middleware' =&gt; [auth:api]], function(){\n Route::get('/log'...)-&gt;middleware('view-logs');\n\n})\n</code></pre>\n<h3>Why it works?</h3>\n<p>With <code>auth:api</code> or even <code>auth</code> middleware the logged in user appears, while without this middleware you don't have logged in user and checking for <code>Auth::check()</code> will always be false. That is expected behaviour.</p>\n<h3>Can it be done even better?</h3>\n<p>Yes, if you are using <code>spatie/laravel-permissions</code>, and <code>-&gt;hasRole()</code> make me think you are. Then you can get rid of self written middleware and use this.</p>\n<pre><code>Route::get('/log...', [...Controller::class, 'index'])-&gt;middleware('role:admin');\n</code></pre>\n"^^ . + . + . + "0"^^ . + . + . + "paddle"^^ . + . + . + . + . + "Your error is pretty clear; `$lastNumber` or `$lastColumn` are null, and `null->id` is not valid PHP. You need to handle this. Sidenote, when you call `Number::all()`, you load _every record from your database table into a Collection_, only to query and sort that Collection and get the first record that matches... That's wildly inefficient... Just do `Number::latest()->first()` and `Number::where('column', $column)->latest()->first()`; that'll use your database to query and sort (`latest()` is a shortcut for `orderBy('created_at', 'DESC')`) and is _way_ more efficient that your current code."^^ . + "0"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "1"^^ . + "<p>I inserted the next function to wordpress theme's functions.php. It is a sample function to enable partial.ly widget to only products tagged 'partially-widget'. I really dont know why this function is ignored completely and all products have partial.ly widget enable. From partial.ly website:</p>\n<blockquote>\n<p>Perhaps you only want the Partial.ly widget to only display on product\npages tagged with the tag partially-widget. Adding the following code\nwould cause the widget to only display on product pages with that tag.</p>\n</blockquote>\n<p>Thanks</p>\n<pre><code>function custom_partially_widget_settings($settings) {\n $settings['render'] = false;\n $tags = get_the_terms( get_the_ID(), 'partially-widget' );\n if ($tags) {\n foreach ($tags as $tag) {\n if ($tag-&gt;name == 'partially-widget') $settings['render'] = true;\n }\n }\n return $settings;\n}\nadd_filter('partially_widget_config', 'custom_partially_widget_settings');\n</code></pre>\n"^^ . + . + "0"^^ . + "1"^^ . + . + "3"^^ . + . + . + . + . + "Can you also post your annotations.yaml or attributes.yaml file as well as the Controller method that app_login is pointed to?"^^ . + "1"^^ . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + "Have you enabled the Rest API in WordPress? If yes try these [solutions](https://stackoverflow.com/questions/34670533/wordpress-rest-api-wp-api-404-error-cannot-access-the-wordpress-rest-api#answer-34743649). If the Rest API isn't working for you, then the query to retrieve **Course ID** from **Lesson ID** will surely help you."^^ . + . + "This is not a builtin directive. What extension are you trying to configure? Settings editor indicates what extension each directive belongs to, but I presume it's mentioned wherever you read about the setting."^^ . + . + "0"^^ . + "hydephp"^^ . + . + . + "0"^^ . + . + . + . + "1"^^ . + "<p>I'm trying to build a website, I keep getting this errors. Has anyone encountered this type of challange before,</p>\n<blockquote>\n<p>During inheritance of ArrayAccess: Uncaught ErrorException: Return\ntype of Illuminate\\Support\\Collection::offsetExists($key) should\neither be compatible with ArrayAccess::offsetExists(mixed $offset):\nbool, or the #[\\ReturnTypeWillChange] attribute should be used to\ntemporarily suppress the notice in\n/home/zaiiinve/domains/zaiiinvetsment.com/public_html/core_invapp/vendor/laravel/framework/src/Illuminate/Collections/Collection.php:1443\nStack trace:\n#0 /home/zaiiinve/domains/zaiiinvetsment.com/public_html/core_invapp/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(13):\nIlluminate\\Foundation\\Bootstrap\\HandleExceptions-&gt;handleError()\n#1 /home/zaiiinve/domains/zaiiinvetsment.com/public_html/core_invapp/vendor/composer/ClassLoader.php(480):\ninclude('/home/zaiiinve/...')\n#2 /home/zaiiinve/domains/zaiiinvetsment.com/public_html/core_invapp/vendor/composer/ClassLoader.php(346):\nComposer\\Autoload\\includeFile()\n#3 /home/zaiiinve/domains/zaiiinvetsment.com/public_html/core_invapp/vendor/laravel/framework/src/Illuminate/Collections/helpers.php(15):\nComposer\\Autoload\\ClassLoader-&gt;loadClass()\n#4 /home/zaiiinve/domains/zaiiinvetsment.com/public_html/core_invapp/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(89):\ncollect()\n#5 /home/zaiiinve/domains/zaiiinvetsment.com/public_html/core_invapp/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(78):\nIlluminate\\Foundation\\PackageManifest-&gt;config()\n#6 /home/zaiiinve/domains/zaiiinvetsment.com/public_html/core_invapp/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php(26):\nIlluminate\\Foundation\\PackageManifest-&gt;aliases()\n#7 /home/zaiiinve/domains/zaiiinvetsment.com/public_html/core_invapp/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(237):\nIlluminate\\Foundation\\Bootstrap\\RegisterFacades-&gt;bootstrap()\n#8 /home/zaiiinve/domains/zaiiinvetsment.com/public_html/core_invapp/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(152):\nIlluminate\\Foundation\\Application-&gt;bootstrapWith()\n#9 /home/zaiiinve/domains/zaiiinvetsment.com/public_html/core_invapp/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(136):\nIlluminate\\Foundation\\Http\\Kernel-&gt;bootstrap()\n#10 /home/zaiiinve/domains/zaiiinvetsment.com/public_html/core_invapp/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110):\nIlluminate\\Foundation\\Http\\Kernel-&gt;sendRequestThroughRouter()\n#11 /home/zaiiinve/domains/zaiiinvetsment.com/public_html/index.php(80):\nIlluminate\\Foundation\\Http\\Kernel-&gt;handle()\n#12 {main}</p>\n</blockquote>\n<p>I tried locating the lines but I haven't seen any corrections</p>\n"^^ . + . + . + . + . + "If i print the **$allowed_protocols** i get `array:4 [\n "data://" => ["rules" => []],\n "file://" => ["rules" => [\n [Dompdf\\Options {#1981}, "validateLocalUri"]\n ]],\n "http://" => ["rules" => [\n [Dompdf\\Options {#1981}, "validateRemoteUri"]\n ]],\n "https://" => ["rules" => [\n [Dompdf\\Options {#1981}, "validateRemoteUri"]\n ]]\n]`"^^ . + "1"^^ . + "toastr"^^ . + . + . + . + "1"^^ . + . + "dockerfile"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + "@AlexHowansky Thank you, I had already tried different versions, but does not make much a difference. I have been tinkering with a custom .conf, to the point that it does not stall, but makes a significant difference in connections around the 15k mark, then it slows down, and then after a while, it speeds up, speeds down, and like that. It appears to me that something is getting used up, takes a while to get released, and keeps cycling."^^ . + . + "<p>I am trying to setup a rpi which can handle both nextcloud and pihole using nginx but it seems i can't get it to work,</p>\n<pre><code>pi@raspberry:~ $ sudo cat /etc/nginx/sites-available/nextcloud \nupstream php-handler {\n # server 127.0.0.1:9000;\n server unix:/run/php/php8.2-fpm.sock;\n}\n\n# Set the `immutable` cache control options only for assets with a cache busting `v` argument\nmap $arg_v $asset_immutable {\n &quot;&quot; &quot;&quot;;\n default &quot;, immutable&quot;;\n}\n\nserver {\n listen 80;\n listen [::]:80;\n server_name ***.ts.net;\n\n\n # Prevent nginx HTTP Server Detection\n server_tokens off;\n location /admin {\n proxy_pass http://127.0.0.1:80;\n proxy_set_header Host $host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n }\n # Enforce HTTPS just for `/nextcloud`\n location /nextcloud {\n return 301 https://$server_name$request_uri;\n }\n}\n\nserver {\n listen 443 ssl http2;\n listen [::]:443 ssl http2;\n # With NGinx &gt;= 1.25.1 you should use this instead:\n # listen 443 ssl;\n # listen [::]:443 ssl;\n # http2 on;\n server_name ***.ts.net;\n\n # Path to the root of the domain\n root /var/www;\n\n ssl_certificate /etc/ssl/certs/nextcloud-selfsigned.crt;\n ssl_certificate_key /etc/ssl/private/nextcloud-selfsigned.key;\n\n\n # Prevent nginx HTTP Server Detection\n server_tokens off;\n\n # Set .mjs and .wasm MIME types\n # Either include it in the default mime.types list\n # and include that list explicitly or add the file extension\n # only for Nextcloud like below:\n include mime.types;\n types {\n text/javascript mjs;\n \n }\n\n location = /robots.txt {\n allow all;\n log_not_found off;\n access_log off;\n }\n\n location ^~ /.well-known {\n # The rules in this block are an adaptation of the rules\n # in the Nextcloud `.htaccess` that concern `/.well-known`.\n\n location = /.well-known/carddav { return 301 /nextcloud/remote.php/dav/; }\n location = /.well-known/caldav { return 301 /nextcloud/remote.php/dav/; }\n\n location /.well-known/acme-challenge { try_files $uri $uri/ =404; }\n location /.well-known/pki-validation { try_files $uri $uri/ =404; }\n\n # Let Nextcloud's API for `/.well-known` URIs handle all other\n # requests by passing them to the front-end controller.\n return 301 /nextcloud/index.php$request_uri;\n }\n location /admin {\n proxy_pass http://127.0.0.1:80;\n proxy_buffer_size 16k;\n proxy_buffers 4 32k;\n proxy_busy_buffers_size 64k;\n proxy_set_header Host $host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n }\n location ^~ /nextcloud {\n # set max upload size and increase upload timeout:\n client_max_body_size 512M;\n client_body_timeout 300s;\n fastcgi_buffers 64 4K;\n\n # Enable gzip but do not remove ETag headers\n gzip on;\n gzip_vary on;\n gzip_comp_level 4;\n gzip_min_length 256;\n gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;\n gzip_types application/atom+xml text/javascript application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;\n\n # Pagespeed is not supported by Nextcloud, so if your server is built\n # with the `ngx_pagespeed` module, uncomment this line to disable it.\n #pagespeed off;\n\n # The settings allows you to optimize the HTTP2 bandwidth.\n # See https://blog.cloudflare.com/delivering-http-2-upload-speed-improvements/\n # for tuning hints\n client_body_buffer_size 512k;\n\n # HSTS settings\n # WARNING: Only add the preload option once you read about\n # the consequences in https://hstspreload.org/. This option\n # will add the domain to a hardcoded list that is shipped\n # in all major browsers and getting removed from this list\n # could take several months.\n #add_header Strict-Transport-Security &quot;max-age=15768000; includeSubDomains; preload;&quot; always;\n\n # HTTP response headers borrowed from Nextcloud `.htaccess`\n add_header Referrer-Policy &quot;no-referrer&quot; always;\n add_header X-Content-Type-Options &quot;nosniff&quot; always;\n add_header X-Frame-Options &quot;SAMEORIGIN&quot; always;\n add_header X-Permitted-Cross-Domain-Policies &quot;none&quot; always;\n add_header X-Robots-Tag &quot;noindex, nofollow&quot; always;\n add_header X-XSS-Protection &quot;1; mode=block&quot; always;\n\n # Remove X-Powered-By, which is an information leak\n fastcgi_hide_header X-Powered-By;\n\n # Specify how to handle directories -- specifying `/nextcloud/index.php$request_uri`\n # here as the fallback means that Nginx always exhibits the desired behaviour\n # when a client requests a path that corresponds to a directory that exists\n # on the server. In particular, if that directory contains an index.php file,\n # that file is correctly served; if it doesn't, then the request is passed to\n # the front-end controller. This consistent behaviour means that we don't need\n # to specify custom rules for certain paths (e.g. images and other assets,\n # `/updater`, `/ocs-provider`), and thus\n # `try_files $uri $uri/ /nextcloud/index.php$request_uri`\n # always provides the desired behaviour.\n index index.php index.html /nextcloud/index.php$request_uri;\n\n # Rule borrowed from `.htaccess` to handle Microsoft DAV clients\n location = /nextcloud {\n if ( $http_user_agent ~ ^DavClnt ) {\n return 302 /nextcloud/remote.php/webdav/$is_args$args;\n }\n }\n\n # Rules borrowed from `.htaccess` to hide certain paths from clients\n location ~ ^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; }\n location ~ ^/nextcloud/(?:\\.|autotest|occ|issue|indie|db_|console) { return 404; }\n\n # Ensure this block, which passes PHP files to the PHP process, is above the blocks\n # which handle static assets (as seen below). If this block is not declared first,\n # then Nginx will encounter an infinite rewriting loop when it prepends\n # `/nextcloud/index.php` to the URI, resulting in a HTTP 500 error response.\n location ~ \\.php(?:$|/) {\n # Required for legacy support\n rewrite ^/nextcloud/(?!index|remote|public|cron|core\\/ajax\\/update|status|ocs\\/v[12]|updater\\/.+|ocs-provider\\/.+|.+\\/richdocumentscode(_arm64)?\\/proxy) /nextcloud/index.php$request_uri;\n\n fastcgi_split_path_info ^(.+?\\.php)(/.*)$;\n set $path_info $fastcgi_path_info;\n\n try_files $fastcgi_script_name =404;\n\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n fastcgi_param PATH_INFO $path_info;\n fastcgi_param HTTPS on;\n\n fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice\n fastcgi_param front_controller_active true; # Enable pretty urls\n fastcgi_pass php-handler;\n\n fastcgi_intercept_errors on;\n fastcgi_request_buffering off;\n\n fastcgi_max_temp_file_size 0;\n }\n\n # Serve static files\n location ~ \\.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ {\n try_files $uri /nextcloud/index.php$request_uri;\n # HTTP response headers borrowed from Nextcloud `.htaccess`\n add_header Cache-Control &quot;public, max-age=15778463$asset_immutable&quot;;\n add_header Referrer-Policy &quot;no-referrer&quot; always;\n add_header X-Content-Type-Options &quot;nosniff&quot; always;\n add_header X-Frame-Options &quot;SAMEORIGIN&quot; always;\n add_header X-Permitted-Cross-Domain-Policies &quot;none&quot; always;\n add_header X-Robots-Tag &quot;noindex, nofollow&quot; always;\n add_header X-XSS-Protection &quot;1; mode=block&quot; always;\n access_log off; # Optional: Don't log access to assets\n }\n\n location ~ \\.(otf|woff2?)$ {\n try_files $uri /nextcloud/index.php$request_uri;\n expires 7d; # Cache-Control policy borrowed from `.htaccess`\n access_log off; # Optional: Don't log access to assets\n }\n\n # Rule borrowed from `.htaccess`\n location /nextcloud/remote {\n return 301 /nextcloud/remote.php$request_uri;\n }\n\n location /nextcloud {\n try_files $uri $uri/ /nextcloud/index.php$request_uri;\n }\n }\n}\n</code></pre>\n<p>here is config.php</p>\n<pre><code>&lt;?php\n$CONFIG = array (\n 'instanceid' =&gt; 'oc5c39ph4rqe',\n 'passwordsalt' =&gt; 'VZq4yLJIdkBvcbNFl7yNEtdUm/kny6',\n 'secret' =&gt; 'yZzcUH/EDrYUOUfkbCmRUufKsVacn9xsml3VqatiEDwux0TA',\n 'trusted_domains' =&gt; \n array (\n 0 =&gt; '100.73.164.18',\n 1 =&gt; 'raspberry.tail68744e.ts.net',\n 2 =&gt; '192.168.2.17',\n 3 =&gt; '127.0.0.1',\n ),\n 'overwriteprotocol' =&gt; 'https',\n 'overwritewebroot' =&gt; '/nextcloud',\n 'overwritehost' =&gt; 'raspberry.tail68744e.ts.net',\n 'overwrite.cli.url' =&gt; 'https://raspberry.tail68744e.ts.net/nextcloud',\n 'trusted_proxies' =&gt; \n array (\n 0 =&gt; '100.73.0.0/10',\n ),\n 'remote_ip_header' =&gt; 'HTTP_X_REAL_IP',\n 'datadirectory' =&gt; '/var/www/nextcloud/data',\n 'dbtype' =&gt; 'mysql',\n 'version' =&gt; '30.0.6.2',\n 'overwritecondaddr' =&gt; '',\n 'dbname' =&gt; 'nextcloud',\n 'dbhost' =&gt; 'localhost',\n 'dbport' =&gt; '',\n 'dbtableprefix' =&gt; 'oc_',\n 'mysql.utf8mb4' =&gt; true,\n 'dbuser' =&gt; 'nextcloud',\n 'dbpassword' =&gt; 'raspberry',\n 'installed' =&gt; true,\n 'maintenance' =&gt; false,\n 'force_https' =&gt; true,\n 'check_for_working_webdav' =&gt; false,\n 'check_for_working_htaccess' =&gt; false,\n 'forwarded_for_headers' =&gt; \n array (\n 0 =&gt; 'HTTP_X_FORWARDED_FOR',\n 1 =&gt; 'HTTP_X_REAL_IP',\n ),\n 'bruteforce.protection.enabled' =&gt; false,\n 'maintenance_window_start' =&gt; '03:00',\n 'memcache.local' =&gt; '\\\\OC\\\\Memcache\\\\Redis',\n 'memcache.locking' =&gt; '\\\\OC\\\\Memcache\\\\Redis',\n 'redis' =&gt; \n array (\n 'host' =&gt; 'localhost',\n 'port' =&gt; 6379,\n 'timeout' =&gt; 0.0,\n ),\n 'memories.db.triggers.fcu' =&gt; true,\n 'memories.exiftool' =&gt; '/var/www/nextcloud/apps/memories/bin-ext/exiftool-aarch64-glibc',\n 'memories.vod.path' =&gt; '/var/www/nextcloud/apps/memories/bin-ext/go-vod-aarch64',\n 'memories.exiftool_no_local' =&gt; true,\n 'enabledPreviewProviders' =&gt; \n array (\n 0 =&gt; 'OC\\\\Preview\\\\Image',\n 1 =&gt; 'OC\\\\Preview\\\\HEIC',\n 2 =&gt; 'OC\\\\Preview\\\\TIFF',\n 3 =&gt; 'OC\\\\Preview\\\\Movie',\n ),\n 'memories.ffmpeg_path' =&gt; '/usr/bin/ffmpeg',\n 'memories.ffprobe_path' =&gt; '/usr/bin/ffprobe',\n 'memories.vod.disable' =&gt; false,\n 'memories.vod.ffmpeg' =&gt; '/usr/bin/ffmpeg',\n 'memories.vod.ffprobe' =&gt; '/usr/bin/ffprobe',\n 'memories.gis_type' =&gt; 1,\n 'system' =&gt; \n array (\n 'filelocking.enabled' =&gt; true,\n 'maxBigFileUpload' =&gt; 10737418240,\n ),\n);\n</code></pre>\n<p>my problem is i can't get them to work, it is either working nextcloud and borken pihole or working pihole and broken nextcloud, or both just does not work, is this even possible? my stack is nginx and mariadb for nextcloud</p>\n<pre><code>pi@raspberry:~ $ sudo tail -f /var/log/nginx/error.log\n2025/03/29 15:56:05 [error] 969#969: *2 open() &quot;/usr/share/nginx/html/api/dns/blocking&quot; failed (2: No such file or directory), client: 192.168.2.14, server: raspberry.tail68744e.ts.net, request: &quot;GET /api/dns/blocking HTTP/1.1&quot;, host: &quot;192.168.2.17&quot;, referrer: &quot;http://192.168.2.17/admin/groups/lists&quot;\n2025/03/29 15:56:35 [error] 969#969: *2 open() &quot;/usr/share/nginx/html/api/dns/blocking&quot; failed (2: No such file or directory), client: 192.168.2.14, server: raspberry.tail68744e.ts.net, request: &quot;GET /api/dns/blocking HTTP/1.1&quot;, host: &quot;192.168.2.17&quot;, referrer: &quot;http://192.168.2.17/admin/groups/lists&quot;\n2025/03/29 15:56:51 [error] 969#969: *2 open() &quot;/usr/share/nginx/html/api/info/messages/count&quot; failed (2: No such file or directory), client: 192.168.2.14, server: raspberry.tail68744e.ts.net, request: &quot;GET /api/info/messages/count HTTP/1.1&quot;, host: &quot;192.168.2.17&quot;, referrer: &quot;http://192.168.2.17/admin/groups/lists&quot;\n2025/03/29 15:57:05 [error] 969#969: *2 open() &quot;/usr/share/nginx/html/api/dns/blocking&quot; failed (2: No such file or directory), client: 192.168.2.14, server: raspberry.tail68744e.ts.net, request: &quot;GET /api/dns/blocking HTTP/1.1&quot;, host: &quot;192.168.2.17&quot;, referrer: &quot;http://192.168.2.17/admin/groups/lists&quot;\n2025/03/29 15:57:35 [error] 969#969: *2 open() &quot;/usr/share/nginx/html/api/dns/blocking&quot; failed (2: No such file or directory), client: 192.168.2.14, server: raspberry.tail68744e.ts.net, request: &quot;GET /api/dns/blocking HTTP/1.1&quot;, host: &quot;192.168.2.17&quot;, referrer: &quot;http://192.168.2.17/admin/groups/lists&quot;\n2025/03/29 15:57:51 [error] 969#969: *2 open() &quot;/usr/share/nginx/html/api/info/messages/count&quot; failed (2: No such file or directory), client: 192.168.2.14, server: raspberry.tail68744e.ts.net, request: &quot;GET /api/info/messages/count HTTP/1.1&quot;, host: &quot;192.168.2.17&quot;, referrer: &quot;http://192.168.2.17/admin/groups/lists&quot;\n2025/03/29 15:58:05 [error] 969#969: *2 open() &quot;/usr/share/nginx/html/api/dns/blocking&quot; failed (2: No such file or directory), client: 192.168.2.14, server: raspberry.tail68744e.ts.net, request: &quot;GET /api/dns/blocking HTTP/1.1&quot;, host: &quot;192.168.2.17&quot;, referrer: &quot;http://192.168.2.17/admin/groups/lists&quot;\n2025/03/29 15:58:35 [error] 969#969: *2 open() &quot;/usr/share/nginx/html/api/dns/blocking&quot; failed (2: No such file or directory), client: 192.168.2.14, server: raspberry.tail68744e.ts.net, request: &quot;GET /api/dns/blocking HTTP/1.1&quot;, host: &quot;192.168.2.17&quot;, referrer: &quot;http://192.168.2.17/admin/groups/lists&quot;\n2025/03/29 15:58:51 [error] 969#969: *2 open() &quot;/usr/share/nginx/html/api/info/messages/count&quot; failed (2: No such file or directory), client: 192.168.2.14, server: raspberry.tail68744e.ts.net, request: &quot;GET /api/info/messages/count HTTP/1.1&quot;, host: &quot;192.168.2.17&quot;, referrer: &quot;http://192.168.2.17/admin/groups/lists&quot;\n2025/03/29 15:59:05 [error] 969#969: *2 open() &quot;/usr/share/nginx/html/api/dns/blocking&quot; failed (2: No such file or directory), client: 192.168.2.14, server: raspberry.tail68744e.ts.net, request: &quot;GET /api/dns/blocking HTTP/1.1&quot;, host: &quot;192.168.2.17&quot;, referrer: &quot;http://192.168.2.17/admin/groups/lists&quot;\n</code></pre>\n"^^ . + . + . + "If you'd need to name the fields: `<input id="a1" name="a[a1]">`"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + "namecheap"^^ . + . + "0"^^ . + "<p>In Woocommerce Rest API, I need to get the quantity of items from orders (Get) in float format and on the frontend (what the clients see) should remain in integer format.</p>\n<p>For ex:</p>\n<p>If the client orders 2 items:</p>\n<p>2 itemA</p>\n<p>3 itemB</p>\n<p>The Rest API should return:</p>\n<p>0.2 itemA</p>\n<p>0.3 itemB</p>\n<p>This is because the client buys a pack and the pack is 0.1 gramms. I need to get in gramms because I use an accounting software that I bought that I can't modify.</p>\n<p>I found this stackoverflow question, where the Rest API quantity datatype is changed from int to float, but I don't know where I need to modify: quantity*0.1.</p>\n<p><a href="https://stackoverflow.com/questions/52462350/woocommerce-api-create-order-with-float-quantity">Woocommerce API - Create Order With Float Quantity</a></p>\n<p>Question: Where do I need to change in Rest API, to change the quantity to quantity* 0.1?</p>\n<p>Thanks.</p>\n<p>Expecting: Rest API - Get orders with items with quantity * 0.1</p>\n"^^ . + "spout"^^ . + . + . + "1st, Can you add the code from `customprefix_get_allowed_products_per_user()` custom function and give an example of what you get for `$allowed` variable using `print_r($allowed);` in your question."^^ . + "1"^^ . + . + "0"^^ . + . + "1"^^ . + . + . + . + "0"^^ . + "1"^^ . + "This question is similar to: [How to pull the torrent file from DHT?](https://stackoverflow.com/questions/35895997/how-to-pull-the-torrent-file-from-dht). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem."^^ . + . + . + ""but there's nothing like that for php8" - why not? https://github.com/okta/okta-sdk-php is compatible with PHP 8, according to their composer.json"^^ . + "1"^^ . + . + . + "How do I pass form data to the next form page after sending to a php mailto page?"^^ . + "<p>I'm noticing a significant performance difference when running the same Imagick script on PHP 7.2 versus PHP 8.2. Here are the results I’ve gathered:</p>\n<ul>\n<li><p>PHP 7.2, ImageMagick 7.0.7, Imagick 3.44: 3.8 seconds</p>\n</li>\n<li><p>PHP 8.2, ImageMagick 7.1, Imagick 3.7: 13.32 seconds</p>\n</li>\n</ul>\n<p>Same spec machine, tested on windows and centos, both 64bit architecture imagick with similar results.</p>\n<p>I’m wondering if anyone has encountered similar issues or knows why this change between PHP versions might be affecting Imagick's performance so drastically? Or know any fixes for this? Below is the test script I’m using (it does this on other functions too not just distorts, this is just an example):</p>\n<pre><code>&lt;?php\n\n$startTime = microtime(true);\n\n// Get script directory\n$script_path = dirname(__FILE__) . &quot;/&quot;;\n\n$controlPoints = [\n 1.5,\n 0, 0, 355, 70,\n 0, 3708, 337, 974,\n 1380, 0, 657, 105,\n 1380, 3708, 654, 956,\n];\n\necho &quot;Doing Distortion 1\\n&quot;;\n\n$design = new Imagick($script_path . 'input.png');\n\n// Apply distortion\ntry {\n $design-&gt;distortImage(Imagick::DISTORTION_POLYNOMIAL, $controlPoints, true);\n} catch (Exception $e) {\n echo &quot;Error applying distortion: &quot; . $e-&gt;getMessage() . &quot;\\n&quot;;\n}\n\n// Write the distorted image to an output file\n$design-&gt;writeImage($script_path . &quot;testoutput.png&quot;);\n\n$endTime = microtime(true);\n$executionTime = ($endTime - $startTime);\n\necho &quot;Execution Time: &quot; . $executionTime . &quot; seconds\\n&quot;;\n</code></pre>\n"^^ . + . + "0"^^ . + . + . + . + . + . + . + "_"and posts it as an 'editor' user"_ - can you share some more details on that, please. What _exactly_ is done, and how?"^^ . + . + "0"^^ . + "0"^^ . + . + . + "@hakre default fallback means the page is load that time the default image is selected on the file uploader"^^ . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + "@siggemannen Is numeric(19,2) available in laravel migration Schema in Laravel"^^ . + . + "1"^^ . + . + "volt"^^ . + . + . + . + "-1"^^ . + . + "<p>I've got a similar scenario in an app. The requirement was to push custom events to the Facebook Pixel. Here are the things that I have implemented:</p>\n<p>I used this package</p>\n<pre><code>&quot;esign/laravel-conversions-api&quot;: &quot;^1.1&quot;\n</code></pre>\n<p>Here is the repo <a href="https://github.com/esign/laravel-conversions-api" rel="nofollow noreferrer">link</a></p>\n<p>You can do this for Meta pixel script code in the blade :</p>\n<pre><code>@conversionsApiPageView\n@include('conversions-api::facebook-pixel-script')\n</code></pre>\n<p>Controller Usage :</p>\n<pre><code>$newEvent = (new Event());\n$eventId = ConversionsApi::getEventId();\n $newEvent-&gt;setEventName('EventName')-&gt;setEventId($eventId)-&gt;setEventTime(time())-&gt;setUserData($data);\n\n if ($cData) {\n $newEvent-&gt;setCustomData($cData);\n }\n\n ConversionsApi::setEvent($newEvent);\n ConversionsApi::execute();\n</code></pre>\n<p>And</p>\n<pre><code>ConversionsApi::addEvent(\n PurchaseEvent::create()\n);\n</code></pre>\n<p>I hope This Helps , Thanks.</p>\n"^^ . + . + . + . + "Why does my browser submit emoji characters as html entities?"^^ . + "0"^^ . + "0"^^ . + "2"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + "404 popup on button press in Livewire component"^^ . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + "1) You haven't shown us the button on your HTML page, or the form it's within, so we don't know what that does when you press it, or where it submits to. Perhaps it submits to the code you've shown us here? It's not clear. 2) Presumably if it doesn't redirect you to anywhere, it's because those Session values (e.g. `$_SESSION['ApplicantID'])`) don't exist. Or maybe one of the `verify...` function conditions fails? Have you debugged that part to see if that's the case? We can't run your code or see your login data, so we can't predict exactly what will happen. Please [edit] your post to clarify"^^ . + "2"^^ . + . + "Why Is file_get_contents('php://input') Returning NULL for GET method?"^^ . + "0"^^ . + . + . + . + "<p>If your incoming data is not reliably structured, then use a whitelist of expected columns in your desired order to filter and map the parsed data. <a href="https://3v4l.org/DFMRo" rel="nofollow noreferrer">Demo &gt;= PHP7.4</a>, <a href="https://3v4l.org/B18lQ" rel="nofollow noreferrer">Demo PHP7 - PHP8.3</a>, <a href="https://3v4l.org/1fLgs" rel="nofollow noreferrer">Demo PHP5.2 - PHP8.3</a></p>\n<pre class="lang-php prettyprint-override"><code>$whitelist = [\n &quot;Symbol&quot;,\n &quot;Description&quot;,\n &quot;Qty (Quantity)&quot;,\n &quot;Price&quot;,\n &quot;Price Chng % (Price Change %)&quot;,\n &quot;Price Chng $ (Price Change $)&quot;,\n &quot;Day Chng % (Day Change %)&quot;,\n &quot;Day Chng $ (Day Change $)&quot;,\n &quot;Cost Basis&quot;,\n &quot;Gain % (Gain/Loss %)&quot;,\n &quot;Gain $ (Gain/Loss $)&quot;,\n &quot;Reinvest?&quot;,\n &quot;Reinvest Capital Gains?&quot;,\n &quot;Last Div (Last Dividend)&quot;,\n &quot;Volume&quot;,\n &quot;Security Type&quot;\n];\n\n$result = [];\nif (($handle = fopen(&quot;file.csv&quot;, &quot;r&quot;)) !== false) {\n $headers = fgetcsv($handle, escape: '') ?: [];\n $map = array_flip($headers);\n while (($values = fgetcsv($handle, escape: '')) !== false) {\n $row = [];\n foreach ($whitelist as $col) {\n $row[$col] = $values[$map[$col]] ?? null;\n }\n $result[] = $row;\n }\n fclose($handle);\n}\nvar_export($result);\n</code></pre>\n<p>File Contents:</p>\n<pre class="lang-none prettyprint-override"><code>&quot;Price&quot;,&quot;Bogus&quot;,&quot;Symbol&quot;,&quot;Description&quot;,&quot;Qty (Quantity)&quot;,&quot;Price Chng % (Price Change %)&quot;,&quot;Price Chng $ (Price Change $)&quot;,&quot;Day Chng % (Day Change %)&quot;,&quot;Day Chng $ (Day Change $)&quot;,&quot;Cost Basis&quot;,&quot;Gain % (Gain/Loss %)&quot;,&quot;Gain $ (Gain/Loss $)&quot;,&quot;Reinvest?&quot;,&quot;Reinvest Capital Gains?&quot;,&quot;Last Div (Last Dividend)&quot;,&quot;Volume&quot;,&quot;Security Type&quot;\n&quot;$19.39&quot;,&quot;foo1&quot;,&quot;Test1&quot;,&quot;ETF&quot;,&quot;820&quot;,&quot;-2.42%&quot;,&quot;-$0.48&quot;,&quot;-2.42%&quot;,&quot;-$393.6&quot;,&quot;$601.73&quot;,&quot;-18.89%&quot;,&quot;-$3701.93&quot;,&quot;No&quot;,&quot;--&quot;,&quot;$0.72025&quot;,&quot;14,626,464&quot;,&quot;ETFs &amp; Closed End Funds&quot;\n&quot;$49.43&quot;,&quot;foo2&quot;,&quot;Test2&quot;,&quot; ETF&quot;,&quot;110&quot;,&quot;-2.39%&quot;,&quot;-$1.21&quot;,&quot;-2.39%&quot;,&quot;-$133.1&quot;,&quot;$995.2&quot;,&quot;-9.31%&quot;,&quot;-$557.9&quot;,&quot;Yes&quot;,&quot;--&quot;,&quot;N/A&quot;,&quot;59,351,095&quot;,&quot;ETFs &amp; Closed End Funds&quot;\n&quot;$21.77&quot;,&quot;foo3&quot;,&quot;Test3&quot;,&quot; ETF&quot;,&quot;760&quot;,&quot;-3.72%&quot;,&quot;-$0.84&quot;,&quot;-3.72%&quot;,&quot;-$638.4&quot;,&quot;$687.73&quot;,&quot;-20.02%&quot;,&quot;-$142.53&quot;,&quot;No&quot;,&quot;--&quot;,&quot;$2.0216&quot;,&quot;6,402,084&quot;,&quot;ETFs &amp; Closed End Funds&quot;\n</code></pre>\n<p>Output:</p>\n<pre class="lang-php prettyprint-override"><code>array (\n 0 =&gt; \n array (\n 'Symbol' =&gt; 'Test1',\n 'Description' =&gt; 'ETF',\n 'Qty (Quantity)' =&gt; '820',\n 'Price' =&gt; '$19.39',\n 'Price Chng % (Price Change %)' =&gt; '-2.42%',\n 'Price Chng $ (Price Change $)' =&gt; '-$0.48',\n 'Day Chng % (Day Change %)' =&gt; '-2.42%',\n 'Day Chng $ (Day Change $)' =&gt; '-$393.6',\n 'Cost Basis' =&gt; '$601.73',\n 'Gain % (Gain/Loss %)' =&gt; '-18.89%',\n 'Gain $ (Gain/Loss $)' =&gt; '-$3701.93',\n 'Reinvest?' =&gt; 'No',\n 'Reinvest Capital Gains?' =&gt; '--',\n 'Last Div (Last Dividend)' =&gt; '$0.72025',\n 'Volume' =&gt; '14,626,464',\n 'Security Type' =&gt; 'ETFs &amp; Closed End Funds',\n ),\n 1 =&gt; \n array (\n 'Symbol' =&gt; 'Test2',\n 'Description' =&gt; ' ETF',\n 'Qty (Quantity)' =&gt; '110',\n 'Price' =&gt; '$49.43',\n 'Price Chng % (Price Change %)' =&gt; '-2.39%',\n 'Price Chng $ (Price Change $)' =&gt; '-$1.21',\n 'Day Chng % (Day Change %)' =&gt; '-2.39%',\n 'Day Chng $ (Day Change $)' =&gt; '-$133.1',\n 'Cost Basis' =&gt; '$995.2',\n 'Gain % (Gain/Loss %)' =&gt; '-9.31%',\n 'Gain $ (Gain/Loss $)' =&gt; '-$557.9',\n 'Reinvest?' =&gt; 'Yes',\n 'Reinvest Capital Gains?' =&gt; '--',\n 'Last Div (Last Dividend)' =&gt; 'N/A',\n 'Volume' =&gt; '59,351,095',\n 'Security Type' =&gt; 'ETFs &amp; Closed End Funds',\n ),\n 2 =&gt; \n array (\n 'Symbol' =&gt; 'Test3',\n 'Description' =&gt; ' ETF',\n 'Qty (Quantity)' =&gt; '760',\n 'Price' =&gt; '$21.77',\n 'Price Chng % (Price Change %)' =&gt; '-3.72%',\n 'Price Chng $ (Price Change $)' =&gt; '-$0.84',\n 'Day Chng % (Day Change %)' =&gt; '-3.72%',\n 'Day Chng $ (Day Change $)' =&gt; '-$638.4',\n 'Cost Basis' =&gt; '$687.73',\n 'Gain % (Gain/Loss %)' =&gt; '-20.02%',\n 'Gain $ (Gain/Loss $)' =&gt; '-$142.53',\n 'Reinvest?' =&gt; 'No',\n 'Reinvest Capital Gains?' =&gt; '--',\n 'Last Div (Last Dividend)' =&gt; '$2.0216',\n 'Volume' =&gt; '6,402,084',\n 'Security Type' =&gt; 'ETFs &amp; Closed End Funds',\n ),\n)\n</code></pre>\n"^^ . + . + . + . + . + . + . + . + "I removed the "-d" and it seems to send request but nothing is returned where as in command line curl json is returned..."^^ . + . + . + "1"^^ . + "<p><strong>Is this type of division of the package into selectable segments possible and How to handle conflicts of this type?</strong></p>\n<p>No, it is not possible to divide a package into segments/parts and install only selected segments/parts. If you think each segment can be installed as a separate component, then it should have it's own <code>comoser.json</code> file. And you should register it as a separate package in Packagist. So someone who needs your entire package can install the entire package and if others need only individual parts they can install those separate packages.</p>\n<ul>\n<li>Your Package (Entire Package)\n<ul>\n<li>Separate Part 1 (Separate Independent Package)</li>\n<li>Separate Part 2 (Separate Independent Package)</li>\n<li>...</li>\n</ul>\n</li>\n</ul>\n<p>This is how frameworks are built. They have separate packages for different parts of the framework (Routing, Templating etc..). And these separate packages are combined/bundled to form an entire framework.</p>\n"^^ . + "<p>Tabula like many PDF text extractions will not see the PDF text with its surface colours but simply the core monochromatic plain text.</p>\n<p><a href="https://i.sstatic.net/wiz7LdwY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wiz7LdwY.png" alt="enter image description here" /></a></p>\n<p>The main reason is that PDF colouring can be applied many ways unlike say HTML where the style is cascading so may be defined purely for text in an area/object via tags in a .css file or a header <code>&lt;style&gt;</code> or inline <code>&lt;p style=&quot;color: rgb(255,0,0)&quot;&gt;</code> or older pre HTML5 <code>&lt;font color=&quot;red&quot;&gt;</code>.</p>\n<p>The nice thing about HTML is the colour is text related and defined before the text it applies to.</p>\n<p>The Problem with PDF is the colour may be after the text and is NOT only text related. So more like colour all objects in a division.</p>\n<p>What about the shown text? Well it is actually, in this one case, fairly simple to see the colours. HOWEVER the <strong>page objects</strong> are first set to red = <code>1 0 0 rg</code> before any <strong>B</strong>egin <strong>T</strong>ext starts thus is the default color for the first line. Then black = <code>0 0 0 rg</code> for the next line. Green = <code>0 1 0</code> and then blue binary text is different type of colour <code>0 0 1 scn</code>. Thus we are lucky for this simple plain text file. We look for a colour then can extract the text after it.</p>\n<pre><code>stream\nq /GS0 gs 1 0 0 1 222 775.68008 cm 1 0 0 rg\nBT\n.001 Tc /F0 12.0005 Tf &lt;0037004c0057004f0048&gt; Tj\n0 0 0 rg 1 0 0 1 36.0072 0 Tm &lt;000300200003&gt; Tj\n0 1 0 rg 1 0 0 1 57.611497 0 Tm &lt;002b0048004f004f0052&gt; Tj\n0 0 0 rg 1 0 0 1 93.6187 0 Tm &lt;000f0003&gt; Tj\n0 0 1 scn 1 0 0 1 108.0216 0 Tm &lt;003a00520055004f0047&gt; Tj\n0 0 0 scn 0 Tc 1 0 0 1 144.0288 0 Tm &lt;0004&gt; Tj\nET\n</code></pre>\n<p>The simplest way to see what text is what colour is convert PDF into HTML which is easier to reverse so as to trace the colour differences.</p>\n<p>There are many utilities to convert PDF to HTML in one single command.</p>\n<p>Poppler does not work in this case:\n<a href="https://i.sstatic.net/XWjZKwMc.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XWjZKwMc.png" alt="enter image description here" /></a></p>\n<p>But MuTool does (PyMuPDF would too). &gt;<code>mutool convert -o colours.html colours.pdf</code>\n<a href="https://i.sstatic.net/88h3lcTK.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/88h3lcTK.png" alt="enter image description here" /></a></p>\n<pre><code>&lt;p style=&quot;top:56.6pt;left:222.0pt;line-height:12.0pt&quot;&gt;&lt;tt&gt;&lt;span style=&quot;font-family:F1,monospace;font-size:12.0pt;color:#ff0000&quot;&gt;Title&lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style=&quot;font-family:F1,monospace;font-size:12.0pt;color:#000000&quot;&gt; = &lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style=&quot;font-family:F1,monospace;font-size:12.0pt;color:#00ff00&quot;&gt;Hello&lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style=&quot;font-family:F1,monospace;font-size:12.0pt;color:#000000&quot;&gt;, &lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style=&quot;font-family:F1,monospace;font-size:12.0pt;color:#0000ff&quot;&gt;World&lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style=&quot;font-family:F1,monospace;font-size:12.0pt;color:#000000&quot;&gt;!&lt;/span&gt;&lt;/tt&gt;&lt;/p&gt;\n&lt;p style=&quot;top:69.5pt;left:70.9pt;line-height:12.0pt&quot;&gt;&lt;tt&gt;&lt;span style=&quot;font-family:F1,monospace;font-size:12.0pt;color:#000000&quot;&gt;# Tabula&lt;/span&gt;&lt;/tt&gt;&lt;/p&gt;\n</code></pre>\n<p>Yet again, no method is perfect as you need to note the source was Courier (monospaced) <code>Fonts: CIDFont+F1 (TrueType (CID); Identity-H; embedded)</code> but the Browser HTML default.css style is SansSerif (for font-family:F1,monospace;).</p>\n<p>Others may fail to see the colours correctly. So remember I said the default line colour was Red! I wont mention names but here is another apps attempt!</p>\n<p><a href="https://i.sstatic.net/9hpUufKN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/9hpUufKN.png" alt="enter image description here" /></a></p>\n"^^ . + "0"^^ . + "0"^^ . + . + . + . + "You should be able to add variable to Watched at any time (normal approach -- it's a "watch list", meaning: "I'm interested in those few out of all of the rest"). Side note: looks like phpBB uses a lot of variables in (global?) context.. or it's Sublime Text that displays them this way. Because normally you should have less of them (but then: it depends on a code base)."^^ . + "0"^^ . + . + . + . + . + . + . + "No there isn't. But I'd still use `escapeshellcmd` anyway, so that I didn't forget in future if I changed the rules about what values can be passed through in the GET parameter."^^ . + . + "Then it means your logger is configured to log to the standard output and not to a file."^^ . + . + . + "<p>I have a sever on the Internet running php 7.4.33 with wordpress includes to show the correct interface and a test server on Win10 using xampp running PHP 7.4.27 without any wordpress includes.</p>\n<p>I put the same .php input form and supporting classes on both servers (except one includes wp-load.php and runs get_header());</p>\n<p>When I run on the web server version a name like <code>O'Riley</code> comes in as <code>O\\'Riley</code> so when escaped it ends up <code>O\\\\\\'Riley</code> where as the local server comes in as <code>O'Riley</code> and when escaped ends up <code>O\\'Riley</code>.</p>\n<p>Is this some type of PHP or Apache option (or somehow wordpress intercepting something)? If PHP, where do I look for the difference so I can have both servers working the same way?</p>\n<p>TIA!!</p>\n<p><strong>Update</strong>: It appears it has to do with WordPress. I came up with this solution, does this look safe?</p>\n<pre><code>&lt;?php\n\n$alreadyquoted = false;\n\nclass Connection {\n var $conn;\n\n function __construct() {\n global $alreadyquoted;\n \n $this-&gt;conn = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB);\n\n if ($this-&gt;conn-&gt;connect_errno) {\n die(&quot;Could not connect : &quot;.$this-&gt;conn-&gt;connect_errno);\n }\n\n $this-&gt;conn-&gt;set_charset(&quot;utf8mb4&quot;); \n \n if (!$alreadyquoted) {\n if ( !defined( 'WPINC' )) {\n $_GET = $this-&gt;array_map_r(array($this-&gt;conn, 'real_escape_string'), $_GET);\n $_POST = $this-&gt;array_map_r(array($this-&gt;conn, 'real_escape_string'), $_POST);\n $_COOKIE = $this-&gt;array_map_r(array($this-&gt;conn, 'real_escape_string'), $_COOKIE);\n } else {\n $_GET = $this-&gt;array_map_r('stripslashes', $_GET);\n $_POST = $this-&gt;array_map_r('stripslashes', $_POST);\n $_COOKIE = $this-&gt;array_map_r('stripslashes', $_COOKIE);\n $_GET = $this-&gt;array_map_r(array($this-&gt;conn, 'real_escape_string'), $_GET);\n $_POST = $this-&gt;array_map_r(array($this-&gt;conn, 'real_escape_string'), $_POST);\n $_COOKIE = $this-&gt;array_map_r(array($this-&gt;conn, 'real_escape_string'), $_COOKIE);\n }\n $alreadyquoted=true;\n }\n }\n\n function array_map_r($func, $arr) {\n $newArr = array();\n foreach($arr as $key =&gt; $value) {\n $newArr[$key] = (is_array($value) ? $this-&gt;array_map_r($func, $value) : $func($value));\n }\n return $newArr;\n }\n};\n\n?&gt;\n</code></pre>\n"^^ . + "0"^^ . + . + "0"^^ . + . + "Which version are you using? It says there were breaking changes with the `1.0.0` release, so I'm guessing the documentation doesn't reflect that yet."^^ . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + . + . + "Thank you to both. This option it solves my problem."^^ . + . + . + "3"^^ . + . + "3"^^ . + "0"^^ . + "`php -S 127.0.0.1:9000 -t .` and `xdebug.remote_port=9000` -- 9000 is Xdebug port -- it is what Xdebug uses when it connects to the debug client (CodeLite in your case -- the editor/IDE). You cannot use that port for website serving. So either use `xdebug.remote_port=9003` and adjust that port number in your DIE (the default port since Xdebug v3) or use `php -S 127.0.0.1:8000 -t .` (or whatever other suitable port number). The website and Xdebug ports must be *different*."^^ . + "-4"^^ . + "3"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + "Your regex complexity skyrockets. You should never use `(a+)+` like patterns. `'/<a[^>]*href="([^"]+)"[^>]*>/i'` will work. Also, if you use `match` in JS, you should use `preg_match` in PHP to get a similar functionality."^^ . + "0"^^ . + . + . + . + . + . + "Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking."^^ . + "sendgrid"^^ . + . + "Issue with Telegram Bot Loop Running Indefinitely"^^ . + . + . + "0"^^ . + . + . + . + "Fortunately, I got it working. Now with this question CLOSED, there is no way (or even a reasonable motivation) to provide the solution. Unfortunate that just because a few stalwarts of SO believe that something is not possible, they impulsively cancel even genuine questions & their solutions. Coding is NOT 'A few man know it all' arena. There are new updates every now & then, & new workarounds evolving in people's minds. Anyways.... :-("^^ . + "Overriding PhpDocs Argument of a Method in a Parent Class"^^ . + "Set CSRF/XSRF token with laravel + react"^^ . + . + . + . + "3"^^ . + . + "<p>ok so ive identified the issue is specifically with the email field, i run mysqli_fetch_array and when i access any other field of the record other than email it prints fine on the web page but if i try to access the email the page crashes and i am redirected. Here is the function i am running:</p>\n<pre><code>function getContacts() {\n $query = &quot;SELECT * FROM ContactsTable&quot;;\n $result = $this-&gt;do_query($query, $this-&gt;sqldb2);\n \n $a_record = mysqli_fetch_array($result);\n $data = &quot;&lt;h3&gt;Contacts&lt;/h3&gt;&quot;;\n $data .= &quot;&lt;table border='1'&gt;&quot;;\n $data .= &quot;&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Department&lt;/th&gt;&lt;th&gt;Phone&lt;/th&gt;&lt;th&gt;Email&lt;/th&gt;&lt;/tr&gt;&quot;;\n $data .= &quot;&lt;tr&gt;&lt;td&gt;&quot; . $a_record['contactName'] . &quot;&lt;/td&gt;&lt;td&gt;&quot; . $a_record['contactDepartment'] . &quot;&lt;/td&gt;&lt;td&gt;&quot; . $a_record['contactName'] . &quot;&lt;/td&gt;&lt;td&gt;&quot; . $a_record['contactName'] . &quot;&lt;/td&gt;&lt;/tr&gt;&quot;;\n\n /*if ($result) {\n while ($row = mysqli_fetch_array($result)) {\n $data .= &quot;&lt;tr&gt;\n &lt;td&gt;{$row['contactName']}&lt;/td&gt;\n &lt;td&gt;{$row['contactDepartment']}&lt;/td&gt;\n &lt;td&gt;{$row['contactPhone']}&lt;/td&gt;\n &lt;td&gt;{$row['contactEmail']}&lt;/td&gt;\n &lt;/tr&gt;&quot;;\n }\n } else {\n $data .= &quot;&lt;tr&gt;&lt;td colspan='4'&gt;No contacts available.&lt;/td&gt;&lt;/tr&gt;&quot;;\n }\n*/\n $data .= &quot;&lt;/table&gt;&quot;; \n return $data;\n}\n</code></pre>\n<p>its a little messy right now and this is just for a class but ill put the code i used to make the table im pulling from too:</p>\n<pre><code>$sqlcreate = &quot;CREATE TABLE IF NOT EXISTS ContactsTable (contactName VARCHAR(100),contactDepartment VARCHAR(100),contactPhone VARCHAR(8), PRIMARY KEY(contactPhone), contactEmail VARCHAR(100))&quot;;\n if (mysqli_query($this-&gt;sqldb2, $sqlcreate)) {\n echo &quot;Table ContactsTable created yipee&lt;br&gt;&quot;;\n $sqlinsert = &quot;INSERT INTO ContactsTable (contactName, contactDepartment, contactPhone, contactEmail) VALUES\n ('Jack Jack', 'Hmmm...', '555-1212', 'frank@apple.com'),\n ('Jesus Jones', 'Newborn Delivery', '555-1234', 'jesus@bible.com'),\n ('Dax', 'Meat Packing', '555-4567', 'woah@hey.com'),\n ('Josh Jorgensen', 'Bribing Food Inspectors', '555-8922', 'notadoctor@shhh.com')&quot;; \n\n if (mysqli_query($this-&gt;sqldb2, $sqlinsert)) {\n echo &quot;Data insert done&lt;br&gt;&quot;;\n } else {\n echo &quot;Error inserting data: &quot; . mysqli_error($this-&gt;sqldb2) . &quot;&lt;br&gt;&quot;;\n }\n } else {\n echo &quot;Error creating table: &quot; . mysqli_error($this-&gt;sqldb2);\n }\n</code></pre>\n<p>also messy but you get the point, this is due tonight and id appreciate any insight idk php that well</p>\n<p>I just need to display the email btw its not like im sending emails just needs to display</p>\n<p>I tried <code>htmlspecialchars($a_record['contactEmail'], ENT_QUOTES, 'UTF-8')</code> because i thought maybe it was just getting caught on the @ symbol and this would handle the error, i was wrong. I still assume it must be the @ symbol messing it up because what else could it be? Maybe i should build the table differently?</p>\n"^^ . + . + "0"^^ . + . + "linkedin-api"^^ . + . + "1"^^ . + "Nothing you've shown would put a non-breaking space in the file. That must be coming from somewhere else. Please post a [mre]."^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "Back to my original question, how are these requests supposed to be handled on the server? Always `/page/<something>` to `/page.php/<something>` (what can `<something>` be)? So you do have a mixture of PHP and JS? How are these related?"^^ . + . + . + "0"^^ . + "0"^^ . + "null-coalescing"^^ . + . + . + "1"^^ . + "2"^^ . + . + "0"^^ . + . + . + . + . + "2"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + "1"^^ . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + "Laravel 10 login not working after deployment to Ubuntu Server (NGINX)"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + "<p>This issue might be due to SSL not configured properly. So use below code in wp-config.php to make it use ssl forcefully.</p>\n<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false" data-babel-preset-react="false" data-babel-preset-ts="false">\r\n<div class="snippet-code">\r\n<pre class="snippet-code-html lang-html prettyprint-override"><code>// Force SSL in Admin and Frontend\ndefine('FORCE_SSL_ADMIN', true);\ndefine('FORCE_SSL_LOGIN', true);\n\n// Ensure HTTPS detection (for reverse proxies, Cloudflare, etc.)\nif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &amp;&amp; $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {\n $_SERVER['HTTPS'] = 'on';\n}</code></pre>\r\n</div>\r\n</div>\r\n</p>\n"^^ . + . + "0"^^ . + "3"^^ . + . + "mod-rewrite"^^ . + "<p>I've been exploring codeigniter for quite some time now and so far it's been good. however I am really having a hard time figuring out how base_url works here. Take for example this one\n$config['base_url'] = 'http://Office-Inventory/';.\nIf I run that as http://Office-Inventory/ it will give me error 404</p>\n<p><em>Not Found\nThe requested URL was not found on this server.\nApache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 Server at dict-inventory Port 80</em></p>\n<p>with this url http://office-inventory/login.</p>\n<p>This really confuses me because if I use http://localhost:8000/, the project is actually working and i can access all controllers thru base_url or site_url.</p>\n"^^ . + "0"^^ . + . + . + . + . + "64bit architecture on both."^^ . + "0"^^ . + . + "0"^^ . + . + "Can you please confirm if the database container is up and running? \n`docker-compose ps` command Also, share the docker logs with the following. `docker-compose logs -f db`. I would appreciate it if we can do it in another stackoverflow question/discussion. \nThanks."^^ . + "<p>Based on your comment on how you registered the middleware, I think it has to do with the order middlewares are executed. The <code>Illuminate\\Session\\Middleware\\StartSession</code> middleware is part of the <code>web</code> group so you have to append your middleware to that group to ensure the session is started before your middleware is executed. The fix is to register your middleware like this:</p>\n<pre class="lang-php prettyprint-override"><code>return Application::configure(...)\n -&gt;withMiddleware(function (Middleware $middleware) {\n $middleware-&gt;web(append: [\n SetLocale::class,\n ]);\n })\n</code></pre>\n<p>This should fix your problem.</p>\n<p>Docs: <a href="https://laravel.com/docs/11.x/middleware#laravels-default-middleware-groups" rel="nofollow noreferrer">Laravel Middleware Groups</a></p>\n"^^ . + . + "@DavidC.Rankin, this is Postgres not MySQL. In Postgres `schema` != `database`."^^ . + . + "Tenancy for Laravel v3 not creating database"^^ . + "`\\xE9` is ISO-8859-1 (or windows-1252) for `é`. In other words, you are not sending UTF-8 to MySQL. Are you reading the strings from a CSV?"^^ . + "3"^^ . + . + . + . + "1"^^ . + . + "ok, but what if someone type any URL which include .PHP?"^^ . + . + . + "1"^^ . + . + . + . + . + "1"^^ . + "Hi, KIKO Software I shared all your concerns. That's why I am posting this question to collect as much as preparations before implementation. Thank you."^^ . + . + "0"^^ . + "0"^^ . + "response could have redirected due to validation error. set `Accept:application/json` in your request header to fix this"^^ . + "To avoid this kind of issues you might try https://www.powerlitepdo.com/\n(I'm the author, it's open source and free on Gighub)."^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + "This didn't help. The strange thing is, AFAICS opcache wasn't enabled to begin with."^^ . + . + . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + "That's quite strange. Also, ensure you're running `npm run dev` since you have @vite up there, if it's on dev environment"^^ . + "0"^^ . + . + "<p>There were several problems, and I had to fix them all before I got confirmation of a heartbeat in the management UI:</p>\n<ol>\n<li>My constructor was wrong; what I used above was adapted from <a href="https://php-amqplib.github.io/php-amqplib/classes/PhpAmqpLib-Connection-AMQPStreamConnection.html#method___construct" rel="nofollow noreferrer">this documentation of the PhpAmqpLib's <code>AMQPStreamConnection</code> constructor</a>. Possibly that was a different version of <code>PhpAmqpLib</code>? But using a long list of positional arguments made it hard to notice that. <a href="https://github.com/php-amqplib/php-amqplib/blob/2.12.2/PhpAmqpLib/Connection/AMQPStreamConnection.php" rel="nofollow noreferrer">When I found this constructor source code</a> and compared the call in detail, it gave me a couple more things to try.</li>\n<li>From the RabbitMQ docs, &quot;<a href="https://www.rabbitmq.com/docs/heartbeats#heartbeats-timeout" rel="nofollow noreferrer">The negotiation process works like this: the server will suggest its configurable value and the client will reconcile it with its configured value, and send the result value back</a>&quot;. In particular, this means that <em>if</em> the client (<code>PhpAmqpLib</code> in this case) decides not to follow the AMQP/RabbitMQ protocol on heartbeat negotiation, the server won't force it to do so.</li>\n<li><a href="https://github.com/php-amqplib/php-amqplib/pull/815" rel="nofollow noreferrer">This GitHub discussion thread</a> shows that the <code>PhpAmqpLib</code> community was aware heartbeats weren't fully supported, and they made a change in version 2.12.2 to fix that - but heartbeats were still an <em>optional</em> feature. &quot;PHP can't do heartbeats as configured&quot; is <em>why</em> the client was overriding the server (see #2) in a way counter to the RabbitMQ docs. <a href="https://github.com/php-amqplib/php-amqplib/commit/39a5fc005fee102d2e605b69dc036047729bd2c1" rel="nofollow noreferrer">The source code and constructors from that pull request</a> was useful in helping me figure out how to configure my connection.</li>\n</ol>\n<p>Putting it all together, here's the corresponding excerpt of the code after making the necessary changes:</p>\n<pre><code>use Illuminate\\Support\\Facades\\Log;\nuse PhpAmqpLib\\Connection\\AMQPConnectionConfig;\nuse PhpAmqpLib\\Connection\\AMQPStreamConnection;\nuse PhpAmqpLib\\Connection\\Heartbeat\\PCNTLHeartbeatSender;\n...\n\n private AMQPStreamConnection $connection;\n # For info on PCNTLHeartbeatSender, see\n # https://github.com/php-amqplib/php-amqplib/pull/815\n private PCNTLHeartbeatSender $sender; # Asynchronous AMQP heartbeat-sender\n...\n $heartbeat = 20;\n # See\n # https://php-amqplib.github.io/php-amqplib/classes/PhpAmqpLib-Connection-AMQPStreamConnection.html\n # https://github.com/php-amqplib/php-amqplib/blob/2.12.2/PhpAmqpLib/Connection/AMQPStreamConnection.php\n $this-&gt;connection = new AMQPStreamConnection(\n $this-&gt;host,\n $this-&gt;port,\n $this-&gt;user,\n $this-&gt;password,\n '/', # $vhost\n # $insist - insist on connecting to a specified server, default\n # value:\n false, \n AMQPConnectionConfig::AUTH_AMQPPLAIN, # $login_method, default value\n null, # $ login_response, default value\n 'en_US', # $locale, default value\n 3.0, # $connection_timeout, default value\n 40.0, # $read_write_timeout, supposed to be at least 2*heartbeat?\n null, # $context, default value\n true, # $ keepalive\n # $heartbeat, heartbeat interval; default is 0 which RabbitMQ\n # recommends against. See \n # https://www.rabbitmq.com/docs/heartbeats\n $heartbeat,\n 0.0, # $channel_rpc_timeout,\n null, # $ssl_protocol ?\n );\n $this-&gt;sender = new PCNTLHeartbeatSender($this-&gt;connection);\n $this-&gt;sender-&gt;register();\n Log::debug('Heartbeat values:', [\n &quot;input&quot;=&gt;$heartbeat,\n &quot;connection&quot;=&gt;$this-&gt;connection-&gt;getHeartbeat(),\n ]);\n</code></pre>\n<p>Now both logs and the RabbitMQ Management UI confirm I've got the intended 20s heartbeat in place. Because of the issues with replicating the silently-closed-connection bug described above, it'll be some time before I can confirm this is completely fixed, but I'm hopeful.</p>\n"^^ . + "1"^^ . + . + "0"^^ . + "<p>I have this strange condition where &quot;env()&quot; function is not reading from .env file.</p>\n<p>I'm on laravel 11 and I have tried the following commands.</p>\n<pre><code>php artisan cache:clear\nphp artisan config:clear\nphp artisan optimize:clear\n</code></pre>\n<p>I even deleted the whole project folder and restored the files using git.</p>\n<p>Still, env() function is not reading from .env file.</p>\n<p>I have to reclone the project from git to solve the problem.\nI have been doing that more than 4 times.</p>\n<p>What is happening?</p>\n"^^ . + "excel"^^ . + . + . + "imap"^^ . + "Lampp phpMyAdmin page gives an error. Not sure how to fix"^^ . + . + "1"^^ . + . + "0"^^ . + "<p>This is a feature called <code>inlayHints</code> provided by an extension. It can definitely be found in <a href="https://marketplace.visualstudio.com/items?itemName=DEVSENSE.phptools-vscode" rel="nofollow noreferrer">devsense/PHPTools</a>, but I can't comment on other extensions off the top of my head.</p>\n<p>Sometimes, during copy-paste, inlay hints end up on the clipboard. If we ignore this small issue, the inlay hint can only be added to the code by double-clicking, and you can disable this by modifying the <code>settings.json</code> (or <kbd>Ctrl</kbd><kbd>,</kbd> and search <code>php.inlayHints.insertOnDoubleClick</code> and set to <code>false</code>) in VSCode:</p>\n<pre><code>{\n &quot;php.inlayHints.insertOnDoubleClick&quot;: false,\n}\n</code></pre>\n<ul>\n<li><a href="https://docs.devsense.com/vscode/editor/inlay-hints/" rel="nofollow noreferrer">Inlay Hints</a> - Devsense PHPTools Docs</li>\n</ul>\n"^^ . + "Yes, using GET instead of HEAD does a much better job."^^ . + "Passing docker-compose .env file values into the container"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + "0"^^ . + "Sonar + Devops + PHP - How to analyze projects that doesn’t have a “Build” stage?"^^ . + . + "1"^^ . + . + . + "1"^^ . + . + . + . + "Polylang language switcher appears twice"^^ . + . + . + . + . + . + . + "Redirect with a form is blocked"^^ . + . + . + . + . + "SMTP validation for real existence of email is not working for some emails"^^ . + . + "Composer version control vendor directory with local repository"^^ . + "Error on PHP 8.4-fpm IMAP package install with Dockerfile"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "Obviously, that snippet isn't intended to be run in a vacuum."^^ . + . + "0"^^ . + . + . + "0"^^ . + "1"^^ . + "On php-config, I run into: `/usr/bin/php-config8.0 for php-config not registered; not setting`"^^ . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + "0"^^ . + "@Progman - thank you. this is my var_dump($_customer['customer']['adress']): string(13) "südendstr. " With one space."^^ . + . + "If you enter in the navigator the url `http://yourdomain.com` php get the main page, if you enter in the `navigator the url `http://yourdomain.com/about` php get the "about" page. I imagine -sorry, I'm a pretty rookie in google positions- the robots.txt makes that google index ok your pages, but php it's only execute one time, any change in the route by using a link in the application, not execute again the php."^^ . + "0"^^ . + . + "1"^^ . + . + . + . + "<p>I'm running a Laravel application on a VPS server managed with Webmin. Recently, I upgraded PHP from version 7 to PHP 8. Since the upgrade, I've noticed that a few pages in my application are significantly slower than before. Interestingly, after rebooting the server, the performance improves for about 2–3 hours before the slowdowns return.</p>\n<p>Here are some details about my environment:</p>\n<p>Server Environment:</p>\n<ul>\n<li>VPS managed via Webmin</li>\n<li>PHP upgraded from 7 to 8</li>\n<li>Laravel (version 9.0 )</li>\n</ul>\n<p>Issue Characteristics:</p>\n<p>Only a few pages are affected\nRebooting the server temporarily resolves the performance issues</p>\n<p>My Questions:</p>\n<ol>\n<li>What could be causing only select pages to slow down after the PHP 8\nupgrade?</li>\n<li>Could there be PHP 8-specific configuration issues (like OPcache or\nPHP-FPM settings) that might lead to this behavior?</li>\n<li>Are there Laravel-related issues or caching problems that could\nexplain the temporary improvement after a server reboot?</li>\n<li>Any insights, suggestions for further diagnostics, or known\ncompatibility issues between Laravel and PHP 8 would be greatly\nappreciated.</li>\n</ol>\n"^^ . + . + . + . + . + . + "Safe alternative for mcrypt_get_iv in current situation"^^ . + "0"^^ . + . + . + "<p>You might use a regex to split on:</p>\n<pre><code>\\S\\S\\K(?=\\S\\S)\n</code></pre>\n<p>The regex matches:</p>\n<ul>\n<li><code>\\S\\S</code> Match 2 non whitespace characters</li>\n<li><code>\\K</code> Forget what is matched so far (this will result in the position to split on)</li>\n<li><code>(?=\\S\\S)</code> Assert that there are 2 non whitespace characters to the right</li>\n</ul>\n<p>If you only want to match digits, you can use <code>\\d</code> instead of <code>\\S</code></p>\n<p>See the matches on <a href="https://regex101.com/r/o9djgR/1" rel="nofollow noreferrer">regex 101</a> and a <a href="https://3v4l.org/JCqDV" rel="nofollow noreferrer">PHP demo</a></p>\n<pre><code>$data = [\n &quot;&quot;,\n &quot;2&quot;,\n &quot;22&quot;,\n &quot;223&quot;,\n &quot;2233&quot;,\n &quot;22334&quot;,\n &quot;223344&quot;,\n &quot;2233444&quot;,\n &quot;22334455&quot;\n];\n\n$pattern = '/\\S\\S\\K(?=\\S\\S)/';\n\nforeach ($data as $item) {\n var_export(preg_split($pattern, $item));\n}\n</code></pre>\n<p>Output</p>\n<pre><code>array (\n 0 =&gt; '',\n)array (\n 0 =&gt; '2',\n)array (\n 0 =&gt; '22',\n)array (\n 0 =&gt; '223',\n)array (\n 0 =&gt; '22',\n 1 =&gt; '33',\n)array (\n 0 =&gt; '22',\n 1 =&gt; '334',\n)array (\n 0 =&gt; '22',\n 1 =&gt; '33',\n 2 =&gt; '44',\n)array (\n 0 =&gt; '22',\n 1 =&gt; '33',\n 2 =&gt; '444',\n)array (\n 0 =&gt; '22',\n 1 =&gt; '33',\n 2 =&gt; '44',\n 3 =&gt; '55',\n)\n</code></pre>\n"^^ . + "@Sam Please share the `var_dump` of `$item` in the filter callback, so we can verify the calculation, because it also depends on the item quantity. And since in your **Update 2**, you said calculation is working fine for one product, I did not look into the calculation. `woocommerce_calculate_item_totals_taxes` is the right filter to use to calculate the tax for each item. You just need to get the calculation right."^^ . + . + . + "What are the 24 consecutively numbered variables used for? Where do they come from?"^^ . + . + . + "ok, now it works fully, the $client was set to deferred. (immutability someone?)"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + "I've got Rest API enabled and working, but it still doesn't seem to be loading. I've had to manually set an entry for each lesson in the wp_postmeta to acknowledge its linkage to the course (it doesn't seem to have linked this way)"^^ . + . + . + "Shopify - Select option multi select not working in contact form"^^ . + . + "2"^^ . + "0"^^ . + . + "1"^^ . + . + . + "<p>I am using Laravel 11 for a small project and I am trying to handle internationalization.</p>\n<p>I have a dropdown where I allow a user to select languages and based on the selection, it takes the user to the following code in my web.php file in my routes directory:</p>\n<pre><code>Route::get('/lang/{locale}', function ($locale) {\n if (in_array($locale, ['en', 'fr'])) {\n session(['locale' =&gt; $locale]);\n App::setLocale($locale);\n }\n return redirect()-&gt;back();\n});\n</code></pre>\n<p>Then I have middleware set up to help with the internationalization as well. It looks like this:</p>\n<pre><code>public function handle(Request $request, Closure $next): Response\n{\n if (session()-&gt;has('locale')) {\n App::setLocale(session('locale'));\n }\n else{\n App::setLocale(config('app.locale'));\n }\n return $next($request);\n}\n</code></pre>\n<p>The problem I am seeing is that when I click on the language option in a dropdown, and the request goes through the route. I am not seeing any change within the session. If the route is redirecting back, is the session not being set? I have tried dumping all the session variables in the middleware, and it is blank. There is no &quot;locale&quot; property in the session. Where am I going wrong?</p>\n<p>I can confirm that the middleware is hit after the redirect-&gt;back() fires...help?</p>\n"^^ . + "serialization"^^ . + "How do you enter into the container?"^^ . + "1"^^ . + . + . + "0"^^ . + . + "<p>I have got it working and there were 2 things which might went wrong.</p>\n<ol>\n<li><p>I might have picked the x86 instead the x64 version of the php and/or Apache server install package. I reinstalled everything from scratch.</p>\n</li>\n<li><p>in the httpd.conf make sure the command is</p>\n</li>\n</ol>\n<p><code>LoadModule php_module &quot;C:/php/php8apache2_4.dll&quot;</code> not php8_module</p>\n<p>Problem solved for now, but I have another small annoying thing which I post as new topic.</p>\n<p>p.s. the settings in the IIS to have things running were a nightmare</p>\n"^^ . + . + . + . + "<p>We host a set of &quot;resource&quot; pages - a collection of useful links for our users. For years we've had a script run daily - looping through each link and sending one php Guzzle HEAD request to make sure each page on the resource sites is active.</p>\n<p>But over the past few years, I suspect as more and more sites adopt Cloudflare, sites are returning 403 codes to the HEAD request, and it's getting to the point where it's pretty useless to do this.</p>\n<p>Is there a way to do this that isn't going to get this traffic treated as malicious? I don't need the content from the other sites... just simply to know if the pages are in good working order.</p>\n<p>Here's the PHP code I'm using:</p>\n<pre><code>$client = new Client();\n$request = $client-&gt;head($encoded_link);\n$request-&gt;setOptions(['userAgent' =&gt; 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36']);\n$response = $request-&gt;send();\n</code></pre>\n"^^ . + . + . + "Also, removing that harmful try and catch stuff could also help. So would you please remove it and then copy and paste the exact output (removing sensitive stuff only) for a failed request"^^ . + . + . + . + . + . + "Very interesting. Thank you. I tried your solution against mine on the server that will eventually host the website with an array of 2943 names and probabilities between 1 and 20. Your solution took a pretty consistent 0.133 seconds on average (with a standard deviation of only 0.001 seconds) while my solution took 0.603 seconds on avarage (and standard deviation of 0.015 seconds). So your solution is 4.5 times as quick with that data. And for a webapp (that does a lot of other stuff besides), half a second versus one tenth of a second is quite relevant."^^ . + "You'll have to determine the values on the client side via JS first, and then make another request to the server, in which you send those values - either via AJAX/fetch in the background, or by changing the URL via assignment to `location.href`, or by automatically submitting a form in which you populated hidden fields with the values ..."^^ . + . + . + . + "<p>Starting with Fedora 41, <strong>dnf 5</strong> only has a very minimal support for modules, without the <strong>switch-to</strong> command :(</p>\n<p>So when the proper stream is enabled, you have to remove/reinstall all you need</p>\n<pre><code>dnf remove php\\*\ndnf install php-cli ....\n</code></pre>\n<p>Another way is to ensure everything is installed from the enabled repositories and streams:</p>\n<pre><code>dnf distro-sync\n</code></pre>\n<p>Notice: The <a href="https://rpms.remirepo.net/wizard/" rel="nofollow noreferrer">wizard</a> gives proper repository usage instructions (instead of using some random howto on the internet).</p>\n<p>Also notice that <strong>8.3</strong> is the default version on Fedora 41 (so module is not mandatory)</p>\n<p><strong>P.S.</strong> also need to check that the &quot;php&quot; command is the one provided by the RPM using</p>\n<pre><code>$ which php\n/usr/bin/php\n$ rpm -qf /usr/bin/php\nphp-cli-8.3.19-1.fc42.remi.x86_64\n</code></pre>\n"^^ . + "How to ask a Question on Stack Overflow without getting it deleted?"^^ . + . + . + "<p>This solution uses more generic regex syntax and can also be used with other languages, e.g. Python (<em>re module</em>). <em>(This pattern is inspired by the more PCRE specific pattern, <code>\\b(?:xx[gls]|([A-Za-z])\\1+)\\b(*SKIP)(*F)|([A-Za-z])\\2+</code>, by <a href="https://stackoverflow.com/users/5527985/bobble-bubble">@bobble bubble</a>, in the question comments.)</em></p>\n<p>REGEX PATTERN <em>(PCRE2 flavor; Flags: gi) (Updated with edit)</em>:</p>\n<pre><code>\\b(xx[gls]|([a-z])\\2+)\\b|([a-z])\\3+\n</code></pre>\n<p>REPLACEMENT STRING:</p>\n<pre><code>$1$3\n</code></pre>\n<p><em>Regex Demo:</em> <a href="https://regex101.com/r/AUE3y0/6" rel="nofollow noreferrer">https://regex101.com/r/AUE3y0/6</a></p>\n<p>TEST STRING:</p>\n<pre><code>aaa ccdd -&gt; aaa cd\nuuii -&gt; ui\nxxg aabbb -&gt; xxg\nabbbccddeeffgg\naabbbcc\n</code></pre>\n<p>RESULT:</p>\n<pre><code>aaa cd -&gt; aaa cd\nui -&gt; ui\nxxg ab -&gt; xxg\nabcdefg\nabc\n</code></pre>\n<p>REGEX NOTES:</p>\n<ul>\n<li><code>\\b</code> Match word boundary</li>\n<li><code>(</code> Begin alternation <code>(...|...)</code>. Also, begin 1st <em>capture group</em> (<em>group 1</em>), <code>(...)</code>. Referred to with <code>$1</code> in the <em>replacement string</em>.\n<ul>\n<li><code>xx[gls]</code> Match literal 'xx' followed by literal 'g', 'l', or 's'.</li>\n<li><code>|</code> OR, in the <em>alternation</em>.</li>\n<li><code>([a-z])</code> <em>Group 2</em> <code>(...)</code>. Referred to with <em>backreference</em> <code>\\2</code> in the pattern. Matches a letter. Note we have the ignorecase flag (i) set.</li>\n<li><code>\\2+</code> Matches the string captured by <em>group 2</em> (<code>\\2</code>), in this case the one letter, <em>1 or more</em> times (<code>+</code>).</li>\n</ul>\n</li>\n<li><code>)</code> Close <em>alteration</em>. Close <em>group 1</em>.</li>\n<li><code>\\b</code> Match word boundary.</li>\n<li><code>|</code> OR (<em>alternation</em>).</li>\n<li><code>([a-z])</code> <em>Group 3</em> <code>(...)</code>. Referred to with <em>backreference</em> <code>\\3</code> in the pattern, and with <code>$3</code> in the replacement string. Matches a letter.</li>\n<li><code>\\3+</code> Matches the string captured by <em>group 3</em> (<code>\\3</code>), in this case the one letter, <em>1 or more</em> (<code>+</code>) times.</li>\n</ul>\n<p>REPLACEMENT STRING NOTES:</p>\n<ul>\n<li>Replace the match with the string (character) captured by groups 1 (<code>$1</code>), followed by the string (character) captured by group 3 (<code>$3</code>).</li>\n</ul>\n"^^ . + . + . + . + "1"^^ . + "apache2"^^ . + . + . + "2"^^ . + . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + "count"^^ . + "Telegram bot doesn't trigger the webhook"^^ . + . + "Instead you must use prepared statements and parameters to correctly build the query and insert the values safely. See [How to include a PHP variable inside a MySQL statement](https://stackoverflow.com/questions/7537377/how-to-include-a-php-variable-inside-a-mysql-statement), [How can I prevent SQL injection in PHP?](https://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php) and https://phpdelusions.net/mysqli for some excellent resources and simple examples of how to do this stuff properly. Even as a beginner on a practice project you should get into good habits."^^ . + "The best solution instead of XAMPP is to install native PHP and MySQL, but the asker is not very familiar with these. The goal is to automatically host their own application locally on startup - almost like a production environment. How does Herd solve this? The asker does not want to do any development"^^ . + "<p>I built a PHP application to establish a TCP socket connection to a mail server (SMTP server) on port 25, using a proxy. Here the main part:</p>\n<pre><code>$context = [\n &quot;http&quot; =&gt; [\n &quot;proxy&quot; =&gt; &quot;tcp://xx.xx.xx.xx:xxxx&quot;,\n &quot;request_fulluri&quot; =&gt; true \n &quot;header&quot; =&gt; &quot;Proxy-Authorization: Basic xxxxxxxxxxx&quot;\n ]]\n};\n\n$connection = @stream_socket_client(\n address: &quot;tcp://$mxHost:25&quot;,\n error_code: $errno,\n error_message: $errstr,\n timeout: 10,\n context: $context\n);\n</code></pre>\n<p>I built the first version of the app as a Vanilla PHP with some Symfony components, and I run it using <code>php -S localhost:8000 -t .</code> and it works like a charm.</p>\n<p>Then I decided to install Symfony, inside a Docker installation. Since I build a DDD/Clean Architecture application, it was easy to switch to a fully Symfony application.</p>\n<p>But then the problems start.</p>\n<p>It seems like inside Docker I cannot use <code>stream_socket_client</code> correctly, I always get a connection timeout (110).</p>\n<p>At some point I added</p>\n<pre><code> dns: # Custom DNS settings\n - 8.8.8.8\n - 1.1.1.1\n</code></pre>\n<p>to my docker-compose.yml, and it worked for one day. The day after, it stopped to works and I started again to get connection timeout.</p>\n<p>My knowledge about network is not so strong, so I need a help.</p>\n<p>Can someone give me a tip, a suggestion, an idea to unblock this situation?</p>\n"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + "By the way, random question. Have you ever worked for a Japanese company before? I had a workmate with the same name as yours."^^ . + . + "<p>I'm encountering issues with wkhtmltopdf when passing non-English file names as arguments. For example passing the file named Japan日本.xml, the output file is saved as <em><strong>Japan.xml</strong></em> missing non-english characters instead of <em><strong>Japan日本.xml</strong></em>. This problem occurs on my Ubuntu server, while my client PC runs Windows. I've ensured that the necessary fonts are installed on the server, and the locale settings are configured to support UTF-8. However, the issue persists.\nI also found similar issue reported in <a href="https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2395" rel="nofollow noreferrer">wkhtmltopdf-Repository</a>.</p>\n<p>PHP Code Snippet:</p>\n<pre><code>&lt;?php\n$WKHTMLTOPDF = $wkhtmltopdf_path;\n$_options = [\n '--dump-outline ' . escapeshellarg('/usr/local/apache2/htdocs/Japan日本.xml'),\n $input_file_path,\n $output_file_path\n];\n\n$options_string = implode(' ', $_options);\n$output = shell_exec('&quot;' . $WKHTMLTOPDF . '&quot; ' . $options_string);\n?&gt;\n</code></pre>\n<p>Also, if you notice how I pass the option parameters, sometimes we forget to add a space between the command option and its value, which causes issues. It would be helpful if you could explain how to keep proper spacing between command options.</p>\n"^^ . + . + . + . + . + "1"^^ . + . + . + . + "2"^^ . + . + . + . + . + . + "I think you'd get better answers on [security.se]. Ultimately, though, anyone with access and sufficient determination can modify the data. It's down to you to decide how difficult to make it."^^ . + . + "@LoicTheAztec I've added filters and $post checks for woocommerce_register_post, woocommerce_process_registration_errors and woocommerce_registration_errors and we're still continuing to get spam registrations that are missing required fields. we even got a couple that appeared to be completely blank. not even an email address. is it possible that these different filters are somehow interfering with each other's proper function?"^^ . + . + . + . + . + "Issues writing to GPIO"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + "Your SQL (which is part of your server-side processing logic!) seems to be returning _any_ row containing `epic` - and _any_ row containing `5`. So if there is no other server-side filtering logic (e.g somewhere in some other PHP) then I can see why you are getting the results you are getting. You have to write the filtering (and sorting and pagination) logic - or use a server-side library which does this for you the way you want."^^ . + . + . + . + "Because its not a scoped relationship, its a [local scope](https://laravel.com/docs/11.x/eloquent#local-scopes)"^^ . + "Are you using all four at once probably? Then it might be that two does not work as it conflicts with four. Please clarify by [edit]ing your question with the clarification."^^ . + . + "<p>Modify your method to handle <code>null</code> values</p>\n<pre><code>public function countColumn($column)\n{\n $lastNumber = Number::orderBy('created_at', 'desc')-&gt;first();\n $lastColumn = Number::where('column', '=', $column)-&gt;orderBy('created_at', 'desc')-&gt;first();\n\n if (!$lastNumber || !$lastColumn) {\n return 0; // or handle the case when data is missing\n }\n\n $count = $lastNumber-&gt;id - $lastColumn-&gt;id;\n return $count;\n}\n</code></pre>\n"^^ . + . + . + "I'm able to run it through my provider if my Application URL is my domain name but not if i set it as my subdomain name. So in my case my hosting should not be my issue"^^ . + . + "<p>I have a project for setting up news websites, and I’ve decided not to rely on external Composer packages. I’ve already removed all dependencies except for Minishlink\\WebPush, which I still need for push notifications.</p>\n<p>So far, I’ve successfully:</p>\n<ul>\n<li>Generated the publicKey and privateKey for my website’s push notifications.</li>\n<li>Created the endpoint, p256dh, and auth keys for subscribers.\nEverything works fine, except for the final step — actually sending the notifications. Right now, I’m using Minishlink\\WebPush for that, like this:</li>\n</ul>\n<pre><code>use Minishlink\\WebPush\\WebPush;\nuse Minishlink\\WebPush\\Subscription;\nfunction sendDeviceNotification($email, $content, $email_subject, $userAvatar, $articlePath) {\n global $pdo;\n $query = &quot;SELECT endpoint, p256dh, authKey FROM users_auth_tokens WHERE email = :email&quot;;\n $stmt = $pdo-&gt;prepare($query);\n $stmt-&gt;execute([':email' =&gt; $email]);\n if ($stmt-&gt;rowCount() &gt; 0) {\n $auth = [\n 'VAPID' =&gt; [\n 'subject' =&gt; main_url,\n 'publicKey' =&gt; website_push_public_key,\n 'privateKey' =&gt; website_push_private_key,\n ],\n ];\n $webPush = new WebPush($auth);\n while ($subscriber = $stmt-&gt;fetch(PDO::FETCH_ASSOC)) {\n $subscription = Subscription::create([\n 'endpoint' =&gt; $subscriber['endpoint'],\n 'keys' =&gt; [\n 'p256dh' =&gt; $subscriber['p256dh'],\n 'auth' =&gt; $subscriber['authKey'],\n ],\n ]);\n $payload = json_encode([\n 'title' =&gt; $content,\n 'body' =&gt; $email_subject,\n 'icon' =&gt; $userAvatar,\n 'badge' =&gt; main_url . '/favicon.ico',\n 'extraData' =&gt; $articlePath,\n ]);\n $webPush-&gt;queueNotification($subscription, $payload);\n }\n foreach ($webPush-&gt;flush() as $report) {\n if ($report-&gt;isSuccess()) {\n }\n }\n }\n}\n</code></pre>\n<p>I’ve tried countless ways to replace Minishlink\\WebPush with a custom solution, but nothing works. This is literally the last missing piece—once I solve this, my push notification system will be fully independent.</p>\n<p>Has anyone successfully implemented Web Push notifications without Minishlink\\WebPush?</p>\n<h1>Additional Info:</h1>\n<p>To help others, I’m also sharing how I generate and store the website’s VAPID keys (works perfectly):</p>\n<pre><code>if (strpos(main_url, 'https://') === 0 &amp;&amp; empty(website_push_public_key) &amp;&amp; empty(website_push_private_key)) {\nfunction generateVAPIDKeys() {\n$config = [\n&quot;private_key_type&quot; =&gt; OPENSSL_KEYTYPE_EC,\n&quot;curve_name&quot; =&gt; &quot;prime256v1&quot;,\n];\n$res = openssl_pkey_new($config);\nif (!$res) {\nthrow new Exception('The key pair cannot be created.');\n}\nif (!openssl_pkey_export($res, $privateKeyPem)) {\nthrow new Exception('The private key cannot be extracted.');\n}\n$keyDetails = openssl_pkey_get_details($res);\nif (!$keyDetails || !isset($keyDetails['ec']['x']) || !isset($keyDetails['ec']['y']) || !isset($keyDetails['ec']['d'])) {\nthrow new Exception('The key details cannot be extracted.');\n}\n$publicKeyHex = '04' . bin2hex($keyDetails['ec']['x']) . bin2hex($keyDetails['ec']['y']);\n$publicKey = hex2bin($publicKeyHex);\n$publicKeyBase64 = rtrim(strtr(base64_encode($publicKey), '+/', '-_'), '=');\n$privateKeyBase64 = rtrim(strtr(base64_encode($keyDetails['ec']['d']), '+/', '-_'), '=');\nreturn [\n'publicKey' =&gt; $publicKeyBase64,\n'privateKey' =&gt; $privateKeyBase64,\n];\n}\ntry {\n $vapidKeys = generateVAPIDKeys();\n $updateKeys = [\n 'website_push_public_key' =&gt; $vapidKeys['publicKey'],\n 'website_push_private_key' =&gt; $vapidKeys['privateKey']\n ];\n $sql = &quot;UPDATE system_options SET display = :display WHERE setting_name = :setting_name&quot;;\n $statement = $pdo-&gt;prepare($sql);\n foreach ($updateKeys as $settingName =&gt; $keyValue) {\n $statement-&gt;bindValue(':display', $keyValue, PDO::PARAM_STR);\n $statement-&gt;bindValue(':setting_name', $settingName, PDO::PARAM_STR);\n $statement-&gt;execute();\n }\n} catch (Exception $e) {\n trigger_error($e-&gt;getMessage());\n}\n}\n</code></pre>\n<p>And this is how I store the user’s subscription keys (also working fine):</p>\n<pre><code>if (strpos(main_url, 'https://') === 0 &amp;&amp; isset($data['push_subscriber']) &amp;&amp; !empty($data['push_subscriber'])) {\n$pushData = $data['push_subscriber'];\n$endpoint = $pushData['endpoint'];\n$p256dh = $pushData['keys']['p256dh'];\n$authKey = $pushData['keys']['auth'];\n$device_id_decrypted = decrypt($device_id, encryption_key);\n$sql = &quot;UPDATE users_auth_tokens SET endpoint = :endpoint, p256dh = :p256dh, authKey = :authKey WHERE email = :email AND device_id = :device_id&quot;;\n$stmt = $pdo-&gt;prepare($sql);\n$stmt-&gt;bindParam(':endpoint', $endpoint, PDO::PARAM_STR);\n$stmt-&gt;bindParam(':p256dh', $p256dh, PDO::PARAM_STR);\n$stmt-&gt;bindParam(':authKey', $authKey, PDO::PARAM_STR);\n$stmt-&gt;bindParam(':email', $email, PDO::PARAM_STR);\n$stmt-&gt;bindParam(':device_id', $device_id_decrypted, PDO::PARAM_STR);\n$stmt-&gt;execute();\n}\n</code></pre>\n<p>Would really appreciate any help in getting push notifications to work without Minishlink\\WebPush! Thanks in advance. </p>\n<p>I tried implementing Web Push Notifications without Minishlink\\WebPush by manually constructing the VAPID JWT, encrypting the payload using AES-GCM, and sending the push request via cURL.</p>\n<p>Here's what I did:</p>\n<ol>\n<li>Retrieved subscriber details (endpoint, p256dh, auth).</li>\n<li>Generated a VAPID token manually using ES256 (ECDSA) signing.</li>\n<li>Derived a shared secret from the VAPID private key and the subscriber’s public key.</li>\n<li>Created an encryption key and nonce using HKDF.</li>\n<li>Encrypted the push payload using AES-128-GCM.</li>\n<li>Sent the push notification via cURL with the required headers (Authorization: vapid, Encryption, Crypto-Key, etc.).</li>\n<li>Expected vs Actual Results</li>\n<li>Expected: The push notification should be received by the browser.</li>\n<li>Actual: No push notifications arrive, and sometimes I get a 401 Unauthorized or Invalid crypto key error.</li>\n<li>I've logged errors and checked the JWT generation, key derivation, and encryption process, but I can’t seem to figure out what's missing.</li>\n</ol>\n<p><strong>Has anyone successfully implemented this without Minishlink\\WebPush? Any help would be appreciated!</strong></p>\n"^^ . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + "1"^^ . + "laravel-8"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + "cpanel"^^ . + . + . + . + "Interesting situation. I have no insight into the possible cause, but if I were debugging this, first thing I'd probably do is try a different major version of Redis, and/or one that's not based on Alpine. After this failure, is Redis just flat out dead? Can you connect via the cli and still use Redis?"^^ . + "1"^^ . + . + "<p>I am trying to setup <em>UPS Rate API</em> for one of my app, my data looks like:</p>\n<pre><code>{\n &quot;RateRequest&quot;: {\n &quot;Request&quot;: {\n &quot;RequestOption&quot;: &quot;Rate&quot;\n },\n &quot;CustomerClassification&quot;: {\n &quot;Code&quot;: &quot;00&quot;\n },\n &quot;Shipment&quot;: {\n &quot;Shipper&quot;: {\n &quot;Name&quot;: &quot;**********&quot;,\n &quot;ShipperNumber&quot;: &quot;*****&quot;,\n &quot;Address&quot;: {\n &quot;AddressLine&quot;: &quot;7550 N Croname RD STE 500&quot;,\n &quot;City&quot;: &quot;Niles&quot;,\n &quot;StateProvinceCode&quot;: &quot;IL&quot;,\n &quot;PostalCode&quot;: &quot;*****&quot;,\n &quot;CountryCode&quot;: &quot;US&quot;\n }\n },\n &quot;ShipTo&quot;: {\n &quot;Address&quot;: {\n &quot;PostalCode&quot;: &quot;90001&quot;,\n &quot;CountryCode&quot;: &quot;US&quot;\n }\n },\n &quot;ShipFrom&quot;: {\n &quot;Address&quot;: {\n &quot;AddressLine&quot;: &quot;******&quot;,\n &quot;City&quot;: &quot;Los Angeles&quot;,\n &quot;StateProvinceCode&quot;: &quot;*****&quot;,\n &quot;PostalCode&quot;: &quot;*****&quot;,\n &quot;CountryCode&quot;: &quot;US&quot;\n }\n },\n &quot;Service&quot;: {\n &quot;Code&quot;: &quot;03&quot;\n },\n &quot;TaxInformationIndicator&quot;: &quot;True&quot;,\n &quot;NumOfPieces&quot;: &quot;1&quot;,\n &quot;Package&quot;: [\n {\n &quot;PackagingType&quot;: {\n &quot;Code&quot;: &quot;02&quot;\n },\n &quot;PackageWeight&quot;: {\n &quot;Weight&quot;: &quot;7.31&quot;,\n &quot;UnitOfMeasurement&quot;: {\n &quot;Code&quot;: &quot;LBS&quot;\n }\n }\n }\n ],\n &quot;ShipmentRatingOptions&quot;: {\n &quot;NegotiatedRatesIndicator&quot;: &quot;True&quot;\n }\n }\n }\n}\n</code></pre>\n<p>I am targeting the URL <a href="https://onlinetools.ups.com/api/rating/v2409/Rate" rel="nofollow noreferrer">https://onlinetools.ups.com/api/rating/v2409/Rate</a>, but I am getting response something like:</p>\n<blockquote>\n<p>{&quot;response&quot;:{&quot;errors&quot;:[{&quot;code&quot;:&quot;9110034&quot;,&quot;message&quot;:&quot;Missing or invalid\nrequest option.&quot;}]}}</p>\n</blockquote>\n<p>While the <code>RequestOption</code> is available in the payload. What I am doing wrong? (I have access token).</p>\n<p>my code for call is</p>\n<pre><code> $version = &quot;v2409&quot;;\n $requestoption = &quot;Rate&quot;;\n $accessToken = $this-&gt;getUpsAccessToken(); // Get OAuth token\n\n if (!$accessToken) {\n return ['error' =&gt; 'Failed to get access token'];\n }\n$query = array();\n\n$curl = curl_init();\n\n$payload = $this-&gt;processPackageRateRequest($ShippingConstants, $PostalCode, $CountryCode, $BoxCount, $ShippingWeight, $ServiceType, $addressType);\n\n//print_r(json_encode($payload));\n\n\ncurl_setopt_array($curl, [\n CURLOPT_HTTPHEADER =&gt; [\n &quot;Authorization: Bearer $accessToken&quot;,\n &quot;Content-Type: application/json&quot;,\n &quot;transId: string&quot;,\n &quot;transactionSrc: testing&quot;,\n &quot;Accept: application/json&quot;,\n \n ],\n CURLOPT_POSTFIELDS =&gt; json_encode($payload),\n CURLOPT_URL =&gt; &quot;https://onlinetools.ups.com/api/rating/&quot; . $version . &quot;/&quot; . $requestoption . &quot;?&quot; . http_build_query($query),\n CURLOPT_RETURNTRANSFER =&gt; true,\n CURLOPT_CUSTOMREQUEST =&gt; &quot;POST&quot;,\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n echo &quot;cURL Error #:&quot; . $error;\n} else {\n echo $response;\n}\n</code></pre>\n<p>the function &quot;processPackageRateRequest&quot; returns the payload in formatted version.</p>\n"^^ . + "2"^^ . + . + . + . + . + . + . + . + . + . + . + . + "3"^^ . + . + "xdebug3 , https://xdebug.org / https://www.jetbrains.com/phpstorm/"^^ . + . + . + . + . + . + . + "<p>i have a php e-commerce website When i add product to cart from category A then move to category B product that already added from category A can not increase or decrease from cart side until i moved back to category A.in same category window it works fine.when i click on category button in console this error show products.php?category_id=4:1607 Uncaught ReferenceError: toggleSidebar is not defined\nat HTMLAnchorElement.onclick (products.php?category_id=4:1607:47).\ni already review session data its fine between three files.this is script</p>\n<pre><code>&lt;script&gt;\n // Function to toggle cart sidebar\n function toggleCart() {\n $('.cart-sidebar').toggleClass('active');\n $('.overlay').toggleClass('active');\n if ($('.cart-sidebar').hasClass('active')) {\n loadCartSidebar();\n }\n }\n\n // Function to load cart sidebar content\n function loadCartSidebar() {\n $.ajax({\n url: 'cart_dropdown.php',\n type: 'GET',\n success: function(response) {\n $('#cart-sidebar-content').html(response);\n }\n });\n }\n\n // Function to update cart\n function updateCart(productId, action) {\n const quantityType = $(`#quantity-type-${productId}`).val();\n const quantity = $(`#quantity-${productId}`).val();\n\n $.ajax({\n url: 'update_cart.php',\n type: 'POST',\n data: { \n product_id: productId, \n action: action,\n quantity_type: quantityType,\n quantity: quantity\n },\n success: function(response) {\n let data = JSON.parse(response);\n if (data.error) {\n alert(data.error);\n } else {\n $('#cart-count').text(data.cartCount);\n $('#cart-total').text('$' + data.cartTotal.toFixed(2));\n loadCartSidebar();\n\n // Enable/Disable the Order Submit button based on cart count\n if (data.cartCount &gt; 0) {\n $('#order-submit').prop('disabled', false);\n } else {\n $('#order-submit').prop('disabled', true);\n }\n\n // Show/hide the minus button based on the product's quantity in the cart\n if (data.cartCount &gt; 0) {\n $(`#minus-${productId}`).show(); // Show minus button\n } else {\n $(`#minus-${productId}`).hide(); // Hide minus button\n }\n\n // Show discount tag if applicable\n if (data.discountApplied) {\n const totalSaved = data.totalSaved.toFixed(2);\n $(`#discount-tag-${data.productId}`).show().find(`#discount-amount-${data.productId}`).text(totalSaved);\n } else {\n $(`#discount-tag-${data.productId}`).hide(); // Hide the tag if quantity is below packets_per_pallet\n }\n\n // Show discount popup if applicable\n if (data.discountApplied) {\n const totalSaved = data.totalSaved.toFixed(2);\n const newPrice = data.newPrice.toFixed(2);\n const productName = $(`#product-${data.productId} h4`).text(); // Get product name\n $('#discount-popup').html(`🎉 You saved $${totalSaved} on ${productName}! Now you get this price: $${newPrice} 🎉`).fadeIn().delay(3000).fadeOut();\n }\n }\n },\n error: function(xhr, status, error) {\n console.error(&quot;AJAX Error:&quot;, status, error);\n }\n });\n }\n\n // Function to handle order submission\n $(document).ready(function() {\n $('#order-submit').click(function() {\n if ($(this).prop('disabled')) {\n return; // Do nothing if the button is disabled\n }\n\n // Handle the order submission\n $.ajax({\n url: 'submit_order.php',\n type: 'POST',\n success: function(response) {\n alert('Order submitted successfully!');\n // Optionally, clear the cart or redirect the user\n window.location.href = 'thank_you.php';\n },\n error: function(xhr, status, error) {\n console.error(&quot;AJAX Error:&quot;, status, error);\n alert('There was an error submitting your order. Please try again.');\n }\n });\n });\n\n // Toggle Categoría Sidebar\n $('.bottom-nav a').on('click', function(e) {\n if ($(this).attr('href') === '#') {\n e.preventDefault();\n $('.sidebar').toggleClass('active');\n $('.overlay').toggleClass('active');\n }\n });\n\n // Close sidebar and cart sidebar when clicking outside\n $(document).on('click', function(event) {\n if (!$(event.target).closest('.sidebar').length &amp;&amp; !$(event.target).closest('.bottom-nav a').length) {\n $('.sidebar').removeClass('active');\n $('.overlay').removeClass('active');\n }\n if (!$(event.target).closest('.cart-button').length &amp;&amp; !$(event.target).closest('.cart-sidebar').length) {\n $('.cart-sidebar').removeClass('active');\n $('.overlay').removeClass('active');\n }\n });\n\n // Back Arrow in Cart Sidebar (Mobile)\n $('.cart-sidebar').on('click', '.back-arrow', function() {\n toggleCart();\n });\n\n // Live Search Functionality\n $('.search-bar').on('input', function() {\n const query = $(this).val();\n if (query.length &gt; 2) { // Only search if query has at least 3 characters\n $.ajax({\n url: 'search_products.php',\n type: 'GET',\n data: { query: query },\n success: function(response) {\n $('.search-results').html(response).show();\n }\n });\n } else {\n $('.search-results').hide();\n }\n });\n\n // Close search results when clicking outside\n $(document).click(function(event) {\n if (!$(event.target).closest('.search-container').length) {\n $('.search-results').hide();\n }\n });\n\n // Handle click on search result item\n $(document).on('click', '.search-results .product-item', function() {\n const productId = $(this).data('product-id');\n // Hide search results\n $('.search-results').hide();\n // Scroll to the product card and highlight it\n const productCard = $(`#product-${productId}`);\n if (productCard.length) {\n $('html, body').animate({\n scrollTop: productCard.offset().top - 100 // Adjust offset for better visibility\n }, 500);\n productCard.css('border', '2px solid #28a745'); // Highlight the product\n setTimeout(() =&gt; {\n productCard.css('border', '1px solid #ddd'); // Remove highlight after 2 seconds\n }, 2000);\n }\n });\n\n // Handle subcategory filter change\n $('.subcategory-filter input[type=&quot;checkbox&quot;]').change(function() {\n const selectedSubcategories = [];\n $('.subcategory-filter input[type=&quot;checkbox&quot;]:checked').each(function() {\n selectedSubcategories.push($(this).val());\n });\n\n const categoryId = &lt;?= $categoryId ? $categoryId : 'null' ?&gt;;\n const url = new URL(window.location.href);\n\n // Update or remove the 'subcategories' parameter\n if (selectedSubcategories.length &gt; 0) {\n url.searchParams.set('subcategories', selectedSubcategories.join(','));\n } else {\n url.searchParams.delete('subcategories');\n }\n\n // Update or remove the 'category_id' parameter\n if (categoryId) {\n url.searchParams.set('category_id', categoryId);\n } else {\n url.searchParams.delete('category_id');\n }\n\n // Reload the page with the updated URL\n window.location.href = url.toString();\n });\n\n // Function to scroll subcategories\n function scrollSubcategories(direction) {\n const scrollContainer = document.querySelector('.subcategory-filter-scroll');\n const scrollAmount = 200; // Adjust scroll amount as needed\n\n if (direction === 'left') {\n scrollContainer.scrollBy({ left: -scrollAmount, behavior: 'smooth' });\n } else if (direction === 'right') {\n scrollContainer.scrollBy({ left: scrollAmount, behavior: 'smooth' });\n }\n }\n\n // Function to check if scrolling is needed and show/hide arrows\n function checkScroll() {\n const scrollContainer = document.querySelector('.subcategory-filter-scroll');\n const leftArrow = document.querySelector('.subcategory-filter-arrow.left-arrow');\n const rightArrow = document.querySelector('.subcategory-filter-arrow.right-arrow');\n\n if (scrollContainer.scrollLeft &gt; 0) {\n leftArrow.style.display = 'block';\n } else {\n leftArrow.style.display = 'none';\n }\n\n if (scrollContainer.scrollLeft &lt; (scrollContainer.scrollWidth - scrollContainer.clientWidth)) {\n rightArrow.style.display = 'block';\n } else {\n rightArrow.style.display = 'none';\n }\n }\n\n // Attach event listener for scroll\n document.querySelector('.subcategory-filter-scroll').addEventListener('scroll', checkScroll);\n\n // Initial check on page load\n window.addEventListener('load', checkScroll);\n });\n\n // Function to handle WhatsApp button click\n function openWhatsApp() {\n alert(&quot;WhatsApp functionality is disabled for now.&quot;);\n }\n\n // Function to show location popup\n function showLocation() {\n document.getElementById('location-popup').style.display = 'block';\n }\n\n // Function to close location popup\n function closeLocationPopup() {\n document.getElementById('location-popup').style.display = 'none';\n }\n\n // Function to get directions\n function getDirections() {\n const address = encodeURIComponent('Carrer de l\\'Almirall Oquendo, 153, 08020 Sant Adrià de Besòs, Barcelona');\n window.open(`https://www.google.com/maps/dir/?api=1&amp;destination=${address}`, '_blank');\n }\n\n // Function to scroll to top\n function scrollToTop() {\n window.scrollTo({ top: 0, behavior: 'smooth' });\n }\n &lt;/script&gt;\n</code></pre>\n"^^ . + . + "<p>I’m to find a regular expression to match strings inside single but not multiple particular characters. For example:</p>\n<pre><code>this is =one= and =two= but not ==three== or ==four== etc\n</code></pre>\n<p>Here I’m using <code>=</code> as a delimiter, and I want to match the <code>one</code> and <code>two</code> because they’re inside single delimiters but not <code>three</code> or <code>four</code> because they’re inside multiple delimiters.</p>\n<p>I thought using negative lookahead and lookbehind would do the trick:</p>\n<pre><code>/(?&lt;!=)=(.+?)=(?!=)/g\n</code></pre>\n<p>but I end up matching the other strings as well, so I obviously don’t understand properly hot negative lookahead and lookbehind work. I thought the expression means <code>=</code> <em>not</em> preceded by a <code>=</code>, and so on.</p>\n<p>A bigger test includes multiline strings:</p>\n<pre><code>this is =one= and =two= but not ==three== or ==four==.\n\n====\nthis shouldn’t count at all\n====\n</code></pre>\n<p>There might be another approach, which would be welcome, but one using lookahead and lookbehind would be more educational I think.</p>\n<p>I’m using PHP and I plan to use the <code>preg_replace_callback()</code> function.</p>\n"^^ . + "1"^^ . + . + . + . + . + . + . + "I got an error on Laravel. It is about an Unknown Database though I havent created a database. Another is I got a lot of deprecated warnings"^^ . + "0"^^ . + . + . + "1) check that your phpmyadmin version is compatible with the php version you're running. 2) follow the instructions in the "Error during session start..." message to see if anything needs correcting. P.S. 3) a deprecation notice isn't technically an error and won't crash the code."^^ . + . + "1"^^ . + . + . + "0"^^ . + . + "<p>I'm using library <a href="https://github.com/chiiya/passes" rel="nofollow noreferrer">chiiya/passes</a> to generate membership cards for my project. The github page has an <a href="https://github.com/chiiya/passes/blob/master/examples/google_generic.php" rel="nofollow noreferrer">example to create a generic object</a> but, maybe I'm wrong, some information is missing.</p>\n<pre><code>$object = new GenericObject(\n cardTitle: LocalizedString::make('en', '::cardTitle::'),\n header: LocalizedString::make('en', '::header::'),\n subheader: LocalizedString::make('en', '::subheader::'),\n logo: Image::make('https://example.org/logo.png'),\n hexBackgroundColor: '#333',\n notifications: new Notifications(\n upcomingNotification: new UpcomingNotification(\n enableNotification: true\n ),\n ),\n classId: '1234567890123456789.generic-object',\n id: '1234567890123456789.'.Str::uuid()-&gt;toString(),\n heroImage: Image::make('https://example.org/hero-image.png'),\n state: State::ACTIVE,\n barcode: new Barcode(\n type: BarcodeType::QR_CODE,\n value: '1464194291627',\n renderEncoding: BarcodeRenderEncoding::UTF_8,\n ),\n validTimeInterval: new TimeInterval(\n start: new DateTime(date: now()),\n end: new DateTime(date: now()-&gt;addMonth())\n ),\n textModulesData: [\n new TextModuleData(\n header: 'label-1',\n body: 'value-1',\n id: 'key-1',\n ),\n new TextModuleData(\n header: 'label-2',\n body: 'value-2',\n id: 'key-2',\n )\n ],\n groupingInfo: new GroupingInfo(\n groupingId: 'group1'\n )\n);\n\n$jwt = (new JWT(\n iss: $credentials-&gt;client_email,\n key: $credentials-&gt;private_key,\n origins: ['https://example.org'],\n))-&gt;addGenericObject($object)-&gt;sign();\n</code></pre>\n<p>Once the object has been created and signed using the credentials, how is it sent to Google so the pass is created and how do I offer the user the &quot;Add to Google Wallet&quot; button. I've seen somewhere that I need an id of the object but I haven't been able to find how to do that.</p>\n<p>I've already created the generic class in the Google Wallet website.</p>\n<p>Is there someone who has used this library, or similars, able to give me a hint?</p>\n<p>Thanks</p>\n"^^ . + ""will become 50 projects with a total size of 250mb (50 x 5mb)." - I still don't understand the mathmatics behind this. You would still have **one** project using 50 packages. What makes you think that this would split up a single project into 50? Also, none of these libraries should use its own composer.lock"^^ . + "With PHP 8.4 I have to use locale identifier (e.g. `en@numbers=roman`), otherwise error will be triggered."^^ . + "1"^^ . + . + "zend-framework"^^ . + "If you need serialization, use `serialize()`. But why do you need it in the first place?"^^ . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + "*"but then I lose my UTF-8 support"* The file is still encoded in UTF-8 (assuming your data is), whether you put a BOM or not."^^ . + . + "1"^^ . + . + "0"^^ . + . + . + . + . + . + "shell"^^ . + . + "Probably not related to your problem, but inspecting the raw URL can be troublesome in WordPress sometimes. You are correctly registering your interest in a custom variable using the `query_vars` hook, so I would encourage you to use `get_query_var` in `index.php` to check for its existence."^^ . + "0"^^ . + "What dependencies does your libmysql.dll has?"^^ . + "You shouldn't be really doing it in PHP, so I changed the title a little"^^ . + "<p>I have one docker container apache01</p>\n<pre><code> # Apache 1\n apache1:\n image: ubuntu_8.2.7:latest\n restart: always\n container_name: apache01\n volumes:\n - volume1:/var/www/html\n</code></pre>\n<p>I want to fix this permissions issue automatically every time I upload a laravel project.</p>\n<pre><code>file_put_contents(/var/www/html/laravel-12.x/storage/framework/views/a6de69a89194aefb57015b6dda999edc.php): Failed to open stream: Permission denied\n</code></pre>\n<p>The error screenshot:</p>\n<p><a href="https://i.sstatic.net/fzYY43l6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/fzYY43l6.png" alt="enter image description here" /></a></p>\n<p>This is my dockerfire:</p>\n<pre><code>FROM ubuntu:22.04\n\nENV DEBIAN_FRONTEND=noninteractive\n\nRUN apt update &amp;&amp; apt install -y software-properties-common\n\nRUN add-apt-repository ppa:ondrej/php\n\nRUN apt update &amp;&amp; apt install -y \\\n libbz2-dev \\\n libsqlite3-dev \\\n libjpeg-dev \\\n libpng-dev \\\n libwebp-dev \\\n libfreetype6-dev \\\n wget \\\n curl \\\n unzip \\\n apache2 \\\n libapache2-mod-php8.2 \\\n php8.2 \\\n php8.2-fpm \\\n php8.2-cli \\\n php8.2-mysql \\\n php8.2-mbstring \\\n php8.2-xml \\\n php8.2-bcmath \\\n php8.2-bz2 \\\n php8.2-gd \\\n php8.2-sqlite3 \\\n php8.2-curl &amp;&amp; \\\n apt clean\n\n# copy phpMyAdmin to container\nCOPY ./phpmyadmin/ /home/phpmyadmin/\n\n# add sh\nCOPY entrypoint.sh /usr/local/bin/\nRUN chmod +x /usr/local/bin/entrypoint.sh\n\n# This makes directory /var/www owned by www-data which is the default user for php-fpm.\nRUN chown -R www-data:www-data /var/www\n\n#RUN mkdir -p /var/www/html/logs &amp;&amp; \\\n# chown -R www-data:www-data /var/www/html/logs &amp;&amp; \\\n# chmod -R 755 /var/www/html/logs\n\n# edit 000-default.conf\nCOPY 000-default.conf /etc/apache2/sites-available/\n\nRUN a2enmod proxy_fcgi setenvif &amp;&amp; \\\n a2enconf php8.2-fpm\n\nEXPOSE 80\nENTRYPOINT [&quot;/usr/local/bin/entrypoint.sh&quot;]\nCMD [&quot;sh&quot;, &quot;-c&quot;, &quot;service php8.2-fpm start &amp;&amp; apache2ctl -D FOREGROUND&quot;]\n</code></pre>\n<p>I don't want to do it manually every time. I don't know how to fix this anymore...</p>\n<pre><code>chown -R www-data:www-data /var/www\nchmod -R 755 /var/www/storage\nsetfacl\n</code></pre>\n"^^ . + "Those were the last changes I made before the page presented that error. It's a static page with information, so I don't really understand where the issue could be!\nI have looked at other Stack Overflow posts regarding similar issues, and I've looked in YT was well, but nothing has been able to fix my problem."^^ . + . + "P.S If you're building a link specifically to put in an email that you send out (rather than having a form on your website), I wouldn't include the email address in the URL _or_ request body _at all_. Look at how big companies do this now...most likely the "unsubscribe" link actually just contains some unique value in the URL parameter - a random GUID perhaps - that does not contain any personal data. The GUID is associated with the actual email address behind the scenes, in the backend database. So when the app receives the request it unsubscribes whatever email it finds linked to that GUID"^^ . + . + . + . + . + . + . + . + . + "How did you define the alias?"^^ . + "0"^^ . + . + "No not getting any errors just icons are not displaying in front end. it seems svg icons code is missing or not formatted properly"^^ . + . + . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + "email-notifications"^^ . + "2"^^ . + "P.S. Why do you care anyway, on the PHP side? You seem to be redirecting people to two different pages depending on what kind of browser you think they used to make the request. Why? This seems like the kind of thing people were doing 10-15 years ago, before websites removed the need for such duplication by using Responsive Design techniques in their HTML and CSS."^^ . + "1"^^ . + . + "1"^^ . + . + . + . + . + . + . + "<p>From <a href="https://woocommerce.com/document/managing-products/virtual-downloadable/" rel="nofollow noreferrer">WooCommerce Docs</a>:</p>\n<blockquote>\n<p>Orders containing only products that are both virtual and downloadable will skip the Processing order status and move directly to the Completed order status.</p>\n</blockquote>\n<p>So if your free product is either virtual or downloadable and if your order doesn't contain any other paid item then the hook <code>woocommerce_order_status_processing</code> will not be fired. <strong>Instead use the hook <code>woocommerce_order_status_completed</code>.</strong></p>\n"^^ . + . + . + . + . + "0"^^ . + . + "1"^^ . + . + "0"^^ . + . + . + "Please provide enough code so others can better understand or reproduce the problem."^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + "Your question isn't very clear. If you're writing a parser, why do you need to know how the encoder works?"^^ . + . + . + "0"^^ . + . + . + . + . + "What is the URL you are requesting? (Both domain/URLs I've tested return a 404?) Is that really your `.htaccess` file? Where is it located? `Alias` and `Directory` directives are not permitted in `.htaccess` and would result in a fatal error on Apache (or _ignored_ on LiteSpeed). You appear to be on a LiteSpeed server, not Apache (where are you getting "Apache" from?)."^^ . + "Explanation of [`(.{4,5})+`](https://regex101.com/r/ZMDzfm/1) vs [`(.{4,5})*`](https://regex101.com/r/LlbInb/1). In short, it's the difference between matching between 1 or more repetition vs 0 or more repetition, see [thread](https://stackoverflow.com/questions/20919403/difference-between-and-in-python-regex)."^^ . + "<p>I am editting email-order-items.php, and I removed the quantity column <em>(because in my case it is always &quot;1&quot; in my case)</em> by commenting the part of code.</p>\n<p>Now my code looks like this now:</p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n/**\n * Email Order Items\n *\n * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-items.php.\n *\n * HOWEVER, on occasion WooCommerce will need to update template files and you\n * (the theme developer) will need to copy the new files to your theme to\n * maintain compatibility. We try to do this as little as possible, but it does\n * happen. When this occurs the version of the template file will be bumped and\n * the readme will list any important changes.\n *\n * @see https://woocommerce.com/document/template-structure/\n * @package WooCommerce\\Templates\\Emails\n * @version 9.7.0\n */\n\nuse Automattic\\WooCommerce\\Utilities\\FeaturesUtil;\n\ndefined( 'ABSPATH' ) || exit;\n\n$margin_side = is_rtl() ? 'left' : 'right';\n\n$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );\n$price_text_align = $email_improvements_enabled ? 'right' : 'left';\n\nforeach ( $items as $item_id =&gt; $item ) :\n $product = $item-&gt;get_product();\n $sku = '';\n $purchase_note = '';\n $image = '';\n\n if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {\n continue;\n }\n\n if ( is_object( $product ) ) {\n $sku = $product-&gt;get_sku();\n $purchase_note = $product-&gt;get_purchase_note();\n $image = $product-&gt;get_image( $image_size );\n }\n\n ?&gt;\n \n &lt;tr class=&quot;&lt;?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?&gt;&quot;&gt;\n &lt;td class=&quot;td font-family text-align-left&quot; style=&quot;vertical-align: middle; word-wrap:break-word;&quot;&gt;\n &lt;?php if ( $email_improvements_enabled ) { ?&gt;\n &lt;table class=&quot;order-item-data&quot;&gt;\n &lt;tr&gt;\n &lt;?php\n // Show title/image etc.\n if ( $show_image ) {\n /**\n * Email Order Item Thumbnail hook.\n *\n * @param string $image The image HTML.\n * @param WC_Order_Item_Product $item The item being displayed.\n * @since 2.1.0\n */\n echo '&lt;td&gt;' . wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) ) . '&lt;/td&gt;';\n }\n ?&gt;\n &lt;td&gt;\n &lt;?php\n /**\n * Order Item Name hook.\n *\n * @param string $item_name The item name HTML.\n * @param WC_Order_Item_Product $item The item being displayed.\n * @since 2.1.0\n */\n echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item-&gt;get_name(), $item, false ) );\n\n // SKU.\n if ( $show_sku &amp;&amp; $sku ) {\n echo wp_kses_post( ' (#' . $sku . ')' );\n }\n\n /**\n * Allow other plugins to add additional product information.\n *\n * @param int $item_id The item ID.\n * @param WC_Order_Item_Product $item The item object.\n * @param WC_Order $order The order object.\n * @param bool $plain_text Whether the email is plain text or not.\n * @since 2.3.0\n */\n do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );\n\n wc_display_item_meta( $item );\n\n /**\n * Allow other plugins to add additional product information.\n *\n * @param int $item_id The item ID.\n * @param WC_Order_Item_Product $item The item object.\n * @param WC_Order $order The order object.\n * @param bool $plain_text Whether the email is plain text or not.\n * @since 2.3.0\n */\n do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );\n\n ?&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;/table&gt;\n &lt;?php\n } else {\n\n // Show title/image etc.\n if ( $show_image ) {\n /**\n * Email Order Item Thumbnail hook.\n *\n * @param string $image The image HTML.\n * @param WC_Order_Item_Product $item The item being displayed.\n * @since 2.1.0\n */\n echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) );\n }\n\n /**\n * Order Item Name hook.\n *\n * @param string $item_name The item name HTML.\n * @param WC_Order_Item_Product $item The item being displayed.\n * @since 2.1.0\n */\n echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item-&gt;get_name(), $item, false ) );\n\n // SKU.\n if ( $show_sku &amp;&amp; $sku ) {\n echo wp_kses_post( ' (#' . $sku . ')' );\n }\n\n /**\n * Allow other plugins to add additional product information.\n *\n * @param int $item_id The item ID.\n * @param WC_Order_Item_Product $item The item object.\n * @param WC_Order $order The order object.\n * @param bool $plain_text Whether the email is plain text or not.\n * @since 2.3.0\n */\n do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );\n\n wc_display_item_meta(\n $item,\n array(\n 'label_before' =&gt; '&lt;strong class=&quot;wc-item-meta-label&quot; style=&quot;float: ' . ( is_rtl() ? 'right' : 'left' ) . '; margin-' . esc_attr( $margin_side ) . ': .25em; clear: both&quot;&gt;',\n )\n );\n\n /**\n * Allow other plugins to add additional product information.\n *\n * @param int $item_id The item ID.\n * @param WC_Order_Item_Product $item The item object.\n * @param WC_Order $order The order object.\n * @param bool $plain_text Whether the email is plain text or not.\n * @since 2.3.0\n */\n do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );\n }\n ?&gt;\n &lt;/td&gt;\n\n&lt;!--\n &lt;td class=&quot;td font-family text-align-&lt;?php echo esc_attr( $price_text_align ); ?&gt;&quot; style=&quot;vertical-align:middle;&quot;&gt;\n &lt;?php\n echo $email_improvements_enabled ? '&amp;times;' : '';\n $qty = $item-&gt;get_quantity();\n $refunded_qty = $order-&gt;get_qty_refunded_for_item( $item_id );\n\n if ( $refunded_qty ) {\n $qty_display = '&lt;del&gt;' . esc_html( $qty ) . '&lt;/del&gt; &lt;ins&gt;' . esc_html( $qty - ( $refunded_qty * -1 ) ) . '&lt;/ins&gt;';\n } else {\n $qty_display = esc_html( $qty );\n }\n echo wp_kses_post( apply_filters( 'woocommerce_email_order_item_quantity', $qty_display, $item ) );\n ?&gt;\n &lt;/td&gt;\n--&gt; \n &lt;td class=&quot;td font-family text-align-&lt;?php echo esc_attr( $price_text_align ); ?&gt;&quot; style=&quot;vertical-align:middle;&quot;&gt;\n &lt;?php echo wp_kses_post( $order-&gt;get_formatted_line_subtotal( $item ) ); ?&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php\n\n if ( $show_purchase_note &amp;&amp; $purchase_note ) {\n ?&gt;\n &lt;tr&gt;\n &lt;td colspan=&quot;3&quot; class=&quot;font-family text-align-left&quot; style=&quot;vertical-align:middle;&quot;&gt;\n &lt;?php\n echo wp_kses_post( wpautop( do_shortcode( $purchase_note ) ) );\n ?&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;?php\n }\n ?&gt;\n\n&lt;?php endforeach; ?&gt;\n</code></pre>\n<p>Here is what I got, where there is still some missing things:</p>\n<p><a href="https://i.sstatic.net/FydSEusV.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/FydSEusV.jpg" alt="Current layout" /></a></p>\n<p>As you can see, the prices column is now using the space of removed quantity column.</p>\n<p>I would like to achieve this layout:</p>\n<p><a href="https://i.sstatic.net/2fnS4ZQM.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2fnS4ZQM.jpg" alt="Desired layout" /></a></p>\n<p>But I don't know yet how to solve the issue.</p>\n"^^ . + . + . + . + . + . + "<p>So what I ended up doing for this case is this. In my <code>FollowController</code>, for the store method I did this:</p>\n<pre class="lang-php prettyprint-override"><code>public function store(StoreFollowRequest $request, User $user) {\n $request-&gt;validated();\n $user = $request-&gt;user();\n $user-&gt;followings()-&gt;attach($request-&gt;follow_id);\n return UserResource::make($user);\n}\n</code></pre>\n"^^ . + . + . + "<p>You can try <strong>flatten()</strong> method on a collection\nyou can give depth level as argument <strong>flatten(2)</strong></p>\n<pre><code>collect($linedata)-&gt;groupBy('id')-&gt;values()-&gt;flatten()-&gt;all();\n</code></pre>\n"^^ . + "0"^^ . + "Hi. Actually I was following up with Brad Traversy’s PHP course, where he said make the “public” folder as the document root from Laragon by simply adding /public to the document root folder in the above mentioned file. And he said these changes can be made through opening the apache server from the taskbar. I tried doing editing this file, and made the required changes, I restarted the apache server from Laragon, but still there is Server error. I hope this sums up the question. I just want to change the document root to Workopia/public from Workopia"^^ . + "0"^^ . + . + . + "checkout"^^ . + "1"^^ . + . + . + . + . + . + . + "look here for the documentation about this class : https://developer.wordpress.org/reference/classes/wp_session_tokens/"^^ . + "0"^^ . + . + . + "0"^^ . + "4"^^ . + . + . + "<p>AFAIK PHP variables' values are in so called <em>ZVALs</em> so perhaps a <em>Zend Value</em> sort of thing.</p>\n<p>It keeps a reference counter and this is also in use for the garbage collection.</p>\n<p>Therefore the entry in the variable table I'd guess will point to a ZVAL structure and not the memory of the value in my non-internal view.</p>\n<p>So <code>$n =&amp; $p</code> is more an alias than a reference, it does not point to memory (as a pointer in C would do AFAIK). So it points to the ZVAL and PHP manages the reference counting there for the garbage collection.</p>\n<p>Now for the objects (class instances), IIRC, the ZVAL has an ID to the actual object. This makes it lightweight to pass around in function and method calls. And it allows to modify objects at a distance, similar to a global variable but without the effect on the global variable table (not inherently always, if you put objects into the global table, this naturally remains).</p>\n"^^ . + . + . + . + . + "I agree, messing with this is probably poking at an implementation detail that is meant to be abstracted away from you. That said, I think that's what `cache_path_callable` is for in the config, although I could be wrong. It appears to be called by [`getCachePath`](https://github.com/thephpleague/glide/blob/62fc5ebd579e013e7573c00d1fb7e083ed395f00/src/Server.php#L380), and if set you'll get the original path and args to make your own decision. I can't tell if something still hashes that, however."^^ . + "0"^^ . + "1"^^ . + . + . + . + . + . + "I believe this will solve your issue,\n<?php\n$pattern = '/\\batlan\\b/i';\n$replacement = 'replacement';\n$subject = 'here should match without "<", ">"<strong>atlan<strong>\nhere should match without "space" Text AtlaN continue\nthis transATLANtic should not match';\n\n$result = preg_replace($pattern, $replacement, $subject);\necho $result;\n?>"^^ . + "1"^^ . + "This is commonly solved with an append only store. So you have the content addressable storage but it is append only. Only that way it makes sense as you can prevent tampering (what you have as a "security issue" here, it is actually what makes relational databases effective database systems. If the data could not be changed, it would not make sense to reference it with _artificial_ keys otherwise)"^^ . + . + "It indeed seems that this _may_ be a configuration problem. But the way you ask makes it hard to find out. Is the filename just wrong? Hard to say, as the file-name is not documented, you just wrote it's a config file. Maybe it is not even deployed? Hard to say, because you don't write how you test. Etc. Suggestion: [edit] in more details by going through from the perspective of a different person not knowing your project and looking for places where things can break. Use your own words, you're the expert for your own code. And: What did you expect? How did you check?"^^ . + . + "0"^^ . + "You should better use the filter hook `woocommerce_registration_errors` like in [those threads](https://stackoverflow.com/search?tab=votes&q=woocommerce_registration_errors&searchOn=3). Now, maybe you could try to add a custom field (hidden by CSS) acting as a honey pot, that should always require having an empty value, this way you could add it in your validation process. Bots should try to fill it, avoiding the registration process to get completed."^^ . + . + "0"^^ . + . + . + . + . + . + . + "How to call vertex ai script from php from a browser url on a linux or Mac server?"^^ . + . + . + "2"^^ . + "0"^^ . + "The real solution would actually be to get https to work on your site properly but this is good to know."^^ . + . + "1"^^ . + . + . + "0"^^ . + . + ""Doesn't work" isn't an error message or a useful problem statement. We can't fix "doesn't work" in code, like a mechanic can't fix a car that "doesn't work" without any other information about the problem. How isn't it working? What [debugging](https://ericlippert.com/2014/03/05/how-to-debug-small-programs/) have you done? What exactly happens when you run this? What did you expect to happen instead? Please provide details of error messages, unexpected behaviour etc. See also [What do you mean "It doesn't work"?](https://meta.stackexchange.com/questions/147616/what-do-you-mean-it-doesnt-work)"^^ . + . + . + . + . + "-1"^^ . + . + . + . + "0"^^ . + . + "try logging `$sitePath . $uri . '/index.php'` and also use `file_exists`. your default should be `$sitePath . '/index.php'`"^^ . + . + . + "**It shouldn't have.** It's already said on the supeglobals page and doesn't have to be repeated on each page. The definition says about its CONTENTS, but not about the visibility of variable itself."^^ . + "2"^^ . + . + . + . + . + . + . + . + "<p>What's wrong with my code? I get <code>ArgumentCountError</code> with message</p>\n<blockquote>\n<p>Too few arguments to function App\\Http\\Controllers\\UserController::add(), 0 passed</p>\n</blockquote>\n<p>Controller's function</p>\n<pre><code>public function add($request){\n $request-&gt;validate([\n 'name' =&gt; 'required|string|max:50',\n 'email' =&gt; 'required|string|email|max:50|unique:tblmember,Email',\n ]);\n $newid = DB::table('tblmember')-&gt;insertGetId([\n 'name' =&gt; $request-&gt;name,\n 'email' =&gt; $request-&gt;email,\n ]);\n return response()-&gt;json(['message' =&gt; 'Member added successfully', 'MemberID' =&gt; $newid], 201);\n}\n</code></pre>\n<p>Route</p>\n<pre><code>Route::post('/users/add', [UserController::class, 'add'])-&gt;name('users.add');\n</code></pre>\n<p>Ajax</p>\n<pre><code>$.ajax({\n url: &quot;/users/add&quot;,\n type: &quot;POST&quot;,\n data: {\n name : name,\n email : email,\n _token : &quot;{{ csrf_token() }}&quot;\n },\n success: function(response) {\n ...\n },\n error: function(xhr) {\n ...\n }\n }\n});\n</code></pre>\n"^^ . + . + "0"^^ . + . + "@ArkadiuszDrabczyk not sure if you saw my latest comment, am unsure of how to set this, via setenv or via configure? I mean I didn't try yet."^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + "I have figured out, that I also can create a array with `define`.\nBut what is the difference to `const`?"^^ . + . + "I'm curious about how to escape from the Staging Ground. **Please update your code block**"^^ . + . + . + . + "-1"^^ . + . + . + "1"^^ . + . + "1"^^ . + "1"^^ . + . + "-2"^^ . + . + . + "Given the [license conditions](https://github.com/Minishlink/web-push-bundle/blob/master/LICENSE) of the library you've mentioned why don't you start by just copying it and using it, since it already does the job you want, rather than trying to completely re-implement it? All you have to do is include the copyright notice with the code if you ever deploy or distribute it. Or as it's open-source, study it and work out what are the important features you specifically need from it, and take only those, or study how it's done enough to be able to write your own version of the same logical process."^^ . + . + "0"^^ . + . + . + "1"^^ . + "**Warning:** You are wide open to [SQL Injections](https://php.net/manual/en/security.database.sql-injection.php) and should use parameterized **prepared statements** instead of manually building your queries. They are provided by [PDO](https://php.net/manual/pdo.prepared-statements.php) or by [MySQLi](https://php.net/manual/mysqli.quickstart.prepared-statements.php). Never trust any kind of input! Even when your queries are executed only by trusted users, [you are still in risk of corrupting your data](http://bobby-tables.com/). [Escaping is not enough!](https://stackoverflow.com/q/32391315)"^^ . + . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + "Laravel Livewire VOLT, I get undefined variable name error"^^ . + . + . + . + . + "drupal-9"^^ . + "2"^^ . + "<p>I am using Dompdf in my Laravel project to generate PDFs, and I want to apply a box shadow effect to an image. However, since Dompdf does not support CSS3, the box-shadow property is not working. I need all possible solutions to add box shadow in the image.\nHere’s my current code:</p>\n<pre><code>&lt;div class=&quot;&quot; style=&quot;width:80% ;margin-left:10%; height:380px; margin-top: 30px;&quot;&gt;\n &lt;img class=&quot;mt-5&quot; src=&quot;{{ public_path('img/' . $packgeupdate-&gt;header_img) }}&quot; width=&quot;90%&quot; height=&quot;90%&quot; alt=&quot;Sample Image&quot; style=&quot;margin-left: 5%; box-shadow: 100px 100px 15px rgba(225, 24, 24,0.5); object-fit: contain;&quot;&gt;\n&lt;/div&gt; \n\npublic function downloadPdf(Request $request, $id)\n {\n\n $packgeupdate = CreatePackage::where('id', $id)-&gt;first();\n $dataDays = dataDays::where('package_id', $packgeupdate-&gt;id)-&gt;get();\n $dataInclusions = dataInclusions::where('package_id', $packgeupdate-&gt;id)-&gt;get();\n $dataExclusions = dataExclusions::where('package_id', $packgeupdate-&gt;id)-&gt;get();\n $dataPaymentPolicys = dataPaymentPolicy::where('package_id', $packgeupdate-&gt;id)-&gt;get();\n $dataHotels = dataHotel::where('package_id', $packgeupdate-&gt;id)-&gt;get();\n $dataPackageCosts = dataPackageCost::where('package_id', $packgeupdate-&gt;id)-&gt;get();\n $dataNotes = dataNote::where('package_id', $packgeupdate-&gt;id)-&gt;get();\n\n $pdf = PDF::loadView('package.download-pdf', compact(\n 'packgeupdate',\n 'dataInclusions',\n 'dataDays',\n 'dataNotes',\n 'dataExclusions',\n 'dataPaymentPolicys',\n 'dataHotels',\n 'dataPackageCosts'\n ))\n // -&gt;setPaper('a4', 'portrait')\n -&gt;setOption('isHtml5ParserEnabled', true)\n -&gt;setOption('isPhpEnabled', true); // Enable PHP if necessary\n\n\n\n // You can choose to download the PDF or save it\n // return $pdf-&gt;download($packgeupdate-&gt;package_name . '.pdf'); // Downloads the PDF\n return $pdf-&gt;stream($packgeupdate-&gt;package_name . '.pdf'); //open in the browser\n //return $pdf-&gt;save(storage_path('app/public/' . $packgeupdate-&gt;package_name . '.pdf')); // Saves to storage (adjust path as needed)\n }\n</code></pre>\n"^^ . + . + . + . + . + "0"^^ . + . + . + "google-search"^^ . + . + "You're asking a design question but we can't see your design. It's impossible to answer this without understanding the full context of how the values are being used."^^ . + . + . + "2"^^ . + "0"^^ . + . + . + "<p>I have this job-container css and job-box and the job-container is the parent .\nwhen i search for the jobs that shows more than 1 it should be displaying like 2 items per row . Instead the first job-box is inside of job-container the rest is outside of job-container .Here is my code and sorry for my poor english</p>\n<pre><code>if (mysqli_num_rows($result) &gt; 0) {\n echo &quot;&lt;div class='job-container'&gt;&quot;;\n while ($row = mysqli_fetch_assoc($result)) {\n echo &quot;&lt;div class='job-box'&gt;&quot;;\n echo &quot; &lt;article class='job-card'&gt;&quot;;\n echo &quot; &lt;div class='job-items'&gt;&quot;;\n echo &quot; &lt;div class='company-logo'&gt;&quot;;\n if (!empty($row['company_logo'])) {\n echo &quot; &lt;img src='../../Employer/User/logos/&quot; . htmlspecialchars($row['company_logo']) . &quot;' alt='&quot; . htmlspecialchars($row['company_name']) . &quot; Logo'&gt;&quot;;\n } else {\n echo &quot; &lt;img src='../assets/img/default-logo.png' alt='Default Logo'&gt;&quot;;\n }\n echo &quot; &lt;/div&gt;&quot;;\n echo &quot; &lt;div class='job-details'&gt;&quot;;\n echo ' &lt;h4 class=&quot;job-title&quot;&gt;';\n echo ' &lt;a href=&quot;#?vacancyID=' . htmlspecialchars($row['job_name']) . '&quot;&gt;' . htmlspecialchars($row['job_name']) . '&lt;/a&gt;';\n echo ' &lt;/h4&gt;';\n echo ' &lt;ul class=&quot;job-info&quot;&gt; ';\n echo ' &lt;li class=&quot;company-name&quot;&gt;'. htmlspecialchars($row['company_name']) .'&lt;/li&gt;';\n echo ' &lt;li class=&quot;location&quot;&gt;&lt;i class=&quot;fas fa-map-marker-alt&quot;&gt;&lt;/i&gt; ' . htmlspecialchars($row['job_location']) . '&lt;/li&gt;';\n echo ' &lt;li class=&quot;salary&quot;&gt;₱' . htmlspecialchars($row['min_salary']) . ' - ₱' . htmlspecialchars($row['max_salary']) . '&lt;/li&gt;';\n echo ' &lt;/ul&gt;';\n echo ' &lt;/div&gt;';\n echo ' &lt;div class=&quot;items-link items-link2 f-right&quot;&gt;';\n echo ' &lt;a href=&quot;job_details.html&quot; class=&quot;job-type&quot;&gt;' . htmlspecialchars($row['job_type']) . '&lt;/a&gt;';\n echo ' &lt;/div&gt;';\n echo &quot; &lt;/div&gt;&quot;;\n echo &quot; &lt;/div&gt;&quot;;\n echo &quot; &lt;/article&gt;&quot;;\n echo &quot;&lt;/div&gt;&quot;;\n }\n echo &quot;&lt;/div&gt;&quot;;\n} else {\n echo &quot;&lt;p&gt;No job listings found matching your criteria.&lt;/p&gt;&quot;;\n}\nmysqli_stmt_close($stmt);\n</code></pre>\n<p>And this is my Css</p>\n<pre><code>.job-container {\n display: grid;\n grid-template-columns: repeat(2, 1fr); \n gap: 20px; \n padding: 20px;\n max-width: 100%; \n margin: auto; \n}\n\n.job-box {\n background: #fdf5ec; \n border-radius: 8px; \n padding: 15px; \n border: 1px solid #e4d6c9; \n box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.08); \n transition: 0.3s;\n width: 100%; \n}\n</code></pre>\n"^^ . + "You need to use event delegation in the JS. When the page loads you're binding event listeners to the modals etc that already exist at that moment, but that doesn't cover the ones which get loaded later by the fetch() request. They didn't get event listeners bound to them because they didn't exist in the page at that time"^^ . + "From a quick glance, _base_path()_ looks wrong as it resolves to the application directory but in your _env('FIREBASE_CREDENTIALS')_ you already have an absolute path to the system. Compare https://laravel.com/docs/11.x/helpers#method-base-path"^^ . + . + "0"^^ . + . + . + . + . + . + "As I understand it, the point of the question is to find an efficient method."^^ . + . + "file-upload"^^ . + . + "2"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "How to run the php inside an XML file?"^^ . + "1"^^ . + "<p><strong>Laravel waits until all transactions are finished before it triggers any observer events.</strong> This means if you update a model several times within nested transactions, only the last update’s change will trigger the observer.</p>\n<p><strong>To fix this</strong> -&gt; Separate the transactions so that each update commits independently</p>\n<pre><code> public function approve(User $user, array $data)\n {\n if ($data['approve_by_admin'] == 1) {\n $this-&gt;updateAdminStatus($user);\n }\n\n DB::transaction(function () use ($user) {\n $user-&gt;update(['approved' =&gt; 1]); \n });\n }\n</code></pre>\n<hr />\n<p>And there are few issues/typos:</p>\n<ol>\n<li><p>Class name should be <code>ServiceA</code> not <code>Service A</code></p>\n</li>\n<li><p>Wrap the whole data in a single array</p>\n<pre><code> $user-&gt;update(['approved' =&gt; 1]); # not $user-&gt;update(['approved'] =&gt; 1);\n $user-&gt;update(['status' =&gt; 5]); # not $user-&gt;update(['status'] =&gt; 5);\n</code></pre>\n</li>\n<li><p>in <code>updateAdminStatus($user){</code> your're passing one param <code>$this-&gt;updateAdminStatus($user);</code>, why this has two <code>use ($user, $data) {</code></p>\n<pre><code> public function updateAdminStatus(User $user)\n {\n DB::transaction(function () use ($user) {\n $user-&gt;update(['status' =&gt; 5]); \n });\n }\n</code></pre>\n</li>\n</ol>\n<blockquote>\n<p>FYI: <a href="https://medium.com/@andipyk/observers-in-laravel-11-08743b3ac74c" rel="nofollow noreferrer">Model Observer</a> is kinda different what you have tried here. In short its like event-listener. <a href="https://laravel.com/docs/11.x/eloquent#observers" rel="nofollow noreferrer">Official doc</a></p>\n</blockquote>\n"^^ . + . + . + . + . + . + "1"^^ . + "<p>I am trying to create a function when the customer adds a product (variation) in the cart, to add another specific product automatically with the same qty.</p>\n<p>$check_id : the ID of variation</p>\n<p>$add_product : product to add if customers select the variation</p>\n<p>$quantity : the quantity of the variation selected</p>\n<p>This function working, but only with the product ID and the quantity not working</p>\n<pre><code>function add_palet_to_cart( $item_key, $product){\n\n $items = WC()-&gt;cart-&gt;get_cart();\n $check_id=1134;\n $add_product=1135;\n $quantity=$items['quantity'];\n\n \n if($product===$check_id){ \n WC()-&gt;cart-&gt;add_to_cart( $add_product,$quantity );\n } \n}\n\nadd_action( 'woocommerce_add_to_cart', 'add_palet_to_cart', 10, 2 );\n</code></pre>\n<p>Thanks in advance for your help</p>\n"^^ . + . + . + . + "1"^^ . + "@AFerns100 if you use this technique then you don't really need POST as well - the email ID is meaningless to others so it doesn't need protecting in the same way"^^ . + "1"^^ . + "1"^^ . + . + "<p>I'm trying to learn Laravel.</p>\n<p>I pushed my project to GitHub so you can check all the code you need:\n<a href="https://github.com/wolfpain/fibobet/tree/master" rel="nofollow noreferrer">https://github.com/wolfpain/fibobet/tree/master</a></p>\n<p>I'm working on a controller function but I don't understand how to call that method in another method of the same controller.</p>\n<p>Here are my two methods:</p>\n<pre><code>/**\n * Count last extraction\n */\npublic function count($column)\n{\n $lastNumber = Number::all()-&gt;orderBy('created_at', 'DESC')-&gt;first();\n $lastColumn = Number::find()-&gt;where('column', $column)-&gt;take(1);\n $count = $lastNumber - $lastColumn;\n return $count;\n}\n\n/**\n * Display a listing of the resource.\n */\npublic function index()\n{\n $count = count(1);\n //\n $numbers = Number::all();\n\n return view('index', ['numbers' =&gt; $numbers, 'count' =&gt; $count]);\n}\n</code></pre>\n<p>I need to call function count() inside the index() function and send the $count variable to the index view.</p>\n<p>I try to call the function like:</p>\n<pre><code> count(1);\n</code></pre>\n<p>but nothing happened. I try:</p>\n<pre><code>NumberCOntroller::class-&gt;count(1); \n</code></pre>\n<p>too but the result is the same.</p>\n<p>How can I call the count() function?</p>\n<p>If I add:</p>\n<pre><code>return view('index', ['numbers' =&gt; $numbers, 'count' =&gt; $count]);\n</code></pre>\n<p>At the view I get this error:</p>\n<pre><code>Undefined variable $count\n</code></pre>\n<p>This is the code of the view show the $count variable:</p>\n<pre><code> {{-- MOSTRA PUNTATA --}}\n &lt;div class=&quot;row text-center&quot;&gt;\n @if ($count)\n &lt;div class=&quot;col border border-2 border-dark p-5 mb-5&quot;&gt;\n &lt;p&gt;{{ $count }}&lt;/p&gt;\n &lt;/div&gt;\n @endif\n &lt;/div&gt;\n</code></pre>\n"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + "How about using native SQL for bulk imports? `getConnection()` `prepare()` `execute()`"^^ . + . + "*"I have changed input from XML to JSON"* Why on earth did you do that? Do you understand what you're doing?"^^ . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + "What is your understanding what "baseOptions:" means?"^^ . + "install.packages"^^ . + "0"^^ . + . + "dovecot"^^ . + . + . + . + . + . + "Can multiple routes access the same initialized object in laravel?"^^ . + . + "0"^^ . + . + "How to change the generated directory and filename of cache file in Symfony Glide"^^ . + . + "0"^^ . + "-1"^^ . + "0"^^ . + . + . + . + "<p>You can just add a newline to the <code>$msg</code> as it comes in. This will write the newline to the text file along with the text, meaning that the next thing you append to the text file when you submit the form again will start on the next line. The cross-platform way to do this is using the <a href="https://www.php.net/manual/en/reserved.constants.php#constant.php-eol" rel="nofollow noreferrer"><code>PHP_EOL</code> constant</a>.</p>\n<p>If you want to add some stars or similar as you mentioned in your question too, then they can also be appended very easily:</p>\n<pre><code>$msg = (isset($_POST['msg']) ? $_POST['msg'].PHP_EOL.&quot;*************&quot;.PHP_EOL : null); \n</code></pre>\n<hr />\n<p>As mentioned in the comments though, this data is unstructured and it will be comparatively hard to retrieve it in the portions it was originally entered in (although the ************* lines will help). If you think you'll ever need to do that, consider storing this in a different way - such as in a simple database table, or still in a file but in a more structured format such as JSON or XML.</p>\n"^^ . + "1"^^ . + . + . + . + . + "Btw I also describe whole problem on the Prestashop's github --> https://github.com/PrestaShop/PrestaShop/discussions/38302"^^ . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + "Are you using a old laravel project? To solve that one, use the following command. `php artisan session:table`, and the `sessions` table will be generated, then you can run `php artisan migrate` to make the table. You can now work with `SESSION_DRIVER=database` configuration.\n\nAlso, if it's not too much hassle, kindly accept the answer, thanks."^^ . + . + . + . + . + "<p>I am trying to use this library to convert HEIC files to JPG in a Codeigniter 4 controller.</p>\n<p><a href="https://github.com/MaestroError/php-heic-to-jpg" rel="nofollow noreferrer">https://github.com/MaestroError/php-heic-to-jpg</a></p>\n<p>I have the initial .heic file on my server with 777 permissions, and the parent folder is 777 as well.</p>\n<pre><code>HeicToJpg::convert('/var/www/vhosts/mydomain.com/httpdocs/public/assets/image1.heic')-&gt;saveAs(&quot;/var/www/vhosts/mydomain.com/httpdocs/public/assets/image1.jpg&quot;);\n</code></pre>\n<p>I am getting this error and i don't understand it:</p>\n<pre><code>CRITICAL - 2025-03-17 05:59:37 --&gt; RuntimeException: Couldn't convert HEIC to JPG: 'sh: 1: \n/var/www/vhosts/mydomain.com/httpdocs/app/ThirdParty/HeicToJpg/src/../bin/php-heic-to-jpg-linux-arm64: Permission denied' | \nBin used: 'php-heic-to-jpg-linux-arm64' HEIC: '/var/www/vhosts/mydomain.com/httpdocs/public/assets/image1.heic' Full Command: \n'/var/www/vhosts/mydomain.com/httpdocs/app/ThirdParty/HeicToJpg/src/../bin/php-heic-to-jpg-linux-arm64 \n&quot;/var/www/vhosts/mydomain.com/httpdocs/public/assets/image1.heic&quot; &quot;/var/www/vhosts/mydomain.com/httpdocs/public/assets/image1.heic-210237024767d8009993f0b5.70324900&quot; 2&gt;&amp;1' \n\nOutput from heif-converter-image exe: \n\nin APPPATH/ThirdParty/HeicToJpg/src/HeicToJpg.php on line 175.\n 1 APPPATH/ThirdParty/HeicToJpg/src/HeicToJpg.php(49): Maestroerror\\HeicToJpg-&gt;processImage()\n 2 APPPATH/ThirdParty/HeicToJpg/src/HeicToJpg.php(278): Maestroerror\\HeicToJpg-&gt;convertImage()\n 3 APPPATH/Controllers/Checklist.php(325): Maestroerror\\HeicToJpg::convert()\n 4 SYSTEMPATH/CodeIgniter.php(943): App\\Controllers\\Checklist-&gt;upload_image()\n 5 SYSTEMPATH/CodeIgniter.php(503): CodeIgniter\\CodeIgniter-&gt;runController()\n 6 SYSTEMPATH/CodeIgniter.php(361): CodeIgniter\\CodeIgniter-&gt;handleRequest()\n 7 FCPATH/index.php(79): CodeIgniter\\CodeIgniter-&gt;run()\n</code></pre>\n"^^ . + . + . + "0"^^ . + . + . + . + . + . + "2"^^ . + "0"^^ . + "I appreciate this response. I wasn't trying to be contradictive. I don't need to decrypt the password, currently that is what the function does, to verify it is valid. For both register and login and change password, they use mcrypt. Your solution is similar to what I figured would need to happen. Thank you very much."^^ . + "Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer)."^^ . + . + . + "1"^^ . + . + "-1"^^ . + . + . + . + . + "As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer)."^^ . + "<p>OK. <strong>Solved</strong>. I found that since PHP 8.4 <a href="https://php.watch/versions/8.4/imap-unbundled" rel="nofollow noreferrer"><strong>the IMAP extension is no longer part of PHP Core, and has moved to PECL</strong></a>.</p>\n<p>So the solution to install IMAP package <strong>for PHP since 8.4 version</strong> from Dockerfile is:</p>\n<pre><code>RUN pecl install imap &amp;&amp; \\\n docker-php-ext-enable imap\n</code></pre>\n<p>Also <strong>if you do not use docker</strong> but just a native SSH commands on a Debian/Ubuntu. You should use these commands:</p>\n<pre><code>sudo apt-get install libc-client-dev libkrb5-dev\n\n# may be on some systems you need this\nsudo ln -s /usr/lib/x86_64-linux-gnu/libkrb5.so /usr/lib/\nsudo ln -s /usr/lib/x86_64-linux-gnu/libc-client.so /usr/lib/\n\npecl install imap\necho &quot;extension=imap.so&quot; | sudo tee -a /etc/php/8.4/cli/php.ini\necho &quot;extension=imap.so&quot; | sudo tee -a /etc/php/8.4/fpm/php.ini\nsudo systemctl restart php8.4-fpm\n\n# check imap is installed\nphp -m | grep imap\n</code></pre>\n<p><em>Hope that helps!</em></p>\n"^^ . + . + . + "0"^^ . + . + . + . + "<p>I have used php str_replace() function to replace the iframe with embed tag but still it is getting stripped by wordpress.</p>\n<h1>**This is the function I have created to replace iframe to embed tag **</h1>\n<pre><code> function convertIframeToEmbed($html) {\n // Match &lt;iframe&gt; tags and extract their attributes\n $pattern = '/&lt;iframe\\b([^&gt;]*)\\bsrc=[&quot;\\']([^&quot;\\']+)[&quot;\\']([^&gt;]*)&gt;&lt;\\/iframe&gt;/i';\n\n // Convert iframe to embed with the same attributes\n $replacement = '&lt;embed$1 src=&quot;$2&quot;$3&gt;';\n\n return preg_replace($pattern, $replacement, $html);\n }\n</code></pre>\n<h1><strong>This is the data I fetch from the API endpoint</strong></h1>\n<pre><code> [0] =&gt; stdClass Object\n (\n [id] =&gt; 0\n [articleshortcode] =&gt; [testing cat=&quot; News&quot; month=&quot;Feb&quot; year=&quot;2025&quot;]\n [category] =&gt; Tax and Financial News\n [title] =&gt; 2025 U.S. Tax Legislation Forecast: What to Expect\n [display_date] =&gt; February, 2025\n [index_date] =&gt; 2025-02-01 00:00:00\n [meta_description] =&gt; 2025 U.S. Tax Legislation Forecast\n [meta_keywords] =&gt; 2025 U.S. Tax Legislation Forecast\n \n [article_body] =&gt; &lt;div style=&quot;padding: 56.25% 0 0 0; position: relative;&quot;&gt;\n &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%;&quot; \n title=&quot;2025 U.S. Tax Legislation Forecast Key Changes Ahead&quot; frameborder=&quot;0&quot; \n height=&quot;150&quot; src=&quot;https://player.vimeo.com/video/10516145623? badge=0&amp;amp;autopause=0&amp;amp;player_id=0&amp;amp;app_id=58479&quot; \n width=&quot;300&quot;&gt;&lt;/iframe&gt;&lt;/div&gt; \n [version] =&gt; 5\n)\n</code></pre>\n<h1><strong>This is the wordpress provided function that I am using to allow user to add iframe tag in the content</strong></h1>\n<pre><code> function allow_iframes_in_wp($allowed_html, $context) {\n if ($context === 'post') {\n $allowed_html['iframe'] = array(\n 'src' =&gt; true,\n 'width' =&gt; true,\n 'height' =&gt; true,\n 'frameborder' =&gt; true,\n 'allowfullscreen' =&gt; true,\n );\n }\n return $allowed_html;\n }\n\n add_filter('wp_kses_allowed_html', 'allow_iframes_in_wp', PHP_INT_MAX, 2);\n</code></pre>\n<p>wordpress version: 6.7.2\nphp version :7.4.33</p>\n"^^ . + . + . + . + . + . + . + . + "<p>I have observed the use of native PHP functions twice after updating to PHP 8.2:</p>\n<p><a href="https://i.sstatic.net/c0f8e3gY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/c0f8e3gY.png" alt="screen from xhproff" /></a></p>\n<p>I'm using xhproff. Columns: Name Calls Calls%</p>\n<p>I don't know what is function with '@1', but the number of function calls in my project has increased a lot.</p>\n<p>Is it possible to disable the functions from '@1'?\nMaybe someone knows what they are and why they appeared?</p>\n<p>I am 100% sure that they were not there before the php update.</p>\n"^^ . + . + . + . + "@ADyson: None. I am just trying to make an API work. I tried several methods none succeeded so far."^^ . + "1"^^ . + . + . + "1"^^ . + . + "0"^^ . + . + "2"^^ . + "0"^^ . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + . + "3"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + "I was able to get it to work with this variation of your pattern...\n\n$pattern="/(?<=[^a-z])(?=[a-z])|(?<=[A-Z])(?=[^A-Z])/iu";\n\ntook out "/h""^^ . + . + "1"^^ . + . + "@Olivier hmm, good question, maybe it was just not recommended to use? by everyone"^^ . + "0"^^ . + "1"^^ . + . + . + . + "security"^^ . + "1"^^ . + "0"^^ . + . + "@NicoHaase Both the sites are using V3"^^ . + . + . + . + . + . + . + "0"^^ . + "<p>I am using the PHP library <a href="https://github.com/sabre-io/dav" rel="nofollow noreferrer">sabre/dav</a> and try to create a very basic list of folders and files based on a Nextcloud I own. The following loop is successfully looping through my files, but I can’t understand how to create links to them so I can download or open it.</p>\n<p>Edit: the following code will list my files and create links like: <code>https://mynextcloud.com/remote.php/dav/files/SHARED-MEDIA/sound.mp3</code>, if I click on those, a JSON viewer shows in the browser, with the message <code>error: &quot;Strict Cookie has not been found in request&quot;</code>.\nI have no idea what the download URL should look like.</p>\n<p>Any help would be very welcome!</p>\n<pre><code>$settings = array(\n 'baseUri' =&gt; 'https://mynextcloud.com/remote.php/dav',\n 'userName' =&gt; '*********',\n 'password' =&gt; ''*********'\n);\n\n$client = new Sabre\\DAV\\Client($settings);\n\n$directory = 'files/SHARED-MEDIA';\ntry {\n $result = $client-&gt;propFind($directory, [\n '{DAV:}displayname',\n '{DAV:}getlastmodified',\n ], 1);\n echo &quot;&lt;ul&gt;&quot;; // Start an unordered list\n foreach ($result as $file) {\n $name = $file['{DAV:}displayname'];\n $url = $settings['baseUri'] . &quot;/&quot; . $directory . &quot;/&quot; . urlencode($name); \n echo &quot;&lt;li&gt;$name &lt;a href='$url'&gt;Download&lt;/a&gt;&quot;;\n if (str_contains($name, '.mp3')) {\n echo &quot; &lt;audio controls&gt;&lt;source src='$url' type='audio/mpeg'&gt;&lt;/audio&gt;&quot;; \n }\n echo &quot;&lt;/li&gt;&quot;;\n }\n echo &quot;&lt;/ul&gt;&quot;;\n} catch (Exception $e) {\n echo 'Error: ' . $e-&gt;getMessage();\n}\n</code></pre>\n"^^ . + "0"^^ . + . + "That might be because COOKIE isn't available until the next request. I can't recall off the top of my head if it sets the $_COOKIE global when a session is set or a cookie is set with $f3->set('COOKIE.sent')......maybe it's in the code somewhere."^^ . + . + . + "0"^^ . + . + . + . + "3"^^ . + "1"^^ . + "2"^^ . + . + . + "2"^^ . + . + . + . + "1"^^ . + "<p>It can only return the <code>false</code> value, but the value itself still belongs to the <code>bool</code> type.</p>\n<blockquote>\n<p>Singleton types are those which <strong>allow only one <em>value</em></strong>.</p>\n</blockquote>\n<ul>\n<li><a href="https://www.php.net/manual/en/language.types.singleton.php" rel="nofollow noreferrer">Singleton types</a></li>\n</ul>\n<p>So the <code>false</code> singleton type only accepts the result <code>bool(false)</code>, while for the <code>true</code> singleton type, the expected return value will only be <code>bool(true)</code>. This is especially useful when we want to tighten a inherited function that already returns a <code>bool</code> result.</p>\n"^^ . + . + "0"^^ . + . + . + . + "<p>I have followed the following documentation - <a href="https://opentelemetry.io/docs/zero-code/php/" rel="nofollow noreferrer">https://opentelemetry.io/docs/zero-code/php/</a> to send logs/traces/metrics to Grafana using opentelemetry-collector from a php application and verified the changes. I have also checked the connectivity of the php-application and otel-collector by sending sample trace/log, which showed partialSuccess{} on sending successfully and can see the sample trace/log in Grafana as well which verifies the connectivity. But it is not able to show the actual logs/traces/metrics.</p>\n<p>I am sure that the otel-collector config added is correct because we are able to see the data from a java application which was configured from - <a href="https://opentelemetry.io/docs/languages/java/getting-started/" rel="nofollow noreferrer">https://opentelemetry.io/docs/languages/java/getting-started/</a></p>\n<p>From the above zero-code/php/ configuration, we have installed the packages from Linux/PECL in our base docker image as per the documentation and installed SDKs in the main image using this base image and have added the Environment configuration in OKD deployment of the php-application as part of env, shown as below -</p>\n<pre><code>env:\n - name: IMAGE\n value: &gt;-\n &lt;image&gt;\n - name: OTEL_PHP_AUTOLOAD_ENABLED\n value: 'true'\n - name: OTEL_SERVICE_NAME\n value: php-application\n - name: OTEL_TRACES_EXPORTER\n value: otlp\n - name: OTEL_METRICS_EXPORTER\n value: otlp\n - name: OTEL_LOGS_EXPORTER\n value: otlp\n - name: OTEL_EXPORTER_OTLP_PROTOCOL\n value: http/protobuf\n - name: OTEL_EXPORTER_OTLP_ENDPOINT\n value: '&lt;otel-collector-service-url&gt;:4318'\n - name: OTEL_PROPAGATORS\n value: 'baggage,tracecontext'\n</code></pre>\n<p>Also, seeing this weird warning in the pod of the php deployment\n<code>$ php -m | grep opentelemetry PHP Warning: Module &quot;opentelemetry&quot; is already loaded in Unknown on line 0 opentelemetry</code></p>\n<p>Can someone point out if anything that is done is wrong or any config changes required in the app side?</p>\n"^^ . + "<p><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403" rel="nofollow noreferrer">HTTP Status 403</a> is a response from the server stating that the client has insufficient permissions to access the resources found at the url. You should check your <code>/var/log/apache2/error.log</code> to see the cause of the error.</p>\n<p>As for the file permissions, double check that the directory you are serving from has group read permission for www-data.</p>\n<p>The fact that you are receiving this response means your setup is working, it just has wrong settings. Post what you find in the logs so we can help you more.</p>\n"^^ . + "0"^^ . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + "1"^^ . + . + "<p>I have the following code and it is not working, I just get string(0) &quot;&quot;\nThis code is a copy of a DeepL curl script that creates a glossary which works perfect, I just changed the url and options in DATA. I'm also not getting any errors if I change the auth. code.</p>\n<pre><code>&lt;?php\n$text = 'Hi there';\n$source_lang = &quot;en&quot;;\n$target_lang = &quot;de&quot;;\n$glossary_id = &quot;&quot;;\n$tag_handling = &quot;xml&quot;;\n$ignore_tags = &quot;x&quot;;\n$formality = &quot;&quot;;\n$url = &quot;https://api.deepl.com/v2/translate&quot;;\n$authKey = &quot;hidden&quot;;\n\n$curl = curl_init($url);\ncurl_setopt($curl, CURLOPT_URL, $url);\ncurl_setopt($curl, CURLOPT_POST, true);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n$headers = array(\n &quot;Authorization: DeepL-Auth-Key .$authKey&quot;,\n &quot;Content-Type: application/json&quot;,\n);\ncurl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\n$data = &lt;&lt;&lt;DATA\ntext=$text&amp;source_lang=$source_lang&amp;target_lang=$target_lang&amp;tag_handling=$tag_handling&amp;ignore_tags=$ignore_tags&amp;formality=$formality&amp;glossary=$glossary_id\nDATA;\n\ncurl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n//for debug only!\ncurl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);\ncurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n$resp = curl_exec($curl);\n\n// Check for errors and display the error message\nif($errno = curl_errno($curl)) {\n $error_message = curl_strerror($errno);\n echo &quot;cURL error ({$errno}):\\n {$error_message}&quot;;\n}\n\ncurl_close($curl);\nvar_dump($resp);\n?&gt;\n</code></pre>\n<p>I'm not getting any errors.</p>\n"^^ . + "2"^^ . + "You should include Node.js in your tags and might want to drop nginx. Have you tried SSHing to an example machine and running the BASH script directly there? Have you tried pushing the script out as a file and calling the script file from Node.js instead of the method that you're using (which is not clear). Try to reduce the script to the simplest thing that does not work. As is, you're leaving out context, so we can't run your script to see what it would do for us. You're getting an error about awk but don't call awk in your snippet."^^ . + . + . + . + . + . + . + "Convert roman to arabic numbers"^^ . + "@user25669822 It is impossible that you're using v4. It's clearly evident from your configuration file that you're using v3. See more here: https://stackoverflow.com/a/79520989/15167500"^^ . + . + "1"^^ . + . + . + . + "<h3>About aria-hidden</h3>\n<p>Attribute aria-hidden hides the element from the accessibilitiy tree and it dominates everything else, so normally the element isn't supposed to be read or found at all by the screen reader.\nHowever, the button is still focusable with tab, and the screen reader has normally to find something to read when reaching the button.</p>\n<p>At the end, you have a contradiction: the button shouldn't be read because of aria-hidden, but something still have to be read when the button takes the focus (otherwise the user don't know what he/she has just landed on).\nMost screen readers decide to read the value or the label despite it being hidden, but since it's a contradiction, they can choose to do whatever they want. That's an undefined behavior, not specified anywhere officially in the standard, and won't be ever specified since you aren't supposed to do it.</p>\n<p>Note that your button can be correctly reached with tab, but will be ignored when navigating by other means, for example by arrow keys, or from button to button, or when listing all available buttons on the page.\nThat's an extremely confusing behavior to be avoided at all cost.</p>\n<p><strong>Never make a focusable element aria-hidden</strong></p>\n<h3>About replacement text</h3>\n<p>It's usually not a very good idea to replace a text label by another text label. Blind people won't find it problematic, but there are other kind of screen reader users.</p>\n<p>For example, those who have dyslexia, or some remaining sight, will be very happy to read &quot;A&quot; with their eyes while the screen reader would read &quot;B&quot;.</p>\n<p>Those who are using voice control will also be very happy to read &quot;A&quot; visually, say &quot;Press A&quot; to activate the button and notice that it doesn't work, because the label is &quot;B&quot; and you have in fact to say &quot;Press B&quot; to make it work.\nSince &quot;B&quot; isn't displayed anywhere visually, it's impossible to guess it, unless you are also a screen reader user.</p>\n<p>Many voice control softwares indeed base their commands on the label, and not the text actually displayed on screen. This is the correct thing to do, and it allows button icons to call them by their text label when the label is correctly specified.</p>\n<p>It's also not totally clear whether braille displays should display the label, or visible text. Most will take the label. Same confusing question if we imagine devices able to transcript text into sign language, or another form of expression... in any case you will confuse anyone able to read both at the same time.</p>\n<p><strong>Replacement text or label is meant to replace an image, an icon, or any non-text element by some readable, operable, accessible text</strong>,\nnot to replace some accessible text by another text.</p>\n<h3>Back to your input case</h3>\n<p>Please remove aria-hidden on your button, you should have understood by now that it's just bad and non-sense here.</p>\n<p>I imagine you wanted to do this:</p>\n<pre><code>&lt;button&gt;\n &lt;span class=&quot;visually-hidden&quot;&gt;Screen reader text&lt;/span&gt;\n &lt;span aria-hidden=&quot;true&quot;&gt;Visible content on screen&lt;/span&gt;\n&lt;/button&gt;\n</code></pre>\n<p>Or this:</p>\n<pre><code>&lt;button aria-label=&quot;Screen reader text&quot;&gt;Visible content on screen&lt;/button&gt;\n</code></pre>\n<p>Which you can also do with <code>&lt;input&gt;</code> as follows :</p>\n<pre><code>&lt;input type=&quot;submit&quot; aria-label=&quot;Screen reader text&quot; value=&quot;Visible content on screen&quot;/&gt;\n</code></pre>\n<p>However, given what I explained above, you now know that it's a bad idea as well.</p>\n<p>If the &quot;visible content on screen&quot; is an image, then yes, sure, add some label ! That's very good ! Otherwise it won't be accessible. But if it's already text, don't replace it by another text.</p>\n<p>Otherwise said,</p>\n<pre><code>&lt;input type=&quot;image&quot; src=&quot;...&quot; alt=&quot;Label&quot;/&gt;\n</code></pre>\n<p>Makes perfect sense, it's very good ! Note that alt is preferable to aria-label in this case, per the first rule of ARIA (don't use it unless you really need to).</p>\n<p>But the following is a bad idea as explained above:</p>\n<pre><code>&lt;input type=&quot;submit&quot; aria-label=&quot;Screen reader text&quot; value=&quot;Visible content on screen&quot;/&gt;\n</code></pre>\n<p>IF you want to have richer content than a simple text or a simple image with its alt text, you can't do it with <code>&lt;input&gt;</code>.\n<code>&lt;button&gt;</code> have been precisely made for that.</p>\n"^^ . + "0"^^ . + . + "Thank You but does not work"^^ . + . + "It returns ~/.config/herd-lite/bin/php"^^ . + . + "<p>I am trying to implement xero account software in my php project. I have to create an invoice with an attachment. I am using xero api for this. Initial authentication is working well. Means if I authenticate first time then it generates all the tokens and those tokens are being saved into the table.\nBelow is the code for authenticate: <strong>xero_callback.php is:</strong>\nThis is working fine.</p>\n<pre><code> &lt;?php\nsession_start();\nrequire 'db.php'; // Include database connection file\n\ndefine('CLIENT_ID', 'xxxxx');\ndefine('CLIENT_SECRET', 'xxxxx');\ndefine('REDIRECT_URI', 'http://localhost/xero_testing/xero_callback.php');\n\nif (!isset($_GET['code'])) {\n die(&quot;No authorization code received.&quot;);\n}\n\n$code = $_GET['code'];\n\n$tokenUrl = &quot;https://identity.xero.com/connect/token&quot;;\n\n$data = [\n &quot;grant_type&quot; =&gt; &quot;authorization_code&quot;,\n &quot;code&quot; =&gt; $code,\n &quot;redirect_uri&quot; =&gt; REDIRECT_URI,\n &quot;client_id&quot; =&gt; CLIENT_ID,\n &quot;client_secret&quot; =&gt; CLIENT_SECRET\n];\n\n$ch = curl_init($tokenUrl);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POST, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [&quot;Content-Type: application/x-www-form-urlencoded&quot;]);\n\n$response = curl_exec($ch);\ncurl_close($ch);\n\n$result = json_decode($response, true);\n\nif (!isset($result[&quot;access_token&quot;])) {\n die(&quot;Failed to get access token.&quot;);\n}\n\n$accessToken = $result[&quot;access_token&quot;];\n$refreshToken = $result[&quot;refresh_token&quot;];\n$expiresIn = $result[&quot;expires_in&quot;];\n\n// Get Tenant ID\n$ch = curl_init(&quot;https://api.xero.com/connections&quot;);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n &quot;Authorization: Bearer $accessToken&quot;,\n &quot;Content-Type: application/json&quot;\n]);\n\n$tenantResponse = curl_exec($ch);\ncurl_close($ch);\n\n$tenantData = json_decode($tenantResponse, true);\n$tenantId = $tenantData[0][&quot;tenantId&quot;] ?? null;\n\nif (!$tenantId) {\n die(&quot;Failed to retrieve Tenant ID.&quot;);\n}\n\n// Store in Database\n$db-&gt;query(&quot;INSERT INTO xero_tokens (tenant_id, access_token, refresh_token, expires_in) \n VALUES ('$tenantId', '$accessToken', '$refreshToken', '$expiresIn')&quot;);\n\necho &quot;Successfully connected to Xero! Tenant ID: $tenantId&quot;;\n?&gt;\n</code></pre>\n<p>Now below is the code to create invoice and update access token when it expires. After authenticating first time everything is working. But when access token gets expired after 30 mins and then if I regenerate the access token using the refresh token then it gives error: below is the code for <strong>create invoice</strong>:</p>\n<pre><code> &lt;?php\nrequire 'db.php';\n$result = $db-&gt;query(&quot;SELECT * FROM xero_tokens ORDER BY created_at DESC LIMIT 1&quot;);\n$xero = $result-&gt;fetch_assoc();\n$accessToken = $xero['access_token'];\n$tenantId = $xero['tenant_id'];\n$refreshToken = $xero['refresh_token'];\n$record_id = $xero['id'];\n$contactID = getContactID('John Doe', $accessToken, $tenantId);\n\n$invoiceData = [\n &quot;Type&quot; =&gt; &quot;ACCREC&quot;,\n &quot;Contact&quot; =&gt; [&quot;ContactID&quot; =&gt; $contactID],\n &quot;LineItems&quot; =&gt; [[\n &quot;Description&quot; =&gt; &quot;Consulting Service&quot;,\n &quot;Quantity&quot; =&gt; 1,\n &quot;UnitAmount&quot; =&gt; 200.00,\n &quot;AccountCode&quot; =&gt; &quot;200&quot;\n ]],\n &quot;Date&quot; =&gt; date(&quot;Y-m-d&quot;),\n &quot;DueDate&quot; =&gt; date(&quot;Y-m-d&quot;, strtotime(&quot;+30 days&quot;)),\n &quot;InvoiceNumber&quot; =&gt; &quot;INV-&quot; . time()\n];\n\n$headers = [\n &quot;Authorization: Bearer $accessToken&quot;,\n &quot;Xero-tenant-id: $tenantId&quot;,\n &quot;Content-Type: application/json&quot;,\n &quot;Accept: application/json&quot;,\n];\n\n$ch = curl_init(&quot;https://api.xero.com/api.xro/2.0/Invoices&quot;);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POST, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($invoiceData));\ncurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n$response = curl_exec($ch);\n$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\nif ($httpCode == 401 || $httpCode == 403) { \n refreshAccessToken($refreshToken, $record_id);\n\n // Fetch the latest access token from DB after refreshing\n $result = $db-&gt;query(&quot;SELECT * FROM xero_tokens ORDER BY created_at DESC LIMIT 1&quot;);\n $xero = $result-&gt;fetch_assoc();\n $accessToken = $xero['access_token'];\n $tenantId = $xero['tenant_id'];\n\n $headers = [\n &quot;Authorization: Bearer $accessToken&quot;,\n &quot;Xero-tenant-id: $tenantId&quot;,\n &quot;Content-Type: application/json&quot;,\n &quot;Accept: application/json&quot;,\n ];\n\n $ch = curl_init(&quot;https://api.xero.com/api.xro/2.0/Invoices&quot;);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($invoiceData));\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n $response = curl_exec($ch);\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n}\n\ncurl_close($ch);\n$responseData = json_decode($response, true);\n\n$invoiceId = $responseData['Invoices'][0]['InvoiceID'] ?? null;\n\nif (!$invoiceId) {\n die(&quot;Failed to create Invoice.&quot;);\n}\n\necho &quot;Invoice Created: ID = $invoiceId&quot;;\n\n$path = 'ALK.pdf';\n$filename = 'ALK.pdf';\nif (file_exists($path)) {\n $fileHandle = fopen($path, 'r');\n $fileSize = filesize($path);\n\n $ch = curl_init(&quot;https://api.xero.com/api.xro/2.0/Invoices/$invoiceId/Attachments/$filename&quot;);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_UPLOAD, true);\n curl_setopt($ch, CURLOPT_INFILE, $fileHandle);\n curl_setopt($ch, CURLOPT_INFILESIZE, $fileSize);\n curl_setopt($ch, CURLOPT_HTTPHEADER, [\n &quot;Authorization: Bearer $accessToken&quot;,\n &quot;Xero-tenant-id: $tenantId&quot;,\n &quot;Content-Type: application/octet-stream&quot;,\n &quot;Content-Length: $fileSize&quot;\n ]);\n\n $attachmentResponse = curl_exec($ch);\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\n fclose($fileHandle);\n curl_close($ch);\n\n if ($httpCode == 200) {\n echo &quot;Attachment Uploaded Successfully!&quot;;\n } else {\n echo &quot;Error uploading attachment: &quot;;\n print_r(json_decode($attachmentResponse, true));\n }\n} else {\n echo &quot;File does not exist at path: &quot; . $path;\n}\n\n\nfunction getContactID($contactName, $accessToken, $tenantId) {\n\n$headers = [\n &quot;Authorization: Bearer $accessToken&quot;,\n &quot;Accept: application/json&quot;\n];\n\n$ch = curl_init(&quot;https://api.xero.com/connections&quot;);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n$response = curl_exec($ch);\n$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\ncurl_close($ch);\n\nif ($httpCode == 200) {\n echo &quot;Access Token is valid.&quot;;\n print_r($response); \n} else {\n echo &quot;Access Token is invalid or expired. HTTP Code: $httpCode&quot;;\n}\n\n//exit;\n \n $contactName = urlencode($contactName);\n $url = &quot;https://api.xero.com/api.xro/2.0/Contacts?where=Name.Contains(\\&quot;$contactName\\&quot;)&quot;;\n \n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, [\n &quot;Authorization: Bearer $accessToken&quot;,\n &quot;Xero-tenant-id: $tenantId&quot;,\n &quot;Content-Type: application/json&quot;,\n &quot;Accept: application/json&quot;\n ]);\n\n $response = curl_exec($ch);\n $data = json_decode($response, true);\n\n if (isset($data['Contacts'][0]['ContactID'])) {\n return $data['Contacts'][0]['ContactID']; // Return ContactID if found\n } else {\n return null; // Contact not found\n }\n}\n\nfunction refreshAccessToken($refreshToken, $record_id) {\n global $db; \n\n $clientId = 'xxxx'; \n $clientSecret = 'xxxxx'; \n\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL =&gt; 'https://identity.xero.com/connect/token',\n CURLOPT_RETURNTRANSFER =&gt; true,\n CURLOPT_POST =&gt; true,\n CURLOPT_POSTFIELDS =&gt; http_build_query([\n 'grant_type' =&gt; 'refresh_token',\n 'client_id' =&gt; $clientId,\n 'client_secret' =&gt; $clientSecret,\n 'refresh_token' =&gt; $refreshToken\n ]),\n CURLOPT_HTTPHEADER =&gt; [\n 'Content-Type: application/x-www-form-urlencoded'\n ],\n ));\n\n $response = curl_exec($curl);\n $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n curl_close($curl);\n\n if ($httpCode == 200) {\n $tokenData = json_decode($response, true);\n if (isset($tokenData['access_token'], $tokenData['refresh_token'])) {\n // Update the database with the new tokens\n $newAccessToken = $tokenData['access_token'];\n $newRefreshToken = $tokenData['refresh_token'];\n\n $updateQuery = $db-&gt;prepare(&quot;UPDATE xero_tokens SET access_token = ?, refresh_token = ?, created_at = NOW() WHERE id = ?&quot;);\n $updateQuery-&gt;bind_param(&quot;ssi&quot;, $newAccessToken, $newRefreshToken, $record_id);\n $updateQuery-&gt;execute();\n\n if ($updateQuery-&gt;affected_rows &gt; 0) {\n echo &quot;Access token refreshed successfully!&quot;;\n } else {\n echo &quot;Failed to update token in the database.&quot;;\n }\n } else {\n echo &quot; Refresh token response missing expected fields.&quot;;\n }\n } else {\n echo &quot;Failed to refresh access token. HTTP Code: $httpCode&quot;;\n }\n}\n\nfunction saveNewToken($accessToken, $refreshToken, $record_id)\n{\n global $db;\n $stmt = $db-&gt;prepare(&quot;UPDATE xero_tokens SET access_token = ?, refresh_token = ?, created_at = NOW() WHERE id = ?&quot;);\n $stmt-&gt;bind_param(&quot;ssi&quot;, $accessToken, $refreshToken, $record_id);\n $stmt-&gt;execute();\n}\n\n\n\n?&gt;\n</code></pre>\n<p>Error is:</p>\n<pre><code> Access Token is valid.[]403\n{&quot;Type&quot;:null,&quot;Title&quot;:&quot;Forbidden&quot;,&quot;Status&quot;:403,&quot;Detail&quot;:&quot;AuthenticationUnsuccessful&quot;,&quot;Instance&quot;:&quot;1111eace-cfc0-413b-8111-5c53832769b7&quot;,&quot;Extensions&quot;:{}}\n</code></pre>\n"^^ . + . + . + . + "@NicoHaase i have edit the post whit some code of my project."^^ . + . + "That did not help. I tried commenting the migration in my controller. Also no database is created for the tenant."^^ . + "0"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + . + "Why does the image not upload using ajax but does when done directly in php?"^^ . + . + "1"^^ . + "As a side note: Your key is currently only 16 bytes in size, while you specify `aes-256-cbc` as algo. AES-256 requires a 32 bytes key. PHP/OpenSSL solves this contradiction by padding the too short key at the end with 0x00 values to the required size of 32 bytes. You should therefore use a 32 bytes key from the outset or alternatively `aes-128-cbc`."^^ . + . + . + . + . + . + "All HTTP headers can be set arbitrarily by the client, so, yes, the referer can be spoofed."^^ . + "<p>I need to use exec() in my PHP script to call another (long-running) PHP script.</p>\n<p>I am currently trying to create a couple of simple test scripts, but I end up with an infinite loop.</p>\n<p><strong>test.php</strong> is my initial script and <strong>simple.php</strong> is the script that it calls via exec().</p>\n<p><strong>simple.php:</strong></p>\n<pre><code>&lt;?php\nerror_log('simple.php called.');\necho 'OK';\n</code></pre>\n<p>simple.php works fine if I go into Terminal and execute:</p>\n<pre><code>php tasks/simple.php\n</code></pre>\n<p>But when I try and call it via exec() in test.php, I end up with an infinite loop. The code shows the commands I've tried, along with the result for each one.</p>\n<p><strong>test.php:</strong></p>\n<pre><code>&lt;?php\n\nerror_log('test.php called'); // Test code to check infinite loop\n\n$cmd = 'dir'; // This works!\n\n//$cmd = 'php tasks/simple.php'; // Loops forever\n\n//$cmd = 'php tasks/simple.php &gt;/dev/null &amp;'; // With this, the browser doesn't get stuck in an infinite loop, but simple.php is called thousands of times\n\n//$cmd = 'php tasks/this-script-does-not-exist.php';// Loops forever\n\n//$cmd = &quot;php /home/public_html/my_test/tasks/simple.php&quot;; // Loops forever\n\n//$cmd = 'php /home/public_html/my_test/tasks/simple.php'; // Loops forever\n\n//$cmd = 'php-cli tasks/simple.php'; // $return_val: 127. $output:\n/*\nArray\n(\n)\n*/\n\n//$cmd = &quot;php-cli /home/public_html/my_test/tasks/simple.php&quot;; // $return_val: 0. $output:\n/*\nArray\n(\n [0] =&gt; X-Powered-By: PHP/8.1.31\n [1] =&gt; Content-Encoding: gzip\n [2] =&gt; Vary: Accept-Encoding\n [3] =&gt; Content-type: text/html; charset=UTF-8\n [4] =&gt; \n [5] =&gt; �UWuP\\ק㡻a����n�c�٥�xĥ��nYB��nD@��W�]`��}��o��ǝ3w~'��~@E 80���%���'��]��`�@�,@9 �)���=6&quot;vE����o00�*�*0�2z,-�DX����_����R�q�u��q���y��!D�&quot;,��˭����?�@�����e``��;��K������4���8��r��i��DX��e��ui�rB\n [6] =&gt; ���4!鷁3��J�Y���?�5��L�](.R�]E��VBO�_�}^���\\�{f�ȼ��Ez�N:��7����fU�w�6\n�NK�r��:�]�~������R�Qc}V=&lt;�hdj�l�.:������۷��e{`�NK'�P#�p7�'y��m#B*k*��T��׏�:±&amp;o�^��X}�v����KO�dt� ������mߤo��ĸ��3\\��b�_p��� H��Et6�&amp;`���{�H�\\ޜ�C\n��'\\�$�X�������M��NZ;��m��6���e�M�{��8�l����+��۸�t�7�ڗ��mu��AN0��u-�1}�l��sn�Oe)��c��(h���z&quot;&quot;r��t���c!4���E����ϗ+�e�Ԧ飓C��Թ��ɊW�˖�F�^�+��n?=E�fz\\��B��ȟ�x����D뀢:��Xc@xʱ��Qñw�0,�+uP5��7~�����?��F��x��&amp;�?8�O3�(�e�\\�\\eE����.T1)Cm�A��5�%w�#�7�ɴ�(�'^¥�r�����@��*��e��B��G2����r�K$��٘A����Bvd��2���N��_YD�X���L����TՅ��9_��Z�_?o���B��ќ]�M㐖(���P]�P#;ԃlbd�Q�����&quot;k ��(�cs��k�A&quot;E]��N��_M&lt;�5�u;��,�z ������,����0%�\\�����-�e?Dj����&gt;u���o� f5��Ѿ\\wQ�N�׮�za�\nEb47�����u5��s*�6}�H8U�!&lt;�mzcVc�/��?���O�R�䎾�xg��_s��u&lt;&lt;�o����On/���O;�p'�q;%]��JM�B|9���W����&lt;�����N3�6��؁�$���״�=������i�?�}���F$��e�J��d�]~�7��&amp;l�L��k�����gAk�q&amp;��!��H��F�$������HS���&amp;jDNT�tk�/i�K�X��RL��tL��}�Y���~(*��L.����x��)N���bV1�ΐ�u��N;H�f%��i�!���I��L�՟�va����c�A�t�Ր��J�w�d�.=�N�SDe(����7�J��%&quot;�7̻�Ё#x�8ld�m̟�������&amp;:Nߑ��h*��̙�ܞV��t���H[���~�r/�v��u��o��\n#����Ϳ?e\\�1x��U~ud��6������d�;@T����x�dG�S�T?��缫�F��b;J%bK#b�a\n�}\n��s�X��`}w��;���o5�zT�2B�����U5{�'|�(R;��f��}N.7w���*\\�����gT��\n [7] =&gt; �prS���&amp;�����ID�E-ײf�\\j-��&quot;�`0���YFP��������֠D�����eAk+{ж��R7ʹj׉��w{�-l4&gt;�L�Z�%�͌�w殿��B�`�A%6\\��Sj��.�r�����삵o0?��9�1i���7�wd¯*�o���L활��W�\n [8] =&gt; �����&amp;,�:b�np�k�`���M�Gϼ��L\\4�&gt;z,���^%�r�4��x���=f,v� �1z+���t��рC���w�*�&lt;��*�sU�^�x�u�8�h����1W�҂��ϧV�ԏdu����T_�%���?ix�WD� w��9˴A��C}j�BߥiBS�Bz�;;�'��뚐�^��9������1AXV��7-��%����ב�O��Rjc������v�d�&amp;��,���fႣ�������,� �\\��V�\n [9] =&gt; &gt;y����Z�!��=��=��=�!T%��۳Ic�4��5��PucJ�?,�D%菱�����w�^��V0�����0.�C�7���WK˳Jv�������c���X0�L�4��M���]������h���R�7�����y�#!Ѧ�~�1|�&gt;?��3 o��3�\\����,��_��&lt;�\\�ޚ�B{����j�gB��߻Ab�,��v_��ڄ�ܦa&gt;F-j��5�R����ejԐ��l\n [10] =&gt; �Nj��=��dW(�ʔP�A~NJ��R��T[/C��o��u�օ@�,NL�o����\n [11] =&gt; ͧ�^r�ܫ��A��n&quot;&quot;e�6č)���Ck|���Y��h59�b�n���4�6Xq� I��'`��Z��%��b&quot;H���&lt;�a���QZ���^�t/�H��811��5��&gt;��;���wxs,��������ɬ���u)qS8,��W���II�v�o'�{�E��Js��P���^��v�E3CS��x���2���F��[���m\n�����\n [12] =&gt; Q~&amp;�������?�,�I��{�����T���{�@�b�wH��S��I�4W6M�oW��D��Q��R�E� #� (M_��LS�Z���J��!�c�Z*��k�P�)E�,7_ߐ]n-�eLI�}L�z�[����| Y.O��k�/O�\\���L|&quot;?GG��A�wu�G�+����R�(�����v���?]~�,w4� ���0��/l'��J`�pu��&lt;�:�Kԛm�&lt;��m���`2�����bi���0&lt;�!�Ы{�����O��Y��?���_9��q��\\o�ySo��-[p�KM·��p5K�UIh�r5��N7���8;���I�w55$����˼��3�F��-f�N�9���Ԫ�l���\\���&amp;��X1�|��^��p&amp;�,q!#�B7o�+�W�}����6�`i]r�l���&amp;Q�Wa]d^�����&gt;� �+���qb=B�&lt;�t����O��&amp;��F����_�wG5��G�n.ɉ�ւ��4�?���b?���Π�fY�xM�j`��ae6։oqd�\n [13] =&gt; &gt;�Y��T�0����YIe]�z�86B���(�Ήj!��Lq�f#�~�U��&lt;\\r:Ωf,��8�4ţ����)M�j1T�7��ч|z��@&amp;�1D(¦3��r6mվ�g�ɂ�&gt;U��ƈ@����C�~�Y�?��\n����|g����B�Y����c�H(��k�]Gp����\n&lt;�d��#��Uɺ/��Ј4��f������(��%Y ����t��8J+��*_�_�n���r9�1y#��B;�!5#I�a0n�*��U�~�H�^���o(�N��K�o����U�:�Q{���ON\n [14] =&gt; ���8.Ֆ�Y� ����*)���u1���\\���ʿ�/�VD[�b��n&lt;��e��2�4�eJ�b|�?kt�7�b(�����i5Xݯmw����pn������M+�l#�A�&gt;�~1~&lt;�w&quot;՗��?�l?�k11/{L����&quot;�,�*�G����.�S��B�飕�h��k�K���x�w}xZ`v���,��#9&lt;��Ȉ�=����Z?oOc��:+OA��R�$� +v�M{\n�Ԙ�QsI��9k�TF��U*oV}��|�F��Z��&amp;����]R&amp;�a��|������ŅKNS��?4r���~�M�&quot;�G� ��S}����7D����S:���*Uk�&lt;���;��\\�!;B5F�tt�|�ʰ�!h�j$�; ��=��`[{a�%&lt;�zyt���k�%'u�������u]D��.�n�¢Ӽ��@����?wK��~�@�\n)\n */\n\n//$cmd = &quot;php /home/public_html/my_test/tasks/simple.php&quot;; // Loops forever\n\n$output = null;\n$return_val = -1;\nexec($cmd, $output, $return_val);\necho &quot;&lt;pre&gt;Return val: &quot; . print_r($return_val, true) . &quot;&lt;/pre&gt;&quot;;\necho &quot;&lt;pre&gt;Output: &quot; . print_r($output, true) . &quot;&lt;/pre&gt;&quot;;\n</code></pre>\n<p><a href="https://stackoverflow.com/questions/13615573/php-exec-infinite-loop">This</a> and <a href="https://stackoverflow.com/questions/3615713/exec-cause-an-infinite-loop-of-starting-requested-program?noredirect=1&amp;lq=1">this</a> haven't helped. Any ideas?</p>\n"^^ . + . + . + "email"^^ . + "<p>I am getting the following error when trying to install Composer.</p>\n<pre><code>The Composer installer script was not successful [exit code 1].\n\nOpenSSL failed with a 'certificate verify failed' error. This indicates a problem with the Certificate Authority file(s) on your system, which may be out of date.\n\nCertificate location [from openssl.cafile ini setting]:\nC:\\php\\cacert.pem\n\nThe php.ini used by your command-line PHP is: C:\\xampp\\php\\php.ini\n\nScript Output:\nThe &quot;https://getcomposer.org/versions&quot; file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:\nerror:0A000086:SSL routines::certificate verify failed\nFailed to enable crypto\nFailed to open stream: operation failed\n</code></pre>\n<p>I have spent 2 days on this.</p>\n<ul>\n<li>I have reinstalled xampp</li>\n<li>I have downloaded the new CACERT.PEM</li>\n<li>Restored my computer to a point where I know it was working.</li>\n<li>Checked all my certs all are with in date and no alerts</li>\n<li>ran the composer installer with no firewalls and antiviruses</li>\n<li>have tested the curl get the error there also\n<ul>\n<li>ran the following <code>curl --cacert &quot;C:\\xampp\\apache\\bin\\curl-ca-bundle.crt&quot; https://getcomposer.org/installer</code> I have also tested this on <a href="http://amazon.com" rel="nofollow noreferrer">http://amazon.com</a> and <a href="http://google.com" rel="nofollow noreferrer">http://google.com</a> all got the same error.</li>\n</ul>\n</li>\n</ul>\n<p>got this is the error</p>\n<pre><code>curl: (60) schannel: CertGetCertificateChain trust error CERT_TRUST_IS_PARTIAL_CHAIN\nMore details here: https://curl.se/docs/sslcerts.html\n\ncurl failed to verify the legitimacy of the server and therefore could not\nestablish a secure connection to it. To learn more about this situation and\nhow to fix it, please visit the webpage mentioned above.\n</code></pre>\n<ul>\n<li>I have also checked my openSSL <code>openssl s_client -CAfile &quot;C:\\php\\cacert.pem&quot; -connect www.amazon.com:443</code> all ok on that front.</li>\n<li>have tried to check my Schannel service but I cannot find the service and when I looked on line about this I see that this service is intergraded in the windows systems for Windows 11</li>\n</ul>\n<p>I am not new to windows and diagnostic issues, but this is very new to me everything I have done above was suggested by Gemini AI.</p>\n<p>My the question I have that out of everything I have done is there something I missed and how to fix this curl/Cacert issue?</p>\n"^^ . + "-2"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "Livewire: Unable to find component"^^ . + . + "<p>We are using Laravel and trying to update the Cors.php middleware, but it's not working.</p>\n<p>Here is the Cors.php code</p>\n<pre><code> public function handle($request, Closure $next)\n {\n if (null !== $request-&gt;server-&gt;get('HTTP_POSTMAN_TOKEN')) {\n abort(404);\n }\n\n return $next($request)\n -&gt;header('Access-Control-Allow-Origin', 'https://yourdomain.com/')\n -&gt;header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS')\n -&gt;header('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type, X-Token-Auth, Authorization');\n }\n</code></pre>\n"^^ . + . + . + "<p>I'm sending emails from Laravel 11 app via SMTP (SendGrid) and viewing them in Gmail.</p>\n<p>My HTML email has correct encoding configured:</p>\n<pre><code>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;\n</code></pre>\n<p>However, when I click &quot;Show original&quot; in Gmail and check both text and HTML versions of the email, I see other encodings:</p>\n<p>Either &quot;iso-8859-1&quot;</p>\n<pre><code>Content-Type: text/plain; charset=iso-8859-1\nContent-Transfer-Encoding: quoted-printable\n...plain text email...\nContent-Type: text/html; charset=iso-8859-1\nContent-Transfer-Encoding: quoted-printable\n...html email...\n</code></pre>\n<p>Or &quot;us-ascii&quot;:</p>\n<pre><code>Content-Type: text/plain; charset=us-ascii\nContent-Transfer-Encoding: quoted-printable\n...plain text email...\nContent-Type: text/html; charset=us-ascii\nContent-Transfer-Encoding: quoted-printable\n...html email...\n</code></pre>\n<p>I want everything to be UTF-8 of course.</p>\n<p>For the life of me can't find in laravel or sendgrid docs how I can configure the correct encoding. All advice given by LLMs are hallucinations or code from previous laravel versions.</p>\n<p>Incorrect encoding creates issues when I use special characters from other languages, like german umlauts.</p>\n<p>My email is fairly simple:</p>\n<pre><code>$payload = [\n 'url' =&gt; route('login.verify', ['token' =&gt; $token]),\n];\nMail::to($user-&gt;email)-&gt;send(new EmailOTP($payload));\n</code></pre>\n<pre><code>&lt;?php\n\nnamespace App\\Mail;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Mail\\Mailable;\nuse Illuminate\\Mail\\Mailables\\Content;\nuse Illuminate\\Mail\\Mailables\\Envelope;\nuse Illuminate\\Queue\\SerializesModels;\n\nclass EmailOTP extends Mailable\n{\n use Queueable, SerializesModels;\n\n public function __construct(public array $data)\n {\n }\n\n public function envelope(): Envelope\n {\n return new Envelope(\n subject: 'Your login link',\n );\n }\n\n public function content(): Content\n {\n return new Content(\n markdown: 'emails.login-link',\n with: [\n 'url' =&gt; $this-&gt;data['url'],\n ],\n );\n }\n}\n</code></pre>\n<p>How can I configure emails beint sent to be UTF-8?</p>\n"^^ . + . + . + . + "Have you checked the permissions on `/var/www/vhosts/mydomain.com/httpdocs/app/ThirdParty/HeicToJpg/bin/php-heic-to-jpg-linux-arm64`?"^^ . + . + "1"^^ . + "base-url"^^ . + . + "I used NGROK but i want to be up all the time, it is not possible free?"^^ . + . + . + . + . + . + "4"^^ . + "This is indeed the best practice and is on the list of features. But this is not possible under the current conditions because the most simplistic data synchronysation wil already be over 60 requests"^^ . + "Translating HTML Content with OpenAI API in PHP While Preserving Formatting"^^ . + . + "1"^^ . + . + "Is it possible to add OpenSpout to a project, without using composer?"^^ . + . + "@hassan yes i check for it using phpinfo file and the change toke place but still having the same errror"^^ . + . + . + . + "1"^^ . + "1"^^ . + . + . + . + . + . + "1"^^ . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + "0"^^ . + "3"^^ . + "<p>I'm encountering an issue with Laravel 12's custom form request validation. When validation fails, instead of returning the expected validation errors, the application responds with a <code>500 Internal Server Error</code> and redirects to the homepage.</p>\n<p>I have created custom form request and applied it to controller.\nI'm trying to do a /register controller.</p>\n"^^ . + . + . + "@user1934428 I do not know where puth the BASH_ENV, in which file. I do not understand what you mean with "before calling git""^^ . + "0"^^ . + "@Juan That's right, uninstall 8.3, reinstall 8.2 on the same machine. Is there a parameter on Apache that sets a limit ?"^^ . + "@Dharman I guess it is DEVSENSE claiming this"^^ . + . + . + "0"^^ . + . + . + . + . + "<p>I'm trying to build PHP 8.4 from source with GD enabled on Unix</p>\n<pre><code>root@dev:/ # uname -a\nFreeBSD dev 14.2-RELEASE FreeBSD 14.2-RELEASE releng/14.2-n269506-c8918d6c7412 GENERIC amd64\n</code></pre>\n<p>I've compiled from source libjpeg (trying versions 6b, 7, 8 and 9) from <a href="https://www.ijg.org/files/" rel="nofollow noreferrer">https://www.ijg.org/files/</a> using:</p>\n<pre><code>./configure --enable-shared --enable-static\n</code></pre>\n<p>With resulting files:</p>\n<pre><code>dir /usr/local/lib/*jpeg*\n-rw-r--r-- 1 root wheel 2039538 Feb 15 12:25 /usr/local/lib/libjpeg.a\n-rwxr-xr-x 1 root wheel 868 Feb 15 12:25 /usr/local/lib/libjpeg.la\nlrwxr-xr-x 1 root wheel 12 Feb 14 12:52 /usr/local/lib/libjpeg.so -&gt; libjpeg.so.9\n-rwxr-xr-x 1 root wheel 1097904 Feb 14 12:52 /usr/local/lib/libjpeg.so.9\n-rw-r--r-- 1 root wheel 1482374 Jan 30 03:03 /usr/local/lib/libturbojpeg.a\nlrwxr-xr-x 1 root wheel 17 Jan 30 03:03 /usr/local/lib/libturbojpeg.so -&gt; libturbojpeg.so.0\nlrwxr-xr-x 1 root wheel 21 Jan 30 03:03 /usr/local/lib/libturbojpeg.so.0 -&gt; libturbojpeg.so.0.3.0\n-rwxr-xr-x 1 root wheel 976216 Jan 30 03:03 /usr/local/lib/libturbojpeg.so.0.3.0\n</code></pre>\n<p>Everything I try to configure PHP I get <strong>Package 'libjpeg' not found</strong></p>\n<p>My configure command:</p>\n<pre><code>./configure --with-apxs2=/usr/local/apache/bin/apxs \\\n--with-config-file-path=/usr/local/etc \\\n--enable-bcmath --without-cdb \\\n--enable-gd --without-iodbc --enable-inline-optimization \\\n--without-gdbm --with-ndbm --without-db2 --without-dbm \\\n--without-readline --without-recode --with-openssl \\\n--without-db3 --enable-dba \\\n--with-curl \\\n--with-jpeg --enable-calendar \\\n--with-mhash --enable-mbstring=all \\\n--with-zlib \\\n--with-png-dir=/usr/local/libpng/lib \\\n--with-freetype --with-pdo-mysql \\\n--enable-exif --enable-zip \\\n--without-libzip \\\n--with-mysqli=mysqlnd \\\n--without-sqlite3\n</code></pre>\n<p>Searching <em>config.log</em> for 'jpeg' shows that it seems to find it on for first time it looks, but then fails the second time.</p>\n<pre><code>configure:35077: checking for libjpeg\nconfigure:35094: result: yes\n\n...\n\n\nconfigure:36211: checking for libjpeg\nconfigure:36218: $PKG_CONFIG --exists --print-errors &quot;libjpeg&quot;\nPackage libjpeg was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libjpeg.pc'\nto the PKG_CONFIG_PATH environment variable\nPackage 'libjpeg' not found\nconfigure:36221: $? = 1\nconfigure:36235: $PKG_CONFIG --exists --print-errors &quot;libjpeg&quot;\nPackage libjpeg was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libjpeg.pc'\nto the PKG_CONFIG_PATH environment variable\nPackage 'libjpeg' not found\nconfigure:36238: $? = 1\nconfigure:36252: result: no\nPackage 'libjpeg' not found\nconfigure:36277: error: Package requirements (libjpeg) were not met:\n\nPackage 'libjpeg' not found\n\nConsider adjusting the PKG_CONFIG_PATH environment variable if you\ninstalled software in a non-standard prefix.\n\nAlternatively, you may set the environment variables JPEG_CFLAGS\nand JPEG_LIBS to avoid the need to call pkg-config.\nSee the pkg-config man page for more details.\n</code></pre>\n<p>I'm not a C programmer and not too familiar with the build process, so some help would be appreciated. I googles about the suggestions <em>configure</em> listed but could not find anything useful.</p>\n<p>EDIT\nAs per comments, I installed ver 9f of libjpeg</p>\n<pre><code>root@dev:/usr/local/jpeg-9f # make install\n mkdir -p '/usr/local/lib'\n /bin/sh ./libtool --mode=install /usr/bin/install -c libjpeg.la '/usr/local/lib'\nlibtool: install: /usr/bin/install -c .libs/libjpeg.so.9.6.0 /usr/local/lib/libjpeg.so.9.6.0\nlibtool: install: (cd /usr/local/lib &amp;&amp; { ln -s -f libjpeg.so.9.6.0 libjpeg.so.9 || { rm -f libjpeg.so.9 &amp;&amp; ln -s libjpeg.so.9.6.0 libjpeg.so.9; }; })\nlibtool: install: (cd /usr/local/lib &amp;&amp; { ln -s -f libjpeg.so.9.6.0 libjpeg.so || { rm -f libjpeg.so &amp;&amp; ln -s libjpeg.so.9.6.0 libjpeg.so; }; })\nlibtool: install: /usr/bin/install -c .libs/libjpeg.lai /usr/local/lib/libjpeg.la\nlibtool: install: /usr/bin/install -c .libs/libjpeg.a /usr/local/lib/libjpeg.a\nlibtool: install: chmod 644 /usr/local/lib/libjpeg.a\nlibtool: install: ranlib /usr/local/lib/libjpeg.a\n mkdir -p '/usr/local/bin'\n /bin/sh ./libtool --mode=install /usr/bin/install -c cjpeg djpeg jpegtran rdjpgcom wrjpgcom '/usr/local/bin'\nlibtool: install: /usr/bin/install -c .libs/cjpeg /usr/local/bin/cjpeg\nlibtool: install: /usr/bin/install -c .libs/djpeg /usr/local/bin/djpeg\nlibtool: install: /usr/bin/install -c .libs/jpegtran /usr/local/bin/jpegtran\nlibtool: install: /usr/bin/install -c rdjpgcom /usr/local/bin/rdjpgcom\nlibtool: install: /usr/bin/install -c wrjpgcom /usr/local/bin/wrjpgcom\n/bin/sh /usr/local/jpeg-9f/install-sh -d /usr/local/include\n/usr/bin/install -c -m 644 jconfig.h /usr/local/include/jconfig.h\n mkdir -p '/usr/local/include'\n /usr/bin/install -c -m 644 jerror.h jmorecfg.h jpeglib.h '/usr/local/include'\n mkdir -p '/usr/local/share/man/man1'\n /usr/bin/install -c -m 644 cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1 '/usr/local/share/man/man1'\n mkdir -p '/usr/local/lib/pkgconfig'\n\n /usr/bin/install -c -m 644 libjpeg.pc '/usr/local/lib/pkgconfig'\n</code></pre>\n<p>libjpeg.pc is present:</p>\n<pre><code>/usr/local/lib/pkgconfig/libjpeg.pc\n</code></pre>\n<p>However still getting same issue when I configure PHP (I deleted config.log/nice before trying again)</p>\n<pre><code>setenv PKG_CONFIG_PATH /usr/local/lib/pkgconfig\n</code></pre>\n<p>Seems to have worked, now failing on <strong>iconv supports errno... no</strong></p>\n<pre><code>checking for libjpeg... yes\nchecking for libXpm... no\nchecking for FreeType 2... yes\nchecking whether to enable JIS-mapped Japanese font support in GD... no\nchecking for zlib &gt;= 1.2.11... yes\nchecking for libpng... yes\nchecking for libjpeg... yes\nchecking for freetype2... yes\nchecking whether build works... yes\nchecking for GNU gettext support... no\nchecking for GNU MP support... no\nchecking for mhash support... yes\nconfigure: WARNING: The --with-mhash option and mhash* functions are deprecated as of PHP 8.1.0\nchecking size of long... (cached) 8\nchecking if we're at 64-bit platform... yes\nchecking for iconv support... yes\nchecking for iconv... yes\nchecking for iconv implementation... GNU libiconv\nchecking if iconv supports errno... no\nconfigure: error: in '/usr/local/dev_build_sources/php-8.4.3':\nconfigure: error: The iconv check failed, 'errno' is missing.\n</code></pre>\n"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "<p>I would like to use the Woocommerce taxonomy &quot; Brands &quot; to show the product brand above the product title on shop page and product page.</p>\n<p>I add this code to functions.php, it is working, however the brand text is linking to the brand page and both shop page and product page. I would like to disable the brand url link on shop page and keep it only for product page.</p>\n<p>Can someone help ?</p>\n<pre><code>function product_brand() {\n $terms = wp_get_post_terms(get_the_ID(), 'product_brand');\n if (!is_wp_error($terms) &amp;&amp; !empty($terms)) {\n $term = $terms[0];\n $class = esc_attr( $term-&gt;slug );\n $url = esc_url( get_term_link( $term ) );\n $name = esc_html( $term-&gt;name );\n echo &quot;&lt;div class=\\&quot;product_brand $class\\&quot;&gt;&lt;a href=\\&quot;$url\\&quot;&gt;$name&lt;/a&gt;&lt;/div&gt;&quot;;\n }\n}\n\nadd_action( 'woocommerce_shop_loop_item_title', 'product_brand', 10);\n\nadd_action( 'woocommerce_single_product_summary', 'product_brand', 5);\n</code></pre>\n"^^ . + "0"^^ . + "2"^^ . + "0"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + "0"^^ . + . + "1"^^ . + . + . + "setuid"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + "2"^^ . + "How activate darkMode with TailwindCSS in Laravel 12"^^ . + "2"^^ . + . + "0"^^ . + . + "3"^^ . + "1"^^ . + "0"^^ . + . + . + "1"^^ . + . + "<p>I try to upload a file in laravel livewire but I faced some problems\nthis is my code the problem is the $logo can't hold the file like it initialize befor save it in store() method it work in other project but this one didn't I don't know why.</p>\n<p>my component code is</p>\n<pre><code>&lt;?php\n\nnamespace App\\Livewire;\n\nuse App\\Models\\brand;\nuse Exception;\nuse Livewire\\Component;\nuse Livewire\\WithFileUploads;\nuse Livewire\\WithPagination;\n\nclass LiveBrand extends Component\n{\n use WithPagination;\n use WithFileUploads;\n public $search;\n public $t_name;\n public $sort = '';\n public string $name = '';\n public $logo;\n public $namb = 5;\n public bool $stat = false;\n public function stat()\n {\n $this-&gt;stat = !$this-&gt;stat;\n }\n\n public function show()\n {\n $this-&gt;namb++;\n }\n\n public function stor()\n {\n try {\n $validated = $this-&gt;validate([\n 'name' =&gt; 'required|string|max:255|min:2',\n 'logo' =&gt; 'required|image|max:1024', // 1MB Max\n 'stat' =&gt; 'nullable|boolean'\n ]);\n\n // Check if logo exists\n if ($this-&gt;logo) {\n $imagePath = $this-&gt;logo-&gt;store(path: 'public');\n\n Brand::create([\n 'name' =&gt; $validated['name'],\n 'logo' =&gt; $imagePath,\n 'stat' =&gt; $validated['stat'] ?? false\n ]);\n\n $this-&gt;reset(['name', 'logo', 'stat']);\n $this-&gt;create_alert('Brand');\n $this-&gt;dispatch('brand-created');\n } else {\n session()-&gt;flash('error', 'Please select a logo file');\n }\n } catch (\\Exception $e) {\n session()-&gt;flash('upload_error', 'File upload failed: ' . $e-&gt;getMessage());\n $this-&gt;exception_alert($e);\n }\n }\n\n\n public function sorter($name)\n {\n $this-&gt;sort = $this-&gt;sort === 'desc' ? 'asc' : 'desc';\n $this-&gt;t_name = $name;\n }\n\n public function render()\n {\n $all = brand::where('name', 'like', &quot;%{$this-&gt;search}%&quot;)\n -&gt;orWhere('created_at', 'like', &quot;%{$this-&gt;search}%&quot;)\n -&gt;orderBy(empty($this-&gt;t_name) ? 'id' : '' . $this-&gt;t_name . '', '' . empty($this-&gt;sort) ? 'desc' : '' . $this-&gt;sort . '' . '')\n -&gt;latest()\n -&gt;paginate(5);\n $tabelnames = [\n &quot;Brand&quot; =&gt; 'name',\n &quot;Logo&quot; =&gt; 'logo',\n &quot;Créé Le&quot; =&gt; 'created_at',\n &quot;Statut&quot; =&gt; 'stat'\n ];\n return view('livewire.live-brand', [\n &quot;thname&quot; =&gt; $tabelnames,\n &quot;all&quot; =&gt; $all,\n &quot;uploadError&quot; =&gt; session('upload_error')\n ]);\n }\n}\n</code></pre>\n<p>me view is</p>\n<pre><code>&lt;div class=&quot;page-wrapper row&quot;&gt;\n &lt;form wire:submit=&quot;stor&quot;&gt;\n @error('logo')\n &lt;div classs=&quot;alert alert-danger text-danger&quot;&gt;{{$message}}&lt;/div&gt;\n @enderror\n &lt;div class=&quot;col-12&quot;&gt;\n &lt;label for=&quot;&quot; class=&quot;form-label&quot;&gt;Name&lt;/label&gt;\n &lt;input class=&quot;form-control&quot; type=&quot;text&quot; wire:model=&quot;name&quot;&gt;\n &lt;/div&gt;\n &lt;div class=&quot;col-12&quot;&gt;\n &lt;label for=&quot;&quot; class=&quot;form-label&quot;&gt;Logo&lt;/label&gt;\n &lt;input class=&quot;form-control&quot; type=&quot;file&quot; wire:model=&quot;logo&quot;&gt;\n &lt;/div&gt;\n &lt;button class=&quot;btn btn-primary&quot; type=&quot;submit&quot;&gt;Upload&lt;/button&gt;\n &lt;/form&gt;\n&lt;/div&gt;\n</code></pre>\n<p><a href="https://i.sstatic.net/UmvCTUdE.png" rel="nofollow noreferrer">enter image description here</a></p>\n<p>it show me this error The logo failed to upload. and when I click on the upload button it show me the The logo field is required please help me .\n<a href="https://i.sstatic.net/gwGlGQvI.png" rel="nofollow noreferrer">enter image description here</a></p>\n"^^ . + "<p>I found a way by creating a global function at the end of <code>PHP.i</code>:</p>\n<p>First set overloaded constructor to be ignored (not necessary but prevents warning):</p>\n<pre><code>%ignore SomeNamespace::Creator(Enum_Bar);\n</code></pre>\n<p>and then define a global function:</p>\n<pre><code>%inline %{\nnamespace SomeNamespace {\n Creator* CreatorFromBar(Enum_Bar in_enum_bar) {\n return new Creator(in_enum_bar);\n }\n}\n%}\n</code></pre>\n<p>And the call is as:</p>\n<pre><code>$enum_bar = Enum_Bar::Bar_A; // May come via argument of a function\n$correct = CreatorFromBar($enum_bar);\n</code></pre>\n<p>PS: It isn't answer to the question but solves my problem. It works for PHP and Ruby. I will apply for Python too - in order to have consistent code.</p>\n"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + "<pre><code>public function sql_execute(string $sql, array $params = []): array|bool|\\mysqli_result{\n if(empty($params)){\n return $this-&gt;mysqli-&gt;query($sql);\n }\n\n $stmt = $this-&gt;mysqli-&gt;prepare($sql);\n if(!$stmt){\n throw new \\Exception(&quot;SQL Prepare failed: &quot; . $this-&gt;mysqli-&gt;error);\n }\n\n $values = [...array_values($params)];\n $stmt-&gt;execute($values);\n $result = $stmt-&gt;get_result();\n $stmt-&gt;close();\n return $result ?: true;\n}\n</code></pre>\n<p>I tried to use this but wasnt sure if it works</p>\n<p>A function to execute a sql in mysqli</p>\n"^^ . + . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + "1"^^ . + "As a tip, it's not a great idea to use firstname + lastname as the "value" of the option tags...as I'm sure you've noticed, it's not impossible for two people to have the same name. Every row in your `icons` table hopefully has an `ID` field which is unique...use that as the `value` for the related `<option` so you then know exactly which row is being referenced when the form is then submitted"^^ . + . + . + . + "Not sure it can, help, but you can get the size of final unzipped file with -l option and then track the size of the partially extracted file"^^ . + . + . + . + . + . + . + "typo3"^^ . + . + "<p>By default, <code>Dom\\HTMLDocument::createFromString</code> creates all nodes in a namespace <code>http://www.w3.org/1999/xhtml</code>. So if you want to query that via XPath, you need to make a name-space based query, like</p>\n<pre><code>$xpath-&gt;registerNamespace('xhtml', 'http://www.w3.org/1999/xhtml');\n$divs = $xpath-&gt;query('//xhtml:div');\n</code></pre>\n<p>If you want un-namespaced HTML (as in 99% of use cases), pass <code>Dom\\HTML_NO_DEFAULT_NS</code> to\n<code>Dom\\HTMLDocument::createFromString</code>:</p>\n<pre><code>$doc = Dom\\HTMLDocument::createFromString(\n $html, Dom\\HTML_NO_DEFAULT_NS);\n$divs = $xpath-&gt;query('//div'); // returns 1 div\n</code></pre>\n"^^ . + . + . + . + "0"^^ . + "1"^^ . + . + . + "I mean can you install libraqm/libimagequant/libavif?"^^ . + "Invalid CSRF token when accessing Symfony login via domain behind Nginx proxy (works with direct IP)"^^ . + . + . + . + . + "brew install php@8.3 gives CONNECT_CR_SRVR_HELLO:sslv3 alert handshake failure"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + "Are you trying to make a controller associated to a route?"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "<blockquote>\n<pre><code>#protect config files\n&lt;FilesMatch &quot;\\.(env|json|lock|xml|yml|htaccess|gitignore|gitattributes)$&quot;&gt;\nOrder Allow,Deny\nDeny from all\nRequire all denied\n&lt;/FilesMatch&gt;\n</code></pre>\n</blockquote>\n<p>The fact that this started working after removing the <code>&lt;IfModule mod_headers.c&gt;</code> container implies that mod_headers is not installed on your system<b><sup>*1</sup></b>. Which is a little unusual. (Although it made no sense to contain that block in such an <code>&lt;IfModule&gt;</code> directive anyway. In fact, you should generally avoid <code>&lt;IfModule&gt;</code> directives in your config, unless the contained rules are optional and the same config is intended to be used unaltered on many different systems. Otherwise, the <code>&lt;IfModule&gt;</code> directive simply <em>masks</em> the error.)</p>\n<p>You are also mixing both Apache 2.2 (<code>Order</code> and <code>Deny</code>) directives with Apache 2.4 (<code>Require all denied</code>) directive. This is bad practice and can result in unexpected conflicts (not to mention that <code>Order</code> and <code>Deny</code> are formerly deprecated and not available by default on Apache 2.4). So, using this same config on other systems is likely to fail. Assuming you do not have other <code>Order</code>, <code>Deny</code> and/or <code>Allow</code> directives in your config (anywhere) then you should remove the <code>Order</code> and <code>Deny</code> directives here.</p>\n<p>(<b><sup>*1</sup></b> If mod_headers is not installed then the later section that sets some <code>Cache-Control</code> headers is also not processed. Although this is probably a good thing, since this section conflicts with the mod_expires section directly above it!?)</p>\n<blockquote>\n<p>Json files are blocked, but then also in subfolders. I only want to block project configuration files in the root, for security reasons.</p>\n</blockquote>\n<p>(&quot;for security reasons&quot;?! Presumably it's because your application needs client-side access to <code>.json</code> files in subdirectories for some reason? Not a security thing, as <em>allowing</em> access can only be <em>less</em> secure?)</p>\n<p>The <code>&lt;FilesMatch&gt;</code> directive matches against the filename only, not the file-path, so applies to all subdirectories (which is generally what you want in this scenario).</p>\n<p>If you want to be able to access <code>.json</code> files in subdirectories then you need to remove <code>|json</code> from the above <em>alternation</em> section in the regex. And create a separate rule that blocks requests for <code>.json</code> files in the root only. For example:</p>\n<pre><code># Block requests for &quot;.json&quot; files in the root only\n&lt;If &quot;%{REQUEST_URI} =~ m#^/[^/]+\\.json$#&quot;&gt;\n Require all denied\n&lt;/If&gt;\n</code></pre>\n<p>This uses an Apache expression to examine the requested URL. Note that this blocks URLs, regardless of whether a <code>.json</code> file actually exists. (Which is actually the same as the <code>&lt;FilesMatch&gt;</code> directive.)</p>\n<p>The regex <code>^/[^/]+\\.json$</code> will only match <code>/&lt;something&gt;.json</code> and not <code>/&lt;something&gt;/&lt;something&gt;.json</code> etc.</p>\n<blockquote>\n<pre><code>RewriteCond %{REQUEST_FILENAME} !-f\nRewriteRule ^([^\\.]+)$ $1.php [NC,L]\n</code></pre>\n<p>For example the route { path: &quot;/tickets.php/:id&quot;, component: &quot;ticket-component&quot; } works when the hotlinks are updated to tickets.php/4509 instead of tickets/4509</p>\n</blockquote>\n<p>This simply appends the <code>.php</code> extension to any URL-path that does not contain a dot <em>and</em> that does not map to a file<b><sup>*2</sup></b>. (It should at least check that the target <code>.php</code> file exists.)</p>\n<p>(<b><sup>*2</sup></b> Note that this does not necessarily test the full URL-path since <code>REQUEST_FILENAME</code> is a calculated value based on your filesystem.)</p>\n<p>With the above rule, if you request <code>/tickets/4509</code> (and <code>/tickets</code> is not a physical subdirectory) then the <code>RewriteRule</code> directive first matches against <code>tickets/4509</code> (which is saved in the <code>$1</code> backreference). The preceding <em>condition</em> then tests if <code>/tickets</code> (not <code>/tickets/4509</code>) is <em>not</em> a physical file (which I assume it's not, so the <em>condition</em> is successful) so ends up rewriting the request to <code>tickets/4509.php</code> - which naturally fails with a 404.</p>\n<p>Assuming all your relevant <code>.php</code> files exist in the document root only (not subdirectories) then you would need to write the rule something like the following instead to test for <code>.php</code> files in root and append the remaining URL-path as path-info (which seems to be what you are expecting).</p>\n<p>For example:</p>\n<pre><code># Rewrite requests of the form &quot;/page/id&quot; to &quot;/page.php/id&quot;\nRewriteCond %{DOCUMENT_ROOT}/$1.php -f\nRewriteRule ^([^./]+)(/\\d+)?$ $1.php$2 [L]\n</code></pre>\n<p>Note that I included a slash in the negated regex character class so it only matches the first URL-path segment, not the entire URL-path.</p>\n<p>I'm assuming (based on your examples) that only numeric IDs are being passed. eg. <code>/&lt;page&gt;/&lt;numeric-id&gt;</code>. But I've allowed for the <code>/&lt;numeric-id&gt;</code> part to be entirely optional, so <code>/tickets</code> only could be requested and is simply rewritten to <code>/tickets.php</code>.</p>\n<p>The preceding <em>condition</em> (<code>RewriteCond</code> directive) now checks that the corresponding <code>.php</code> file actually exists before attempting to rewrite the request.</p>\n<p>No need to backslash-escape literal dots when used inside a regex character class. And the <code>NC</code> flag is superfluous, since the regex itself is not case-specific.</p>\n<h3>Summary</h3>\n<p>So, bringing the above points together, your complete <code>.htaccess</code> file would now look like this:</p>\n<pre><code># Disable directory browsing\nOptions All -Indexes\n\n# Block requests for &quot;.json&quot; files in the root only\n&lt;If &quot;%{REQUEST_URI} =~ m#^/[^/]+\\.json$#&quot;&gt;\n Require all denied\n&lt;/If&gt;\n\n# Protect other config files (anywhere)\n&lt;FilesMatch &quot;\\.(env|lock|xml|yml|htaccess|gitignore|gitattributes)$&quot;&gt;\n Require all denied\n&lt;/FilesMatch&gt;\n\n&lt;FilesMatch &quot;\\.(html|css|js)$&quot;&gt;\n AddDefaultCharset UTF-8\n&lt;/FilesMatch&gt;\n&lt;FilesMatch &quot;\\.(css|js)$&quot;&gt;\n FileETag MTime Size\n&lt;/FilesMatch&gt;\n\nErrorDocument 304 /error_pages/304.php \nErrorDocument 400 /error_pages/400.php \nErrorDocument 401 /error_pages/401.php \nErrorDocument 403 /error_pages/403.php \nErrorDocument 404 /error_pages/404.php \nErrorDocument 409 /error_pages/409.php \nErrorDocument 410 /error_pages/410.php \nErrorDocument 500 /error_pages/500.php\n\n&lt;IfModule mod_expires.c&gt;\n ExpiresActive On\n # Fonts\n ExpiresByType font/ttf &quot;access plus 1 year&quot;\n ExpiresByType font/otf &quot;access plus 1 year&quot;\n ExpiresByType font/woff &quot;access plus 1 year&quot;\n ExpiresByType font/woff2 &quot;access plus 1 year&quot;\n # Images\n ExpiresByType image/jpg &quot;access plus 1 year&quot;\n ExpiresByType image/jpeg &quot;access plus 1 year&quot;\n ExpiresByType image/gif &quot;access plus 1 year&quot;\n ExpiresByType image/png &quot;access plus 1 year&quot;\n ExpiresByType image/x-icon &quot;access plus 6 year&quot;\n # CSS, JavaScript\n ExpiresByType text/css &quot;access plus 6 month&quot;\n ExpiresByType application/javascript &quot;access plus 6 month&quot;\n ExpiresByType application/x-javascript &quot;access plus 6 month&quot;\n ExpiresByType application/x-shockwave-flash &quot;access plus 6 month&quot;\n # Other\n ExpiresByType application/pdf &quot;access plus 6 month&quot;\n ExpiresDefault &quot;access plus 10 days&quot;\n&lt;/IfModule&gt;\n\n&lt;IfModule mod_rewrite.c&gt;\n RewriteEngine On\n\n # Rewrite requests of the form &quot;/page/id&quot; to &quot;/page.php/id&quot;\n RewriteCond %{DOCUMENT_ROOT}/$1.php -f\n RewriteRule ^([^./]+)(/\\d+)?$ $1.php$2 [L]\n&lt;/IfModule&gt;\n</code></pre>\n<p>I also adjusted the <em>logical</em> order of the rule blocks, which helps readability and maintenance (although this does not strictly affect functionality).</p>\n<p>Ordinarily, the <code>&lt;IfModule mod_rewrite.c&gt;</code> wrapper should probably be removed, although your system is technically usable without this section, providing you use (the less pretty) URLs of the form <code>/page.php/&lt;id&gt;</code>.</p>\n<p>Although this is still strictly not complete as URLs of the form <code>/page.php/&lt;id&gt;</code> are still accessible, potentially creating a duplicate content issue (whether this would become a real problem for your site is another matter). You could implement this as a canonical redirect in <code>.htaccess</code> (or your PHP code) or simply block such requests with a 404. This is left as an exercise for the reader.</p>\n"^^ . + "When loading data with seeder in Laravel, it says there is no conversion from nvarchar data type to datetime data type"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + "2"^^ . + . + . + "1"^^ . + "`the php docs are inconclusive`...I wouldn't agree with that. There's no deprecation notice for that class in the documentation, therefore it's not deprecated. Things that are deprecated have deprecation warnings stated in the docs - just like those specific properties within the class that are mentioned as being deprecated. Perhaps DevSense got confused because of those. As mentioned above, it would be advisable to try and report the issue to the makers of that software."^^ . + "If you look at [`WC_Order_Query::get_default_query_vars()` method](https://github.com/woocommerce/woocommerce/blob/release/9.7/plugins/woocommerce/includes/class-wc-order-query.php#L57-L58), you will see that `shipping_first_name` and `shipping_last_name` are query variables but not usable meta keys in a meta query. So what you are trying to do is not possible, it should require to add a custom input field for each or a selector to specify what data type you are searching."^^ . + . + . + . + "-1"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + . + . + "Well, as I said in my first comment, which I deleted, your second solution is very similar to your first. Whether you use `eval()`, or include a PHP script, in both cases a new anonymous class is created in [global space](https://www.php.net/manual/en/language.namespaces.global.php), every time they are used."^^ . + . + . + "Interestingly, it's now working. I didn’t make any additional changes, but it seems like my configurations took effect after some time. I’m not sure how to explain it, but it’s working now."^^ . + . + . + "not exactly, the prepared query will be cached by the server, which can improve performance. I think it's important to note that the question does not specify sql injection but more generally, it concerns injection (in this case js, html...). Please take a good look at the assignment."^^ . + . + . + "Its is disheartening to see that my question was 'closed' before any solution was provided."^^ . + . + . + "0"^^ . + . + . + "The user just has a switch where he can switch on off, nothing else. Then if he chose yes, the php should give him the new role. The user should not be allowed to chose the user role by himself. So I suppose I dont need a whitelist."^^ . + . + "1"^^ . + . + . + . + . + . + . + "1"^^ . + "2"^^ . + . + . + "2"^^ . + . + . + . + "Perhaps `data` is a reserved keyword in Laravel?"^^ . + . + "<pre class="lang-php prettyprint-override"><code>if ($this-&gt;journal3-&gt;settings-&gt;get('quickCheckoutAccountTelephoneField') === 'required') {\n $telephone = Arr::get($this-&gt;request-&gt;post, 'order_data.telephone');\n \n if ((utf8_strlen($telephone) == 10 ) || preg_match('/[^\\d]/is', $telephone)) {\n $error['telephone'] = $this-&gt;language-&gt;get('error_telephone');\n }\n}\n</code></pre>\n<p>In opencart 2,3,0,2, Journal theme has another <code>register.php</code>, this works for validation for telephone.</p>\n"^^ . + . + . + . + "1"^^ . + "0"^^ . + . + "1"^^ . + "Laravel SQLSTATE[HY093]: Invalid parameter number" but query works?"^^ . + "1"^^ . + "@KamyarSafari Same error occurred..\n\nPHP Info:\nmax_input_time = -1\nmax_execution_time = 0\nmemory_limit = -1\nNginx Config:\nHTTP Block: client_max_body_size 10G\nServer Block: client_max_body_size 4000M"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + "<p>I have a custom post type table which is connected to the post meta table in wordpress. I need to run some tasks after a post is deleted. For that I use the Wordpress hook <strong>after_delete_post</strong>.</p>\n<p>Within my function I need to get access to the user id which is stored by a plugin in the post meta table. I tried to access this meta_value through $post-&gt;meta_key but it doesn't work.</p>\n<p>Before I tested it with the wp_trash_post hook where it worked. I don't understand why I still have access to post-&gt;post_type but not to post-&gt;meta_key anymore?</p>\n<pre><code>add_action( 'after_delete_post', 'my_deleted_post', 10, 2 );\n function my_deleted_post($post_id,$post) {\n if ( $post-&gt;post_type == 'review') {\n $meta_value=$post-&gt;linked_user_id;\n // some stuff to do with $meta_value after post is deleted\n }\n }\n</code></pre>\n"^^ . + . + . + . + . + . + "<p>Hello fellow WordPress user,</p>\n<p>the functionality you are experiencing is likely generated by you SEO plugin, which creates a json element in every page of your website in order to display Post or Page meta data. Inside those meta data, the author name is included.</p>\n<p>You can verify that by inspecting the website with Inspect Element of any browser, and then search for the keyword &quot;author&quot;. If you discover the author is displayed in the json object, then this is your issue.</p>\n<p>The way to come around that is to use filters to remove the Author completely from your plugin generated SEO data. E.g. if it's Rank Math or Yoast, search for a filter to remove authors from pages in their respective documentation.</p>\n<p>For example in Rank Math you can use the below as indicated in their documentation:</p>\n<p>You can add the following code snippet to your theme's rank-math. php file:</p>\n<pre class="lang-php prettyprint-override"><code>add_filter( 'rank_math/json_ld', function( $data, $jsonld ) { \n if ( isset( $data['BlogPosting'] ) ) { \n unset( $data['BlogPosting']['author']); // Remove author information\n }\n return $data;\n}, 99, 2);\n</code></pre>\n<p>Source: <a href="https://support.rankmath.com/ticket/remove-authors-name-from-page-code/" rel="nofollow noreferrer">https://support.rankmath.com/ticket/remove-authors-name-from-page-code/</a></p>\n"^^ . + . + . + . + . + . + "<p>I am working on a docker application with php,mysql,redis. The application is such that individual requests hit a php url, which opens a redis connection, reads/ updates key, and closes connection. I have it working, but when i use k6 for a load test, I start getting &quot; Uncaught RedisException: Cannot assign requested address&quot; error, after about 15k requests. I tried using twemproxy, but this does not seem to make a difference. Looking for some help with what I might be doing wrong.</p>\n<p>Dockerfile:</p>\n<pre><code>FROM unit:1.34.1-php8.4\n\n\nENV PHP_OPCACHE_VALIDATE_TIMESTAMPS=&quot;0&quot; \\\n PHP_OPCACHE_MAX_ACCELERATED_FILES=&quot;10000&quot; \\\n PHP_OPCACHE_MEMORY_CONSUMPTION=&quot;192&quot; \\\n PHP_OPCACHE_MAX_WASTED_PERCENTAGE=&quot;10&quot;\n \nRUN docker-php-ext-install mysqli &amp;&amp; docker-php-ext-enable mysqli\n\n...handle opcache, supervisor, other dependencies, etc...\n\nEXPOSE 80 \n\n# Start supervisord which will manage both cron and nginx unit\nCMD [&quot;/usr/bin/supervisord&quot;, &quot;-c&quot;, &quot;/etc/supervisor/conf.d/supervisord.conf&quot;]\n</code></pre>\n<p>Docker-compose.yml (before adding twemproxy)</p>\n<pre><code>services:\n php:\n build:\n context: .\n dockerfile: Dockerfile\n working_dir: /var/www/html/\n container_name: phpApp\n ports:\n - '80:80'\n volumes:\n - '.:/var/www/html/'\n depends_on:\n - mysql_db\n #- twemproxy # Add dependency to twemproxy if using twemproxy\n - redis # Add dependency to redis\n networks:\n - default \n redis:\n container_name: redis\n image: 'redis:alpine3.21'\n ports:\n - '6379:6379'\n networks:\n - default\n</code></pre>\n<p>And for twemproxy, I used a separate dockerfile, and the following in docker-compose</p>\n<pre><code>twemproxy:\n build:\n context: .\n dockerfile: Dockerfile.twemproxy # Build Twemproxy from the Dockerfile\n container_name: twemproxy\n ports:\n - '6380:6379' # Expose the same port that Redis would have exposed\n volumes:\n - ./config/twemproxy.yml:/etc/twemproxy/nutcracker.yml # Twemproxy config file\n depends_on:\n - redis # Ensure Redis is available before Twemproxy starts\n networks:\n - default\n</code></pre>\n<p>And the following conf</p>\n<pre><code>alpha:\n listen: 0.0.0.0:6380\n hash: fnv1a_64\n distribution: ketama\n redis: true\n auto_eject_hosts: true\n server_retry_timeout: 2000\n server_failure_limit: 3\n servers:\n - redis:6379:1\n</code></pre>\n<p>target.php file. This is what is being hit in the load test.</p>\n<pre><code>&lt;?php \n\n$redis = new Redis(); \n$redis-&gt;connect('redis', 6379,1);\n//$redis-&gt;connect('twemproxy', 6380); //When using Twemproxy\n\nif($redis-&gt;exists($serial)){\n //Do stuff\n}\n$redis-&gt;close();\n?&gt;\n</code></pre>\n<p>When testing with K6, the script is set to make ~500 to 800 connections per second. The test keeps going, and once it hits around 14-15k hits, redis seems to stop responding. And In docker stats, I can see that redis cpu usage goes from ~30% when running fine, to 0 when it stops.</p>\n<p>NOTE\nI came across <a href="https://stackoverflow.com/a/13451917/903978">this</a>. I am not sure if this makes redis not usable in my case, as given the application, my use case is going to be a lot of requests needing to be serviced.</p>\n"^^ . + . + . + "mongodb"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + "This is very strange as normally if any validation is not met, it should stop the process, avoiding the registration. I really don't know why you still get this kind of spam from bots."^^ . + . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + "Sorry for that.\nHere is my php code:\n\n<?PHP\n \n $email_to = 'samplemail@gmail.com'; \n $name = $_POST['name']; \n $email = $_POST['email'];\n $subject = $_POST['subject'];\n $message = $_POST['message'];\n \n $headers = 'From: ' . $email;\n \n if(mail($email_to, $subject, $message, $headers)){\n echo 'sent'; // we are sending this text to the ajax request telling it that the mail is sent.. \n }else{\n echo 'failed';// ... or this one to tell it that it wasn't sent \n }\n?>"^^ . + "0"^^ . + . + . + . + "0"^^ . + "PDT ships with a PhpUnit printer class that opens the port 7478 https://github.com/eclipse-pdt/pdt/blob/c60df3ed25ea5f33ba477c8acd42554860bfcc4d/plugins/org.eclipse.php.phpunit/resources/printer/PHPUnitLogger.php#L604 I assume this enables PDT to report about tests while running. So you will have a the same startup/configuration issues others have asked about. Unless you can clarify the differences to the existing Q&A material, I guess it's than just misconfigured."^^ . + . + . + . + "0"^^ . + . + . + "multiple-select"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + "azure"^^ . + . + "<p>I'm not sure if it will meet your requirements, but there are 2 ways to share the same object.</p>\n<ol>\n<li>Sessions</li>\n<li>Cache</li>\n</ol>\n<p>Sessions are mostly used for saving logged in user's information for a short time (depends on the session lifetime setting).</p>\n<p>Cache is used to store heavy computational data temporarily and can be immediately retrieved.</p>\n<p>You can implement through the following:</p>\n<pre><code>use Illuminate\\Http\\Request;\n\n// Session\nRoute::get('/page1', function(Request $request){\n $sharedObject = new SharedObject();\n $sharedObject-&gt;setFoo('newVal');\n $request-&gt;session()-&gt;put('sharedObject', $sharedObject);\n \n return $sharedObject-&gt;getFoo();\n});\n\nRoute::get('/page2', function(Request $request){\n $sharedObject = $request-&gt;session()-&gt;get('sharedObject');\n return $sharedObject-&gt;getFoo();\n});\n\n\n// Cache\nRoute::get('/page1', function(Request $request){\n $sharedObject = cache('sharedObject');\n if (is_null($sharedObject)) {\n $sharedObject = new SharedObject();\n $sharedObject-&gt;setFoo('newVal');\n cache(['sharedObject' =&gt; $sharedObject], now()-&gt;addHour()); // store for an hour.\n }\n \n return $sharedObject-&gt;getFoo();\n});\n\nRoute::get('/page2', function(Request $request){\n $sharedObject = cache('sharedObject');\n\n return $sharedObject-&gt;getFoo();\n});\n</code></pre>\n<p>Just make sure that your <code>$sharedObject</code> can be serializable. I believe laravel will store the data as a serialized string.</p>\n"^^ . + . + . + . + "1"^^ . + . + "PHP Warning: Trying to access array offset on null"^^ . + . + "0"^^ . + . + . + . + "have flushed the route cache? "php artisan route:clear", check the route exists and is registered "php artisan route:list""^^ . + "0"^^ . + "1"^^ . + . + "1"^^ . + . + "1"^^ . + . + . + . + . + "I edited the original question. Removed the IfModule directive that was interfering with the FilesMatch directive. Apparently the RewriteCond directive is necessary for the way other php scripts are requested (without the extension). For clarification I don't have access to the server itself."^^ . + . + . + . + . + . + "@AbhishekGautam does my answer help? or not yet resolved?"^^ . + "0"^^ . + "0"^^ . + . + . + . + "scopes"^^ . + . + "The Composer installer script was not successful [exit code 1] for Laravel"^^ . + . + . + . + "0"^^ . + . + "Does not work is ambiguous. I meant it didn't update the password as it returned 0 rows affected. This isn't like the duplicate which updated the record and returned 0 rows affected. This simply processes. Returns 0 rows affected and does not change the data at all."^^ . + . + . + . + "Storing and using a variable to populate a shipping field in WooCommerce"^^ . + . + . + "<p>In Notion, when I paste a wordpress page or post link into a note, the “mention” feature appears. When you use this feature, it adds the author username of the page or post into the note. I want to turn this off. In fact, my only goal is to prevent wp usernames from leaking out.</p>\n<p>I tried the code below, this code sends the endpoint “/wp-json/wp/v2/users/1” to 404, but Notion can still somehow find the username.</p>\n<pre><code>&lt;?php\nfunction disable_users_endpoint( $endpoints ) {\n \n if ( isset( $endpoints['/wp/v2/users'] ) ) {\n unset( $endpoints['/wp/v2/users'] );\n }\n\n if ( isset( $endpoints['/wp/v2/users/(?P&lt;id&gt;[\\d]+)'] ) ) {\n unset( $endpoints['/wp/v2/users/(?P&lt;id&gt;[\\d]+)'] );\n }\n\n return $endpoints;\n}\nadd_filter( 'rest_endpoints', 'disable_users_endpoint' );\n?&gt;\n</code></pre>\n"^^ . + "1"^^ . + . + . + "0"^^ . + "2"^^ . + . + . + . + . + "You've got the `database` session driver enabled, so it's trying to connect to a Database to handle sessions. Change this to `file` and see if the error goes away. (defined in in `config/session.php` and set via your `.env`'s `SESSION_DRIVER=` value)"^^ . + . + . + . + . + "Trincot, thanks, please refer to: "Since most popular browsers have a JavaScript stack, they will be able to understand and pass the challenge transparently. In contrast, bots typically do not have a JavaScript stack and, therefore, cannot pass the challenge."\nhttps://auth0.com/blog/protect-site-from-bots-with-captchas-javascript-challenges/"^^ . + . + . + . + . + . + . + . + "<p>I'm working on a car parts search feature for my website. The search logic is very complex, and the number of results is huge. Because of this, the search is running slowly. I want to integrate ElasticSearch into my Laravel 11 project, which is deployed on a VPS server using Docker. The problem is that there's no proper guide for 2025, and the old solutions are no longer relevant. I've already set up ElasticSearch in Docker, and when I access the host, I get a successful response. But I'm not sure what to do next—everywhere I look, the information is different. If you know, please advise! Thanks in advance!)</p>\n"^^ . + . + "0"^^ . + "Did you install package config files for libjpeg? What does `pkg-config --modversion libjpeg` show?"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "1"^^ . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + . + "with `/x` one could even lay the keywords out with added whitespace for legibility - eg. https://regex101.com/r/KCjqPq/1"^^ . + "Have you tried aria-hidden='true' on the \\<span> and using a \\<button> with the submit role? Button labeling is the text-content of the button. You can then add a hidden input with the value because that is what you actually want (I _guess_)."^^ . + . + . + . + . + . + "0"^^ . + . + . + "Can you please re-phrase your question? as it is unclear that what actual issue is.\nDo you mean that email is getting delivered but status is showing undelivered?"^^ . + . + . + "2"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + "@Barmar in this case, no :/"^^ . + "1"^^ . + . + . + "2"^^ . + . + . + . + . + . + . + . + . + . + . + "2"^^ . + . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + "1"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + . + . + "I am confused, what is not working? Did you run that code? It should work perfectly fine. I think `whereOnlyHas` does not exist and you are asking if that works, you should just do `whereHas`, that one does exist, and should only filter on what you want"^^ . + . + . + . + . + "0"^^ . + . + "<p>The <code>getPathPrefix()</code> method has been moved to <a href="https://github.com/thephpleague/flysystem/blob/3.x/src/PathPrefixer.php#L24" rel="nofollow noreferrer">https://github.com/thephpleague/flysystem/blob/3.x/src/PathPrefixer.php#L24</a></p>\n<p>There is no way to use it from <code>FilesystemOperator</code> or <code>LocalFilesystemAdapter</code></p>\n<p>As I understand it, the problem is</p>\n<pre class="lang-php prettyprint-override"><code>class SomeService\n{\n public function __construct(private readonly Filesystem $filesystem) {\n\n }\n\n public function someMethod() {\n // required root directory previosly accessed from $this-&gt;filesystem-&gt;getPathPrefix();\n }\n}\n\nclass SomeController {\n public function __construct(private readonly SomeService $someService) {\n\n }\n\n}\n</code></pre>\n<p>I see 2 options for refactoring</p>\n<ol>\n<li>Assume that the <code>PathPrefixer::prefixPath</code> method in <code>SomeService::someMethod</code> is useless and the <code>$location (/path/to/root)</code> property will suffice.</li>\n</ol>\n<pre class="lang-php prettyprint-override"><code>class SomeServiceFactory \n{\n public function create(string $location): SomeService {\n $adapter = new LocalFilesystemAdapter($location);\n $filesystem = new Filesystem($adapter);\n\n return new SomeService($location, $filesystem);\n }\n}\n\nclass SomeService\n{\n public function __construct(\n private readonly string $location,\n private readonly Filesystem $filesystem\n ) {\n \n }\n\n public function someMethod() {\n $this-&gt;location;\n $this-&gt;filesystem;\n }\n}\n\nclass SomeController {\n public function __construct(private readonly SomeServiceFactory $someServiceFactory) {\n\n }\n\n public function index(string $location) {\n $this-&gt;someServiceFactory-&gt;create($location)-&gt;someMethod();\n }\n\n}\n</code></pre>\n<ol start="2">\n<li>Create the decorator</li>\n</ol>\n<pre class="lang-php prettyprint-override"><code>// use this class, instead of League\\Flysystem\\Filesystem\nclass Filesystem {\n public function __construct(private readonly string $location) {\n $adapter = new LocalFilesystemAdapter($location);\n $this-&gt;filesystem = new \\League\\Flysystem\\Filesystem($adapter);\n }\n\n // proxy to original class methods\n public function __call($name, $arguments)\n {\n if (is_callable([$this-&gt;filesystem, $name])) {\n return $this-&gt;filesystem-&gt;$name(...$arguments);\n }\n\n $message = sprintf('There is no callable method %s::%s', get_class($this-&gt;filesystem), $name);\n throw new \\BadMethodCallException($message);\n }\n\n public function getPathPrefix(): string {\n $prefixer = new League\\Flysystem\\PathPrefixer($this-&gt;location, DIRECTORY_SEPARATOR);\n\n return $prefixer-&gt;prefixPath($this-&gt;location);\n }\n\n}\n</code></pre>\n"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + "<p>I TRIED the answer suggested in the question this is a &quot;duplicate&quot; of (I didn't get the printer error). The solution there (to downgrade) did NOT work for ME. I mentioned trying it.</p>\n<p>I'm running Eclipse (2024-12), PDT (8.2) on WINDOWS 11, and PHPUnit 9.6.22 (a downgrade).</p>\n<p>I'm getting the <em>Cannot launch PHPUnit tests (port address 7478): Accept timed out.</em> error, and not tests run, of course.</p>\n<ol>\n<li><p>HOW do I fix this, please?</p>\n</li>\n<li><p>WHY does PHPUnit even need a port, and what should be running on the other end of it?</p>\n</li>\n</ol>\n"^^ . + . + . + "0"^^ . + "<p>I am making a website for a FiveM server. One of my pages on my website is <code>CityLife.php</code>. It will have a photo gallery of thumbnail images that when clicked opens up to the full size image in another window. I also want to use filters on the gallery by means of drop-down menus. The first being categories which are populated with a separate PHP file that gets the folder names of the subdirectories inside of <code>/Images/PhotoGalley/Thumbnails</code>.</p>\n<p>This populates the 1st drop down menu dynamically by the folder name and is working just fine.</p>\n<p><strong>CityLife.php</strong></p>\n<pre><code>&lt;div class=&quot;DDM1&quot;&gt; \n &lt;?php\n echo '&lt;form method=&quot;post&quot; action=&quot;DDM2.php&quot;&gt;';\n echo &quot;&lt;label for= thumbnails&gt;Categories:&lt;/label&gt;&quot;; \n include &quot;DDM1.php&quot;; \n ?&gt; \n&lt;/form&gt;\n</code></pre>\n<p><strong>DDM1.php</strong></p>\n<pre><code>&lt;?php\n// Define the path to the 'Thumbnails' folder\n$directoryPath = 'Images/PhotoGallery/Thumbnails';\n\n//Scan the directory and get all items\n$items = scandir($directoryPath);\n\n// Filter out the '.' and '..' entries and only keep directories\n$subdirectories = array_filter($items, function($item) use ($directoryPath) {\n return is_dir($directoryPath . '/' . $item) &amp;&amp; $item != '.' &amp;&amp; $item != '..';\n});\n\n// Sort the subdirectories (optional, if you want them in a specific order)\nsort($subdirectories);\n\n// Output the dropdown menu\n \necho '&lt;select name=&quot;thumbnails&quot; id=&quot;thumbnails&quot;&gt;';\n \nforeach ($subdirectories as $subdirectory) {\n echo '&lt;option value=&quot;' . htmlspecialchars($subdirectory) . '&quot;&gt;' . htmlspecialchars($subdirectory) . '&lt;/option&gt;';\n}\necho '&lt;/select&gt;';\n?&gt;\n</code></pre>\n<p>The problem comes when trying to populate the 2nd menu. I have this code to attempt to do that. Intially it uses JS and Ajax to transfer the value to variable $selected_category.</p>\n<p>I then tried to use that variable as part of a filepath <code>Images/PhotoGallery/Thumbnails/$selected_category</code> as the <code>$directorypath</code> of another <code>scandir()</code> to get the sub-directories names in that category's folder. Using those name to populated the 2nd drop-down menu.</p>\n<p>This is the code that I can't seem to figure out what I am doing wrong with after populating the first menu I use:</p>\n<p><strong>CityLife.php</strong></p>\n<pre><code>&lt;div class=&quot;DDM1&quot;&gt; \n &lt;?php\n echo '&lt;form method=&quot;post&quot; action=&quot;DDM2.php&quot;&gt;';\n echo &quot;&lt;label for= thumbnails&gt;Categories:&lt;/label&gt;&quot;; \n include &quot;DDM1.php&quot;; \n ?&gt; \n &lt;/form&gt;\n\n//endof 1 menu just shown for reference// \n&lt;script src=&quot;https://code.jquery.com/jquery-3.6.0.min.js&quot;&gt;&lt;/script&gt;\n\n&lt;script&gt;\n$(document).ready(function() {\n // When the user changes the select element\n $('#thumbnails').change(function() {\n var selectedCategory = $(this).val(); // Get the selected value\n\n // Send the value to DDM2.php using AJAX\n $.ajax({\n url: 'DDM2.php', // The PHP page that will handle the data\n type: 'POST', // Send a POST request\n data: { selected_category: selectedCategory }, // Send the selected value as 'selected_category'\n success: function(response) {\n // Handle the response from DDM2.php\n console.log(response); // Print out the response from DDM2.php (if any)\n },\n error: function(xhr, status, error) {\n // Handle any errors\n console.error('AJAX request failed: ' + error);\n }\n });\n });\n});\n&lt;/script&gt;\n\n &lt;/div&gt;\n&lt;/td&gt;\n&lt;td&gt; \n &lt;div&gt;&lt;img src=&quot;Images/logo.png&quot; alt=&quot;logo&quot; width=&quot;100px&quot; height=&quot;100px&quot;&gt;&lt;/div&gt;\n&lt;/td&gt;\n&lt;td &gt;\n &lt;divclass=&quot;DDM2'&gt;\n &lt;?php\n echo '&lt;form method=&quot;post&quot; action=&quot;photo_gallery.php&quot;&gt;';\n echo '&lt;label for=&quot;SubCategory&quot;&gt;Sub Category&lt;/label&gt;';\n include 'DDM2.php';\n ?&gt;\n &lt;/form&gt; \n</code></pre>\n<p><strong>DDM2.php</strong></p>\n<pre><code>&lt;?php\n// Check if the form is submitted via POST and if 'selected_category' is set\nif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n // Check if the selected_category is set and not empty\n if (isset($_POST['selected_category']) &amp;&amp; !empty($_POST['selected_category'])) {\n $selected_category = $_POST['selected_category']; // Get the value from the POST request\n \n // Define the path to the 'Thumbnails' folder\n$directoryPath1 = 'Images/PhotoGallery/Thumbnails/$selected_category';\n\n // Scan the directory and get all items\n $items = scandir($directoryPath1);\n\n // Filter out the '.' and '..' entries and only keep directories\n $subdirectories = array_filter($items, function($item) use ($directoryPath1) {\n return is_dir($directoryPath1 . '/' . $item) &amp;&amp; $item != '.' &amp;&amp; $item != '..';\n });\n\n // Sort the subdirectories (optional, if you want them in a specific order)\n sort($subdirectories);\n\n // Output the dropdown menu\n echo '&lt;select name=&quot;SubCategory&quot; id=&quot;SubCategory&quot;&gt;';\n \n foreach ($subdirectories as $subdirectory) {\n echo '&lt;option value=&quot;' . htmlspecialchars($subdirectory) . '&quot;&gt;' . htmlspecialchars($subdirectory) . '&lt;/option&gt;';\n }\n echo '&lt;/select&gt;';\n }\n}\n?&gt; \n</code></pre>\n<p>I have tried using my database which is mysql and my site is being hosted on a web hosting site with access to php enabled and a mysql database.</p>\n<p>I hope this makes more sense to someone smarter than me and can show me where I am going wrong.</p>\n"^^ . + . + "<p>It requires decent reading:</p>\n<pre><code>psr\\log\\Psr\\Log\\LoggerInterface\n^^^^^^^^\n</code></pre>\n<p>This interface does not exist, therefore it can never be fulfilled and henceforth PHP can only error.</p>\n<p>This is propably related to a similar confusion:</p>\n<pre><code>application\\third-party\napplication\\psr\\log\n</code></pre>\n<p>You make use of psr\\log as third-party, but you place it out of your <em>third-party</em> classes directory (the class path).</p>\n<p>Therefore, I'd suggest the following:</p>\n<p>1.) Move the third-party code into the <em>third-party</em> directory.</p>\n<p>2.) Double-check the imports on top of the file that makes <em>use</em> of <code>Psr\\Log\\LoggerInterface</code> (<em>D:\\wamp\\www\\test\\application\\third_party\\Mpdf\\ServiceFactory.php</em>).</p>\n<p>There certainly is an issue when making use of the logger (<a href="https://github.com/mpdf/mpdf/blob/development/src/ServiceFactory.php#L28" rel="nofollow noreferrer">https://github.com/mpdf/mpdf/blob/development/src/ServiceFactory.php#L28</a>), which by the source is not an issue in the third-party code <em>there</em> and the other location you present gives a line mismatch in the current version of the third-party code (<a href="https://github.com/mpdf/mpdf/blob/development/src/Mpdf.php#L1092" rel="nofollow noreferrer">https://github.com/mpdf/mpdf/blob/development/src/Mpdf.php#L1092</a>) so it remains unknown to me whether it's just a buggy version you make use of, a misconfiguration on the logger aliasing during service configuration (a configuration issue on your end with MPdf), but you have your code at hand so you may already spot it.</p>\n<p>Just take note on the namespaces and how they are different, you have a prefix that is <em>not</em> in Psr\\Log:</p>\n<pre><code>psr\\log\\Psr\\Log\\LoggerInterface\n^^^^^^^^\n</code></pre>\n"^^ . + . + "<p>I have 3 tables where I want to extract data.\nFirst table is a list of games with score and IDs of clubs and teams.\nThe other 2 tables are IDs and names of clubs. And IDs and names of teams.</p>\n<p>The result I want to get is a list of rows (array) with score and names of clubs and teams.\nSo actually the IDs of the clubs and teams should be replaced by the names of the clubs and teams.\nou can see an example of tables and the result.\nWhere I look for all games where Team with ID = 15 participates. Both home and away games.</p>\n<p>Here is an example, but this is far from complete:</p>\n<pre><code> define('TAB_CLUBS', 'Clubs');\n define('TAB_TEAMS', 'Teams');\n define('TAB_LEAGUEGAMES', 'Games');\n\n\n try {\n\n // set the PDO error mode to exception\n $db-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n \n $stmt = $db-&gt;prepare(&quot;SELECT s.HomeScore AS hScore,\n hc.ClubName AS hClubName,\n ht.TeamName AS hTeamName,\n s.AwayScore AS aScore,\n ac.ClubName AS aClubName,\n at.TeamName AS aTeamName\n FROM &quot;.TAB_LEAGUEGAMES.&quot; s\n JOIN &quot;.TAB_CLUBS.&quot; hc ON hc.ClubID = s.HomeClubID \n JOIN &quot;.TAB_TEAMS.&quot; ht ON ht.TeamID = s.HomeTeamID\n JOIN &quot;.TAB_CLUBS.&quot; ac ON hc.ClubID = s.AwayClubID \n JOIN &quot;.TAB_TEAMS.&quot; at ON ht.TeamID = s.AwayTeamID\n WHERE HomeTeamID='15' OR AwayTeamID='15'&quot;);\n\n $stmt-&gt;execute(array());\n $teamgames = $stmt-&gt;rowCount(); \n $row = $stmt-&gt;fetch();\n\n if($teamgames &gt; 0) {\n while($row = $stmt-&gt;fetch(PDO::FETCH_ASSOC))\n { \n echo(&quot;TEAMGAMES_HOMESCORE:&quot;.$row['hScore'].\n &quot;|TEAMGAMES_HOMECLUB:&quot;.$row['hClubName'].\n &quot;|TEAMGAMES_HOMETEAM:&quot;.$row['hTeamName'].\n &quot;|TEAMGAMES_AWAYSCORE:&quot;.$row['aScore'].\n &quot;|TEAMGAMES_AWAYCLUB:&quot;.$row['aClubName'].\n &quot;|TEAMGAMES_AWAYTEAM:&quot;.$row['aTeamName'].\n &quot;;&quot;);\n }\n die();\n } else {\n die(&quot;NULL&quot;); \n }\n\n }\n catch(PDOException $e)\n {\n // echo &quot;Error: &quot; . $e-&gt;getMessage();\n die(&quot;An error occurred, please retry. $e&quot;);\n</code></pre>\n<p>Table Games</p>\n<div class="s-table-container"><table class="s-table">\n<thead>\n<tr>\n<th>HomeScore</th>\n<th>HomeClubID</th>\n<th>HomeTeamID</th>\n<th>AwayScore</th>\n<th>AwayClubID</th>\n<th>AwayTeamID</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>2</td>\n<td>45</td>\n<td>15</td>\n<td>1</td>\n<td>85</td>\n<td>50</td>\n</tr>\n<tr>\n<td>0</td>\n<td>75</td>\n<td>32</td>\n<td>5</td>\n<td>45</td>\n<td>15</td>\n</tr>\n<tr>\n<td>2</td>\n<td>85</td>\n<td>50</td>\n<td>5</td>\n<td>75</td>\n<td>32</td>\n</tr>\n</tbody>\n</table></div>\n<p>Table Clubs</p>\n<div class="s-table-container"><table class="s-table">\n<thead>\n<tr>\n<th>ClubID</th>\n<th>ClubName</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>45</td>\n<td>Club 1</td>\n</tr>\n<tr>\n<td>75</td>\n<td>Club 2</td>\n</tr>\n<tr>\n<td>85</td>\n<td>Club 3</td>\n</tr>\n</tbody>\n</table></div>\n<p>Table Teams</p>\n<div class="s-table-container"><table class="s-table">\n<thead>\n<tr>\n<th>TeamID</th>\n<th>TeamName</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>15</td>\n<td>Team 4</td>\n</tr>\n<tr>\n<td>32</td>\n<td>Team 26</td>\n</tr>\n<tr>\n<td>50</td>\n<td>Team 67</td>\n</tr>\n</tbody>\n</table></div>\n<p>So ideally, what I would like to get back would be:</p>\n<div class="s-table-container"><table class="s-table">\n<thead>\n<tr>\n<th>HomeScore</th>\n<th>ClubName(Home)</th>\n<th>TeamName(Home)</th>\n<th>AwayScore</th>\n<th>ClubName(Away)</th>\n<th>TeamName(Away)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>2</td>\n<td>Club 1</td>\n<td>Team 4</td>\n<td>1</td>\n<td>Club 3</td>\n<td>Team 67</td>\n</tr>\n<tr>\n<td>0</td>\n<td>Club 2</td>\n<td>Team 26</td>\n<td>5</td>\n<td>Club 1</td>\n<td>Team 4</td>\n</tr>\n</tbody>\n</table></div>\n"^^ . + "project"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + "1"^^ . + "<p>I've been trying for hours to figure out what I'm doing wrong. The $trackName variable may include apostrophes. Also, some of the $subgenre and $mood variables may be NULL. This is my PHP code:</p>\n<pre><code>$sg2 = is_null($subgenre_2) ? NULL : $subgenre_2;\n$sg3 = is_null($subgenre_3) ? NULL : $subgenre_3;\n$sg4 = is_null($subgenre_4) ? NULL : $subgenre_4;\n$sg5 = is_null($subgenre_5) ? NULL : $subgenre_5;\n\n$md2 = is_null($mood_2) ? NULL : $mood_2;\n$md3 = is_null($mood_3) ? NULL : $mood_3;\n\n$query = &quot;INSERT INTO `songs` (song_id, username, subgenre_1, subgenre_2, subgenre_3, subgenre_4, &quot;;\n$query .= &quot;subgenre_5, mood_1, mood_2, mood_3, name, artist_name, active) &quot;;\n$query .= &quot;VALUES ('&quot; . $_SESSION['new_TK_data']['song-id'] . &quot;', '&quot; . $_SESSION['username'] .&quot;', '&quot;;\n$query .= $subgenre_1 . &quot;', &quot; . $sg2 . &quot;, &quot; . $sg3 . &quot;, &quot; . $sg4 . &quot;, &quot; . $sg5 . &quot;, '&quot;;\n$query .= $mood_1 . &quot;', &quot; . $md2 . &quot;, &quot; . $md3 . &quot;, :name, '&quot;;\n$query .= $_SESSION['new_TK_data']['artist_name'] . &quot;', 1)&quot;;\n\n$trackName = $_SESSION['new_TK_data']['name'];\n\n$stmt = $pdo-&gt;prepare($query);\n$stmt-&gt;bindParam(':name', $trackName, PDO::PARAM_STR);\n$stmt-&gt;execute(); \n</code></pre>\n<p>This is what $query shows before binding:</p>\n<pre><code>INSERT INTO `songs` (song_id, username, subgenre_1, subgenre_2, subgenre_3, subgenre_4, subgenre_5, mood_1, mood_2, mood_3, name, artist_name, active) \nVALUES ('1peKZ91pGaS7QXzDBrICRy', 'romotony11', 'CONPNO', NEOCLA, SOLOPN, , , '6565', 4090, 1565, :name, 'Antonio Romo', 1)\n</code></pre>\n<p>This is the error I get:</p>\n<blockquote>\n<p>Query failed: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' , '6565', 4090, 1565, 'Twilight Mood', 'Antonio Romo', 1)' at line 1</p>\n</blockquote>\n<p>I'm not sure if the error comes from the null values, or from the single quotes missing in some values than come from variables, or from something else. I've tried many different things without success. Any help will be appreciated!</p>\n"^^ . + . + . + . + "1"^^ . + "Deploy php app on AWS ECS cluster with ALB"^^ . + "<p>The first thing to clarify here is that types in declarations are primarily <em>assertions</em>: when you say <code>function foo(): SomeType</code> you are telling PHP to <em>throw an error</em> if the function tries to return anything other than <code>SomeType</code>. There <em>are</em> cases where PHP will <em>coerce</em> the result type, and only throw an error if the coercion fails, such as turning the integer 1 into the float 1.0; but if the value returned is already an acceptable type, it will be left alone.</p>\n<p>The second thing to clarify is that the syntax for specifying what types are accepted is richer than the set of types which a value can hold. For instance, it includes &quot;union types&quot; like <code>string|int</code> which means &quot;any string or any integer&quot;; you can't have a <em>value</em> of type <code>string|int</code>, but you can look at a value and see if it matches that constraint.</p>\n<p>Putting these together, the role of <code>true</code> and <code>false</code> in type declarations becomes clearer: they are not describing new types in the language, they are just questions you can ask about a variable. The original motivation was to document the calling convention of existing functions such as <a href="https://www.php.net/strpos" rel="nofollow noreferrer">strpos</a> &quot;returns the location as an integer on success, boolean false on failure&quot;. You could mark that as returning <code>int|bool</code>, but since it never returns <code>true</code>, specifying <code>int|false</code> is more precise. That doesn't mean <code>false</code> is a new type, it just means that if the function tried to return <code>true</code>, the engine could throw an error that &quot;<code>true</code> does not meet the constraint <code>int|false</code>&quot;.</p>\n<p>The ability to specify <code>true</code> in the same place was actually added later, to make things more complete and consistent. The labelling of these as &quot;singleton types&quot; is just a theoretical description of how different types relate to each other - <code>false</code> is a sub-type of <code>bool</code> in the same way that <code>DateTimeImmutable</code> is a sub-type of <code>DateTimeInterface</code>. Note that these &quot;singleton types&quot; are not constrained to use only in return types, they can for instance be used in the type of a property with exactly the same meaning.</p>\n<pre><code>&lt;?php declare(strict_types=1);\n\nclass Foo {\n public int|false $bar;\n}\n\n$foo = new Foo;\n$foo-&gt;bar = 42; // OK\n$foo-&gt;bar = false; // OK\n$foo-&gt;bar = true; // TypeError: Cannot assign true to property Foo::$bar of type int|false\n</code></pre>\n<p>At first glance, it might seem pointless to specify <code>true</code> or <code>false</code> <em>outside</em> a union type, but it might be useful with polymorphism: if an interface says that a method must return <code>int|false</code>, it is allowed for an implementation to say it only ever returns <code>int</code>, or that it only ever returns <code>false</code>. Similarly, an interface might specify a return type of <code>bool</code>, but an implementation wants to document that it only ever returns <code>true</code> - a valid boolean, but a more specific constraint.</p>\n"^^ . + . + . + . + . + . + . + . + . + "<p>Moodle rest webservice calls usually expect all of the data to be passed as URL parameters, it doesn't look at the body of any request.</p>\n<p>So, it would need to look something like:</p>\n<pre><code>http://localhost/webservice/rest/server.php?wstoken=xxx&amp;wsfunction=local_jobsboard_recieve_salesforce_data&amp;wsmoodlerestoformat=json&amp;data['title']=Software%20Engineer&amp;data['description']=We%20are%20looking%20for%20a\n</code></pre>\n<p>etc.</p>\n<p>Note that wsmoodlerestformat is there to specify the <em>response</em> format, not the format of the data accepted.</p>\n<p>There are a couple of 3rd-party plugins out there that add new webservice protocols that allow the content to be included as JSON in the body of the request:</p>\n<ul>\n<li><p><a href="https://moodle.org/plugins/webservice_restful" rel="nofollow noreferrer">https://moodle.org/plugins/webservice_restful</a> - officially supports Moodle 4.4 (so not quite the latest Moodle 4.5, at the time of writing, but should still work)</p>\n</li>\n<li><p><a href="https://moodle.org/plugins/webservice_restjson" rel="nofollow noreferrer">https://moodle.org/plugins/webservice_restjson</a> - only supports Moodle 2.9, has not been updated in 9 years (at the time of writing), so may have problems with recent versions of Moodle</p>\n</li>\n</ul>\n"^^ . + . + . + "2"^^ . + . + . + . + . + "1"^^ . + . + . + "Using the code and data provided it's not possible to reproduce your error: https://phpize.online/sql/mysql80/1161e8aaba578083b324361c0d0120ad/php/php81/5bc5a2f8fd6a1709db7f769283c86f5f/ . I'm not sure why anyone published this out of the Staging Ground while it was still being discussed, but here we are. As we said there, by far the most likely cause of this kind of issue is that either there's actually a difference in your two queries in your real code, or your PHP code connects to a different copy of the database than the SQL editor you're using (e.g. perhaps you have dev/test/live copies?)"^^ . + . + . + . + . + . + . + . + "Have you ever visited https://www.justbringingtheraw.com/hof/wweonly.php ? I think the issue is so obvious."^^ . + . + "Since this is a REST interface, I really need to support all four HTTP methods:\n\nGET → Retrieves the user profile\nPOST → Handles user sign-up\nPUT → Updates the user profile\nDELETE → Removes the user profile"^^ . + . + . + "0"^^ . + "0"^^ . + "Php require modified?"^^ . + "2"^^ . + "0"^^ . + . + "<p><strong>Summarize:</strong><br>\nWoocommerce product dimensions are length, width and height<br>\nScope of this question is to create a shortcode for each product dimension property individually based on product ID.</p>\n<p><strong>Problem:</strong><br>\nI found many sources and no one split the dimensions in three single shortcode attribute, like in <a href="https://stackoverflow.com/questions/65779013/display-woocommerce-product-dimensions-via-a-shortcode/65779287#65779287">Display WooCommerce Product Dimensions via a Shortcode</a> answer thread.</p>\n<p>This is an example on how Display WooCommerce Product Dimensions via a Shortcode.<br>\nI don't know how to show attribute in near.</p>\n<p><strong>Description:</strong> <br>\nAdd where needed a shortcode for Lenght<br>\n<code>[user_meta id=&quot;35&quot; key=&quot;lenght&quot;]</code><br>\nAdd where needed a shortcode for Width<br>\n<code>[user_meta id=&quot;35&quot; key=&quot;width&quot;]</code><br>\nAdd where needed a shortcode for Height<br>\n<code>[user_meta id=&quot;35&quot; key=&quot;height&quot;]</code></p>\n<p><strong>Expections:</strong><br>\nSomething like this with a shortcode foreach dimensions</p>\n<pre><code>add_action( 'woocommerce_after_shop_loop_item', 'aman_show_product_dimensions', 20 );\n \nfunction aman_show_product_dimensions() {\n global $product;\n $dimensions = $product-&gt;get_dimensions();\n if ( ! empty( $dimensions ) ) {\n echo '&lt;div class=&quot;dimensions&quot;&gt;&lt;b&gt;Height:&lt;/b&gt; ' . $product-&gt;get_height() . get_option( 'woocommerce_dimension_unit' );\n echo '&lt;br&gt;&lt;b&gt;Width:&lt;/b&gt; ' . $product-&gt;get_width() . get_option( 'woocommerce_dimension_unit' );\n echo '&lt;br&gt;&lt;b&gt;Length:&lt;/b&gt; ' . $product-&gt;get_length() . get_option( 'woocommerce_dimension_unit' );\n echo '&lt;/div&gt;'; \n }\n}\n</code></pre>\n"^^ . + . + . + "0"^^ . + . + . + "If I'm reading your updates correctly, the CLI is not complaining about openssl, only the web version is. Am I correct?"^^ . + . + . + . + . + . + "4"^^ . + . + . + . + . + "3"^^ . + "What debugging have you done? Any errors or messages in the browser console?"^^ . + "<p>The Checkout payment page does not support 'cart' functionality, where customers can choose which items to purchase. All Price objects passed to the <code>line_items</code> parameter on session creation are considered a part of the payment</p>\n<p>If you want a pre-built UI component that offers plan selection, I'd recommend looking at the <a href="https://docs.stripe.com/no-code/pricing-table" rel="nofollow noreferrer">pricing table</a> which utilises Checkout for payment.</p>\n"^^ . + . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + "0"^^ . + . + . + "5"^^ . + "routes"^^ . + "<p>I'm an author, and I have my books set up as variable products in my WooCommerce store. Each book/variable product has a paperback, e-book, and audiobook variant. I want to leave the quantity button for paperbacks and remove it for the digital items, but for the life of my I can't figure out how to do that. Any info I can find seems to be a blanket option of dealing with product-type-variable, and if I understand this correctly, using that would remove the button from all 3 variants.</p>\n<p>I started off thinking this would be as simple as adding a class and display:none to my CSS, but that doesn't seem to be the case, mainly because I can't seem to be able to find the class for each variant when inspecting my pages.</p>\n<p>I've tried this: <a href="https://stackoverflow.com/questions/62943477/set-quantity-minimum-maximum-and-step-at-product-level-in-woocommerce">Set quantity minimum, maximum and step at product level in Woocommerce</a> but it limits quantities on all variants of the variable product, not selected variants.</p>\n<p>I also tried: <a href="https://stackoverflow.com/questions/62437758/woocomerce-update-max-quantity-for-product-variation">Woocomerce - Update max quantity for product variation</a> but again, this changes quantities for all variants of a variable product.</p>\n<p>I do NOT want to limit quantities of variant paperbacks. I only want to limit quantities of variant ebooks and variant audiobooks. Hopefully, that's doable!</p>\n"^^ . + "0"^^ . + . + "`$data_settings_course` was null, while `$data_settings_quizzes` is a different variable."^^ . + . + . + "character-encoding"^^ . + . + "2"^^ . + . + "0"^^ . + "How to move image to another subdomain's public folder?"^^ . + "<pre><code>class AdminPanelProvider extends PanelProvider\n{\n public function panel(Panel $panel): Panel\n {\n return $panel\n -&gt;default()\n -&gt;id('admin')\n -&gt;path('studio')\n -&gt;login(Login::class)\n -&gt;registration(Register::class)\n }\n\n}\n</code></pre>\n"^^ . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + "<p>Here is a quick example of how you can insert the new jpg image into the input form element.</p>\n<pre class="lang-html prettyprint-override"><code>&lt;form id=&quot;myform&quot; action=&quot;yourposturl&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;\n &lt;input type=&quot;file&quot; id=&quot;image-input&quot;&gt; &lt;input type=&quot;submit&quot;&gt;\n&lt;/form&gt;\n\n&lt;script src=&quot;https://alexcorvi.github.io/heic2any/dist/heic2any.js&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js&quot;&gt;&lt;/script&gt;\n</code></pre>\n\n<p>Then, add create a hidden file input field inside the form, and add the converted jpg file into the hidden file element.</p>\n<pre class="lang-js prettyprint-override"><code>$('#image-input').on('change', function(ev) {\n var blob = ev.target.files[0];\n heic2any({\n blob: blob,\n toType: &quot;image/jpeg&quot;,\n })\n .then(function (resultBlob) {\n var convertedFile = new File([resultBlob], &quot;converted_image.jpg&quot;, {type:&quot;image/jpeg&quot;});\n var fileList = new DataTransfer(); //create DataTransfer object\n fileList.items.add(convertedFile); //add the converted file to it\n \n var $hiddenInput = $('&lt;input&gt;', {\n type: 'file',\n name: 'converted-image', \n style: 'display: none;', \n });\n $hiddenInput[0].files = fileList.files; //update the hidden field's filelist by new filelist\n \n $('#myform').append($hiddenInput); //append the new hiddne field into your form\n })\n .catch(function (x) {\n var error = &quot;Error code: &quot; + x.code + &quot; &quot; + x.message;\n console.log(error);\n });\n});\n</code></pre>\n\n<p>In the PHP backend you can get the file using <code>$_FILES['converted-image']</code></p>\n"^^ . + . + . + . + . + . + "0"^^ . + "1"^^ . + "0"^^ . + . + . + "0"^^ . + . + "3"^^ . + . + "0"^^ . + . + . + . + "2"^^ . + . + . + "/\\batlan\\b/i did not match the case while space in between. The Solution from sin works like a charm"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + "windows curl error 60 while downloading https://repo.packagist.org/packages.json: SSL certificate problem: unable to get local issuer certificate"^^ . + "Are you sure you'd updated the right php.ini file? if you are running linux, your php installation will come with a different versions of php.ini for each installed SAPI."^^ . + "mysqli"^^ . + "0"^^ . + "I see there is a case where using prepared query may be better for improving the performance if the query is executed multiple times on the same connection. Do you guys think I should use it anyway here as a good practice or it doesn't really make sense in this case and I should only use prepared query on the example I will prepare that will take user input and use it as variable?"^^ . + "Thanks for the clarification, but as I see you're still struggeling: that tutorial is making use of _template layouts_ and somehow it's not part of your question. Compare here: https://livewire.laravel.com/docs/quickstart#create-a-template-layout -- probably you're falling into that gap?"^^ . + . + . + . + . + . + . + . + "Trigger woocommerce_update_product or woocommerce_process_product_meta hook on product meta update"^^ . + . + . + . + . + "It's two steps - POST to `/wp-json/jwt-auth/v1/token`, then use the token to call APIs. You're doing step 2 without step 1."^^ . + "Displaying PDF files larger than 2MB stored in mysql database in iframe tag"^^ . + "4"^^ . + "0"^^ . + . + "0"^^ . + . + . + "Only correct, working answers should have a positive score on Stack Overflow (regardless of the time of their posting) otherwise future readers will be confused or misled. After Tim got all of his uv's, ONLY my answer was dv'ed which means voters are not judging quality -- or don't understand the difference between working/not-working solutions. Ideally, the scores should indicate which answers the community recommends for the asked question. The current scores don't accomplish this goal very well."^^ . + "0"^^ . + . + "<p><strong>Problem:</strong>\nMy React app is not serving static files correctly. Requests for JavaScript and CSS files return a <code>text/html</code> content type instead of the expected <code>application/javascript</code> or <code>text/css</code>.</p>\n<p><strong>Details:</strong></p>\n<ul>\n<li><strong>URL:</strong> <a href="https://emergencyplumbersmanchester.com" rel="nofollow noreferrer">https://emergencyplumbersmanchester.com</a></li>\n<li><strong>Build Directory:</strong> <code>/home/wwwplumb/emergencyplumbersmanchester.com/build</code></li>\n<li><strong>Primary Domain:</strong> <a href="https://plumbingmanchester.co.uk" rel="nofollow noreferrer">https://plumbingmanchester.co.uk</a></li>\n<li>** Folder Structure** <a href="https://i.sstatic.net/AJTys3X8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/AJTys3X8.png" alt="Folder Structure" /></a></li>\n</ul>\n<p><strong>Server Details:</strong></p>\n<ul>\n<li><strong>Hosting Package:</strong> Silver 100</li>\n<li><strong>Server Name:</strong> s938</li>\n<li><strong>cPanel Version:</strong> 124.0 (build 26)</li>\n<li><strong>Apache Version:</strong> 2.4.62</li>\n<li><strong>Database Version:</strong> 10.6.21-MariaDB</li>\n<li><strong>Operating System:</strong> Linux</li>\n<li><strong>IP Address:</strong></li>\n</ul>\n<p><strong>Observations:</strong></p>\n<ol>\n<li>Requests for static files (e.g., <code>main.9b9eb604.js</code> and <code>main.724539ac.css</code>) return <code>text/html</code> content type.</li>\n<li>Static files seem to be redirected to <code>index.php</code> and serve <code>index.html</code>.</li>\n<li><code>.htaccess</code> rules appear to be causing issues with serving static files correctly.</li>\n</ol>\n<p><strong>Steps Taken:</strong></p>\n<ol>\n<li>Updated <code>.htaccess</code> to include MIME type settings:\n<pre class="lang-none prettyprint-override"><code>&lt;IfModule mod_mime.c&gt;\n AddType application/javascript .js\n AddType text/css .css\n AddType application/json .json\n&lt;/IfModule&gt;\n</code></pre>\n</li>\n<li>Ensured build directory permissions:\n<pre class="lang-bash prettyprint-override"><code>chmod -R 777 /home/wwwplumb/emergencyplumbersmanchester.com/build\n</code></pre>\n</li>\n<li>Verified build output and file locations.</li>\n<li>Attempted to access static files directly, but received <code>text/html</code> response.</li>\n</ol>\n<p><strong>index.php:</strong></p>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n$react_build_path = __DIR__ . '/build';\n$request_uri = $_SERVER['REQUEST_URI'];\n$clean_uri = parse_url($request_uri, PHP_URL_PATH);\n$file_path = realpath($react_build_path . $clean_uri);\n\nif ($file_path &amp;&amp; strpos($file_path, realpath($react_build_path)) === 0 &amp;&amp; is_file($file_path)) {\n $mime_type = mime_content_type($file_path);\n header('Content-Type: ' . $mime_type);\n header('Content-Length: ' . filesize($file_path));\n readfile($file_path);\n exit;\n} else {\n $index_html_path = $react_build_path . '/index.html';\n if (file_exists($index_html_path)) {\n $content = file_get_contents($index_html_path);\n echo $content;\n } else {\n echo 'React app not found. Please ensure the build directory exists and contains an index.html file.';\n }\n}\n?&gt;\n</code></pre>\n<p><strong>.htaccess</strong>:</p>\n<pre><code>&lt;IfModule mod_rewrite.c&gt;\n RewriteEngine On\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteRule ^(.*)$ index.php [L]\n&lt;/IfModule&gt;\n\n&lt;IfModule mod_mime.c&gt;\n AddType application/javascript .js\n AddType text/css .css\n AddType application/json .json\n&lt;/IfModule&gt;\n\nAlias /static /home/wwwplumb/emergencyplumbersmanchester.com/build/static\n\n&lt;Directory &quot;/home/wwwplumb/emergencyplumbersmanchester.com/build/static&quot;&gt;\n Options Indexes FollowSymLinks\n AllowOverride None\n Require all granted\n&lt;/Directory&gt;\n</code></pre>\n"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + "Wordpress Multisite Network: some site detect a different php version"^^ . + . + . + . + . + . + . + . + "2"^^ . + . + . + . + . + . + . + "0"^^ . + . + "<p>I have just finished translating my personal website into French, English and Greek using the Polylang plugin in Wordpress.org, following this method described here: <a href="https://stackoverflow.com/beta/discussions/79524310/translating-custom-strings-in-wordpress-html-and-css-using-polylang">https://stackoverflow.com/beta/discussions/79524310/translating-custom-strings-in-wordpress-html-and-css-using-polylang</a></p>\n<p>I initially attempted to translate the header templates so that I could use a single header, dynamically displaying the translated values of custom Polylang strings based on the page's language. However, I encountered several issues and ultimately decided to duplicate the header and manually translate it without using the Polylang plugin.</p>\n<p>I modified the page templates to exclude the header and footer, as they were always displayed in Greek. Instead, I copied the templates, made templated <strong>parts</strong> and used them independently. For each language, I created a corresponding translated header part. The main page template contained only the content, and I inserted the appropriate header part at the top, ensuring that everything appeared as intended.</p>\n<p>That said, my goal is still to have a single header template that automatically translates using custom strings. So, my question is: How can this be achieved?</p>\n<p>At first, I thought I could do this:</p>\n<p><strong>functions.php:</strong></p>\n<pre><code>// Register custom string in Polylang\n\nadd_action('init', function() {\n pll_register_string('mytheme-homepage', 'Home');\n});\n\n// Add custom CSS with translated string\nfunction add_custom_css() {\n ?&gt;\n &lt;style&gt;\n :root {\n --homepage-text: &quot;&lt;?php echo pll__('Home'); ?&gt;&quot;;\n \n }\n &lt;/style&gt;\n &lt;?php\n}\nadd_action('wp_head', 'add_custom_css');\n</code></pre>\n<p><strong>Then, in Additional CSS:</strong></p>\n<pre><code>.nav_home::before {\n content: var(--homepage-text);\n}\n</code></pre>\n<p><strong>And then in the HTML of the navigation MENU:</strong></p>\n<pre><code>&lt;!-- Translated Navigation Link --&gt;\n&lt;!-- wp:navigation-link {&quot;label&quot;:nav_home,&quot;url&quot;:&quot;https://myurl&quot;,&quot;kind&quot;:&quot;custom&quot;} /--&gt;\n</code></pre>\n<p>However, everytime, the navigation option &quot;Homepage&quot; and its HTML were automatically deleted.</p>\n<p>Do you know why that happens and what to do instead?</p>\n<p>Thank you for your time,</p>\n<p>Let me know if you need any additional details.</p>\n"^^ . + . + . + "1"^^ . + "The `php artisan serve ` command opens a direct port to your Laravel project so that it can be easily accessed. I'm not entirely sure what you're trying to automate. For production code, you should point your domain to the `/public ` directory. This way, `example.com `, which points to the `public ` folder, will route all incoming requests to `/public/index.php ` due to the `.htaccess ` file in that folder."^^ . + . + . + "<p>In older versions of iTop, when access was granted to roles like Service Desk Agent, Support Agent, Service Manager, and Configuration Manager, the UI would display only the ribbon with the &quot;Welcome,&quot; &quot;Configuration Manager,&quot; and &quot;Helpdesk&quot; options.</p>\n<p>However, in the new version, additional tabs such as &quot;Service Desk Management&quot; are now being displayed, which seem unnecessary for these roles.</p>\n<p>How can I configure iTop to behave like the older versions, where only the essential options are shown in the UI?</p>\n"^^ . + "0"^^ . + . + "I am totally desperate, i cannot update anything in this way. grrrrrr"^^ . + "2"^^ . + . + . + . + . + "phpword"^^ . + . + "@ADyson so if they cannot actually upload such a file, then it's not penetrable, but retrieving a mistaken status."^^ . + . + . + "2"^^ . + "This appears to be an end-uer product support request, rather than a programming question - unless you have some PHP code you were trying to write in order to solve this problem? Please take the [tour] and read [ask] to learn what Stackoverflow is about and what kind of questions you can ask here. See also [Why can't I ask customer service-related questions on Stack Overflow?](https://meta.stackoverflow.com/questions/255745/why-cant-i-ask-customer-service-related-questions-on-stack-overflow). You can [edit] your post if it's actually about programming, or delete it if not. Thanks."^^ . + "2"^^ . + . + . + . + . + . + . + "0"^^ . + . + "`libmysqlclient-dev` isn't needed for mysqli. Where did you get this information from?"^^ . + . + . + . + . + "<p><a href="https://i.sstatic.net/JdQLXd2C.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/JdQLXd2C.png" alt="Show" /></a></p>\n<p>You have the Accept and Content-Type headers both set to application/json</p>\n"^^ . + "<p>The problem stems from the deprecation of a long-standing core constant in PHP --the name shows in the message: E_STRICT-- and roots in the acceptance of this RFC proposal <a href="https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant" rel="nofollow noreferrer"><em>PHP RFC: Deprecations for PHP 8.4</em> (PHP RFC)</a> and specifically the <a href="https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant" rel="nofollow noreferrer"><em>Remove E_STRICT error level and deprecate E_STRICT constant</em></a> section.</p>\n<p>It is unclear to me how PHP core developers could even consider to yield diagnostic messages on a core constant, but as reality shows, they were capable.</p>\n<p>Despite this is a deprecation message, which normally does not break code, the situation is a little different here as constants either exist or not exist - but do not constantly yield notices at place of use.</p>\n<p>In short, the use of the E_STRICT constant practically renders PHP code and scripts incompatible with PHP 8.4. YMMV, but as your specific question shows, the PHP scripts of the PhpMyAdmin application you make use of is incompatible with your setup.</p>\n<p>Restore the last known good version or search and replace the E_STRICT constant with a different constant, e.g. EX_STRICT and define it with an integer value of 2048:</p>\n<pre class="lang-php prettyprint-override"><code>define('EX_STRICT', 2048);\n</code></pre>\n<p><em>(Ex.: define a (global) constant named &quot;EX_STRICT&quot; with an integer value of (decimal) 2 048 )</em></p>\n<pre class="lang-console prettyprint-override"><code>$ find . -type f -name '*.php' -exec sh -c '\n set -ex\n grep --color=always -nH -F E_STRICT &quot;$1&quot;\n sed -n -e s/E_STRICT/EX_STRICT/p &quot;$1&quot;\n ' -- {} \\;\n</code></pre>\n<p><em>(NOTE: sed -n .../p is preview mode, see sed(1) on how to replace if you're new to it, e.g. no p and -i instead of -n for GNU Sed)</em></p>\n<p>Perhaps the more appropriate approach has been documented in <a href="https://stackoverflow.com/q/79263415/367456"><em>PHP 8.4.1 : Constant E_STRICT is deprecated in pearcmd.php on line 441</em> (Q&amp;A)</a> as an example of how to populate changes upstream.</p>\n<p>The other deprecation messages show a slightly different picture, that IMHO is not suitable for ad-hoc fixing but relates more about more generic deprecation handling. E.g. you may want to configure PHP appropriately for production use of a code base that makes use of deprecated features.</p>\n<p>For the deprecation of passing NULL instead of string, you can find more detailed Q&amp;A material in <a href="https://stackoverflow.com/questions/71707325/migration-to-php-8-1-how-to-fix-deprecated-passing-null-to-parameter-error"><em>Migration to PHP 8.1 - how to fix Deprecated Passing null to parameter error</em> (Q&amp;A)</a></p>\n"^^ . + "0"^^ . + "1"^^ . + "0"^^ . + "<p>I have a Magento Cloud Commerce project running on version 2.4.7. Currently, we display all products on the homepage with pagination. We have created multiple attributes for configurable products, and one of these attributes, 'reports,' has over 500 values. According to Magento, the number of attribute values should not exceed 100, which has led to slow site performance. As per client, they cannot limit the optionas value.\nI am bit confuse from where should I start.\nCan anyone recommend a solution for this issue?</p>\n"^^ . + "1"^^ . + "First of all you need to understand that JSON is only a *representation*. While what you need is called a tree structure."^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "1"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + "1"^^ . + . + . + . + . + . + . + . + . + . + "What tailwind version you are using?"^^ . + . + . + . + . + . + . + "PHP doesn't make stuff like this up. Depending on what value you are passing in, `->where('column', '=', $column)` of course has the potential to not find any records at all, so that `->first()` can only return null. Whatever debug output you are looking at, is not actually the variable contents at the time the error was thrown. Maybe the function gets invoked multiple times, but you are looking at the debug output from the "wrong" call."^^ . + "0"^^ . + . + "0"^^ . + "oroplatform"^^ . + . + . + "Resetting permissions in a folder with `chmod` will only affect that folder and its sub-folders. So if you apply this inside a web server root, it's totally safe. Again, please edit your post; there isn't really enough information to go on yet."^^ . + "Have you tried debugging the variables in a console log before submission and after submission, via dump(), in the update() method ?"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + "<p>Enums, in the way that PHP has implemented them, are not just a special type of constant; rather, they are a way of defining a custom type, that the language can keep track of. As a comparison, consider the &quot;boolean&quot; type: it has two values, <code>true</code> and <code>false</code>; in the same way, a custom &quot;Month&quot; type might have 12 values, <code>Month::January</code>, <code>Month::February</code>, etc. The idea is that you can have functions which expect a <code>Month</code>, and accidentally passing some other value will be an error.</p>\n<p>The &quot;backed enum&quot; functionality is just a shorthand way of defining a conversion from or to some &quot;standard&quot; representation of the value as a string or integer, defining <code>-&gt;value</code>, <code>from</code> and <code>tryFrom</code> for you. You can also define whatever other conversions you want.</p>\n<p>If the values you're using do form a natural type - e.g. if a <code>Page</code> value can <em>only ever</em> be one of a fixed list, then an enum might be appropriate. The conversion to and from string is just part of the display and input processing logic, just as with any other complex value (e.g. a date, or a price with attached currency).</p>\n<p>If you just want to put lots of thematically linked constants together, but they aren't &quot;all the values&quot; of anything, you can just use a class, or even a namespace, e.g.</p>\n<pre><code>namespace Hschmauder\\SomeApp\\Fields\\Order {\n const FirstName = 'firstname';\n}\n</code></pre>\n<p>On the other hand, maybe the long list of strings is a smell that you're overusing strings and arrays in contexts where objects could be used:</p>\n<pre><code>$_SESSION['order'] = Order::fromFormArray($_POST);\n</code></pre>\n<p>The knowledge of what string keys are used in the form would be isolated in a couple of methods of the class, and most of the application would access fully-typed properties of the object.</p>\n"^^ . + "<p>I've stared at this so long. I'm on a code marathon and I think my brain is reaching the limit where I'm overthinking everything.</p>\n<p>I am working through code that someone else wrote. I've rewrote the bulk of it and am on the last part.</p>\n<p>This while loop works but I'm questioning if it is going all the way through the file when it could stop when the ID is found. I am not a fan of while loops and usually use for loops, but did not want to break what is working.</p>\n<p>The csv file is full of comma delimited ID's...about 500 of them.</p>\n<p>I found similar code here: <a href="https://www.php.net/manual/en/function.fgetcsv.php" rel="nofollow noreferrer">https://www.php.net/manual/en/function.fgetcsv.php</a></p>\n<pre><code>$openCsv = fopen('../../folder/somecsvfile.csv', 'r');\n$valid = false;\nwhile(($data = fgetcsv($openCsv)) != false) {\nif($_POST['ID'] == $data[0]) { $valid = true; }\n}\nfclose($openCsv);\n</code></pre>\n<p>I think this will only be false on failure, so when it is at the end of the file. Should/could it be like this? Thoughts?</p>\n<pre><code>$openCsv = fopen('../../folder/somecsvfile.csv', 'r');\n$valid = false;\nwhile(($data = fgetcsv($openCsv)) !== FALSE) &amp;&amp; ($valid !== true) {\nif($_POST['ID'] == $data[0]) { $valid = true; }\n}\nfclose($openCsv);\n</code></pre>\n<p>I put another equal sign by false as well. I mean...it's working...so PHP must have interpreted the single equal sign correctly. And I don't know if I should just leave it but it seems the program could save resources and time by not going through the entire file.</p>\n<p>Someone better at while loops than me, please chime in.</p>\n<p>I tested this and it seems to work, but I'm not a while loop expert. So, I'm looking for someone to verify that this is correct or incorrect on my while loop thinking.</p>\n"^^ . + . + . + . + "2"^^ . + . + . + "1"^^ . + . + "2"^^ . + . + "Yes, I admit I'm overwhelmed and don't quite know what to do. Indeed, properly configuring a web server and managing security and performance aspects is more complex than I anticipated. I appreciate all the information and advice given, and I will consider safer and more reliable options for hosting the application"^^ . + . + "0"^^ . + "<p>full name of user, my code is</p>\n<p><code>if (preg_match('/^[a-zA-Z ]+\\.[a-zA-Z ]*$/',$fullName) == false)</code></p>\n<p>it just allow letters, space and 1 dot in the variable</p>\n<p>but i want it allow 0-multiple dots (dots in middle name and in suffix)</p>\n"^^ . + . + . + . + . + . + "<p>So the answer is complicated.</p>\n<p>Like @Moshe Katz offered I created DummyClass and changed createModelByType().</p>\n<ol>\n<li>All my models extend CommonModel class, like Balance</li>\n</ol>\n<pre class="lang-php prettyprint-override"><code>class Balance extends CommonModel\n{\n public $subject;\n public $subject_id;\n \n public function subjectable(): MorphTo\n {\n return $this-&gt;morphTo(__FUNCTION__, 'subject', 'subject_id');\n }\n}\n</code></pre>\n<ol start="2">\n<li>In CommonModel I have overwrite method newMorphTo with my class <em>App\\Models\\Replace\\MorphTo</em></li>\n</ol>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\nnamespace App\\Models;\n\nuse App\\Models\\Replace\\MorphTo;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass CommonModel extends Model\n{\n public function isDummy()\n {\n return false;\n }\n\n protected function newMorphTo(Builder $query, Model $parent, $foreignKey, $ownerKey, $type, $relation)\n {\n return new MorphTo($query, $parent, $foreignKey, $ownerKey, $type, $relation);\n }\n}\n</code></pre>\n<ol start="3">\n<li>I have created app\\Models\\Replace\\MorphTo.php class which return DummyClass:</li>\n</ol>\n<pre class="lang-php prettyprint-override"><code>&lt;?php\n\nnamespace App\\Models\\Replace;\n\nuse App\\Models\\DummyClass;\nuse Illuminate\\Database\\Eloquent\\Relations\\MorphTo as IlluminateMorphTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\Relation;\nuse Illuminate\\Support\\Arr;\n\nclass MorphTo extends IlluminateMorphTo\n{\n public function createModelByType($type)\n {\n $class = Arr::get(Relation::morphMap() ?: [], $type, DummyClass::class);\n\n return tap(new $class, function ($instance) {\n if (! $instance-&gt;getConnectionName()) {\n $instance-&gt;setConnection($this-&gt;getConnection()-&gt;getName());\n }\n });\n }\n}\n</code></pre>\n<ol start="4">\n<li>Next we need DummyClass, that uses fake database.</li>\n</ol>\n<pre><code>&lt;?php\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass DummyClass extends Model\n{\n protected $connection = 'sqlite_fake';\n\n public function isDummy()\n {\n return true;\n }\n}\n</code></pre>\n<ol start="5">\n<li>Also we need to create that fake database in config/database.php</li>\n</ol>\n<pre class="lang-php prettyprint-override"><code> 'connections' =&gt; [\n\n 'sqlite_fake' =&gt; [\n 'driver' =&gt; 'sqlite',\n 'database' =&gt; ':memory:',\n 'prefix' =&gt; '',\n ],\n ...\n</code></pre>\n<ol start="6">\n<li>And finnaly we need to create empty table in memory. I put this code in AppServiceProvider boot() method.</li>\n</ol>\n<pre class="lang-php prettyprint-override"><code> Schema::connection('sqlite_fake')-&gt;create('dummy_classes', function ($table) {\n $table-&gt;id();\n });\n</code></pre>\n"^^ . + "0"^^ . + "a possible cause is that the directive of if the warnings should be displayed can be changed at any point during the run time using the "error_reporting()" function and that will override what's in the ini file. so if that function is being called from one of the package functions it'll then ignore your ini file setting."^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + "3"^^ . + "<p>This should properly calculate the tax based on the profit margin for your specific products. Just make sure you've got the cost prices entered in the '_purchase_price' field (or adjust the code to match your field name).</p>\n<pre><code>// FINALLY WORKING! This hook runs per cart item which is exactly what we need\nadd_filter('woocommerce_calculate_item_totals_taxes', 'margin_based_tax_calc', 10, 3);\n\nfunction margin_based_tax_calc($taxes, $item, $cart_totals) {\n // Don't run in admin except for AJAX requests\n if (is_admin() &amp;&amp; !defined('DOING_AJAX')) {\n return $taxes;\n }\n\n // Only care about products with our special tax class\n if ($item-&gt;tax_class != 'custom-tax-class') {\n return $taxes; // Leave other products alone\n }\n \n // TODO: Move this to settings page later?\n $prod_id = $item-&gt;product-&gt;get_id();\n \n // Get cost price from meta - I'm using _purchase_price but you might use something else\n $cost = get_post_meta($prod_id, '_purchase_price', true);\n // Fallback if someone forgot to add purchase price\n if (!$cost || $cost == '') {\n $cost = 100; // Maybe log this somewhere?\n }\n\n // Price minus cost = profit margin\n $price = floatval($item-&gt;price);\n $margin = $price - floatval($cost); \n \n // Don't allow negative margins\n if ($margin &lt; 0) $margin = 0;\n \n // Need to multiply by quantity! Forgot this in my first version\n $qty = $item-&gt;quantity;\n $total_margin = $margin * $qty;\n \n // This is where my previous code was failing!\n // Tax rates in WC are stored as percentages (10.0) not decimals (0.1)\n $result = array();\n foreach ($item-&gt;tax_rates as $id =&gt; $rate_info) {\n // SUPER IMPORTANT: Must divide rate by 100\n $decimal_rate = floatval($rate_info['rate']) / 100; \n $tax = round($total_margin * $decimal_rate, 2);\n $result[$id] = $tax;\n }\n \n return $result;\n}\n\n</code></pre>\n"^^ . + . + . + . + "Related: https://stackoverflow.com/questions/13816051/php-warning-unable-to-initialize-module/13816082"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + . + . + "If you are using intelephense, you can add multiple folders to one workspace, so that all classes can be indexed."^^ . + . + "sockets"^^ . + . + . + . + . + . + . + "1"^^ . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + "codelite"^^ . + . + . + . + . + . + . + . + "I think this is hardly a `git` question."^^ . + "The docker container probably could work exactly like the shared hosting and vice-versa for all your requirements. Therefore in general I see no blockers and the answer would be: No. But you have neither shown how you build for the docker container nor how you build for the non-docker-host so it's hard to say on first glance what your issue is and what exactly you perhaps want to ask about."^^ . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + "1"^^ . + "Laravel Livewire v3.15.19 does not respond or work at all"^^ . + . + "Use `{$wpdb->prefix}wc_order_product_lookup` instead of `$wpdb->wp_wc_order_product_lookup` ensuring that you declared before `global $wpdb;`."^^ . + . + "0"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + "Use either `is_shop()` or `is_product()` to determine which scenario you are in, and alter your output accordingly."^^ . + . + . + . + "libjpeg"^^ . + . + . + "Excellent. The `\\K` has always been hard to wrap my head around. Time to do some research."^^ . + "0"^^ . + . + "<p>After turning on throwing filesystem exceptions in Laravel <code>config/filesystems.php</code>, parameter <code>throw =&gt; true</code></p>\n<p>Chrome debugger showed that exception is was thrown after call to chmod().\nGeeseFS documentation says that chmod is not supported. Big Problem.</p>\n<p>However, I found that I can remove 'visibility' parameter in this config file config and problematic chmod() will not be called!</p>\n<p>In GeeseFS access rights in are specified when you mount filesystem anyway.</p>\n<pre><code>'disks' =&gt; [\n\n 'local' =&gt; [\n 'driver' =&gt; 'local',\n 'root' =&gt; storage_path('app'),\n 'throw' =&gt; false,\n ],\n\n 'public' =&gt; [\n 'driver' =&gt; 'local',\n 'root' =&gt; storage_path('app/public'),\n 'url' =&gt; env('APP_URL').'/storage',\n /* 'visibility' =&gt; 'public', // calls chmod() that does not work with GeeseFS. Access rights in GeeseFS are specified when you mount filesystem.*/\n 'throw' =&gt; true,\n ],\n\n</code></pre>\n"^^ . + . + "0"^^ . + "1"^^ . + . + . + . + . + . + . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "Livewire is not being found 404"^^ . + . + . + "0"^^ . + . + . + "0"^^ . + "1"^^ . + . + "@aynber I am not asking about the format, time is incorrect. I've already got them formatted using a cast on the model that looks like this: 'created_at' => 'datetime:Y-m-d H:i:s'"^^ . + . + "bulkinsert"^^ . + . + "I tried your suggestion, still no luck.\n\nThis is my code:\n\n $mailto = "$email,myaddress@email.com";\n\nThis works everytime as is. The site visitor's email is the $email part of the recipient code. But I need myaddress@email.com to be bcc."^^ . + . + . + . + "WooCommerce Progressive discount based on cart subtotal if there are no discounted items"^^ . + . + . + "0"^^ . + "free-jqGrid differ in some actions, so for me is difficult to tell you exactly where to look. Instead of this - when you save the data the only way not to save it, is maybe a certain event which is called in saving - by example afterSave and so on. Normally the data should be saved. Just for the test - remove all events related with saving data and see what is happen."^^ . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + "Are sessions not sufficient for this use case? Set a session variable in the first route, access it in the 2nd route (or perform some kind of logic if that value isn't set, etc.)"^^ . + . + . + . + "0"^^ . + . + . + "2"^^ . + . + . + "0"^^ . + . + . + "1"^^ . + . + "Laravel Sanctum Email Verification Not Updating email_verified_at Field"^^ . + . + . + . + "-1"^^ . + . + "<p>In context of WebApp in Symfony7 &amp; Glide symfony bundle (<a href="https://glide.thephpleague.com/" rel="nofollow noreferrer">glide-symfony</a>).</p>\n<p>I would like to custom the path of created image cache and also change the generated webp filename in cache.</p>\n<p>Lot of config in Glide-symfony but it seems that nothing about those things.</p>\n<p>My config glide server :</p>\n<pre><code>public function __construct(array $serverConfig)\n{\n $this-&gt;server = ServerFactory::create(\n [\n 'response' =&gt; new SymfonyResponseFactory(),\n 'source' =&gt; $serverConfig['source_path'],\n 'cache' =&gt; $serverConfig['cache_path'],\n 'driver' =&gt; 'imagick',\n 'cache_with_file_extensions' =&gt; true,\n 'group_cache_in_folders' =&gt; false,\n 'base_url' =&gt; 'toto-on-the-beach',\n 'cache_path_prefix' =&gt; 'toto-on-the-sky',\n ]);\n\n $this-&gt;server-&gt;setCachePathPrefix(null);\n $this-&gt;server-&gt;setGroupCacheInFolders(true);\n}\n</code></pre>\n<p>With this call :</p>\n<pre><code>$server-&gt;outputImage('artwork/038099-0.jpg', ['w' =&gt; 300, 'h' =&gt; 400, 'fm' =&gt; 'webp']);\n</code></pre>\n<p>generate this structure folder :</p>\n<p><a href="https://i.sstatic.net/4h5DjW3L.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/4h5DjW3L.png" alt="enter image description here" /></a></p>\n<p>Obviously, I try many things and glide-symfony provide lot of configs but perhaps something lost one me and I don't find the tricks for controlling folder and filename (all the rest ok!).</p>\n<p>How can I control generated folder (name, created or no) and generated filename ?</p>\n"^^ . + . + "Tailwind is 4.0.14."^^ . + "0"^^ . + "0"^^ . + . + . + "<p>I have a PHP app needing to query all subfolders of a target folder, to create galleries fetching the subfolder images.</p>\n<p>Until now I used the <strong>drive.metadata.readonly</strong> scope, but Google is not approving the app, saying it can be done using <strong>drive.file</strong> scope.</p>\n<p>Stating the user already approved the oauth screen and grabbed its token, the folders and files query always gives me an empty array.I tried the <strong>Drive picker</strong>: it gives me the folder ID. Then I run the query based on that folder ID, but same result.</p>\n<p>Where am I doing the mistake? Is it really possible to automatically fetch a folder contents knowing its ID with that scope?</p>\n"^^ . + . + . + . + . + . + "How to get all photos from a message using $MadelineProto->messages->getHistory()?"^^ . + "0"^^ . + "Check your `.env` file. Make sure `FILESYSTEM_DISK` is set to `s3`."^^ . + . + . + . + "1"^^ . + . + . + . + "I guess I'm confused about the actually utility of something like composer with applications your actually delivering to a customer. How does that usually work, you tell your client " hey You need to have composer installed and run composer install in order for this software to run smoothly"..."^^ . + . + "<p>As far as I know, <code>fastcgi_pass</code> on nginx uses only the major and minor versions. (<code>7.3</code>)\nWhen you use <code>PHP_VERSION</code> it will include patch number as well. (Ex: <code>7.3.25</code>)</p>\n<p>Either use</p>\n<pre><code>PHP_VERSION=$(php -r &quot;echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;&quot;)\n</code></pre>\n<p>Or</p>\n<pre><code>PHP_VERSION=$(php -v | grep -oP '^PHP \\K\\d+\\.\\d+' | head -1)\n</code></pre>\n"^^ . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + "1"^^ . + . + . + "Okay, significant update @chris haas... Swtiched from 7.3.44 to 8.3.3 and OpenSSL loads. Maybe it is something to do with that php 7.4.33 build? I'll a add to the orignal post as contrary to one comment, switching from 7.4.33 to 8.3.3 was trivial"^^ . + "1"^^ . + "0"^^ . + . + . + "P.S. I'm not sure where you've been learning from, but this is totally the wrong way to build a SQL query using PHP when you're incorporating user input into it. 1) It's vulnerable to SQL injection attacks, and 2) it can be crashed with simple syntax issues due to the input values - e.g. anyone with a `'` in their username/email (such as `O'Reilly`) would crash your query because SQL would think the `'` was terminating the input string after the `O`."^^ . + . + . + "Hosting a blog is not programming, so the question is off-topic here. But if you want JSON, you should ask for it with the `Accept` header. If you're sending JSON you should also include the `Content-Type` header. A tool like Postman is typically easier to work with than `curl`."^^ . + . + "<p>You can try using <code>lockForUpdate</code> with your eloquent model.</p>\n<p>A very simple example would be like this.</p>\n<pre><code>public function exampleTransaction()\n{\n DB::beginTransaction();\n\n try {\n $existingModel = Model::lockForUpdate()-&gt;where('column', $value)-&gt;exists();\n\n if ($existingModel) {\n // Maybe put some validation message?\n // then throw an exeption.\n throw new \\Exception('Model already exists');\n }\n\n Model::create(['column' =&gt; $value]);\n\n DB::commit();\n } catch (\\Exception $e) {\n DB::rollback();\n Log::error($e-&gt;getMessage());\n\n return response()-&gt;json(['message' =&gt; 'Cannot create model. Please try again.']);\n }\n\n return response()-&gt;noContent();\n}\n</code></pre>\n<p>Although this will still go to the catch block, by adding <code>lockForUpdate</code>, the code will prevent another process from selecting or modifying while the current process is happening.</p>\n"^^ . + . + . + "<p>According to your code, I can deduce that tags variable is a collection of objects. As such, you cannot explode on it like that in your blade file within the php block statement. The php explode function takes in a &quot;seperator&quot; and &quot;string&quot; as arguements according to its documentation <a href="https://www.php.net/manual/en/function.explode.php" rel="nofollow noreferrer">here</a>. If your aim is to return the ids of the selected tags, you can pluck the id column on tags collection and return it as an array as shown below. That is of course if &quot;tags&quot; is indeed a collection, otherwise you can make it one.</p>\n<pre><code>$selected = $this-&gt;tags-&gt;pluck('id')-&gt;toArray(); // If tags is a collection\n</code></pre>\n<p>But if not a collection,</p>\n<pre><code>$tagsCollection = collect($this-&gt;tags);\n$selected = $tagsCollection-&gt;pluck('id')-&gt;toArray();\n</code></pre>\n<p>Afterwhich, you can pass it along to the view with the rest of the data in the edit method in your controller. Therefore, you wont have a need for the php block any longer in your blade file and the selected tags should now be visible.</p>\n"^^ . + . + "0"^^ . + "<p>The markers show up, but the map itself is blank when markers show, but on pages with no featured listing and no markers, the map displays</p>\n<pre><code>&lt;script src=&quot;https://unpkg.com/leaflet@1.9.4/dist/leaflet.js&quot;\n integrity=&quot;sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=&quot;\n crossorigin=&quot;&quot;&gt;&lt;/script&gt;\n\n&lt;script&gt;\ndocument.addEventListener(&quot;DOMContentLoaded&quot;, function () {\n // Initialize the map with Brampton coordinates and a zoom level\n var map = L.map('map').setView([43.7315, -79.7624], 13);\n\n // Add a tile layer using OpenStreetMap\n L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {\n maxZoom: 19,\n attribution: '&amp;copy; &lt;a href=&quot;http://www.openstreetmap.org/copyright&quot;&gt;OpenStreetMap&lt;/a&gt;'\n}).addTo(map);\n\n // Get housing locations from the backend as JSON\n var housingLocations = @json($housingLocations);\n\n // Create a feature group for markers\n var markers = L.featureGroup();\n\n // Loop through each housing location and add a marker if valid coordinates exist\n housingLocations.forEach(function(location) {\n console.log(&quot;Location:&quot;, location);\n if (location.lat &amp;&amp; location.lon) {\n console.log(&quot;Adding marker at:&quot;, location.lat, location.lon);\n var marker = L.marker([location.lat, location.lon]);\n var popupContent = '&lt;strong&gt;' + location.name + '&lt;/strong&gt;&lt;br&gt;' +\n location.address + '&lt;br&gt;' +\n location.city + ', ' + location.province + ' ' + location.postal_code;\n marker.bindPopup(popupContent);\n markers.addLayer(marker);\n } else {\n console.log(&quot;Invalid coordinates:&quot;, location.lat, location.lon);\n }\n });\n\n // Add all markers to the map\n map.addLayer(markers);\n if (housingLocations.length &gt; 0 &amp;&amp; markers.getLayers().length &gt; 0) {\n map.fitBounds(markers.getBounds());\n }\n\n // Invalidate map size after a short delay to ensure proper rendering\n setTimeout(function() {\n map.invalidateSize();\n }, 500);\n});\n&lt;/script&gt;\n</code></pre>\n<pre><code>/ Fetch housing locations for the map (same query as HousingMapController)\n $housingLocations = DB::table('housing_metas')\n -&gt;join('housings', 'housing_metas.HousingID', '=', 'housings.ID')\n -&gt;select(\n 'housings.Name as name',\n 'housings.Type as type',\n 'housings.Status as status',\n 'housing_metas.Address as address',\n 'housing_metas.City as city',\n 'housing_metas.Province as province',\n 'housing_metas.PostalCode as postal_code',\n 'housing_metas.Lon as lon',\n 'housing_metas.Lat as lat'\n )\n -&gt;whereIn('housings.ID', $housingIDs)\n -&gt;where('housing_metas.City', '=', 'Brampton')\n -&gt;whereIn('housings.Type', ['p', 'b'])\n -&gt;whereNotNull('housing_metas.Lon')\n -&gt;where('housing_metas.Lon', '!=', 0)\n -&gt;get();\n\n return view('frontend.residence_type', [\n 'page_title' =&gt; 'Types of Residence',\n 'housings' =&gt; $housings,\n 'category' =&gt; $category, // Pass category to view\n 'housingLocations' =&gt; $housingLocations\n ]);\n }\n}\n</code></pre>\n<p>Below is a short summary of what my code has accomplished so far:</p>\n<p>• Leaflet Assets:\n– The Leaflet CSS and JS libraries are included via CDN to enable map rendering and functionality.</p>\n<p>• Map Container &amp; Styling:\n– A div with the id &quot;map&quot; is defined with a fixed height and full width to display the map.</p>\n<p>• Map Initialization:\n– On DOMContentLoaded, a Leaflet map is initialized with a central coordinate (Brampton) and a specified zoom level.</p>\n<p>• Tile Layer Setup:\n– The map uses OpenStreetMap tiles, loaded via HTTPS, with proper attribution.</p>\n<p>• Markers Data:\n– Housing location data is passed from the backend (via the $housingLocations JSON object) to JavaScript.</p>\n<p>• Markers Creation:\n– A feature group is created, and for each housing location that has valid latitude and longitude, a marker is added with a popup containing the name, address, city, province, and postal code.</p>\n<p>• Map View Adjustment:\n– Once the markers are added, the map’s view is adjusted to fit all markers (using fitBounds) and the map size is validated with invalidateSize after a short delay.</p>\n<p>This setup allows to dynamically display housing markers on a Leaflet map within your Laravel application.</p>\n"^^ . + . + . + "next.js"^^ . + . + "Use your browser's network tools to see the *actual* value of the JSON that's being returned (likely by the captcha code rather than your code). "SyntaxError: JSON.parse" means the "json" is not json, it does not mean there's an error in *your* code."^^ . + . + "<p>It is really long to explain why I use streams for simple task (and I can't change it)\nbut at the moment I save multiple datas into different keys which are associated with streams.\nAfter data is got from the stream with XRANGE I need to completely destroy the data,key.\nYes, just one access to the stream and everything has to be destroyed.\nI tried everything. I tried expire 0 on the key, del, xtrim maxlen of 0 (and then del) and nothing works and my memory keeps getting bigger until exhaustion.\nEven if 1 key (stream) is used, XRANGEd then deleted same memory leak applies.\nWhat i see is</p>\n<h1>Memory</h1>\n<pre><code>used_memory:27305504\nused_memory_human:26.04M\nused_memory_rss:17321984\nused_memory_rss_human:16.52M\nused_memory_peak:27349928\nused_memory_peak_human:26.08M\nused_memory_peak_perc:99.84%\nused_memory_overhead:681540\nused_memory_startup:660608\nused_memory_dataset:26623964\nused_memory_dataset_perc:99.92%\nallocator_allocated:29209872\nallocator_active:38076416\nallocator_resident:38535168\ntotal_system_memory:2050424832\ntotal_system_memory_human:1.91G\nused_memory_lua:37888\nused_memory_lua_human:37.00K\nused_memory_scripts:0\nused_memory_scripts_human:0B\nnumber_of_cached_scripts:0\nmaxmemory:33554432\nmaxmemory_human:32.00M\nmaxmemory_policy:volatile-lru\nallocator_frag_ratio:1.30\nallocator_frag_bytes:8866544\nallocator_rss_ratio:1.01\nallocator_rss_bytes:458752\nrss_overhead_ratio:0.45\nrss_overhead_bytes:-21213184\nmem_fragmentation_ratio:0.64\nmem_fragmentation_bytes:-9944392\nmem_not_counted_for_evict:0\nmem_replication_backlog:0\nmem_clients_slaves:0\nmem_clients_normal:20496\nmem_aof_buffer:0\nmem_allocator:jemalloc-5.2.1\nactive_defrag_running:0\nlazyfree_pending_objects:0\n</code></pre>\n<p>Using PHP redis to do Redis-&gt;del($key) etc.</p>\n<p>I can't use ordinary key to store the data (when del there is no leak).\nRedis version 6.0.16</p>\n"^^ . + . + . + . + . + . + . + "How can I use my own textract adapter with php?"^^ . + . + "0"^^ . + "2"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "Get term id of loop grid item in Elementor"^^ . + . + . + . + "That's JavaScript not Java. Make sure you understand the difference and refer to them correctly otherwise people can get confused about what you're talking about - they're actually very different languages. Anyway yes that would explain the issue, glad you found it"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + "You're violating Liskov Substitutability if a method in a class that implements an interface doesn't accept the same type of arguments as the method in the interface."^^ . + "<p>i googled this error in many ways but only could find irrelevant messages</p>\n<p>i am migrating a cakephp 4.2 PHP application to cakephp 5 and only the 'default' database is usable</p>\n<p>in my app_local.php i have declared several databases (as i did in cakephp 4) and only the 'default' is working.</p>\n<p>when i use\n<code>/bin/cake schema_cache build --connection default</code>\nthe cache files are generated in tmp/cache/model</p>\n<p>BUT any other db defined i try to use i will get the error</p>\n<blockquote>\n<p>Datasource class <code>XXX</code> could not be found.</p>\n</blockquote>\n<p>if i switch the default configuration with another DB name then the cache is generated. it really looks like only one db configuration is taken, the 'default' one</p>\n<p>all databases are on the same host, same user, same mysql configuration</p>\n<p>if i try to declare the database with code:</p>\n<p><code>ConnectionManager::setConfig('XXX', $config);</code></p>\n<p><code>$connection = ConnectionManager::get('XXX');</code></p>\n<p>i will get the error that the source is already declared, and if i remove the configuration of the XXX db in app_local.php, then i get back to the error</p>\n<blockquote>\n<p>Missing Datasource</p>\n</blockquote>\n<blockquote>\n<p>Datasource class <code>XXX</code> could not be found.</p>\n</blockquote>\n<p>i regenerated the composer several times with\n<code>composer update dumpautoload</code></p>\n<p>other posts about this error are usually very old, wrong configuration or database not accessible, so i don't know if others had the same issue on the latest versions</p>\n"^^ . + . + . + . + . + . + . + . + "passwords"^^ . + . + "@krisgjika i have edit the post whit some code of my project."^^ . + . + . + . + . + . + . + "<p>A PHP Error was encountered\nSeverity: 8192</p>\n<p>Message: Creation of dynamic property CI_URI::$config is deprecated</p>\n<p>Filename: core/URI.php</p>\n<p>Line Number: 101</p>\n<p>Backtrace:</p>\n<p>File: C:\\xampp\\htdocs\\Simple-KasirBarang-Codecodeigniter3-master\\index.php\nLine: 315\nFunction: require_once</p>\n"^^ . + . + . + . + . + . + . + "hook"^^ . + . + . + . + "1"^^ . + . + . + "<p>I have simple class with nullable string</p>\n<pre class="lang-php prettyprint-override"><code>class User {\n public string Name = &quot;John&quot;;\n public ?string Email;\n}\n</code></pre>\n<p>Then i searialize via <code>json_encode</code> it's return only one field</p>\n<pre class="lang-json prettyprint-override"><code>{\n &quot;Name&quot;: &quot;John&quot;\n}\n</code></pre>\n<p>but as say JSON-Schema, json can have null valuables, so i'm expecting</p>\n<pre class="lang-json prettyprint-override"><code>{\n &quot;Name&quot;: &quot;John&quot;,\n &quot;Email&quot;: null\n}\n</code></pre>\n<p>Is it possible (and how) to make right JSON with nullable properties in PHP?</p>\n"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "1"^^ . + "Laravel Cashier (Paddle): Not Storing Transactions & Subscriptions"^^ . + "<p>I found that WebP Express works correctly even without the <code>&lt;picture&gt;</code> tag. The reason is that my server is running Nginx with specific rules that serve WebP images directly at the server level, so WebP Express does not need to modify the HTML.</p>\n<p><strong>How WebP Express Works on My Setup</strong></p>\n<ul>\n<li>I'm using an Nginx server with custom rewrite rules that detect if the browser supports WebP and serve <code>.webp</code> images accordingly.</li>\n<li>The &quot;Alter HTML&quot; option in WebP Express is completely disabled, meaning the plugin does not modify the HTML to use tags.</li>\n<li>Even though HTML still references <code>.jpg/.png</code>, browsers actually receive <code>.webp</code> files due to server-side handling.</li>\n</ul>\n<p><strong>My Nginx WebP Rewrite Rules</strong></p>\n<pre><code># WebP Express rules\n# --------------------\nlocation ~* ^/?wp-content/.*\\.(png|jpe?g)$ {\n add_header Vary Accept;\n expires 365d;\n if ($http_accept !~* &quot;webp&quot;){\n break;\n }\n try_files\n /wp-content/webp-express/webp-images/doc-root/$uri.webp\n $uri.webp\n /wp-content/plugins/webp-express/wod/webp-on-demand.php?xsource=x$request_filename&amp;wp-content=wp-content\n ;\n}\n\n# Route requests for non-existing webps to the converter\nlocation ~* ^/?wp-content/.*\\.(png|jpe?g)\\.webp$ {\n try_files\n $uri\n /wp-content/plugins/webp-express/wod/webp-realizer.php?xdestination=x$request_filename&amp;wp-content=wp-content\n ;\n}\n# ------------------- (WebP Express rules ends here)\n</code></pre>\n<p><strong>How I Verified This</strong></p>\n<ul>\n<li>Checked the browser network requests (DevTools → Network → Img) - the HTML still shows <code>.jpg/.png</code>, but the browser actually loads <code>.webp</code>.</li>\n<li>Tested in a browser that does NOT support WebP (e.g., Safari on iPhone 8) - the server correctly serves <code>.jpg/.png</code> when WebP is not supported.</li>\n</ul>\n"^^ . + . + . + . + "-1"^^ . + . + . + "<p>You should check your model $fillable and $guard variables which is built in variable for <a href="https://laravel.com/docs/11.x/eloquent#mass-assignment" rel="nofollow noreferrer">Mass Assignment</a>.</p>\n"^^ . + "2"^^ . + "0"^^ . + . + "0"^^ . + . + . + . + "How do I upload a file from a string, without saving it to disk, with Symfony Http Client?"^^ . + . + . + . + . + . + . + . + . + . + ""I was on php 8.3 but had to downgrade to php 8.2 for Imagick" - Couldn't you just enable Imagick for 8.3?"^^ . + "<p>I have a problem in processmaker3.2 .</p>\n<p>I have a form that its name is 'formMain' and this form has a grid that this grid has some inputs and a multiFile.</p>\n<p>I have two forms 'form1' and 'form2' and two tasks 'task1' and 'task2'</p>\n<p>task1 has form1 and task2 has form2</p>\n<p>form1 and 'form2' have 'formMain' inside them as subform</p>\n<p>On task1 grid is enable but on task2 grid is disable but multiFile must be enable and user can upload file on it.</p>\n<p>how can I enable just multiFile ?</p>\n"^^ . + "@Tim this answer ONLY works with the truncated array in the asked question. This answer is of no use with the full 5200 element array. Kindly edit or delete this inappropriately scored answer -- it will confuse or misleading researchers, resulting in wasting people's time/energy."^^ . + . + "@WiktorStribiżew - Your comment pointed me in the right direction. I developed a temporary solution based on your feedback. I will now study more about regex complexity for a more permanent solution."^^ . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + . + "`echo "<pre>$first_textarea<hr>$second_textarea</pre>";`"^^ . + . + "0"^^ . + . + . + . + . + . + . + "@Zhorov sql2019,php8, everything is fine, just my query is mess"^^ . + . + . + "1"^^ . + . + . + . + "0"^^ . + "memcached"^^ . + "<p>Can someone help me. The contact form that I am using is not working, it will send successfully but the email recipient can't receive. Below is my code.</p>\n<pre><code> &lt;?PHP\n \n $email_to = 'samplemail@gmail.com'; //the address to which the email will be sent\n $name = $_POST['name']; \n $email = $_POST['email'];\n $subject = $_POST['subject'];\n $message = $_POST['message'];\n \n $headers = 'From: ' . $email;\n \n if(mail($email_to, $subject, $message, $headers)){\n echo 'sent'; // we are sending this text to the ajax request telling it that the mail is sent.. \n }else{\n echo 'failed';// ... or this one to tell it that it wasn't sent \n }\n?&gt;\n</code></pre>\n"^^ . + "1"^^ . + . + "I need help modifying this PHP function to support nested IFs when transforming a string excel-type formula to a valid PHP ternary expression"^^ . + "0"^^ . + . + "0"^^ . + "@Barmar: I'm happy to follow good advice/procedure. However, I tried various methods before I got here. When I used elseif, I was getting further away from the structure that I needed. I will however try it again now that I got closer to what I needed.\nOn the second part of associative arrays, it is wrong to identify where my trees, branches and roots start by placing an identifier? I thought it makes it easier to 'read', and thus write the code to read it as well - kind of consistent loop to retrieve..."^^ . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + . + . + "<p>Here's the first problem I see, doesn't matter what $_SESSION['ApplicantID'] is because it'll be overwritten by the next line.</p>\n<pre><code>$user_data = isset($_SESSION['ApplicantID']) ? check_login($link) : null;\n$user_data = isset($_SESSION['CompanyID']) ? check_login_company($link) : null;\n</code></pre>\n<p>I'm guessing that those session variables are only set after a user is logged in, so if they come back to the login page they'll be redirected to the appropriate landing page instead.</p>\n<p>If they login as an applicant then check password. If password matches then redirect to home-page, otherwise..... At this point if the password fails the user will just get an empty page. Same thing happens for a company login, your page doesn't do anything or provide any feedback if the password fails.</p>\n<p>If you've checked the php error log and see nothing wrong there, output your variables to the page to determine what's happening. If you're not getting redirected anywhere, that tells me that $user_data more than likely isn't returning what you want. Start there.</p>\n<p>Other concerns, is your code is open to sql injection, as someone has already mentioned. Consider using prepared statements with PDO.</p>\n<p>And my final concern is this:</p>\n<pre><code>include(&quot;db-config.php&quot;);\n</code></pre>\n<p>This tells me you probably have your DB credentials in there stored in the webroot. While it would be impossible to output that to the browser without the php being rendered, that assumes the php engine never fails. If apache/nginx remain active but for some reason the php service has failed, scripts can be displayed in raw text. I've seen it happen. Not likely but it is a possibility, so you're best to store that outside the webroot so that should the engine fail and the filename exposed, it won't be accessible from the browser.</p>\n"^^ . + "0"^^ . + "<p>As per the title, I'm getting <strong>PHP Startup: Unable to load dynamic library 'pdo_mysql'</strong> when I run <em>/usr/local/bin/php</em> from the command line, but it works fine as an Apache module.</p>\n<p>PHP 8.4 running on FreeBSD 14.</p>\n<pre><code>./configure \\\n--with-apxs2=/usr/local/apache/bin/apxs \\\n--without-pdo-sqlite --without-sqlite3 --without-iconv \\\n--with-config-file-path=/usr/local/etc \\\n--enable-bcmath --without-cdb \\\n--enable-gd --without-iodbc \\\n--without-gdbm --with-ndbm --without-db2 --without-dbm \\\n--without-readline --with-openssl \\\n--without-db3 --enable-dba \\\n--with-curl \\\n--with-jpeg --enable-calendar \\\n--with-mhash --enable-mbstring=all \\\n--with-zlib \\\n--enable-exif --with-zip \\\n--with-mysqli=mysqlnd --with-freetype --with-pdo-mysql\n\n\n # grep pdo /usr/local/etc/php.ini\n;extension=pdo_firebird\nextension=pdo_mysql\n;extension=pdo_odbc\n;extension=pdo_pgsql\n;extension=pdo_sqlite\n; https://php.net/pdo-odbc.connection-pooling\n;pdo_odbc.connection_pooling=strict\npdo_mysql.default_socket=\n</code></pre>\n<p>Full error:</p>\n<pre><code>PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/local/lib/php/extensions/no-debug-zts-20240924/pdo_mysql (Cannot open &quot;/usr/local/lib/php/extensions/no-debug-zts-20240924/pdo_mysql&quot;), /usr/local/lib/php/extensions/no-debug-zts-20240924/pdo_mysql.so (Cannot open &quot;/usr/local/lib/php/extensions/no-debug-zts-20240924/pdo_mysql.so&quot;)) in Unknown on line 0\n\nWarning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/local/lib/php/extensions/no-debug-zts-20240924/pdo_mysql (Cannot open &quot;/usr/local/lib/php/extensions/no-debug-zts-20240924/pdo_mysql&quot;), /usr/local/lib/php/extensions/no-debug-zts-20240924/pdo_mysql.so (Cannot open &quot;/usr/local/lib/php/extensions/no-debug-zts-20240924/pdo_mysql.so&quot;)) in Unknown on line 0\n</code></pre>\n<p>Extensions directory it's trying is correct as per phpinfo() and there is no PDO files there.</p>\n<p>So, I went to install it via pear and get invalid package name/package file &quot;pdo-mysql&quot;</p>\n<p>I searched pear.php.net for 'pdo' and 'mysql' and cannot find anything remotely like pdo_mysql</p>\n"^^ . + . + . + . + "The relevant templates are apparently applying HTML escaping to the value - so you would have to explicitly overwrite how the value gets output in those places."^^ . + . + . + "<p>AFAIK, the <code>Partitioned</code> attribute is NOT fully supported in PHP's built-in <code>setcookie()</code> function because it is a relatively new addition to cookie spec...</p>\n<p>So I think you can use <code>header()</code> function to manually construct <code>Set-Cookie</code> header with <code>Partitioned</code> attribute.</p>\n<p>Example:</p>\n<pre><code>// Prepare Set-Cookie header string.\n$setCookieHeader = 'your cookie values and stuff here';\n$setCookieHeader .= &quot;Partitioned; &quot;;\n\n// Send custom Set-Cookie header.\nheader(&quot;Set-Cookie: $setCookieHeader&quot;, false);\n</code></pre>\n"^^ . + . + "The additional filters/checks are helpful, but this still doesn't produce a product with an associated thumbnail. :( \n \n(I'd simplified the code in the question to remove properties that didn't pertain to the question, like price, visibility, and shipping class, but left `gallery_image_ids` to show that that works with a specific interger.)"^^ . + "This is on Windows @Chris. php is downloaded as a zip and unzipped. There is no compiling. We're talking about Windows dlls. Downloaded from https://windows.php.net/downloads/releases/php-7.4.33-Win32-vc15-x64.zip\nAnd no, we are not working across versions. I was simply explaining the directory structure and why everything isn 't under c:\\php\\. Everything, but the php.ini, is under C:\\php\\php7-4-33\\. There is no cross versioning, just explaining the path in use"^^ . + "1"^^ . + "0"^^ . + . + "<p>I run this code on my server:</p>\n<pre class="lang-php prettyprint-override"><code>$result = pg_update( \n $conn, &quot;schema.table&quot;, \n array( \n 'thing' =&gt; &quot;value&quot;\n ), \n array( \n 'condition' =&gt; &quot;otherthing&quot;\n )\n);\n</code></pre>\n<p>and I get this warning:</p>\n<pre class="lang-bash prettyprint-override"><code>PHP Warning: pg_update(): ERROR: relation &quot;schema.table.table&quot; does not exist\nLINE 1: UPDATE &quot;schema.table&quot;.&quot;table...\n ^\n</code></pre>\n<p>adding the flag <code>PGSQL_DML_STRING</code> I can see the generated query is this:</p>\n<pre><code>UPDATE &quot;schema.table&quot;.&quot;table&quot; SET &quot;thing&quot;='value' WHERE &quot;condition&quot;='otherthing';\n</code></pre>\n<p>So, it generates <code>&quot;schema.table&quot;.&quot;table&quot;</code> instead of <code>&quot;schema&quot;.&quot;table&quot;</code>.</p>\n<p>If I change the table to just <code>table</code> the error I get is <code>Table does not exist</code>.</p>\n<p>In another environment, connecting to a different DB server with the same structure this works just fine.</p>\n<p><strong>UPDATE:</strong>\nExtra info you asked for:</p>\n<ul>\n<li>The database is included in the connection string:</li>\n</ul>\n<pre class="lang-php prettyprint-override"><code>$connstring = &quot;dbname=&quot;.$DB_DATABASE.&quot; user=&quot;.$DB_USER.&quot; port=&quot;.$DB_PORT.&quot; host=&quot;.$DB_SERVER\n</code></pre>\n<ul>\n<li><p>The database name is the same in the server that works and the one that does not.</p>\n</li>\n<li><p>Versions in the OK Server:</p>\n<ul>\n<li>PHP 8.3.2-1+0~20240120.16+debian12~1.gbpb43448</li>\n<li>PostgreSQL 15.8 (Debian 15.8-0+deb12u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit</li>\n<li>Search path: <code>&quot;$user&quot;, public</code></li>\n</ul>\n</li>\n<li><p>Versions in the server that duplicates the table name</p>\n<ul>\n<li>PHP 8.3.3-1+0~20240216.17+debian11~1.gbp87e37b</li>\n<li>PostgreSQL 15.3 (Debian 15.3-0+deb12u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit</li>\n<li>Search path: <code>&quot;$user&quot;, public</code></li>\n</ul>\n</li>\n</ul>\n"^^ . + . + . + "0"^^ . + . + "0"^^ . + "<p>So I have PHP v 7.3.29 installed on my PC, I hit an error with doku wiki that gave me the following error :</p>\n<pre><code>Parse error: syntax error, unexpected '=' in wiki\\inc\\init.php on line 462\n</code></pre>\n<p>I looked at the line and it uses the &quot;null coalesce&quot; operator which I had not come across before but was apparently introduced in v 7.0.x (<a href="https://www.php.net/manual/en/migration70.new-features.php" rel="nofollow noreferrer">https://www.php.net/manual/en/migration70.new-features.php</a>)</p>\n<p>The line is:\n<code>$abs ??= $conf['canonical'];</code></p>\n<p>So I then tried to investigate and found that v7.3 is apparently simply not recognising it - here's what I tried from the command line on my PC (along with the output):</p>\n<pre><code>C:\\php&gt;php -v\nPHP 7.3.29 (cli) (built: Jun 29 2021 12:30:03) ( NTS MSVC15 (Visual C++ 2017) x64 )\nCopyright (c) 1997-2018 The PHP Group\nZend Engine v3.3.29, Copyright (c) 1998-2018 Zend Technologies\n\nC:\\php&gt;php -a\nInteractive shell\n\nphp &gt; $a ??= 1;\nPHP Parse error: syntax error, unexpected '=' in php shell code on line 1\n\nParse error: syntax error, unexpected '=' in php shell code on line 1\nphp &gt; exit\n\nC:\\php&gt;\n</code></pre>\n"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "And to take your idea to its logical conclusion, you should avoid using any of PHP's built-in functions, because somebody else wrote those (all that PDO code would need to be removed, for a start and replaced with your own self-written database library, and then there's the openssl stuff, etc etc), or any O/S calls (e.g. disk writes) - someone else wrote those too. Actually someone wrote the whole of PHP, so you probably need your own programming language and compiler, and maybe your own assembler language so you don't rely on someone else's low-level code either."^^ . + "How to put a video to a playlist, in php?"^^ . + . + "Laravel 12 with laravel/ui - The login redirection does not work on mobile"^^ . + "Also, what do you mean by "handled properly" in the front-end? What result do you see there? I don't know how you could replicate the same request in your front-end though (assuming it's built sensibly) because this request uses a `name=file[]` parameter, but your validation code expects a field named `photo_1` - presumably that's the name used by the file input control in your blade template. So I'm not the front-end behaviour is especially relevant to this."^^ . + "php-extension"^^ . + . + . + "0"^^ . + "Using Middleware and Prefix or any other parameter simultaneously in Route Groups"^^ . + "@aynber I tried to output the same model timestamps in a separate blade file and they are correct. It must be something to do with Yajra's processing. I can't think of a way how to view what exactly is passed to Yajra."^^ . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + "This is a bit tricky to get right. What I'd do is instead of pivot the raw table, you instead calculate the Totals and percentage columns using a window function, then it's pivot time where the Totals just become grouped by columns. Also, you can probably just use pure Sql solution, no need to involve php in building the column list"^^ . + . + . + "0"^^ . + . + "<p>I use exec() function to unzip large file (when I tried using ZipArchive, I got an error with max execution time). Here is my code:</p>\n<pre><code>exec('unzip '.$path.'exports/'.$dir.'/'.$file.' -d '.$path.'exports/'.$dir.'_work/');\ndie('UNPACKING');\n</code></pre>\n<p>Now, I need to check if this proccess is finished, using <strong>another</strong> PHP script file.\nHow I can do it?</p>\n"^^ . + . + . + . + "1"^^ . + . + . + . + . + . + . + "2"^^ . + . + "What does the PhpStorm message "'file' shortcut can be used" refer to?"^^ . + "1"^^ . + . + "live627: thank you. Is there a difference between storing the HTML entity and the alternative?"^^ . + . + "0"^^ . + . + . + . + "Thank you all for your feedback. @Wiimm There is no error in the system.log."^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + "<p>You can also explicitly cast the <code>_id</code> field to MongoDB <code>ObjectId()</code>:</p>\n<pre><code>use MongoDB\\BSON\\ObjectId;\n\npublic function permission_curds()\n{\n return $this-&gt;hasMany(Permission_curd::class, 'permission_id', '_id')\n -&gt;where('permission_id', new ObjectId($this-&gt;_id));\n}\n</code></pre>\n<p>Also make sure that <code>Helper::object_id()</code> function is consistently used whenever querying or assigning <code>ObjectIds </code>in your application.</p>\n"^^ . + . + "0"^^ . + . + "Would there be any issue if you make bundle(s) for all of this ? Maybe with local packages or private Packagist ?"^^ . + . + . + . + "<p>I have a log file and trying to find instances of 2 consecutive lines.</p>\n<p>Here is an extract of a file :</p>\n<pre><code>21:12:44 | Player &quot;MinecraftNerd8&quot; (DEAD) (id=630DB6BBFCCC2E66508D086E78D202BFA4FB1FB5 pos=&lt;5215.0, 13515.6, 204.5&gt;)[HP: 0] hit by Player &quot;sbog 9000&quot; (id=EAD177E916EE7D01F6DC47C59EAF4802A6061420 pos=&lt;5211.9, 13516.6, 203.8&gt;) into Torso(11) for 35 damage (Bullet_12GaugePellets) with BK-43 from 3.32238 meters \n21:12:44 | Player &quot;MinecraftNerd8&quot; (DEAD) (id=630DB6BBFCCC2E66508D086E78D202BFA4FB1FB5 pos=&lt;5215.0, 13515.6, 204.5&gt;) killed by Player &quot;sbog 9000&quot; (id=EAD177E916EE7D01F6DC47C59EAF4802A6061420 pos=&lt;5211.9, 13516.6, 203.8&gt;) with BK-43 from 3.32238 meters \n21:12:44 | Player &quot;RMuckey06&quot; (DEAD) (id=1BE787EF788074C94B0FB22785EAD502E58240C1 pos=&lt;5214.1, 13515.8, 203.8&gt;)[HP: 0] hit by Player &quot;sbog 9000&quot; (id=EAD177E916EE7D01F6DC47C59EAF4802A6061420 pos=&lt;5211.9, 13516.6, 203.8&gt;) into Head(0) for 8.75 damage (Bullet_12GaugePellets) with BK-43 from 2.24871 meters \n21:12:44 | Player &quot;RMuckey06&quot; (DEAD) (id=1BE787EF788074C94B0FB22785EAD502E58240C1 pos=&lt;5214.1, 13515.8, 203.8&gt;) killed by Player &quot;sbog 9000&quot; (id=EAD177E916EE7D01F6DC47C59EAF4802A6061420 pos=&lt;5211.9, 13516.6, 203.8&gt;) with BK-43 from 2.24871 meters \n21:12:51 | Player &quot;Cogito8434&quot; (id=26DE70CAEF00AE579AF8CA21ED3F1648DB316F1E pos=&lt;4629.4, 15078, 476.3&gt;) regained consciousness\n</code></pre>\n<p>I am trying to return data for these 2 lines :</p>\n<pre><code>21:12:44 | Player &quot;MinecraftNerd8&quot; (DEAD) (id=630DB6BBFCCC2E66508D086E78D202BFA4FB1FB5 pos=&lt;5215.0, 13515.6, 204.5&gt;)[HP: 0] hit by Player &quot;sbog 9000&quot; (id=EAD177E916EE7D01F6DC47C59EAF4802A6061420 pos=&lt;5211.9, 13516.6, 203.8&gt;) into Torso(11) for 35 damage (Bullet_12GaugePellets) with BK-43 from 3.32238 meters \n21:12:44 | Player &quot;MinecraftNerd8&quot; (DEAD) (id=630DB6BBFCCC2E66508D086E78D202BFA4FB1FB5 pos=&lt;5215.0, 13515.6, 204.5&gt;) killed by Player &quot;sbog 9000&quot; (id=EAD177E916EE7D01F6DC47C59EAF4802A6061420 pos=&lt;5211.9, 13516.6, 203.8&gt;) with BK-43 from 3.32238 meters \n</code></pre>\n<p>The 1st line represents the final hit as indicated by the [HP: 0] and the 2nd line immediately after which contains killed by Player, confirms this was the final hit as further hits after payer is dead will still be logged.</p>\n<p>Here is the preg_match_all code I am using</p>\n<pre><code>/(.*?)Player &quot;(.*)&quot; (DEAD) (id=(.*) pos=&lt;(.*)&gt;)[HP: 0] hit by Player &quot;(.*)&quot; (id=(.*) pos=&lt;(.*)&gt;) into (.*) for (.*) damage (.*) with (.*) from (.*) meters\\s*\n(.*?)Player &quot;(.*)&quot; (DEAD) (id=(.*) pos=&lt;(.*)&gt;) killed by Player (.*)/\n</code></pre>\n<p>I'm trying this in the onlinephp.io sandbox but no matter what I change it still wont return any data.</p>\n<p>Appreciate any help</p>\n<p>Edit :\nIve tried the below and now get data matches\nHowever its essential only lines with [HP: 0] are returned</p>\n<pre><code>/(.*?) | Player &quot;(.*)&quot; (DEAD) (id=(.*) pos=&lt;(.*)&gt;) [HP:0] hit by Player &quot;(.*)&quot; (id=(.*) pos=&lt;(.*)&gt;) into (.*) for (.*) damage (.*) with (.*) from (.*) meters\\s(.*?)Player &quot;(.*)&quot; (DEAD) (id=(.*) pos=&lt;(.*)&gt;) killed by Player (.*)/\n</code></pre>\n<p>Fixed : Thanks to everyone for their help.\nThe correct regex was</p>\n<pre><code>/(.*?)Player &quot;(.*)&quot; \\(DEAD\\)\\ \\(id=(.*) pos=&lt;(.*)&gt;\\)\\[HP: 0\\] hit by Player &quot;(.*)&quot; \\(id=(.*)\\ pos=&lt;(.*)&gt;\\) into (.*)\\((.*)\\) for(.*)damage (.*) with (.*) from (.*)\\s*(.*) | Player &quot;(.*)&quot; \\(DEAD\\) (id=(.*)) (.*) killed by Player/\n</code></pre>\n<p>I ran the above on a larger log file and the returned data was as below</p>\n<pre><code>[0] =&gt; 22:09:04 | Player &quot;GigglingCobra52&quot; (DEAD) (id=BE2ABB8084EEC781014AC8E6B5C88A5A90F855BF pos=&lt;1658.8, 15056.8, 451.4&gt;)[HP: 0] hit by Player &quot;Cogito8434&quot; (id=26DE70CAEF00AE579AF8CA21ED3F1648DB316F1E pos=&lt;1659.4, 14990.8, 441.4&gt;) into Head(0) for 36.7336 damage (Bullet_308WinTracer) with M70 Tundra from 66.7822 meters \n22:09:04 | Player &quot;GigglingCobra52&quot; (DEAD) (id=BE2ABB8084EEC781014AC8E6B5C88A5A90F855BF pos=&lt;1658.8, 15056.8, 451.4&gt;) killed by Player &quot;Cogito8434&quot; (id=26DE70CAEF00AE579AF8CA21ED3F1648DB316F1E pos=&lt;1659.4, 14990.8, 441.4&gt;) with M70 Tundra from 66.7822 meters\n</code></pre>\n<p>I can now use the returned array data and pull info I need.\nThanks again for everyone's help in guiding me how to figure this out</p>\n"^^ . + . + . + . + "0"^^ . + . + "So you are registering two callbacks for the route `/update-listener-stats/(?P<track_id>\\d+)`, `update_listener_stats_callback` and `handle_update_listener_stats`, I suppose those are what you are talking about here regarding the editing that is "not working"? In both of those I can only see you _access_ some of the passed parameters, but I don't see you actually updating anything with them?"^^ . + . + . + . + . + . + . + "global-scope"^^ . + . + . + . + "7"^^ . + . + . + "how to access codeignter4 routes metadata by route name?"^^ . + . + ""If still not working try php 7.4 I hope it will be fine. And these should resolve the problem." - downgrading to an outdated version of PHP is never a good idea"^^ . + . + . + "0"^^ . + . + . + . + "@Chris Haas, every php7 version reports the same 'unable to find openssl.dll' problem. php 8 versions work, excepting 8.4.4 which gives this memory access violation. Cannot understand why it is so universal with php7 versions and why it points to the actual dll it claims it can't find!"^^ . + . + "0"^^ . + "0"^^ . + "<p>Since this is currently blocking me, I have altered my phpUnit bootstrap.php file and mocked the missing function so it can be available while testing:</p>\n<pre><code>&lt;?php\n\n// include the composer autoloader\nrequire __DIR__ . '/../vendor/autoload.php';\n\n// dev environment reports that global function laravel_cloud() is missing\nif (! function_exists('laravel_cloud')) {\n function laravel_cloud()\n {\n return false;\n }\n}\n</code></pre>\n<p>This doesn't solve the issue with why the Laravel framework is choking on the backported <code>laravel_cloud()</code> method. It simply allows me to bypass the error when I run my tests.</p>\n"^^ . + . + . + . + "1"^^ . + . + "4"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + "1"^^ . + "laravel-authorization"^^ . + . + "0"^^ . + "0"^^ . + . + "1"^^ . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + "1"^^ . + . + . + . + "Deploying Laravel app with reverb on railway"^^ . + . + . + "<p>I have an array with values and probabilities (or in PHP, keys and values):</p>\n<pre><code>Value Probability\nJohn 3\nPeter 2\nPaul 1\n</code></pre>\n<p>I want to shuffle this array but have the order be influenced by the probability. That is, on average John should appear at the top of the list half the time, Peter a third of the time, and Paul one sixth of the time, etc.* The average order over thousands of shuffles should be the one given above.</p>\n<p>I have thought to</p>\n<ol>\n<li><p>Create an array in which each value appears as often as indicated by the probability:</p>\n<pre><code>John\nJohn\nJohn\nPeter\nPeter\nPaul\n</code></pre>\n</li>\n<li><p>Shuffle this array, e.g.:</p>\n<pre><code>John\nPaul\nPeter\nJohn\nJohn\nPeter\n</code></pre>\n</li>\n<li><p>Remove the duplicates, leaving the first instance:</p>\n<pre><code>John\nPaul\nPeter\n</code></pre>\n</li>\n</ol>\n<p>In PHP code this might look something like this:</p>\n<pre><code>$items = array(\n 'John' =&gt; 3,\n 'Peter' =&gt; 2,\n 'Paul' =&gt; 1\n);\n\n$probabilities = array();\nforeach($items as $item =&gt; $value){\n $interim = array_fill(1, $value, $item);\n $probabilities = array_merge($probabilities, $interim);\n}\n\nshuffle($probabilities);\n\n$result = array_unique($probabilities);\n\nprint(&quot;&lt;pre&gt;&quot;.print_r($result,true).&quot;&lt;/pre&gt;&quot;);\n</code></pre>\n<p><strong>Is there a faster way to do this?</strong></p>\n<p>The real array contains a few hundred values and this probability-based shuffling has to be done everytime a webpage is called, so it should be lightning quick.</p>\n<hr />\n<p>* Here are the probabilities for each position for each person:</p>\n<pre><code>Person P1 P2 P3\nJohn 3/6 2/6 1/6\nPeter 2/6 2/6 2/6\nPaul 1/6 2/6 3/6\n</code></pre>\n<p>Note that the probabilities for the second and third rank follow from the probability for the first rank and are not explicitly given in the original data. They are just presented here for your convenience, because someone asked about them in the comments below.</p>\n<hr />\n<p>The real array contains a few hundred values:</p>\n<pre><code>John 3 ← line 1\nPeter 2\nPaul 1\nSimon 6\nRobert 2\nWilliam 1\n...\nSean 1 ← line 786\n</code></pre>\n"^^ . + . + "2"^^ . + . + . + "0"^^ . + . + . + . + "0"^^ . + "0"^^ . + "1"^^ . + "-2"^^ . + . + . + "8"^^ . + "0"^^ . + . + . + . + "pecl"^^ . + . + "Unfortunately, at the moment `DOMXPath` only supports XPath 1.0. XPath 2.0 features like default namespaces and inline namespaces like `$xpath->query('//{http://www.w3.org/1999/xhtml}div')` are not supported yet."^^ . + "2"^^ . + . + "1"^^ . + "1"^^ . + . + . + . + "-1"^^ . + "the home directory for www-data is /var/www, and I also tried adding the drivers, *.ini files there with no result other than the same error as before.\n\nIf I print the env set in apache this is what it looks like:\n [ODBCINI] => /etc/odbc.ini\n [ODBCINSTINI] => /etc/odbcinst.ini\n[PATH] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/snap/bin:/usr/local/lib:/opt/sqlanywhere17/lib64\n\nLinux itself is new to me. I got this working on IIS in the matter of a few hours. but unfortinately we have decided to run on Linux instead."^^ . + "0"^^ . + "1"^^ . + "orocommerce"^^ . + "This feels like a server (nginx, built-in server) and php-fpm issue. What server are you running?"^^ . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + "you can try to replace } { with },{ anf then add [ and ] around your string and then json decode it"^^ . + . + . + "We're not being harsh - you basically have the exact same problem as in the duplicate question. So the answer is the same. Read through that carefully and take note of all the advice, and align your code towards it. We don't need to repeat ourselves. Note also that `mail()` doesn't send email by itself, it still needs an MTA (a mailserver or a forwarding service) to actually take the email and send it off. mail() just passes the message to the MTA, that's all. So if you're testing in your local environment and haven't set anything like that up, that'll be another reason you don't get an email."^^ . + . + . + "Just in case you want to consider it, check out https://fullcalendar.io/demos (see the Resource Timeline demo). It's configurable to different resources (rooms in your case) and different lengths of timeslots, and many other things. Only dependency is javascript. You'd need a license but it might save you a lot of time and headaches. You simply give it a list of rooms and a list of bookings, and the rendering is all done for you. (I'm not affiliated with the product at all, I only mention it because it seems to suit your use case closely. If you have the budget it may be worth considering)."^^ . + . + . + . + "<p>I have installed Drupal CMS with drupal 11 with Php 8.3 with Radix theme. In that i can't able to find the <strong>Demonstrate block region section</strong> in the block layout menu. Where I already used it in Drupal 8 and 9 <a href="https://i.sstatic.net/AJwaVCs8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/AJwaVCs8.png" alt="like this" /></a>. But it is missing in the Drupal 11 website.</p>\n"^^ . + "0"^^ . + . + "2"^^ . + . + . + . + "Thank you, but it didn't work, it didn't change anything."^^ . + "With PHP prepared statements, is there a way to bind a query and have that query executed?"^^ . + . + . + "<p>I'm working on a project that uses API Platform 4 to implement a REST API, but it doesn't have a database and no Doctrine ORM.</p>\n<p>I'm trying to implement an <code>ApiResource</code> that, among other properties, expects a list of objects:</p>\n<pre class="lang-php prettyprint-override"><code>#[ApiPlatform\\Metadata\\ApiResource(\n operations: [new ApiPlatform\\Metadata\\Post()],\n processor: App\\State\\OrderProcessor::class,\n)]\nclass Order\n{\n /** @var Product[] */\n #[Symfony\\Component\\Validator\\Constraints\\Valid]\n public array $products = [];\n}\n\nclass Product\n{\n public string $name = '';\n}\n</code></pre>\n<p>But when accessing <code>Order::$products</code> in my Processor, it's not a list of <code>Product</code> objects, but an associative array of whatever was provided as <code>products</code> in the HTTP payload:</p>\n<pre class="lang-php prettyprint-override"><code>/**\n * @implements ApiPlatform\\State\\ProcessorInterface&lt;App\\ApiResource\\Order, App\\ApiResource\\Order|void&gt;\n */\nfinal class OrderProcessor implements ApiPlatform\\State\\ProcessorInterface\n{\n /**\n * @return App\\ApiResource\\Order\n */\n public function process(\n mixed $order,\n ApiPlatform\\Metadata\\Operation $operation,\n array $uriVariables = [],\n array $context = [],\n ): mixed {\n // $order-&gt;products is array[] with whatever was passed in the\n // HTTP payload instead of Product[].\n\n return $order;\n }\n}\n</code></pre>\n<p>API Platform doesn't seem to know to what object <code>$product</code> should be hydrated onto, probably because it doesn't read the <code>@var</code> annotation on the property, so it resorts to just unserializing <code>$products</code>. How can I map <code>$products</code> to <code>Product</code>?</p>\n<p>Do I need to write a custom normalizer?</p>\n<p>I already tried requiring <code>doctrine/collections</code> and using <code>public Doctrine\\Common\\Collections\\ArrayCollection $products</code>, but that just resulted in an empty collection.</p>\n"^^ . + "@ADyson: Thanks. You are right. I do need to think over it. Alas! My issue remains unresolved."^^ . + . + . + . + . + "<p>From the <a href="https://www.php.net/session_regenerate_id" rel="nofollow noreferrer" title="session_regenerate_id — Update the current session id with a newly generated one (PHP 4 &gt;= 4.3.2, PHP 5, PHP 7, PHP 8)">PHP manual</a>:</p>\n<pre><code>function session_regenerate_id(bool $delete_old_session = false): bool {}\n</code></pre>\n<p>This is how the function is defined, so just call the function without passing the <em>delete_old_session</em> parameter:</p>\n<pre><code>session_regenerate_id();\n</code></pre>\n<hr />\n<blockquote>\n<p>Is this behavior normal?</p>\n</blockquote>\n<p>Yes, as long as you pass <code>true</code> for the <em>delete_old_session</em> parameter, the old session is deleted.</p>\n<blockquote>\n<p>How can I securely regenerate the session without losing existing data?</p>\n</blockquote>\n<p>By using the default for the <em>delete_old_session</em> parameter, that is either leaving it out (the code example above) or passing the default value, <code>false</code>.</p>\n<blockquote>\n<p>Do I need to manually copy session values before regenerating?</p>\n</blockquote>\n<p>No, not at all. And also don't do it, because you have more code to debug and maintain.</p>\n<blockquote>\n<p>I’m using PHP 8.2 and storing sessions in the default file-based handler. Could the session storage settings affect this ?</p>\n</blockquote>\n<p>No, not in your case. It would have been an issue with the file-based handler if the data would <em>not</em> have been deleted.</p>\n<hr />\n<p>See as well: <a href="https://stackoverflow.com/q/32235382/367456" title="Confusion with PHP session_regenerate_id"><em>Confusion with PHP session_regenerate_id</em> (Q&amp;A)</a></p>\n"^^ . + . + "2"^^ . + . + "<p>Sure, your original approach works. You do not need, however, to create large arrays.</p>\n<p>The urn behaviour can be implemented like this (<strong>note: for smaller arrays I suspect your approach might be faster, and the fact it's not memory efficient could well be irrelevant.</strong> I haven't checked where the tipping point is):</p>\n<pre><code> function extractWithProbability(array $order): string {\n if (1 === count($order)) {\n return array_key_first($order);\n }\n $sum = array_sum($order);\n $throw = rand(0, $sum - 1);\n foreach ($order as $key =&gt; $value) {\n if ($throw &lt; $value) {\n return $key;\n }\n $throw -= $value;\n }\n throw new RuntimeException('Unexpected');\n }\n</code></pre>\n<p>First we get the total number of balls in our virtual urn. Each player contributes with a weight, so John gets three, Peter gets two, Paul gets one. Then we imagine the balls lined up one after another, so you extract at random the position where to pick the ball, and this goes from 0 to the number of balls minus one. This takes care of probability.</p>\n<p>Then we build the array.</p>\n<p>We could do this with <code>uasort</code> and a custom sort function, but it would involve <em>knowing that PHP is internally using quicksort()</em> and a whole lot of other assumptions. We could get a very approximate probability function for the compare callback, but I don't think it would be worth the pain, <em>and</em> it could give occasional pathological results.</p>\n<p>So, we simply &quot;remove&quot; all of a player's balls whenever he gets chosen, and repeat the extraction with the remaining players:</p>\n<pre><code>function shuffleWithProbability(array $order): array {\n $result = [ ];\n while (!empty($order)) {\n $chosen = extractWithProbability($order);\n $result[] = $chosen;\n unset($order[$chosen]);\n }\n return $result;\n }\n</code></pre>\n<p>On some hardwares and small arrays, it <em>might</em> be more convenient to neuter <code>$order[$chosen]</code> by setting its value to 0. This means that the array isn't internally shuffled, which is a gain, but is then scanned in its entirety on each loop iteration, which is a loss (N^2 against 1/2 N^2 on average). For large N's, this is not convenient. We could try and offset this effect by running <code>$order</code> through an <code>array_filter</code> every K iterations (instead of unset, we would have setting to 0, and if, say, count($order) modulo X is Y, run it through <code>array_filter</code>. X and Y will vary based on hardware, kernel configuration and PHP version - a maintenance nightmare).</p>\n<p>To gauge results, run a certain number of extractions and check the actual scores:</p>\n<pre><code> srand(time());\n\n $results = array_fill_keys(array_keys($order), 0.001);\n\n for ($i = 0; $i &lt; 1000000; $i++) {\n $arr = shuffleWithProbability($order);\n // Who came first?\n $results[$arr[0]]++;\n }\n $least = min(array_values($results));\n $results = array_map(static fn($v) =&gt; round($v / $least, 2), $results);\n arsort($results);\n foreach ($order as $name =&gt; $expected) {\n $actual = $results[$name];\n print(&quot;{$name} expected {$expected}, got {$actual}\\n&quot;);\n }\n</code></pre>\n<p><strong>(The output display code assumes the least probable name always has a weight of 1)</strong></p>\n<p>With five names, these results are achieved in about 2.1s on a Core i9:</p>\n<pre><code>Zero expected 20, got 20\n\nJohn expected 10, got 10\n\nLuke expected 5, got 4.98\n\nPaul expected 2, got 2\n\nMatt expected 1, got 1\n</code></pre>\n<p>Using an array of 1000 names, one iteration takes on average 13 milliseconds.</p>\n<p>With 500 names, 3.5 milliseconds (about 1/4th of the time), and with 2000 names, as expected, about 53 milliseconds (4x the time). The algorithm therefore appears to behave, as expected, as O(N^2).</p>\n<h1>Random, idle musing</h1>\n<p>I will explore the approach below some time in the next days, but I was wondering - how do things behave if I assign each player a random weight based on the player's desired odds and overall range? And then I sort the players based on the new, static weight?</p>\n<p>In other words, I start with three W values for each player</p>\n<pre><code>Paul = 10, John = 5, Luke = 1\n</code></pre>\n<p>The overall range is 16. I assign to each player a F(W) that, for example (I don't think this would work, the question is whether <em>some other F() might work</em>. For example: F(x) = the highest of x random extractions? Or a power function of x/range with phi?) F(x) = rand()/getrandmax()*x. So Paul extracts 0.21 and gets 2.1, John extracts 0.7 and gets 3.5, Luke extracts 0.11 and gets 0.11. The O(N) processed array is [ Paul: 2.1, John: 3.5, Luke: 0.11 ]. I quicksort this array in O(N log N), getting [ John, Paul, Luke ] in O(N log N). How often does each player end first place?</p>\n"^^ . + . + "0"^^ . + "exec"^^ . + "1"^^ . + "3"^^ . + . + . + "<p>I want to add a unsubscribe link in my emails.</p>\n<p>On my website I have deployed a PHP module with code as given below. I am worried if the link can be a misused (security loophole).</p>\n<p>URL will be somewhat like seen below, wherein <code>test@domain.com</code> is the 'To' email ID which I will note in a text file via my PHP code.</p>\n<pre class="lang-none prettyprint-override"><code>https://example.com/unsubscribe/MyCode.php?param=test@domain.com\n</code></pre>\n<pre class="lang-php prettyprint-override"><code>$file = 'access_log.txt';\n$timestamp = date('Y-m-d H:i:s');\n$ip = $_SERVER['REMOTE_ADDR'];\n$param = isset($_GET['param']) ? $_GET['param'] : 'No Parameter';\n$entry = &quot;$timestamp, $ip, $param\\n&quot;;\n\nif (file_put_contents($file, $entry, FILE_APPEND | LOCK_EX)) {\n echo &quot;Log entry recorded.&quot;;\n} else {\n echo &quot;Error writing to file.&quot;;\n}\n</code></pre>\n"^^ . + . + . + "String replace adds extra spaces"^^ . + . + "your web-server is probably firewalled"^^ . + . + . + "2"^^ . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + . + "0"^^ . + "1"^^ . + . + "0"^^ . + "fsockopen"^^ . + . + . + "0"^^ . + . + . + "Your own solution looks pretty good; I would look at the generated SQL to see if it's what I would expect. If this solves your problem, would you please post it as an answer so others can see this needs no further attention?"^^ . + "1"^^ . + "2"^^ . + . + . + . + . + . + . + "1"^^ . + . + . + "3"^^ . + . + . + . + . + . + . + . + "Do you mean _when you're developing the libraries_? Yes, you will need a copy of each somewhere, with a `vendor` directory if it has dependencies needed for testing. But if you're so short on space that you can't afford *a few megabytes* of development space, what on earth development system are you using!? And again, **you should not create 50 tiny projects**; that would just be making work for yourself for no reason."^^ . + "0"^^ . + . + . + "0"^^ . + . + "1"^^ . + "3"^^ . + "2"^^ . + . + "@IMSoP agreed but I think my point was why the OP was proposing that over quoting, which would be far simpler to implement."^^ . + . + "1"^^ . + . + . + . + . + "0"^^ . + "1"^^ . + . + "xml-parsing"^^ . + "2"^^ . + . + "0"^^ . + . + . + . + . + . + "<p>that worked for me</p>\n<pre><code>&lt;?php\ndefined('_JEXEC') or die;\n\nuse Joomla\\CMS\\Factory;\nuse Joomla\\CMS\\Plugin\\CMSPlugin;\nuse Joomla\\CMS\\Uri\\Uri;\n\n\nif (!class_exists('VmConfig')) {\n require(JPATH_ROOT . '/administrator/components/com_virtuemart/helpers/config.php');\n}\nif (class_exists('VmConfig')) {\n VmConfig::loadConfig();\n}\n\n// creating the plugin class \nclass plgVmShipmentProds2boxes extends vmPlugin\n{\n function __construct(&amp;$subject, $config)\n {\n parent::__construct($subject, $config);\n\n // Loading plugin Joomla parameters\n $this-&gt;website = $this-&gt;params-&gt;get('value1', '');\n $this-&gt;username = $this-&gt;params-&gt;get('value2', '');\n $this-&gt;serial = $this-&gt;params-&gt;get('value3', '');\n }\n\n /**\n * VirtueMart Call this function at backend οrder page.\n */\n public function plgVmOnShowOrderBEShipment($orderId, $order)\n {\n $this-&gt;Prods2Boxes($orderId, $order);\n }\n\n /**\n * Custom function for data process\n */\n private function Prods2Boxes($orderId, $order)\n { ....\n</code></pre>\n"^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + "polymorphism"^^ . + . + . + "0"^^ . + . + . + . + "1"^^ . + . + "0"^^ . + . + "2"^^ . + "0"^^ . + "This code works great! Except that the progressive discount is turned off completely. Is there any possibility to leave the progressive discount only for products without a sale?"^^ . + . + . + . + . + . + "-1"^^ . + "1"^^ . + . + . + "0"^^ . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + "@Barmar any time I've used gmail to send emails, I've always had to use one of the secure ports, 587 now I've checked."^^ . + "1"^^ . + "0"^^ . + "I think the codesigning took care of the first error message, but I still get the Segmentation faults."^^ . + . + . + . + "Simple PHP Class Autoloader for a WordPress plugin without using Composer"^^ . + . + "1"^^ . + . + . + . + . + "<p>I'm working on a Symfony 4.4 console command and I want to prevent exceptions from being displayed on the terminal. I've already set up a logger to log the exceptions, but they still appear on the terminal. I've also enabled production mode, but the issue persists.</p>\n<p>Here is the code</p>\n<pre><code>&lt;?php\n\nnamespace App\\Command;\n\nuse Psr\\Log\\LoggerInterface;\nuse Symfony\\Component\\Console\\Command\\Command;\nuse Symfony\\Component\\Console\\Input\\InputArgument;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\nuse Symfony\\Component\\Console\\Input\\InputOption;\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\nuse Symfony\\Component\\Console\\Style\\SymfonyStyle;\n\nclass SampleCommand extends Command\n{\n protected static $defaultName = 'SampleCommand';\n protected static $defaultDescription = 'Add a short description for your command';\n\n private $logger;\n\n public function __construct(LoggerInterface $logger)\n {\n parent::__construct();\n $this-&gt;logger = $logger;\n }\n\n protected function configure(): void\n {\n $this\n -&gt;setDescription(self::$defaultDescription)\n -&gt;addArgument('arg1', InputArgument::OPTIONAL, 'Argument description')\n -&gt;addOption('option1', null, InputOption::VALUE_NONE, 'Option description');\n }\n\n protected function execute(InputInterface $input, OutputInterface $output)\n {\n try {\n throw new \\Exception('This is a built-in exception message.');\n } catch (\\Exception $exception) {\n $this-&gt;logger-&gt;critical('An error occurred', [\n 'exception' =&gt; $exception,\n ]);\n }\n }\n}\n</code></pre>\n<p>I tried logging it but error still getting generated on terminal.</p>\n"^^ . + "0"^^ . + "2"^^ . + . + . + . + . + . + "`PrestaShopException` - that's pretty broad. Is there anything else you can share about that exception? Also, keep in mind that PHP 7.4 is horribly outdated"^^ . + . + . + . + "<p>$_POST[] is typically used to handle form data via the POST method.</p>\n<p>If you want to get a parameter value from query string, you can use $_GET['demo']. I hope this helps!</p>\n"^^ . + . + "<p>my php mailer is not sending html emails. I used this code a few years back and it was able to send html emails. I am using PHPMailer_5.2.4. Here is my code.</p>\n<pre><code> $mail = new PHPMailer(true);\n\n $mail-&gt;AddAddress($SendToAddress, $SendToNameSurname);\n $mail-&gt;AddCC($SendFromAddress);\n $mail-&gt;AddBCC($AdminMail);\n $mail-&gt;SetFrom($SendFromAddress, $SendFromNameSurname);\n $mail-&gt;AddReplyTo($SendFromAddress, $SendFromNameSurname);\n\n $mail-&gt;isHTML(true);\n $mail-&gt;Subject = &quot;PHPMailer SMTP test&quot;;\n $mail-&gt;Body = &quot;&lt;h1&gt;Send HTML Email using SMTP in PHP&lt;/h1&gt;&lt;p&gt;This is a test email Im sending using SMTP mail server with PHPMailer.&lt;/p&gt;&quot;;\n $mail-&gt;AltBody = &quot;This is the plain text version of the email content&quot;;\n\n $mail-&gt;Send();\n</code></pre>\n<p>And this is how my email looks.</p>\n<pre><code>--b1_78f9d5cee1ab466d9fb8fdec064042c8\nContent-Type: text/plain; charset=iso-8859-1\nContent-Transfer-Encoding: 8bit\n\nThis is the plain text version of the email content\n\n\n--b1_78f9d5cee1ab466d9fb8fdec064042c8\nContent-Type: text/html; charset=iso-8859-1\nContent-Transfer-Encoding: 8bit\n\n&lt;h1&gt;Send HTML Email using SMTP in PHP&lt;/h1&gt;&lt;p&gt;This is a test email Im sending using SMTP mail server with PHPMailer.&lt;/p&gt;\n\n\n\n--b1_78f9d5cee1ab466d9fb8fdec064042c8--\n</code></pre>\n<p>Any help will be appreciated.</p>\n"^^ . + . + . + . + "<p>You may use an <em>alternation</em> of keywords, e.g.</p>\n<pre class="lang-php prettyprint-override"><code>$pattern = &quot;/\\b(?:auch|ein|sehendes)\\b/i&quot;;\n$subject = &quot;Auch ein blindes Huhn findet einmal ein Korn.&quot;;\npreg_match_all($pattern, $subject, $matches);\nprint_r($matches);\n\nArray\n(\n [0] =&gt; Array\n (\n [0] =&gt; Auch\n [1] =&gt; ein\n [2] =&gt; ein\n )\n)\n</code></pre>\n<p>Note: The <code>?:</code> inside the alternation <code>(?...)</code> simply tells PHP to turn off the capture group. There is nothing wrong with leaving the capture group on, but we don't need it here, and so it is better to not use it.</p>\n"^^ . + "microsoft-edge"^^ . + "console"^^ . + . + . + "This is probably what you're after, on that basis: `$this->$base = function($atts, $contents = null, $base, $current) { $output = _WSH()->shortcodes->shortcode_output( $atts, $contents, $base, $current); return $output; };` . Did you try anything? If you don't at least _try_, you'll never learn for yourself."^^ . + . + . + . + . + "1"^^ . + . + "-3"^^ . + "Tested and does not calculate the tax on the margin for products assigned the custom-tax-class"^^ . + "3"^^ . + . + "-1"^^ . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + "1"^^ . + "How to display two different currencies prices at the same time in WooCommerce"^^ . + "0"^^ . + "0"^^ . + . + "2"^^ . + . + . + . + "You have a spelling error `const massage ... if (message)`"^^ . + . + . + . + "I have `supervisors` running an nginx task as root that directs logs successfully to `/proc/1/fd/1`. I've also just `echo`d a random string in the startup script and that successfully gets put into the log. Just can't seem to run `tail` or a long running task (not sure which) in App Runner, can local."^^ . + "I agree, no one types but the website I made in Laravel was in normal PHP before which include lots of PHP pages and google listed that pages so that pages still available in google that's why I need this solution. Thanks for your answer."^^ . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + "Running a Laravel project locally with XAMPP and starting automatically on Windows startup without php artisan serve"^^ . + . + "I was answering the post and suddenly the post is closed."^^ . + "0"^^ . + "What does qualify as nicer for you? And why do you pass the builder as argument to the [method of the scoped relationship](https://laravel.com/docs/eloquent-relationships#scoped-relationships)? I'd consider that less nice, but I don't know why you do that in the first place, so just curious."^^ . + . + . + "0"^^ . + . + "2"^^ . + . + "agreed @siggemannen"^^ . + . + "please run the _composer diagnose_ function and put the text output from your terminal including the prompt to your question by [edit]ing it."^^ . + "Have you checked to make sure your project's bootstrap/storage directories have the correct permissions?"^^ . + "0"^^ . + . + "Are you looking for [basename](https://www.php.net/manual/en/function.basename.php)?"^^ . + "import-maps"^^ . + . + "I’m not clear on what you are trying to do. The referrer header is a request header, not a response header, so you would set it and send to the server, it isn’t going to send one back to you."^^ . + . + "1"^^ . + "0"^^ . + "1"^^ . + "I have them set to 644"^^ . + "Thank you Anthony for your response,\n\nThe BudgetingModule and the other are defined modules autoloaded in the Autoload.php file.\n\nAgain, even with the same delimiters, they still dont respond\n\nI have also tried specifying the full path to the module routes, yet I keep getting pageNotFound when I visit any of the routes defined in those custom modules"^^ . + "0"^^ . + . + "Carbon diffInSeconds() returning negative value"^^ . + . + . + . + . + . + "<p>Given an external dependency within a php@8.0 project (without composer):</p>\n<pre><code>interface Contract\n{\n public static function getFoo(): string;\n}\n\nclass ExternalDependency implements Contract\n{\n\n public static function getFoo(): string\n {\n return 'gnarf!';\n }\n}\n</code></pre>\n<p>That <code>ExternalDependecy</code> is used in dozen other services like so:</p>\n<pre><code>class Service extends ExternalDependency {\n}\n</code></pre>\n<p>I want to replace <code>ExternalDependency</code> while changing as little code as possible.</p>\n<p>I thought I could make use of a <code>class_alias</code>:</p>\n<pre><code>class MyFix implements Contract {\n public static function getFoo(): string {\n return 'Foo';\n }\n}\n\nclass_alias(MyFix::class, SomeExternalDependency::class);\n\nclass Service extends SomeExternalDependency {\n}\n</code></pre>\n<p>Yet this will issue a warning:</p>\n<pre><code>PHP Warning: Cannot declare class SomeExternalDependency, because the name is already in use in test.php on line 23\n</code></pre>\n<p>In my contrived example, I could delete the <code>ExternalDependency</code>, then it would work as expected. Yet in my actual use-case, the <code>ExternalDependency</code> is a vendor file that I cannot delete easily. (It is sourced from an external path on the server.)</p>\n<p>How to replace the <code>ExternalDependency</code> with <code>MyFix</code> then?</p>\n<hr />\n<p><a href="https://onlinephp.io/c/9e4db84e-619f-46a4-9628-bce9d5c15021" rel="nofollow noreferrer">Example on onlinephp.io</a></p>\n<hr />\n<p><a href="https://stackoverflow.com/questions/9510087/how-to-replace-a-class-in-php">This question</a> is related, yet all its answers are based on extending the to be replaced class or or <a href="https://stackoverflow.com/a/9510170/457268">lack detail</a>.</p>\n"^^ . + . + . + . + "“ I've been tasked with editing the PHP inside an XML file.” — You have a bunch of questions about how the system you are dealing with works and why it was designed that way. We can only see a tiny piece if the puzzle. Whomever set you this task is probably much better placed to answer those questions."^^ . + "Off: In Hungary, the largest bus company sent the ticket price to the payment page via a GET request about two years ago... Clever people simply changed the price to 0 and send request manually."^^ . + . + "If you only have `\\x` escapes, I think you could do a simple RegEx on it: https://3v4l.org/osTZc"^^ . + "cool. you still ended up using `sync` though. which is correct. Calling $this refers to the current controller"^^ . + "Ok. Fair critique. Edits/code added."^^ . + "1"^^ . + . + "0"^^ . + . + "ubuntu"^^ . + . + "filter"^^ . + "You can check my answer to a similar question for the front end if you don't have issues with your backend https://stackoverflow.com/a/79528682/9439823"^^ . + . + . + . + "0"^^ . + "This is the version that is installed when I run sudo apt install phpmyadmin, I cannot find a way to install a more updated version"^^ . + "1"^^ . + . + . + . + . + "0"^^ . + . + . + . + "2"^^ . + "0"^^ . + "3"^^ . + . + "rabbitmq-management"^^ . + . + . + . + "comments"^^ . + "0"^^ . + . + . + . + . + . + . + "0"^^ . + . + . + "<pre><code>$myCallable('calling this works!');\n^^^^^^^^^^^.. defined variable\n</code></pre>\n<p>now for your static:: invocation:</p>\n<pre><code>static::$myCallable('this does not work');\n ^^^^^^^^^^^.. undefined variable\n\n\n(static::$myCallable)('this does work');\n ^^^^^^^^^^^^^^^^^^^.. defined static property\n\n(static::$myCallable)(...)('this does work');\n\n...\n</code></pre>\n<p>As you can see, it works the same, but you need a defined variable/property.</p>\n"^^ . + "0"^^ . + "0"^^ . + "<p>Replacing <code>HasPermissions</code> with <code>HasRoles</code> in <code>User.php</code>.</p>\n<p>You're using:</p>\n<pre class="lang-php prettyprint-override"><code>use Spatie\\Permission\\Traits\\HasPermissions;\n</code></pre>\n<p>but in Spatie's documentation, the correct trait is:</p>\n<pre class="lang-php prettyprint-override"><code>use Spatie\\Permission\\Traits\\HasRoles;\n</code></pre>\n"^^ . + "How to get Referrer value using CURLINFO or cURL"^^ . + . + . + "0"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + "WordPress doesn't use widgets as much as it does blocks now. Widgets are kinda obsolete."^^ . + "PHP rotates image -90deg while moving from one to another folder - but only huge .HEIC files"^^ . + "0"^^ . + "Where exactly are you stuck currently? Try to solve one problem at a time. Are you asking how to populate a html `<select` with options taken from your database data?"^^ . + "0"^^ . + . + . + . + . + . + "0"^^ . + "2"^^ . + "1"^^ . + "0"^^ . + . + "yes, I changed setting as below, and restarted nginx and fpm\nbut still same.. \nsendfile on; tcp_nopush on; types_hash_max_size 2048; client_max_body_size 10G; client_body_timeout 2024; client_header_timeout 2024; large_client_header_buffers 8 64k; fastcgi_read_timeout 300s; fastcgi_send_timeout 300s; proxy_read_timeout 300s; client_body_buffer_size 10M; fastcgi_buffering off; proxy_buffer_size 16k; proxy_buffers 8 16k; proxy_busy_buffers_size 32k;"^^ . + . + . + "<p>The constructor is</p>\n<pre><code> public function __construct(\n public string $apiKey,\n public ?string $indexHost = null,\n ) {}\n</code></pre>\n<p>as per the <a href="https://github.com/probots-io/pinecone-php/blob/de505b0a3bb95f8c4657f923f8b8288a7fabfeb9/src/Client.php#L24C1-L27C9https://github.com/probots-io/pinecone-php/blame/master/src/Client.php#L24C1-L27C9" rel="nofollow noreferrer">permalink</a>.</p>\n<p>If you take a look at <a href="https://github.com/probots-io/pinecone-php/blame/master/src/Client.php#L24C1-L27C9" rel="nofollow noreferrer">Git Blame</a>, then you can see that <a href="https://github.com/probots-io/pinecone-php/commit/959c6d92439d0e30fab7e2effb5e50f77defb5e9" rel="nofollow noreferrer">this commit</a> has changed the constructor from</p>\n<pre><code> public function __construct(\n\n\n public string $apiKey,\n\n\n public string $environment,\n\n )\n\n {\n\n // (Temporary) Workaround for https://github.com/probots-io/pinecone-php/issues/3\n\n $this-&gt;sender()-&gt;addMiddleware(function (callable $handler) {\n\n return function (RequestInterface $request, array $options) use ($handler) {\n\n return $handler(FetchVectors::queryIdsWorkaround($request), $options);\n\n };\n\n });\n\n }\n</code></pre>\n<p>to</p>\n<pre><code> public function __construct(\n\n\n public string $apiKey,\n\n\n public ?string $indexHost = null,\n\n )\n\n {\n\n // (Temporary) Workaround for https://github.com/probots-io/pinecone-php/issues/3\n\n $this-&gt;sender()-&gt;addMiddleware(function (callable $handler) {\n\n return function (RequestInterface $request, array $options) use ($handler) {\n\n return $handler(FetchVectors::queryIdsWorkaround($request), $options);\n\n };\n\n });\n\n }\n</code></pre>\n<p>so it is clear that the commit we are discussing changed the second parameter from being a mandatory string for the environment into an optional String.</p>\n<p>So you are using an older version than this commit and that obliges you to pass a second parameter.</p>\n<p>There are two possible solutions: either you pass a string as a second parameter as per the version you currently use, or update the version, that is, pulling and checking out an appropriate branch, such as master.</p>\n"^^ . + . + "As I said in my answer, this is called "premature optimisation". A _single photo_ taken on a smartphone will probably be larger than the `vendor` directory on the development copy of a library. Most programming decisions are about _developer convenience_, not optimising the number of bytes spent in source code on a development environment. If you're interested in that kind of micro-optimisation, maybe you could become a developer on embedded systems - in which case, you won't be using PHP, so this question will no longer be relevant to you."^^ . + . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + "0"^^ . + . + "0"^^ . + . + . + . + "laravel hasMany relation didnot work with mongodb database"^^ . + . + "csv"^^ . + . + . + "Clearly your php script is sending back html instead of json (those tags in the JS error message give it away). So probably your php script crashed and sent back a html-formatted error report. Inspect the raw response to the ajax request (using your browser's Network tool) and view the full message. Then you'll have some idea what went wrong in the php script and be able to tru and fix it."^^ . + "apcu"^^ . + "0"^^ . + . + "<p>Finally I noticed that I have called the wrong &quot;Component&quot; Class.</p>\n<pre><code>use Livewire\\Component;\n</code></pre>\n<p>should be</p>\n<pre><code>use Livewire\\Volt\\Component;\n</code></pre>\n<p>Now, everything is fine.</p>\n"^^ . + "0"^^ . + . + . + . + "I'm not sure how you'd make this work with the models/tables/relationships you've got defined. For something like this, you'd typically just have a `Person` model, and you'd define a relationship between each person, with the gender of the `Person` (usually a column on that table) defining the type (father, son, uncle, nephew, mother, daughter, aunt, niece, etc.). The position of the people would then determine if it's a parent (above), grandparent (above a parent), child (below) grandchild (below parent), etc. Just my 2¢, but I think you have a structure problem, not a problem with polymorph."^^ . + . + . + . + . + . + . + . + "0"^^ . + . + "0"^^ . + . + "ok, i removed mysql, Opencart Journal Theme is correct."^^ . + "I rolled back your edit. Solutions don't belong in the question area. And the answer already exists in the duplicate question anyway."^^ . + . + "code-snippets"^^ . + . + "0"^^ . + . + "1"^^ . + "tenancyforlaravel"^^ . + . + . + "0"^^ . + . + "createobjecturl"^^ . + . + . + . + "maybe I didn't register the middleware correctly? I just added the following line to the app.php in the bootstrap directory \n $middleware->append(SetLocale::class);"^^ . + "I can't reach `controller.my-index.pinecone.io` either. Are you sure this is a programming-related problem? Did you try to run this with cURL on the command line with any other result?"^^ . + "1"^^ . + . + "1"^^ . + . + . + "0"^^ . + "0"^^ . + "Compress pdf with IlovePDF pdf library: how to load manually the php lib?"^^ . + . + "front-controller"^^ . + "1"^^ . + . + . + . + . + "2"^^ . + . + . + . + . + . + "ajax"^^ . + . + . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + "Thanks for editing the post and making it more specific and clearer. It changes the context somewhat. So I think what you're really asking is - do you need to bother with escaping the text for the shell because you're limiting the possible values to a set of pre-defined, hard-coded ones. And yes that does massively reduce the risk - but as deceze says, you should consider the possibility that things change. If you escape the input value when you pass it to the shell you can't do any harm, but if you omit it then you always run a risk in future."^^ . + . + . + . + . + . + . + "0"^^ . + . + "@yivi did you manually create the `/api/login_check` route?"^^ . + "1"^^ . + . + "There is no good way to map these things via array shapes with phpstan - if I get your question right. That is, you're trying to have some kind of generics here but then the array should already know/express that by it's shape. I might be wrong but IIRC this is not possible. But as you have a class, you can define all arrays as [_Local type aliases_](https://phpstan.org/writing-php-code/phpdoc-types#local-type-aliases), that can be already helpful. and if only for a first overview. When done, check [_Offset access_](https://phpstan.org/writing-php-code/phpdoc-types#offset-access)."^^ . + . + . + . + . + "0"^^ . + . + . + "2"^^ . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + "Tried that already; no luck,"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + "0"^^ . + . + . + "<p>I uploaded a website on Godaddy and have a php file on there to send an email with PHPMailer from a form, but every time I clicked the send button I get a 504 Error. I ran it on a localhost and it worked perfectly fine. This is the code for the php file.</p>\n<pre><code>&lt;?php\n use PHPMailer\\PHPMailer\\PHPMailer;\n use PHPMailer\\PHPMailer\\Exception;\n use PHPMailer\\PHPMailer\\SMTP;\n\n include('vendor/autoload.php');\n include('PHPMailer.php');\n include(&quot;SMTP.php&quot;);\n include('Exception.php');\n\n\n\n if($_SERVER[&quot;REQUEST_METHOD&quot;] == &quot;POST&quot;) {\n $name = htmlspecialchars($_POST['name']);\n $email = htmlspecialchars($_POST['email']);\n $company = htmlspecialchars($_POST['company']);\n $phone = htmlspecialchars($_POST['phone']);\n $subject = htmlspecialchars($_POST['subject']);\n $message = htmlspecialchars($_POST['message']);\n\n $mail = new PHPMailer(true);\n\n $mail-&gt;isSMTP();\n $mail-&gt;Host = 'smtpout.secureserver.net';\n $mail-&gt;SMTPAuth = true;\n $mail-&gt;Username = 'email@mail.com';\n $mail-&gt;Password = 'password';\n $mail-&gt;SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;\n $mail-&gt;Port = 587;\n\n\n $mail-&gt;setFrom(&quot;mahogany@mahoganymarketingagency.com&quot;);\n $mail-&gt;addAddress('mahogany@mahoganymarketingagency.com');\n $mail-&gt;isHTML(true);\n $mail-&gt;Subject = $subject;\n $mail-&gt;Body = &quot;Name: &quot; . &quot;$name&quot; . &quot;&lt;br&gt;&quot; . &quot;Email: &quot; . &quot;$email&quot; . &quot;&lt;br&gt;&quot; . &quot;Company: &quot; . &quot;$company&quot; . &quot;&lt;br&gt;&quot; . \n &quot;Phone: &quot; . &quot;$phone&quot; . &quot;&lt;br&gt;&quot;\n . &quot;Message: &quot; . &quot;$message&quot; . &quot;&lt;br&gt;&quot;;\n $mail-&gt;send();\n echo '&lt;script type=&quot;text/javascript&quot;&gt;\n window.onload = function () { alert(&quot;Your email was sent!!!&quot;); }\n &lt;/script&gt;';\n\n \n\n }\n\n?&gt;\n</code></pre>\n"^^ . + "PHP Deprecated: Creation of dynamic property WooCommerce\\Square\\Gateway\\Gift_Card::$is_default_placeholder is deprecated in /home/teconnexpower/public_html/wp-content/plugins/woocommerce-square/includes/Framework/PaymentGateway/Payment_Gateway.php"^^ . + . + . + . + "0"^^ . + "shared-hosting"^^ . + "Thank you!! I am happy to get any guidance here. I will switch to using azure functions! Are you familiar with running them when you are using word press? I cannot find any resources online even discussing this idea."^^ . + . + "1"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + "@KIKOSoftware You are correct! However on the code I am working all the other devs opted to use double quote to quote strings (there is explicitly a manual that says the single quote is reserved for strings that will be used on system calls like `exec`)."^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "Run another Laravels' Artisan as a Subprocess from Laravel"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + . + "0"^^ . + . + "not yet, try my new suggestion first"^^ . + . + "3"^^ . + . + "You can add html comment as `delimiter` like this `<!-- SOME DELIMITER -->` and then in PHP you can do `$chunks = explode("<!-- SOME DELIMITER -->", $html);`"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + "2"^^ . + . + . + . + "<p>Can you try below updated code,</p>\n<pre><code>&lt;?php\n$text = 'Hi there';\n$source_lang = &quot;en&quot;;\n$target_lang = &quot;de&quot;;\n$tag_handling = &quot;xml&quot;;\n$ignore_tags = &quot;x&quot;;\n$formality = &quot;&quot;;\n$url = &quot;https://api.deepl.com/v2/translate&quot;;\n$authKey = &quot;hidden&quot;;\n\n$curl = curl_init($url);\ncurl_setopt($curl, CURLOPT_URL, $url);\ncurl_setopt($curl, CURLOPT_POST, true);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n$headers = array(\n &quot;Authorization: DeepL-Auth-Key $authKey&quot;,\n &quot;Content-Type: application/json&quot;,\n);\ncurl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\n$data = json_encode([\n 'text' =&gt; [$text],\n 'source_lang' =&gt; $source_lang,\n 'target_lang' =&gt; $target_lang,\n 'tag_handling' =&gt; $tag_handling,\n 'ignore_tags' =&gt; $ignore_tags,\n 'formality' =&gt; $formality\n]);\ncurl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n//for debug only!\ncurl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);\ncurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n$resp = curl_exec($curl);\n\n// Check for errors and display the error message\nif ($errno = curl_errno($curl)) {\n $error_message = curl_strerror($errno);\n echo &quot;cURL error ({$errno}):\\n {$error_message}&quot;;\n} else {\n echo &quot;Response:\\n&quot;;\n print_r(json_decode($resp, true));\n}\n\ncurl_close($curl);\n?&gt;\n</code></pre>\n"^^ . + . + . + "The post was simply should I convert a special character to an html entity, with no context. The answer was universally accepted: special characters are better. As for "maybe they're just very opinionated", that sounds like one of the most ridiculous comments I've ever read on this site. If I ask a question discussed on previous posts on this website, I'm told I should do more research. But if I base my post on a previous post on this website, I'm now told to ignore it because they're just very opinionated. Wow."^^ . + . + . + . + . + . + . + . + "mailchimp-api-v3.0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + "[What is the difference between client-side and server-side programming?](https://stackoverflow.com/q/13840429/1427878) explains the basics you are missing here."^^ . + . + . + "1"^^ . + "-1"^^ . + . + . + . + "0"^^ . + "Formatting with PHPWord's Template Processor"^^ . + . + . + "Please post an example of the CSV file. The arrays you show don't look like they come from a proper CSV. The first row should be the headers, but those look like they're in the 3rd array."^^ . + "0"^^ . + . + . + . + . + "*"when I click on the dropdown, nothing changes."* - What are you expecting to change and why? The JavaScript code shown doesn't visually **do** anything. It only makes a POST request to the server. It does nothing with the response nor updates the UI in any way. What specifically are you observing about that request and in what way does it differ from what you expect?"^^ . + . + "0"^^ . + "I think I installed a full version of FreeBSD and seem to have that file /usr/include/errno.h -> sys/errno.h"^^ . + . + "hostinger"^^ . + . + "0"^^ . + . + "mailchimp"^^ . + "OK, let's start with some security lessons then. Have a look at [the lessons from Hacksplaining](https://www.hacksplaining.com/lessons). Relevant lessons are SQL-injection, command execution, password mismanagement, session fixation, and insecure design. Lots of other lessons can also be useful, of course. This site teaches you well what you're up against, and you should expect all kind of attacks, because they do happen, always. I'm not sure if you even need to use a database, but if you do, this a great resource: [PDO tutorial](https://phpdelusions.net/pdo)."^^ . + . + "1"^^ . + . + . + . + . + . + "12:00 does indeed represent the end/start of a half day.\nI like your thinking with the modulo 24, good alternative.\nEmployees can only book a half or full day, 16:00 isn't a scenario."^^ . + . + . + . + . + . + . + . + . + "<p>You cannot simply copy libmysql.dll to your windows/system32. It depends on some other dlls (perhaps, even some runtime libs from msys2) and, as a result, you get 0xc0000135 when you try to run your app.</p>\n"^^ . + . + . + . + . + . + "<p>I need to update records for Guide Steps (Every recipe has steps/instruction and my table was created for storing this data)</p>\n<p>I was able to create those records in the db with quite easy syntax:</p>\n<pre><code>GuideStep::insert($groupedSteps); // $groupedSteps is an array\n</code></pre>\n<p>But now I need to update those records (and remove unnecessary ones), for this moment I came up with logic that can only update records or create if there is no such records:</p>\n<pre><code>foreach ($groupedSteps as $step){\n GuideStep::updateOrInsert(\n ['recipe_id' =&gt; $recipeId, 'step_number' =&gt; $step['step_number']],\n ['step_text' =&gt; $step['step_text'], 'step_image' =&gt; $step['step_image']]\n );\n}\n</code></pre>\n<p>migration:</p>\n<pre><code>Schema::create('guide_steps', function (Blueprint $table) {\n $table-&gt;id();\n $table-&gt;foreignId('recipe_id')-&gt;constrained()-&gt;cascadeOnDelete();\n $table-&gt;integer('step_number');\n $table-&gt;text('step_text');\n $table-&gt;string('step_image')-&gt;default('recipes-images/default/default_photo.png');\n $table-&gt;timestamps();\n });\n</code></pre>\n<p>I thought that I'll be able to use <code>upsert()</code> but this method requires <code>unique</code> columns (I don't have those)</p>\n<p>Be grateful for some advices</p>\n"^^ . + . + "I updated the question to provide more context. @u_mulder you are right, my functions should probably use the "actual enum" and get the value from there, however my enum values may go into HTTP requests, so I end up getting a string from that side. If I were to switch over the options, I'd still need to use the cases' `->value`s then."^^ . + "1"^^ . + . + "1"^^ . + "<p>I want to log in using my phone number or email in Laravel 11 with Breeze.</p>\n<pre class="lang-none prettyprint-override"><code> \n ┌──────────────────────────────────────────────┐ \n │ │ \n │ │ \n │ │ \n │ Email Or Mobile │ \n │ [__________________________________] │ \n │ │ \n │ │ \n │ Password │ \n │ [__________________________________] │ \n │ │ \n │ │ \n │ [ ] Remember me │ \n │ │ \n │ .─────────. │ \n │ &lt;Forgot your password?&gt; │ LOG IN │ │ \n │ `─────────´ │ \n │ │ \n └──────────────────────────────────────────────┘ \n \n</code></pre>\n<p>This is a picture of what I want to do</p>\n<p><img src="https://i.sstatic.net/behoaPUr.png" alt="Login Form" /></p>\n<p>But what is stopping me is how I will do this thing inside <strong>LoginRequest.php</strong> file of <strong>Laravel 11</strong>.</p>\n<p><strong>LoginRequest.php file</strong>:</p>\n<p>This is the official file that comes with Laravel 11 when you install Breeze</p>\n<pre><code>&lt;?php\n\nnamespace App\\Http\\Requests\\Auth;\n\nuse Illuminate\\Auth\\Events\\Lockout;\nuse Illuminate\\Foundation\\Http\\FormRequest;\nuse Illuminate\\Support\\Facades\\Auth;\nuse Illuminate\\Support\\Facades\\RateLimiter;\nuse Illuminate\\Support\\Str;\nuse Illuminate\\Validation\\ValidationException;\n\nclass LoginRequest extends FormRequest\n{\n /**\n * Determine if the user is authorized to make this request.\n */\n public function authorize(): bool\n {\n return true;\n }\n\n /**\n * Get the validation rules that apply to the request.\n *\n * @return array&lt;string, \\Illuminate\\Contracts\\Validation\\ValidationRule|array&lt;mixed&gt;|string&gt;\n */\n public function rules(): array\n {\n return [\n 'email' =&gt; ['required', 'email','exists:users,email'],\n 'password' =&gt; ['required', 'string'],\n ];\n }\n public function messages(): array\n {\n return [\n 'email.exists' =&gt; 'unavailable',\n ];\n }\n /**\n * Attempt to authenticate the request's credentials.\n *\n * @throws \\Illuminate\\Validation\\ValidationException\n */\n public function authenticate(): void\n {\n $this-&gt;ensureIsNotRateLimited();\n\n if (! Auth::attempt($this-&gt;only('email', 'password'), $this-&gt;boolean('remember'))) {\n RateLimiter::hit($this-&gt;throttleKey());\n\n throw ValidationException::withMessages([\n 'email' =&gt; trans('auth.failed'),\n ]);\n }\n\n RateLimiter::clear($this-&gt;throttleKey());\n }\n\n /**\n * Ensure the login request is not rate limited.\n *\n * @throws \\Illuminate\\Validation\\ValidationException\n */\n public function ensureIsNotRateLimited(): void\n {\n if (! RateLimiter::tooManyAttempts($this-&gt;throttleKey(), 5)) {\n return;\n }\n\n event(new Lockout($this));\n\n $seconds = RateLimiter::availableIn($this-&gt;throttleKey());\n\n throw ValidationException::withMessages([\n 'email' =&gt; trans('auth.throttle', [\n 'seconds' =&gt; $seconds,\n 'minutes' =&gt; ceil($seconds / 60),\n ]),\n ]);\n }\n\n /**\n * Get the rate limiting throttle key for the request.\n */\n public function throttleKey(): string\n {\n return Str::transliterate(Str::lower($this-&gt;string('email')).'|'.$this-&gt;ip());\n }\n}\n</code></pre>\n"^^ . + . + "<p>Try enabling CodeReady Builder\nMany EPEL packages require the CodeReady Builder (CRB) repository.\nIt is recommended that you run /usr/bin/crb enable to enable the CRB repository.</p>\n<pre><code>/usr/bin/crb enable\n</code></pre>\n<p>Or potentially use the fedora EPEL:</p>\n<pre><code>sudo dnf install \\\nhttps://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm\n</code></pre>\n"^^ . + "supervisord"^^ . + . + . + . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + "bcc"^^ . + . + . + . + . + . + . + "<p>While you do not show it, your controller is very likely extending the base <code>Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController</code>.</p>\n<p>This base class has a bunch of convenience/shortcut methods to reproduce common patterns.</p>\n<p>That allows you to do things like:</p>\n<pre><code>return $this-&gt;json(['foo' =&gt; 'bar']);\n</code></pre>\n<p>instead of the slightly more verbose, but functionally almost equivalent:</p>\n<pre><code>$payload = json_encode(['foo' =&gt; 'bar']);\n$response = new JsonResponse($payload);\nreturn $response;\n</code></pre>\n<p>Similarly, the <code>file()</code> method would allow you to do:</p>\n<pre><code>$response = $this-&gt;file($attachment);\n</code></pre>\n<p>Note that <a href="https://github.com/symfony/framework-bundle/blob/06b9c6f486aa1bc1a1f4b9d00b036f79e3ac3994/Controller/AbstractController.php#L163" rel="nofollow noreferrer">this method</a> doesn't accept passing the response headers (although it does set up the <code>Content-Disposition</code> header). So if you want to set the other two headers you are setting, you'd have to do it before returning the response:</p>\n<pre><code>$response-&gt;headers-&gt;set('Content-Type', $attachment-&gt;getType());\n$response-&gt;headers-&gt;set('Content-Length', $attachment-&gt;getSize());\n\nreturn $response;\n</code></pre>\n<p>Can't at the moment say if the changes in code would be good, convenient or necessary for you; but now you know that the <code>file()</code> shortcut is.</p>\n<hr />\n<p>I'd imagine that that warning doesn't come from stock PhpStorm, but from the very good <a href="https://plugins.jetbrains.com/plugin/7219-symfony-support" rel="nofollow noreferrer">Symfony Support plugin</a>, that you likely have installed.</p>\n"^^ . + . + . + "0"^^ . + "0"^^ . + "@hakre I believe MAX_FILE_SIZE is ignored when upload_max_filesize is set."^^ . + "@NikPatel: Please provide reference to what you mean by "default" image/fallback."^^ . + . + "@ArkadiuszDrabczyk No I didn't do that, not sure how to. \n\nroot@dev:/usr/local # pkg-config --modversion libjpeg\nPackage libjpeg was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libjpeg.pc'\nto the PKG_CONFIG_PATH environment variable\nPackage 'libjpeg' not found - I had done a FIND on libjpeg.pc, it's not on my filesystem"^^ . + . + . + "XAMPP needs to be placed in the startup folder, and then, to ensure that Apache and MySQL start when XAMPP launches, you need to check two options in the Config. - [How to start Apache and MySQL automatically when Windows startup](https://stackoverflow.com/a/20960324/15167500)"^^ . + . + . + . + . + . + "1"^^ . + "mapping"^^ . + . + . + "<p>Recently I'm using Laravel to develop my booking service applications.</p>\n<p>I had a problem when I wanted to store the data into the database through the form page. I already set the route, and method correctly, but the problem starts when I click the submit button. The form was reloaded and didn't save the data that I already inputted before.</p>\n<p>This is the blade form for the interface :</p>\n<pre><code>&lt;form method=&quot;POST&quot; action=&quot;{{ route('front.appointment_store') }}&quot;\n class=&quot;flex flex-col p-[30px] rounded-[20px] gap-[18px] bg-white shadow-[0_10px_30px_0_#D1D4DF40] w-full md:w-[700px] shrink-0&quot;&gt;\n @csrf\n\n....\n&lt;button type=&quot;submit&quot;\n class=&quot;bg-cp-dark-blue p-5 w-full rounded-xl hover:shadow-[0_12px_30px_0_#312ECB66] transition-all duration-300 font-bold text-white&quot;&gt;Book\n Appointment&lt;/button&gt;\n &lt;/form&gt;\n</code></pre>\n<p>And this is for route file in web.php</p>\n<pre><code>Route::get('/', [FrontController::class, 'index'])-&gt;name('front.index');\nRoute::get('/team', [FrontController::class, 'team'])-&gt;name('front.team');\nRoute::get('/about', [FrontController::class, 'about'])-&gt;name('front.about');\nRoute::get('/appointment', [FrontController::class, 'appointment'])-&gt;name('front.appointment');\nRoute::post('/appointment/store', [FrontController::class, 'appointment_store'])-&gt;name('front.appointment_store');\n</code></pre>\n<p>As you can see, data from blade file is referring to appointment_store method.</p>\n<p>And this is for appointment_store method that i save in Controller :</p>\n<pre><code>public function appointment_store(StoreAppointmentRequest $request)\n {\n DB::transaction(function () use ($request) {\n $validated = $request-&gt;validated();\n $newAppointment = Appointment::create($validated);\n // dd($newAppointment);\n });\n\n return redirect()-&gt;route('front.index');\n }\n</code></pre>\n<p>Honestly i had a stuck when troubleshooting this bug, since all the method, variable, and route are pronounced correctly, and when i try to debug it using dd($newAppointment);, it didn't show any data that being saved into the form.</p>\n<p>Please provide the solutions for this bug, so the data can be stored into database, and the form can be moved to Index file as written in appointment_store method. Thank you.</p>\n"^^ . + "Unzip into a different filename, and rename it when done. Then have the other script check for the existence of the renamed file. Renaming is atomic so you won't see a partial file."^^ . + . + "1"^^ . + . + "I uncommented this line extension=mbstring in my php.ini. I also did restart apache and the vps multiple time"^^ . + . + . + . + "hosting"^^ . + "My interpretation of the OP's question was that he wants a permutation of the original array elements with weighted random ordering. Some clarification from the OP is in order here."^^ . + "@KIKOSoftware Ok, I thought about that too. It all comes down to the same thing."^^ . + "There's a way of using an exotic kind of binary search tree data structure to do this, where you can find and delete the ith element in key sorted order in o(log(n)) time which would give you an O(nlog(n)) implementation. However, if doing it your way only requires creating an array a few times bigger, I doubt it's an idea worth pursuing. Also, I don't think there's a PHP implementation of this kind of data structure, so you'd have to create an API. If the sum of probabilities could be hundreds or thousands of times the number of elements though, then it could be worth considering."^^ . + . + . + "1"^^ . + "Yes, it worked, but I ended up using it.\n\nRUN setfacl -R -m u:www-data:rwx /var/www/html\nRUN setfacl -d -R -m u:www-data:rwx /var/www/html"^^ . + . + "0"^^ . + . + . + "<p>in general, I'm trying to log in to the roblox via API requests, but I ran into such a problem that when sending a request to <a href="https://apis.roblox.com/challenge/v1/continue" rel="nofollow noreferrer">https://apis.roblox.com/challenge/v1/continue</a> I get this in response:</p>\n<p>{\n&quot;statusCode&quot;: 403,\n&quot;statusText&quot;: &quot;Forbidden&quot;,\n&quot;errors&quot;: [\n{\n&quot;code&quot;: 1,\n&quot;message&quot;: &quot;an internal error occurred&quot;\n}\n]\n}</p>\n<p>No matter how much I try to change, add, and so on, nothing helps, I no longer know what to do.</p>\n<p>Code:</p>\n<pre><code>&lt;?php\n\n$request_body = file_get_contents('php://input');\n$request_body = json_decode($request_body, true);\n\nfunction get_csrf_token() {\n $csrf_url = &quot;https://www.roblox.com&quot;;\n $csrf_headers = [&quot;User-Agent: Mozilla/5.0&quot;];\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $csrf_url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, &quot;GET&quot;);\n\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_HEADER, true);\n \n curl_setopt($ch, CURLOPT_HTTPHEADER, $csrf_headers);\n $csrf_response = curl_exec($ch);\n curl_close($ch);\n \n preg_match('/meta name=&quot;csrf-token&quot; data-token=&quot;(.*?)&quot;/', $csrf_response, $matches);\n $csrf_token = $matches[1] ?? null;\n return $csrf_token;\n};\n$csrf_token = get_csrf_token();\n\nfunction continue_load($challengeId, $unifiedCaptchaId, $captchaToken, $actionType, $challengeType) {\n $login_url = &quot;https://apis.roblox.com/challenge/v1/continue&quot;;\n $login_data = [\n &quot;challengeId&quot; =&gt; $challengeId,\n &quot;challengeMetadata&quot; =&gt; json_encode([\n &quot;unifiedCaptchaId&quot; =&gt; $unifiedCaptchaId,\n &quot;captchaToken&quot; =&gt; $captchaToken,\n &quot;actionType&quot; =&gt; $actionType\n ]),\n &quot;challengeType&quot; =&gt; $challengeType\n ];\n \n $headers = [\n &quot;Content-Type: application/json&quot;,\n &quot;User-Agent: Mozilla/5.0&quot;,\n &quot;X-Csrf-Token: &quot; . $csrf_token\n ];\n \n $options = [\n CURLOPT_URL =&gt; $login_url,\n CURLOPT_POST =&gt; true,\n CURLOPT_POSTFIELDS =&gt; json_encode($login_data),\n CURLOPT_HTTPHEADER =&gt; $headers,\n CURLOPT_RETURNTRANSFER =&gt; true,\n CURLOPT_COOKIEJAR =&gt; $cookie_string,\n CURLOPT_COOKIEFILE =&gt; $cookie_string\n ];\n \n $ch = curl_init();\n curl_setopt_array($ch, $options);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n}\n$login_response = continue_load($request_body['challengeId'], $request_body['unifiedCaptchaId'], $request_body['captchaToken'], &quot;Login&quot;, &quot;captcha&quot;);\nprint_r($login_response);\nprint_r($login_data);\n?&gt;\n</code></pre>\n"^^ . + . + . + . + "Transfer Session between Javascript and PHP"^^ . + . + . + . + . + . + . + "0"^^ . + "1"^^ . + . + . + . + ""When I send two Laravel API requests at once via cURL" - how are you testing this exactly? In your code you are sending a second request after the first one. Are you saying that in your code you don't get the response from the second "products" request"^^ . + . + "2"^^ . + "3"^^ . + "XAMPP MySQL Shutdown Unexpectedly – How to Fix It Permanently?"^^ . + "0"^^ . + "0"^^ . + . + "For gmail emails, SMTP email validations is not working properly"^^ . + . + "PHP files show raw code when accessed from an HTML page but work when accessed directly"^^ . + . + . + . + "smarty"^^ . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + "https://datatables.net/manual/installation#HTML: _"Please also note that while DataTables supports `colspan` and `rowspan` in the table's header and footer, they are not supported in the table's `tbody` and must not be present."_"^^ . + . + . + . + . + . + "Thanks, I see that, but what should I change in my code so that it would work?"^^ . + . + "Thank you, I know nothing about Oauth though, so I still have a problem. I have a app_id, Dev_id and cert_id. I'm confused about $client_id and $client_secret. Can I use app_id and Cert_id for those? I tried that, and I got an error. Trying to get property of non-object in line 24. That's the $access_token line."^^ . + . + . + . + "<p>In my Laravel project I've got an admin page made with Filament. It allows me to create a Room object and after creating, the user who created it should be added to room.</p>\n<p>But for some reason it doesn't happen. The room is being created, but the pivot table stays empty.</p>\n<p>Also when I call the <code>$roomDomainService-&gt;create()</code> in <code>RoomController</code> the user is being assigned correctly.</p>\n<pre class="lang-php prettyprint-override"><code>// CreateRoom.php\nclass CreateRoom extends CreateRecord\n{\n protected static string $resource = RoomResource::class;\n\n protected function handleRecordCreation(array $data): Room\n {\n try {\n $roomDomainService = app()-&gt;make(RoomDomainService::class);\n\n $roomDTO = new RoomDTO($data['user_id'], $data['name'], $data['description'] ? $data['description'] : Optional::create());\n $room = $roomDomainService-&gt;create($roomDTO);\n\n return $room;\n } catch (BindingResolutionException $e) {\n throw $e;\n }\n }\n}\n\n</code></pre>\n<pre class="lang-php prettyprint-override"><code>//RoomDomainService.php\npublic function create(RoomDTO $dto): Room\n {\n $room = new Room();\n $this-&gt;update($room, $dto);\n\n $this-&gt;userService-&gt;assignToRoom($dto-&gt;userId, $room-&gt;id);\n\n return $room;\n }\n\n public function update(Room $room, RoomDTO $dto): void\n {\n $room-&gt;name = $dto-&gt;resolve($dto-&gt;name, $room-&gt;name);\n $room-&gt;description = $dto-&gt;resolve($dto-&gt;description, $room-&gt;description);\n $room-&gt;user_id = $dto-&gt;resolve($dto-&gt;userId, $room-&gt;user_id);\n\n $room-&gt;save();\n }\n</code></pre>\n<pre class="lang-php prettyprint-override"><code>//UserService.php\npublic function assignToRoom(int $userId, int $roomId)\n{\n $room = $this-&gt;roomRepository-&gt;find($roomId);\n try {\n $room-&gt;users()-&gt;attach($userId);\n } catch(\\Exception $e) {\n throw $e;\n }\n}\n</code></pre>\n<pre class="lang-php prettyprint-override"><code>//Room.php\nclass Room extends Model\n{\n use SoftDeletes;\n\n protected $guarded = [];\n\n public function users() {\n return $this-&gt;belongsToMany(User::class, 'room_user')-&gt;withTimestamps();\n }\n\n public function creator() {\n return $this-&gt;belongsTo(User::class, 'user_id');\n }\n}\n</code></pre>\n<pre class="lang-php prettyprint-override"><code>//RoomController.php\npublic function create(RoomRequest $request)\n{\n $room = $this-&gt;roomDomainService-&gt;create($request-&gt;toDTO());\n return response()-&gt;json([\n 'success' =&gt; true,\n 'data' =&gt; new RoomPresenter($room),\n ], 201);\n}\n</code></pre>\n"^^ . + . + . + . + "Error message complaining about an unexpected ] brace but it's valid"^^ . + . + . + "0"^^ . + . + . + . + . + . + "0"^^ . + . + . + "0"^^ . + . + "0"^^ . + . + "Import images from database to html"^^ . + "0"^^ . + "1"^^ . + . + "1"^^ . + . + . + . + . + "1"^^ . + . + "0"^^ . + . + . + . + . + . + "onedrive"^^ . + . + "`dirname(__DIR__)` returns the parent directory of the directory where the file is located, while `__DIR__` returns the current directory. For example, from `/var/www/html/index.php`, `dirname(__DIR__)` will return `/var/www/`, which is not what you need. `__DIR__` will return `/var/www/html/`, the location of your `vendor` directory."^^ . + . + "0"^^ . + "Nothing is "going crazy" here - VSCode is auto-completing [named parameters](https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments), which were introduced in PHP 8.0. If you get errors when running that code, you are using [a version of PHP which is no longer officially supported](https://www.php.net/eol.php). However, you can _configure VSCode to use highlighting and completion for the version of PHP you're using_, as shown in the linked duplicate or [some of these search results](https://stackoverflow.com/search?q=%5Bvisual-studio-code%5D+%5Bphp%5D+version)."^^ . + . + "psalm-php"^^ . + "1"^^ . + "0"^^ . + . + "api-platform.com"^^ . + . + . + . + . + "0"^^ . + . + . + . + . + . + "can you provide a sane example where you need to manually boot a request and validate it via FormRequest's?"^^ . + "1"^^ . + . + "0"^^ . + "Yes, it's a [property of the language](https://www.php.net/manual/en/language.oop5.anonymous.php) and can't be changed. It sounds like a [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem), though. Why do you need so many anonymous classes? Why do you need anonymous classes at all?"^^ . + "0"^^ . + . + "2"^^ . + "0"^^ . + "0"^^ . + "0"^^ . + . + . + . + . + "Oh, I'm out of ideas then. Can you have a look in the developer site, there used to be a way that you could see all of your API calls as they are received at Xero to try to help diagnose issues, I can't remember whether token issues were covered in there. Or Xero developer support were always helpful when I couldn't fathom things out, as they can check into what you're sending to give an idea of what the issue might be. The doc says you need an "Authorization" header on a token refresh, but my code doesn't send one."^^ . + "Hi there. Migrations are meant to be defined by the developers manually. There might be a package to dynamically generated them, but I won't recommend since others developers won't have the same database schema with others."^^ . + . + . + . + . + "1"^^ . + . + "3"^^ . + "1"^^ . + "0"^^ . + "<p>You can just change xamp to Laravel herd. When you use Laravel Herd, you don't need to run any command, just keep the project in the Herd folder and in your browser hit project__name.test this will work for every project.</p>\n"^^ . + "I'm sorry Davi, but it doesn't work. Please note I am using the PHP SDK with the *drive.file* scope. Even knowing the folder ID and performing the *"'FOLDER-ID' in parents and trashed=false"* query, it returns an empty array."^^ . + . + . + "0"^^ . + . + "0"^^ . + "0"^^ . + . + . + "0"^^ . + "filamentphp"^^ . + "0"^^ . + "database"^^ . + "PHP Code. Breadcrumb not explainable. There is the closing bracelet ? it work´s"^^ . + . + "<p>I'm trying to automatically add a product to the YITH WooCommerce Wishlist using an AJAX request, but it's failing with { result: false } in the response.</p>\n<p>Code in functions.php</p>\n<pre><code>add_action('wp_footer', 'enqueue_auto_yith_wishlist_script');\n\n function enqueue_auto_yith_wishlist_script() {\n if (!class_exists('YITH_WCWL')) {\n return; // Exit if YITH Wishlist plugin is not active\n }\n ?&gt;\n &lt;script&gt;\n jQuery(document).ready(function($) {\n var product_id = &quot;13058&quot;; // Ensure it's correct\n \n $.ajax({\n url: &quot;&lt;?php echo admin_url('admin-ajax.php'); ?&gt;&quot;,\n type: &quot;POST&quot;,\n data: {\n action: &quot;add_to_wishlist&quot;,\n add_to_wishlist: product_id,\n context: &quot;frontend&quot;,\n product_type: &quot;simple&quot;,\n nonce: &quot;&lt;?php echo wp_create_nonce('yith_wcwl_add_to_wishlist'); ?&gt;&quot;\n },\n success: function(response) {\n console.log(&quot;Wishlist Response:&quot;, response);\n \n if (response.success) {\n console.log(&quot;Product added successfully.&quot;);\n } else {\n console.log(&quot;Failed to add product. Error:&quot;, response);\n alert(JSON.stringify(response)); // Show full response in an alert box\n }\n },\n error: function(xhr, status, error) {\n console.log(&quot;AJAX Error:&quot;, error, &quot;Response:&quot;, xhr.responseText);\n }\n });\n });\n &lt;/script&gt;\n &lt;?php\n }\n</code></pre>\n"^^ . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + . + . + . + "-3"^^ . + . + "2"^^ . + . + "@ADyson Backslash-escaping is what a lot of systems will do automatically - for instance, tab completion in bash."^^ . + . + . + . + "0"^^ . + . + "entity"^^ . + . + . + "<p>I have to migrate an API developed on APIPlatform v2 to APIPlatform v3.\nIn this project the previous developer created custom patch actions as this (in a YAML file) :</p>\n<pre class="lang-yaml prettyprint-override"><code> reactivated:\n security_post_denormalize: 'is_granted(&quot;OT&quot;, object)'\n security_post_denormalize_message: &quot;Vous n'avez pas l'accès à cette ressource.&quot;\n method: PATCH\n path: /o_ts/{id}/reactivated\n controller: App\\Controller\\OTReactivated\n openapi_context:\n summary: Work Order reactivated\n</code></pre>\n<p>I transformed it to PHP 8 attribute like this :</p>\n<pre class="lang-php prettyprint-override"><code>#[ApiResource(\n operations: [\n new GetCollection(normalizationContext: ['groups' =&gt; ['ot_collection_read']]),\n new Get(requirements: ['id' =&gt; '\\d+'], normalizationContext: ['groups' =&gt; ['ot_read']]),\n new Post(\n securityPostDenormalize: 'is_granted(&quot;OT&quot;, object)',\n securityPostDenormalizeMessage: &quot;Vous n'avez pas l'accès à cette ressource.&quot;,\n validationContext: ['groups' =&gt; [OTAddSequencedGroup::class]],\n ),\n new Put(\n denormalizationContext: ['groups' =&gt; ['ot_update_write', 'ot:attachments', 'attachment:write', 'attachment:subcontractingProductionCenter', 'attachment:customFieldValues', 'attachment_custom_field_value:field', 'custom_field_value:write']],\n securityPostDenormalize: 'is_granted(&quot;OT&quot;, object)',\n securityPostDenormalizeMessage: &quot;Vous n'avez pas l'accès à cette ressource.&quot;,\n validationContext: ['groups' =&gt; ['Default', OTDefaultSequencedGroup::class, 'attachment:valid:create', 'ot:address:update']]\n ),\n new Patch(\n requirements: ['id' =&gt; '\\d+'],\n denormalizationContext: ['groups' =&gt; ['ot_update_write', 'ot:attachments', 'attachment:write', 'attachment:subcontractingProductionCenter', 'attachment:customFieldValues', 'attachment_custom_field_value:field', 'custom_field_value:write']],\n securityPostDenormalize: 'is_granted(&quot;OT&quot;, object)',\n securityPostDenormalizeMessage: &quot;Vous n'avez pas l'accès à cette ressource.&quot;,\n validationContext: ['groups' =&gt; ['Default', OTDefaultSequencedGroup::class, 'attachment:valid:create', 'ot:address:update']]\n ),\n ],\n normalizationContext: ['groups' =&gt; ['ot_read']],\n denormalizationContext: ['groups' =&gt; ['ot_write']],\n validationContext: ['groups' =&gt; OTDefaultSequencedGroup::class],\n security: 'is_granted(&quot;ROLE_USER&quot;)'\n)]\n#[Patch(\n uriTemplate: '/o_ts/{id}/reactivated',\n controller: OTReactivated::class,\n openapiContext: ['summary' =&gt; 'Work Order reactivated'],\n securityPostDenormalize: 'is_granted(&quot;OT&quot;, object)',\n securityPostDenormalizeMessage: &quot;Vous n'avez pas l'accès à cette ressource.&quot;,\n name: 'api_o_ts_reactivated',\n)]\n</code></pre>\n<p>So far so good, the route is here, and the call work as expected. Except in the response. The generated iri is not correct. It seems that the ApiPlatform converter thinks the object id is &quot;-id-/reactivated&quot;, but its not.\nLook yourself.<br />\n<a href="https://i.sstatic.net/yrLDPqj0.png" rel="nofollow noreferrer">The call (image) :</a></p>\n<p>The beginning of the response:</p>\n<pre class="lang-json prettyprint-override"><code>{\n &quot;@context&quot;: &quot;\\/contexts\\/OT&quot;,\n &quot;@id&quot;: &quot;\\/o_ts\\/2\\/reactivated&quot;,\n &quot;@type&quot;: &quot;OT&quot;,\n &quot;id&quot;: 2\n}\n</code></pre>\n<p>The @id should be : &quot;/o_ts/2&quot;</p>\n<p>I know, the documentation says that it's not recommanded but the API is already done and in production … So I can't just change the routes …</p>\n<p>So, does anybody have a solution to my problem?</p>\n<p>I tried to add uriVariables like this :</p>\n<pre class="lang-php prettyprint-override"><code>#[Patch(\n uriTemplate: '/o_ts/{id}/reactivated',\n uriVariables: ['id' =&gt; new Link(fromClass: self::class, identifiers: ['id'])],\n controller: OTClose::class,\n openapiContext: ['summary' =&gt; 'Work Order reactivated'],\n securityPostDenormalize: 'is_granted(&quot;OT&quot;, object)',\n securityPostDenormalizeMessage: &quot;Vous n'avez pas l'accès à cette ressource.&quot;,\n name: 'api_o_ts_reactivated',\n)]\n</code></pre>\n"^^ . + "<p>You can do this by checking <code>document.referrer</code> on pageC. For example:</p>\n<pre class="lang-html prettyprint-override"><code>&lt;script&gt;\ndocument.addEventListener(&quot;DOMContentLoaded&quot;, function() {\n var referrer = document.referrer;\n var fruitBasket = document.getElementById(&quot;fruitBasket&quot;);\n\n // If coming from pageB, show orange; otherwise, default to apple.\n if (referrer.indexOf(&quot;mywebsite.com/pageB&quot;) !== -1) {\n fruitBasket.innerHTML = '&lt;img src=&quot;orange.jpg&quot; alt=&quot;Orange&quot;&gt;';\n } else {\n fruitBasket.innerHTML = '&lt;img src=&quot;apple.jpg&quot; alt=&quot;Apple&quot;&gt;';\n }\n});\n&lt;/script&gt;\n</code></pre>\n"^^ . + "1"^^ . + . + "0"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + "1"^^ . + "0"^^ . + . + . + . + "The reason is, to give users the possibility to set privacy rights which means that they will have a switch where they can enable/disable the plugin's functionality. The plugin itself unfortunately doesnt have this option.\nWhat do you mean by whitelist. I can check if the user is a subscriber already. Is that what you meant?"^^ . + "Please right-click your page and select "inspect", then look in the console and the network tab and look at the "view page source" too"^^ . + . + "0"^^ . + "0"^^ . + "WordPress Vehica Theme: API Data Not Showing in Listing"^^ . + . + . + "1"^^ . + . + . + . + "processmaker"^^ . + . + . + . + . + "1"^^ . + . + . + "0"^^ . + . + "2"^^ . + . + . + "redis"^^ . + "-1"^^ . + . + "4"^^ . + . + "What is the question?"^^ . + . + . + . + . + . + "0"^^ . + . + . + . + . + . + . + . + . + "2"^^ . + "_"I tried a subdomain but I was unable to run it from there."_ - "was unable to" doesn't tell us anything _useful_ about what actually went wrong. In theory, you should be able to run both under the same domain - but then you will either have to use a different port for Node for your requests from the outside, than for the web server that executes your PHP; or you will have to configure your web server to proxy certain requests to Node internally."^^ . + . + . + "1"^^ . + "<p>This is not possible within phpunit, as they need the current behavior so they can compute the total number of tests.</p>\n<p>See this <a href="https://github.com/sebastianbergmann/phpunit/issues/836" rel="nofollow noreferrer">closed phpunit issue</a> for reference.</p>\n<hr />\n<p>There is a <a href="https://github.com/sebastianbergmann/phpunit/issues/836#issuecomment-510646195" rel="nofollow noreferrer">proposed workaround by user machitgarha</a>:</p>\n<blockquote>\n<p>A solution would be defining a new private method and define as many\nvariables as needed, as static ones inside it. Then, check if one of\nthem is set, and if it is not, set all of them and return (or yield)\nthem. This way, the variables will be declared only once, even if you\nhave ten providers or whatever. Besides, you can use it in\nsetUpBeforeClass() or setUp().</p>\n<p>See it in an example:</p>\n<pre class="lang-php prettyprint-override"><code>private static function getData() {\n static $data, $anotherData;\n\n if (!isset($data)) {\n $data = new TestClass();\n $anotherData = [];\n }\n\n return [\n $data,\n // Or: clone $data\n $anotherData,\n ]; }\n\npublic static function setUpBeforeClass() {\n list(self::$sampleJson, self::$sampleData) = self::getData(); }\n\npublic function sampleProvider() {\n $data = self::getData();\n\n return [\n $data\n ]; }\n</code></pre>\n</blockquote>\n"^^ . + . + "0"^^ . + "$GLOBALS **itself,** being a superglobal, is available in **all** scopes. It contains (references) all variables from the **global** scope. Is it what you were asking for?"^^ . + . + "1"^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "Can you clarify the problem further? You've tagged this with MySQL and journal - how are these techniques related?"^^ . + "0"^^ . + . + . + "I think this will answer your question: [Sending forms through JavaScript](https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Sending_forms_through_JavaScript)."^^ . + "0"^^ . + "1"^^ . + . + . + . + . + . + "_"My main concern is ensuring that only the intended parts of the HTML are modified, while other parts of the document remain unchanged."_ Why would the DOM manipulation be broken? Do you have an example of that happening? Or is that just a fear? Look at the [DOMDocument documentation](https://www.php.net/manual/en/class.domdocument.php) - it has quite a lot of examples for you on how to use it correctly. There is no reason to assume that it just breaks your HTML unless you are doing something incorrectly."^^ . + . + . + . + . + . + . + "the query will exteract the 4 numbers, no matter which numbers they are, and same for the last letter."^^ . + "0"^^ . + "1"^^ . + . + "`I already added XSS protection` - excellent. `I also added some handling of connection and query errors` - that you shouldn't. At least if you need a good code. But it seems you are interviewed by some ancient folks who code as tough it's 2000 around and they might appreciate that. Or might not. `Do you guys think I should use it anyway` - not at all. You were explicitly tasked to prevent SQL injection, not to add some imaginary performance improvement."^^ . + . + . + . + . + "0"^^ . + "Not too familiar with Herd, but I don't think so. The location directive is based off the URI/URL, not the file system."^^ . + "Please keep in mind that Laravel 5 is EOL since nearly five years!"^^ . + "<p>This is caused by the IDE not knowing what type you're passing in.</p>\n<p>There's <a href="https://github.com/barryvdh/laravel-ide-helper" rel="nofollow noreferrer">a third-party package to help with this</a>.</p>\n<p>Annotations are generally the way to solve your issue.</p>\n"^^ . + . + . + . + . + . + "Note that `simplexml_load_string()` _can not_ return an empty string, it can only return an instance of SimpleXMLElement or `false`."^^ . + . + "You need 4 JOINs, not 2. You join to the club table twice, and the team table twice, but using the home IDs for the first set of joins, and the away IDs for the second set of joins. Use table aliases to distinguish between each instance. P.S. This is purely a SQL issue, nothing to do with PHP"^^ . + "None of those other headers are listed in their docs."^^ . + . + "0"^^ . + "0"^^ . + . + . + . + "-1"^^ . + "2"^^ . + . + . + . + "uname - a Linux boring-johnson.52-25-1-221.plesk.page 6.5.0-1022-aws #22~22.04.1-Ubuntu SMP Fri Jun 14 16:31:00 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux"^^ . + . + "0"^^ . + . + "2"^^ . + "1"^^ . + . + . + "1"^^ . + . + . + . + "1"^^ . + . + "3"^^ . + . + . + . + . + . + . + . + . + "traits don't inherit anything, classes inherit. For what you show I don't see why you need to overwrite any trait method, any not use a new trait"^^ . + . + . + . + "ffmpeg"^^ . + . + . + . + . + . + . + . + "0"^^ . + . + . + . + "3"^^ . + . + . + "<p>The <em>spl_autoload_register()</em> function registers your callback on a stack.</p>\n<p>Now the problem you are confronted with is, that the callback receives most classes to load, including those unrelated to your plugin.</p>\n<p>This requires you to differentiate between your plugins' classes and other classes.</p>\n<hr />\n<p>Let's go through this step-by-step, starting with your classes directories:</p>\n<pre><code>\\my-plugin\\inc\\classes\\post-types # for CPT\n\\my-plugin\\inc\\classes\\taxonomies # for taxonomies\n</code></pre>\n<p>For the <em>easiest</em> and most PHP (Standard PHP Library, SPL) compatible form, rename the <code>post-types</code> directory so that it is compatible with <em>namespace segments</em>, e.g. use an underscore &quot;_&quot; instead of the hyphen-minus &quot;-&quot;:</p>\n<pre><code>\\my-plugin\\inc\\classes\\post_types # for CPT\n\\my-plugin\\inc\\classes\\taxonomies # for taxonomies\n</code></pre>\n<p>Then put the pathname of <code>\\my-plugin\\inc</code> onto the <em>include path</em>. This is for the <a href="https://www.php.net/manual/en/function.spl-autoload.php" rel="nofollow noreferrer">default implementation of class autoloading, <em>spl_autoload()</em></a>.</p>\n<p>Then put all of your classes into <code>.php</code> files (with lower-case filenames) beneath it and the related namespaces in those files:</p>\n<pre><code>\\my-plugin\\inc\\classes\\post_types\n aaa.php # namespace classes/post_types; class Aaa {}\n bbb.php # namespace classes/post_types; trait bBb {}\n ccc.php # namespace classes/post_types; interface ccC {}\n ...\n\\my-plugin\\inc\\classes\\taxonomies\n my_tax.php # namespace classes/taxonomies; class My_Tax {}\n</code></pre>\n<p>Finally register the default SPL autoloader callback instead of your own:</p>\n<pre><code>spl_autoload_register(); # Default SPL autoload implementation\n</code></pre>\n<p>This is the very basic setup. The namespaces guard SPL autoload to look into the right directories in the file-system (based on the include path names).</p>\n<p>You use lower-case filenames in the file-system, so that the files are portable across file-systems (e.g. those with and without lower and upper-case characters, or not making a difference between them).</p>\n<p>This is extensible, e.g. if you want to configure your plugin with a composer.json file, you can configure the base-directory from the include path as a class-map directory. (If you want to rely on PSR-1/4, you have to rename the files, as those autoloading standards are not portable across file systems.)</p>\n"^^ . + . + "0"^^ . + . + "port"^^ . + "0"^^ . + "<p>The several methods I have tried so far.</p>\n<ol>\n<li><p>Explicitly declare the return type of callback.</p>\n<pre><code>/** @return object{value: ?int, label: string} */\nfunction foo (State $state) {\n return (object) [\n 'value' =&gt; $state-&gt;id,\n 'label' =&gt; $state-&gt;name,\n ];\n}\n\nreturn State::all()\n -&gt;map('foo')\n ...\n</code></pre>\n</li>\n<li><p>Declare the <code>$id</code> property as <code>?int</code>.</p>\n</li>\n<li><p>Create a dedicated type instead of <code>stdClass</code>.</p>\n</li>\n<li><p>Unable to explain but this can deceive the phpstan.</p>\n<pre><code>-&gt;map(fn (State $state) =&gt; (object) [\n 'value' =&gt; $state-&gt;id ?? null,\n 'label' =&gt; $state-&gt;name\n])\n</code></pre>\n</li>\n</ol>\n"^^ . + "<p>I have an function that tries to synchronize data of the API to the system and the system data needs to be synchronized with the API.</p>\n<p>As you can imagine this can take a little while, definitely when the API has an minute rate limit of 60 requests every minute and you get an <code>503 error</code> after 3 minutes. The system has over 1000 requests it has to make.</p>\n<p>This problem will only occur in the first synchronization since after that the data wil get indexed and there wil only be requests if needed.</p>\n<p>The larger issue I am facing is at the end of the function it retrieves the access and refresh token since it throws an <code>503 error</code>. It will never reach that far and it isn't user friendly to let someone press the same button 15 times to synchronize data.</p>\n<p>Extra info:</p>\n<ul>\n<li>This project is hosted on hostinger</li>\n<li>This project is made with codeignitor x4.3.6</li>\n<li>This project is made with php X8.1</li>\n</ul>\n<p>An minimalist piece of code to reproduce the error:</p>\n<pre class="lang-php prettyprint-override"><code> function test() {\n sleep(185);\n return &quot;test&quot;;\n}\n</code></pre>\n<p>What I have tried is to change request limits in the PHP's config and execution time, this had no result. I have also looked at the RAM, CPU, etc. usage and it wasn't even over 50%. Within the function I added an <code>ini_set('max_execution_time', 5000);</code> which also changed nothing.</p>\n<p>I have found something that the if the browser needs to wait for too long it will also stop the process.</p>\n<p>I am open for any wild ideas/solutions/workarounds/answers since this problem drives me crazy.</p>\n"^^ . + "0"^^ . + "0"^^ . + . + "0"^^ . + . + . + "1"^^ . + . + . + "0"^^ . + . + . + . + . + . + "1"^^ . + . + . + . + "1"^^ . + "0"^^ . + "0"^^ . + . + . + . + "0"^^ . + . + . + . + . + "<blockquote>\n<p>What extension brings function <code>#ifingroup</code>?</p>\n</blockquote>\n<p>That is <a href="https://www.mediawiki.org/wiki/Extension:UserFunctions" rel="nofollow noreferrer"><em>Extension:UserFunctions</em> (MediaWiki)</a>.</p>\n<p>You may have it already enabled, however this note about the namespace (and there is also something about the side-bar):</p>\n<blockquote>\n<p>By default, functions are only enabled in <code>NS_MEDIAWIKI</code> namespace, for enabling them in other namespaces, see the <a href="https://www.mediawiki.org/wiki/Extension:UserFunctions#Allowing_namespaces" rel="nofollow noreferrer">examples below</a>. <em>(<a href="https://www.mediawiki.org/wiki/Extension:UserFunctions" rel="nofollow noreferrer">ebd.</a>)</em></p>\n</blockquote>\n"^^ . + . + "0"^^ . + . + . + . + . + "2"^^ . + . + "Making Video in Laravel 11"^^ . + "@SergeyPervushin: May I suggest you answer your own question? See https://stackoverflow.com/help/self-answer"^^ . + . + . + . + "@disinfor it is missing because for some reason files are not getting copied to the main directory which is in nfs server - that is the problem right there."^^ . + . + "<p><strong>Update based on the comment:</strong></p>\n<p>I think your best shot is to use the <a href="https://www.php.net/manual/en/ref.outcontrol.php" rel="nofollow noreferrer">PHP output buffers</a>. So you don't have to repeat the mark up and you can implement what you want with a <strong>single while loop</strong>.</p>\n<p>Example:</p>\n<pre><code>if (have_rows('repeater')): \n\n $current_user = wp_get_current_user();\n $adminOnlyContent = '';\n $nonAdminContent = '';\n\n while( have_rows('repeater') ): the_row();\n\n $show_only = get_sub_field('show_only_to_logged_in_admins');\n\n ob_start();\n\n echo '&lt;div class=&quot;col&quot;&gt;';\n echo '&lt;div class=&quot;title&quot;&gt;';\n the_sub_field('title');\n echo '&lt;/div&gt;&lt;/div&gt;';\n\n if ((user_can( $current_user, 'administrator' )) &amp; ($show_only == 1)) {\n $adminOnlyContent .= ob_get_clean();\n } else {\n $nonAdminContent .= ob_get_clean();\n }\n\n endwhile;\n\n echo '&lt;div class=&quot;container-fluid&quot;&gt;&lt;div class=&quot;row&quot;&gt;';\n\n echo $adminOnlyContent;\n\n echo $nonAdminContent;\n\n echo '&lt;/div&gt;&lt;/div&gt;';\n\nendif;\n</code></pre>\n<p>Another option is implement a separate function which will return the markup.</p>\n<p><strong>Original Answer:</strong></p>\n<p><strong>You cannot use <code>the_row()</code> twice within a loop. So you cannot use the nested loops here.</strong> But there are several ways to achieve what you want.</p>\n<p>Here is one option: Store the content for both groups of fields in variables and echo them after the while loop.</p>\n<pre><code>$other_rows = [];\n\nif (have_rows('repeater')): \n\n $adminFields = '';\n $nonAdminFields = '';\n\n $current_user = wp_get_current_user();\n\n while( have_rows('repeater') ): $row = the_row();\n\n $show_only = get_sub_field('show_only_to_logged_in_admins');\n\n if ((user_can( $current_user, 'administrator' )) &amp; ($show_only == 1)) {\n\n $adminFields .= '&lt;div class=&quot;col&quot;&gt;&lt;div class=&quot;title&quot;&gt;';\n $adminFields .= the_sub_field('title');\n $adminFields .= '&lt;/div&gt;&lt;/div&gt;';\n\n } else {\n $nonAdminFields .= '&lt;div class=&quot;col&quot;&gt;&lt;div class=&quot;title&quot;&gt;';\n $nonAdminFields .= the_sub_field('title');\n $nonAdminFields .= '&lt;/div&gt;&lt;/div&gt;';\n }\n\n endwhile;\n\n echo '&lt;div class=&quot;container-fluid&quot;&gt;&lt;div class=&quot;row&quot;&gt;';\n\n echo $adminFields;\n echo $nonAdminFields;\n\n echo '&lt;/div&gt;&lt;/div&gt;';\n\nendif;\n</code></pre>\n<p><strong>Alternate solution:</strong></p>\n<p>The other options may require at least two loops. You need to use the loops one after the other instead of nested loops.</p>\n<pre><code>...\n $current_user = wp_get_current_user();\n\n while( have_rows('repeater') ): $row = the_row();\n\n $show_only = get_sub_field('show_only_to_logged_in_admins');\n if ((user_can( $current_user, 'administrator' )) &amp;&amp; ($show_only == 1)) {\n\n // Display content\n\n }\n\n endwhile;\n\n while( have_rows('repeater') ): $row = the_row();\n\n $show_only = get_sub_field('show_only_to_logged_in_admins');\n if (! (user_can( $current_user, 'administrator' )) || ($show_only != 1)) {\n\n // Display content\n\n }\n\n endwhile;\n...\n</code></pre>\n<p><strong>Alternate Solution 2</strong></p>\n<p>Here is another technique: Get all the repeater rows and segregate them to admin and non-admin rows. Then you can loop over them. Here also you need to use two loops.</p>\n<pre><code>// This is just a pseudo-code but you get the idea\n$rows = get_field('repeater');\n$current_user = wp_get_current_user();\n\n$adminOnlyRows = array_filter($rows, function ($row) {\n $show_only = $row['show_only_to_logged_in_admins'];\n return (user_can( $current_user, 'administrator' )) &amp;&amp; ($show_only == 1);\n});\n\n$nonAdminOnlyRows = array_filter($rows, function ($row) {\n $show_only = $row['show_only_to_logged_in_admins'];\n return ! (user_can( $current_user, 'administrator' )) || ($show_only != 1);\n});\n\necho '&lt;div class=&quot;container-fluid&quot;&gt;&lt;div class=&quot;row&quot;&gt;';\n foreach ($adminOnlyRows as $row) {\n // Display content\n }\n\n foreach ($nonAdminOnlyRows as $row) {\n // Display content\n }\necho '&lt;/div&gt;&lt;/div&gt;';\n</code></pre>\n"^^ . + "0"^^ . + . + . + . + . + "1"^^ . + . + . + . + . + . + . + . + . + "0"^^ . + . + "Changed -> "curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);" to false and seems to work!"^^ . + . + "To answer point 3, see https://stackoverflow.com/q/978061/2232127"^^ . + . + . + "0"^^ . + . + "Can you share more details about the problem? I don't see how that CORS erroris related to the given code"^^ . + "<p>What I need is to use <code>prefix()</code> with <code>Middleware</code> simultaneously within Laravel.</p>\n<p>For example this code:</p>\n<pre><code>Route::prefix('admin')-&gt;group(function () {\n Route::get('/users', function () {\n // Matches The &quot;/admin/users&quot; URL\n });\n});\n</code></pre>\n<p>What I want is to use <code>prefix()</code> and <code>Middleware</code> simultaneously.</p>\n<p>But I have no idea how to integrate them into Laravel 11.</p>\n<p>In previous versions, it was done like this:</p>\n<pre><code>Route::group(['prefix' =&gt; 'post', 'middleware' =&gt; ['auth']], function(){\n Route::get('all','Controller@post');\n Route::get('user','Controller@post');\n })\n</code></pre>\n<p>But how do I do that with my current Laravel version 11?</p>\n"^^ . + . + "Please add all clarification to your question by editing it, not to the comment section. Also, keep in midn that the browser's session and PHP's session are completely different"^^ . + "Hi Sir, I just realize, how to print this in table, ex. <th>accountname</th><th>month_year</th><th>target</th><td>account1</td><td>jan</td><td>1000</td> and so on"^^ . + . diff --git a/php/chunk19.nt b/php/chunk19.nt new file mode 100644 index 0000000000000000000000000000000000000000..300dbe42a31251532d0a92a946601bc5534cbb62 --- /dev/null +++ b/php/chunk19.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b9babf8d762dceb675aac455d232e31ddbdd4d29be1ad3575816150c5549efa +size 90676546 diff --git a/php/chunk2.nt b/php/chunk2.nt new file mode 100644 index 0000000000000000000000000000000000000000..6a59015c84d00c4071d14608280d7c9d2eaaa32e --- /dev/null +++ b/php/chunk2.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d151478706c05dd17d44d9dd3fd191b396d37bf6e03e869977ebae956e8f1f8 +size 84830578 diff --git a/php/chunk20.nt b/php/chunk20.nt new file mode 100644 index 0000000000000000000000000000000000000000..3dba927a4a7fd3f6f3ccf01c8cfe483a08f84071 --- /dev/null +++ b/php/chunk20.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e688e8176056d2a80c7517a1b12df0ebe331e286c80612767bddb42c817904d5 +size 91637706 diff --git a/php/chunk21.nt b/php/chunk21.nt new file mode 100644 index 0000000000000000000000000000000000000000..b416a4bfd1ce2bee5a4d4049203bba5954a32d89 --- /dev/null +++ b/php/chunk21.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4433f523c48ddf99a68b06a09a37e5595bf3e9245ec8ce4d7c14c6b70d54aef8 +size 93519766 diff --git a/php/chunk22.nt b/php/chunk22.nt new file mode 100644 index 0000000000000000000000000000000000000000..40dcbd7a0bd87e9a0fc9b33ec1a8d0e8061e6333 --- /dev/null +++ b/php/chunk22.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2e3b5fad842884d45eed4af66cb6bdb85982bd7bc27ec3961557a788d2197d9 +size 96473633 diff --git a/php/chunk23.nt b/php/chunk23.nt new file mode 100644 index 0000000000000000000000000000000000000000..dd999f41b1cc22ad797f37110b832c4025e261ef --- /dev/null +++ b/php/chunk23.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee59f6c4af80e39d7ed913e9fde234b714f5ac90f942c472d6220479237a5453 +size 93419909 diff --git a/php/chunk24.nt b/php/chunk24.nt new file mode 100644 index 0000000000000000000000000000000000000000..90920a386720f8a0719c62499b824df523cdff22 --- /dev/null +++ b/php/chunk24.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a3b4283d190e075f99db20203399cda8445ad1334179720e203c0d874ed768e +size 94604394 diff --git a/php/chunk25.nt b/php/chunk25.nt new file mode 100644 index 0000000000000000000000000000000000000000..15b6ec5c34b8e9085edfd49c93a8eb3c24389f1a --- /dev/null +++ b/php/chunk25.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e926cab43975b1d1d2d92912c5c70afe08a3f36766f2342b3e59fa277390e941 +size 93261933 diff --git a/php/chunk26.nt b/php/chunk26.nt new file mode 100644 index 0000000000000000000000000000000000000000..817fd3ed8bcf72375fa5f582d825734860a227ad --- /dev/null +++ b/php/chunk26.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e66dff8e284f358315d204bd5a57a693c7e19b7e11cd444a7663993297f4f8af +size 95834438 diff --git a/php/chunk27.nt b/php/chunk27.nt new file mode 100644 index 0000000000000000000000000000000000000000..fc61050ee90a141a871e5ee8eb32fd16d9a876e8 --- /dev/null +++ b/php/chunk27.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:141129a5b095be57b2a5a91f38cad0655b8dfb67d207259c48bdbbc1fe76145d +size 97040066 diff --git a/php/chunk28.nt b/php/chunk28.nt new file mode 100644 index 0000000000000000000000000000000000000000..3b56b59b18fe354f60d9669d91d3f621c157c9f9 --- /dev/null +++ b/php/chunk28.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18c2c5c1d99731b3b1b54e7790cb9e771845b0fb3492498ea68f6e526c50a953 +size 96167553 diff --git a/php/chunk29.nt b/php/chunk29.nt new file mode 100644 index 0000000000000000000000000000000000000000..ecd1f2a389839d3faf430f695967de2a439a4ea4 --- /dev/null +++ b/php/chunk29.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43e9d51625a540af0876c90cd9423e989fb92b67d46901b179248d99c54cfc9c +size 94635494 diff --git a/php/chunk3.nt b/php/chunk3.nt new file mode 100644 index 0000000000000000000000000000000000000000..4535e758408ede7db1a83cb10db611a1b90137f1 --- /dev/null +++ b/php/chunk3.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0c32fa6effbaae6bfcc08682089dc0d8c7dff339e0b03a0c363d70f01de7d73 +size 94444181 diff --git a/php/chunk30.nt b/php/chunk30.nt new file mode 100644 index 0000000000000000000000000000000000000000..0c72e2b48c42fbecaad7a6b6de56454c2425d148 --- /dev/null +++ b/php/chunk30.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de4662abdbb8332669ecf8f40dec07b4c52b30c32e8e66436b8c203f92915c3b +size 96993328 diff --git a/php/chunk31.nt b/php/chunk31.nt new file mode 100644 index 0000000000000000000000000000000000000000..4124fe3d7211fb2c0e1f4a0b0a54cf1268b8f4bf --- /dev/null +++ b/php/chunk31.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:772c86d49349fe55fb445dfd084b009f7b98f94e854d07c2ad1708767abd5230 +size 100950578 diff --git a/php/chunk32.nt b/php/chunk32.nt new file mode 100644 index 0000000000000000000000000000000000000000..28fe08167fb08223d9fe9fffa617d62aa9c3ab21 --- /dev/null +++ b/php/chunk32.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea9deb9a4e65fc6092e5f0540ee5d9d7e0aa740f63a1f7a7ba6f5cb312dbc068 +size 100310779 diff --git a/php/chunk33.nt b/php/chunk33.nt new file mode 100644 index 0000000000000000000000000000000000000000..592f437e2d9414497d64616fc0c4ddac259a29e6 --- /dev/null +++ b/php/chunk33.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52f69b72f9b597d13bc44a58e028a818ba1e22f568a4327be1079b4ca55e0b8a +size 95018597 diff --git a/php/chunk34.nt b/php/chunk34.nt new file mode 100644 index 0000000000000000000000000000000000000000..2d0a3c2a324f59d778e7cfac2271cab8c375b6ae --- /dev/null +++ b/php/chunk34.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d518db458af6eb16799a2ea9ba79357ae54122d0396b15fd193ee40c81cdb13 +size 94327763 diff --git a/php/chunk35.nt b/php/chunk35.nt new file mode 100644 index 0000000000000000000000000000000000000000..62d176f2129e764af58d0269ecc78baa379c0b11 --- /dev/null +++ b/php/chunk35.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53133f5c181b142a2ef979f361a76044ed75d193eb294f33afb2096cab029934 +size 92300596 diff --git a/php/chunk36.nt b/php/chunk36.nt new file mode 100644 index 0000000000000000000000000000000000000000..e7d52c0f4cf4ce1736282728e8ef976368f0d0e0 --- /dev/null +++ b/php/chunk36.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e847827616a655f54e9ee2059aa67893f3276626035e4867a744266a3c45a095 +size 93627053 diff --git a/php/chunk37.nt b/php/chunk37.nt new file mode 100644 index 0000000000000000000000000000000000000000..f1fb07ac8cbbac613daaf8dcb75ac22e6aebaa25 --- /dev/null +++ b/php/chunk37.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d97daaa6aceb6a7efececee79f0d427e8e6b99b43e04c7a610b184249bde765 +size 95440933 diff --git a/php/chunk38.nt b/php/chunk38.nt new file mode 100644 index 0000000000000000000000000000000000000000..aacd06f6fd7c9d0cb2868fb5a10e6135b81b0b6e --- /dev/null +++ b/php/chunk38.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb17bdb876ac7593175736d634d78f0b5526c19c33c90ce24a1431074810186d +size 103138630 diff --git a/php/chunk39.nt b/php/chunk39.nt new file mode 100644 index 0000000000000000000000000000000000000000..5aeb55667033082e0b9f927c03207ae4272f2f76 --- /dev/null +++ b/php/chunk39.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b933e0f81040c41b9c6224811793890ea23053c7255c6a0c68447fc4c4e92129 +size 96768482 diff --git a/php/chunk4.nt b/php/chunk4.nt new file mode 100644 index 0000000000000000000000000000000000000000..51a4d755e1f3be194de06b9293f7e1fa74ad7a26 --- /dev/null +++ b/php/chunk4.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:daaf995e3dedd449d56669ac98fd7bacca6beafc9c1a68d6978a25a18de8b32a +size 86700443 diff --git a/php/chunk40.nt b/php/chunk40.nt new file mode 100644 index 0000000000000000000000000000000000000000..cb5ed8ec3948a335f6220c86fc024747959affc6 --- /dev/null +++ b/php/chunk40.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3d79033202a40473b022ca4ceccdceebe2b7f9af21e264a05c82de13e94e2fb +size 95420245 diff --git a/php/chunk41.nt b/php/chunk41.nt new file mode 100644 index 0000000000000000000000000000000000000000..8a4b2d06a1ec5242b2f2e8025272de896b0f0e04 --- /dev/null +++ b/php/chunk41.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7538955697a3619133c0847a1d3385166f58820027d91f3776377cedf4716118 +size 95637445 diff --git a/php/chunk42.nt b/php/chunk42.nt new file mode 100644 index 0000000000000000000000000000000000000000..b97f1e6804c355f696eef5110d24d1227053a840 --- /dev/null +++ b/php/chunk42.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7f5ac64f07a8bbf172b1f39f75b838c76a6068e981c4a81c0d9db44bcbdd770 +size 93600932 diff --git a/php/chunk43.nt b/php/chunk43.nt new file mode 100644 index 0000000000000000000000000000000000000000..1999bf3b8e2dd539523caed4daa2cefe68b479bd --- /dev/null +++ b/php/chunk43.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07c752bc38f8b1a03afc8721880a8528d94060844e0785e2768dfb4c383811c9 +size 95577235 diff --git a/php/chunk44.nt b/php/chunk44.nt new file mode 100644 index 0000000000000000000000000000000000000000..2637d0e819ceb34c319215ae183fa33984dcaa58 --- /dev/null +++ b/php/chunk44.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb8ab9dc346f0fadc350521485b949b6104bbc4340baa4f2ddecd4ae5b9e44f8 +size 94037318 diff --git a/php/chunk45.nt b/php/chunk45.nt new file mode 100644 index 0000000000000000000000000000000000000000..6ca83a849f5a4b8b395e8408d86c0af5352d6bde --- /dev/null +++ b/php/chunk45.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fdd35ccce707bff2cefa910fe67647c4c825e3522815f5daa325c671d891cddf +size 93651975 diff --git a/php/chunk46.nt b/php/chunk46.nt new file mode 100644 index 0000000000000000000000000000000000000000..5edb22ccfba150fd533839536e899b236e3d3d2e --- /dev/null +++ b/php/chunk46.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:719d314392a5ddc0599cf78ea5cc7c29a5fd99b59e6696ded0ccc644a0c816a4 +size 94249530 diff --git a/php/chunk47.nt b/php/chunk47.nt new file mode 100644 index 0000000000000000000000000000000000000000..2d34a9a15e67e3fcbd12f26abd700c97f7bb8129 --- /dev/null +++ b/php/chunk47.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:beef1329a0eeacfc26fd0f7636bb8d0ca534600ad56e5f5579c6720e9caaac9e +size 93301048 diff --git a/php/chunk48.nt b/php/chunk48.nt new file mode 100644 index 0000000000000000000000000000000000000000..dc237f87880edde45ad751cc042dd32a21b5b653 --- /dev/null +++ b/php/chunk48.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6d3d1d8fc49c21d206d21cb9c3f3a531ba49a43b1b13af93d6254a0701ef449 +size 93045679 diff --git a/php/chunk49.nt b/php/chunk49.nt new file mode 100644 index 0000000000000000000000000000000000000000..f6f2c7c4cc8c57d24458b4764523d19faf4ef80a --- /dev/null +++ b/php/chunk49.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db25a611767c002a071ea43b16b68b3735bb6223dbc37b08565fc6fa5f84d6a8 +size 96806525 diff --git a/php/chunk5.nt b/php/chunk5.nt new file mode 100644 index 0000000000000000000000000000000000000000..906ba51bc3ba8f32d5f30690a22abc0e6983bd92 --- /dev/null +++ b/php/chunk5.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fda1b06c57b0f5dad8e191869394ad9d939a489edf39311e47c63b5febb90c19 +size 89182138 diff --git a/php/chunk50.nt b/php/chunk50.nt new file mode 100644 index 0000000000000000000000000000000000000000..473cda9c0c53c37573f8bffdb55165599bc00378 --- /dev/null +++ b/php/chunk50.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7df0ce6311d3e23ea0324108b93589dbb4159f57ef96039fe293c159fdb0373b +size 98105741 diff --git a/php/chunk51.nt b/php/chunk51.nt new file mode 100644 index 0000000000000000000000000000000000000000..896660496b4ef966eb6366c43509a96a29a71585 --- /dev/null +++ b/php/chunk51.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7f8a5a583f7209bc4e5b7f654709e2bc25fc88f0685ee6e2b3cbb20fed3c378 +size 101661638 diff --git a/php/chunk52.nt b/php/chunk52.nt new file mode 100644 index 0000000000000000000000000000000000000000..73acf17deea49753d4187cb29b0536b552a8ae25 --- /dev/null +++ b/php/chunk52.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15a92549fc0aa6222c15ce06541b220bbd3e3afa4cebc962c8b415bc6bb62287 +size 97721350 diff --git a/php/chunk53.nt b/php/chunk53.nt new file mode 100644 index 0000000000000000000000000000000000000000..8c40dd096ac50c4cec50b931d53ada14caa072c6 --- /dev/null +++ b/php/chunk53.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0190801c495f6cfb5fb34d463102c53c55cba2e244bfccb66c8569fb1230b32 +size 96524615 diff --git a/php/chunk54.nt b/php/chunk54.nt new file mode 100644 index 0000000000000000000000000000000000000000..95c9c5df42013048045276d7c46ee70ed45422ca --- /dev/null +++ b/php/chunk54.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:136244fc4ed8bcb6bf91332007013e27f887475fe3e23bb59f76e9fbe89c85f2 +size 91696825 diff --git a/php/chunk55.nt b/php/chunk55.nt new file mode 100644 index 0000000000000000000000000000000000000000..2f38da0dab7a8b8a6b8f89c1ef197e6306cfbef3 --- /dev/null +++ b/php/chunk55.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bfadedaf8905825333cda5a32d5e9c674ea7a923fdeb2d262771bf19da5d720f +size 93067877 diff --git a/php/chunk56.nt b/php/chunk56.nt new file mode 100644 index 0000000000000000000000000000000000000000..478f1dbbf32c73937efbdadf27d9de1498abfb33 --- /dev/null +++ b/php/chunk56.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d5e161e5db5575785a18efb9830790b03345bc1be847c031ace01f645bc6703 +size 94207301 diff --git a/php/chunk57.nt b/php/chunk57.nt new file mode 100644 index 0000000000000000000000000000000000000000..2a1371cb78227f38ec6f06e02ee745570c0ac209 --- /dev/null +++ b/php/chunk57.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11838bfdba48ebe11fae4ac3410a35d9b458db9d77b853b06de9ff7463f903fb +size 97670693 diff --git a/php/chunk58.nt b/php/chunk58.nt new file mode 100644 index 0000000000000000000000000000000000000000..7086a43c6a3ea82bee76e2ad4af00559dca45b54 --- /dev/null +++ b/php/chunk58.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:753cd5042bcd52673a3f76ad6215560f7c73177c868fb93f171b5f3dec90fd90 +size 52362903 diff --git a/php/chunk59.nt b/php/chunk59.nt new file mode 100644 index 0000000000000000000000000000000000000000..a574603909e826657bd847c553c7670c0aedd1aa --- /dev/null +++ b/php/chunk59.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21f6168e4e10f7dfd0cf76f88455351d40ee3b520428133c6791274c2a7f7b39 +size 54860565 diff --git a/php/chunk6.nt b/php/chunk6.nt new file mode 100644 index 0000000000000000000000000000000000000000..956598690d6442e229810c72d0098e2764b72b28 --- /dev/null +++ b/php/chunk6.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:879858c0133254049e68e61855ec25dc52dbe94b1a8547dc6adf38a6c3d9f6e8 +size 88746100 diff --git a/php/chunk60.nt b/php/chunk60.nt new file mode 100644 index 0000000000000000000000000000000000000000..8b0e8c447212dbc5ce4765cf52fbc1c2c3824603 --- /dev/null +++ b/php/chunk60.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13ef8e1211b2eac05fdaabffd978f89335904218c41398edffed082996ff2609 +size 100096895 diff --git a/php/chunk61.nt b/php/chunk61.nt new file mode 100644 index 0000000000000000000000000000000000000000..0cf3abb235dba49e1c1ed8f681d2f1c222ec61d6 --- /dev/null +++ b/php/chunk61.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8692bea611bfb15a99e8aa198a61fe6b242c375669d03382525bfb4be6a7eb85 +size 102070333 diff --git a/php/chunk62.nt b/php/chunk62.nt new file mode 100644 index 0000000000000000000000000000000000000000..e704fc9d93c3ee1b0fe614b9e6720fff641ab13d --- /dev/null +++ b/php/chunk62.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3235aed2b1c9bc524ba403abe21828020609d5eb74e19f1ddfc2764c9edda1df +size 98967890 diff --git a/php/chunk63.nt b/php/chunk63.nt new file mode 100644 index 0000000000000000000000000000000000000000..4d8852d8b530d87b4760185ef34fb3dbd9798ea0 --- /dev/null +++ b/php/chunk63.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:716db016c9b5b0ea8774a7049d3180b9903f317595753eaef9970d7fc459ded4 +size 96802096 diff --git a/php/chunk64.nt b/php/chunk64.nt new file mode 100644 index 0000000000000000000000000000000000000000..86e4cbf95bf690f7fb3cb35f4d5632fc04c77172 --- /dev/null +++ b/php/chunk64.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea7b50a08d3d5d5f77a90c32f72ef7a748ee21c08885cdda06c66173f3e973e0 +size 97830463 diff --git a/php/chunk65.nt b/php/chunk65.nt new file mode 100644 index 0000000000000000000000000000000000000000..64ff5a400df3065b8c94bd8a1528ec5adb64a448 --- /dev/null +++ b/php/chunk65.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:599addcf0dd5efcaacd28be150fb19359a82592d71740da36dab0500abb96ca2 +size 99014894 diff --git a/php/chunk66.nt b/php/chunk66.nt new file mode 100644 index 0000000000000000000000000000000000000000..0eeb6e2e24cf9ae2b209e2caf4827ad0d0562fdf --- /dev/null +++ b/php/chunk66.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a15aa352d4250006609010d40109e75e8c0ec8a6d19d5baf147e614e7d7e223 +size 101366067 diff --git a/php/chunk67.nt b/php/chunk67.nt new file mode 100644 index 0000000000000000000000000000000000000000..62c0b50bbefa01dd944a25a2b619c013b351094d --- /dev/null +++ b/php/chunk67.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89378706d38e2443f7808a943dce2168f7c91b838e603d48c195c20a012a5a1e +size 99888771 diff --git a/php/chunk68.nt b/php/chunk68.nt new file mode 100644 index 0000000000000000000000000000000000000000..793186e72da70a103b8e96f09051a1491ee6dc35 --- /dev/null +++ b/php/chunk68.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2f7cf9f9ea204241327693d4103a6b89159ac40a1de1d408c0f4dddcfaf5d1b +size 92261260 diff --git a/php/chunk69.nt b/php/chunk69.nt new file mode 100644 index 0000000000000000000000000000000000000000..ae23343de9615c36cbea72fd0cf677e5c85746f8 --- /dev/null +++ b/php/chunk69.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19f0adf53ab55989c8825d52612215ef08d8e756cd5c21a13036171d198f154e +size 87014250 diff --git a/php/chunk7.nt b/php/chunk7.nt new file mode 100644 index 0000000000000000000000000000000000000000..a6c04f01245e4375e64ab7a94a11f61d3332ff05 --- /dev/null +++ b/php/chunk7.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:921da3de2c7dd10d82b7497a80d468e4e4e21cfbc36c2bc0c2f9c62dbee65eff +size 95925321 diff --git a/php/chunk70.nt b/php/chunk70.nt new file mode 100644 index 0000000000000000000000000000000000000000..9f56e0fa2f0ffe33fe3bcc70686ba8549f477714 --- /dev/null +++ b/php/chunk70.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:187822f29fb1a82908348da86ba8f0d895da1f251d205e24a09ca9a6e8898d82 +size 90568088 diff --git a/php/chunk71.nt b/php/chunk71.nt new file mode 100644 index 0000000000000000000000000000000000000000..734d73ec2e23e46e2c406559005ca1bdcfeb9e79 --- /dev/null +++ b/php/chunk71.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bf9d52331427701f1343e79053cd79ea4cdc797af737626ef8c285bf79a20a1 +size 89406878 diff --git a/php/chunk72.nt b/php/chunk72.nt new file mode 100644 index 0000000000000000000000000000000000000000..9b25ab58b29d95a78771af585434b87c2d2e75bd --- /dev/null +++ b/php/chunk72.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d541c775fc11574b31fb8c48ef39991cb1bade6c8a8ea810d10ee6adc3e1965c +size 88569361 diff --git a/php/chunk73.nt b/php/chunk73.nt new file mode 100644 index 0000000000000000000000000000000000000000..6962ab5281c604f7198007ed8b9ae976fbc1dfdf --- /dev/null +++ b/php/chunk73.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a1e6fa93e4456f033f7e5bea7460c63fbfcd22e47282d9034d65933783e7e8c +size 88447546 diff --git a/php/chunk74.nt b/php/chunk74.nt new file mode 100644 index 0000000000000000000000000000000000000000..9371aca816409fbffe612794b6f7a57dd4092621 --- /dev/null +++ b/php/chunk74.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04e5cd4d4f990b2413c1ca02a53ccccc7ec8bf4f697e19553fc0bb6b76f37431 +size 89087995 diff --git a/php/chunk75.nt b/php/chunk75.nt new file mode 100644 index 0000000000000000000000000000000000000000..6b0ee53059df899a0e51c5d9e60d2f99191a4831 --- /dev/null +++ b/php/chunk75.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d7384c99961630c756430b9971166f6d9dec95a1e849d20333078639a8dfc19 +size 88799780 diff --git a/php/chunk76.nt b/php/chunk76.nt new file mode 100644 index 0000000000000000000000000000000000000000..eca3ed2b1b63553d0ad2e1b4f3ded8f22d437894 --- /dev/null +++ b/php/chunk76.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d406ac920ff817a1f61a6656a5fed510cdc2cc0798e6734435024e51a2d45b0 +size 88049821 diff --git a/php/chunk77.nt b/php/chunk77.nt new file mode 100644 index 0000000000000000000000000000000000000000..0981eb8c23d1e08db7d1765fc69cb4c4b3294347 --- /dev/null +++ b/php/chunk77.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb4375fd4894757731bab6de4698ffe202e7e3cda11403158452fe5ce346c6c4 +size 83033475 diff --git a/php/chunk78.nt b/php/chunk78.nt new file mode 100644 index 0000000000000000000000000000000000000000..309777ea086f65221229305ed1b770c9be35693b --- /dev/null +++ b/php/chunk78.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac8f202015f35c1e0673da62cf68047277524bae4a6c369305e8d0dd55bdbee8 +size 84218777 diff --git a/php/chunk79.nt b/php/chunk79.nt new file mode 100644 index 0000000000000000000000000000000000000000..add2c42a1a8f9250708b7f21943d8bed348d1018 --- /dev/null +++ b/php/chunk79.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d366bfc65a0ca4836c323283d184f4430b999bf2c5518f3680b98b2a5d25165f +size 87313995 diff --git a/php/chunk8.nt b/php/chunk8.nt new file mode 100644 index 0000000000000000000000000000000000000000..7f200402347ebb4369d9e9f64e98a0ca9ab11f1a --- /dev/null +++ b/php/chunk8.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25cbb6b685bd8a4239ff1576b477860d6b41a8f3f69bdceb4a6b7f10209286ee +size 85217521 diff --git a/php/chunk80.nt b/php/chunk80.nt new file mode 100644 index 0000000000000000000000000000000000000000..bb3dd6431c22f2c4d81cc82aee7e9d7fd7f41243 --- /dev/null +++ b/php/chunk80.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c95a9ff68575d8a60704856a42a76b04e1842311db73edaee50cc58a8c7196d0 +size 93315229 diff --git a/php/chunk81.nt b/php/chunk81.nt new file mode 100644 index 0000000000000000000000000000000000000000..6461cd30d7f5216286ebd2d81d6418dd7c2ab9ca --- /dev/null +++ b/php/chunk81.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:041be6679358d06558cefc44fe0893be72844c279465e30b5e19aaa48cad633d +size 91158163 diff --git a/php/chunk82.nt b/php/chunk82.nt new file mode 100644 index 0000000000000000000000000000000000000000..1e2b798b005931c78ab0bfd3001bcbd9b8db8c1d --- /dev/null +++ b/php/chunk82.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:665e591cdd594e5317d5af5606a7014ab83eb87f87fb939737f52e04eeefde25 +size 91121963 diff --git a/php/chunk83.nt b/php/chunk83.nt new file mode 100644 index 0000000000000000000000000000000000000000..2c6dce98e0e9163e97fda38fd4535e9794e0018a --- /dev/null +++ b/php/chunk83.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17e0eaa8b51929ab5f7bc67247642097e7dd560ba80007297228f309951d7a81 +size 86811501 diff --git a/php/chunk84.nt b/php/chunk84.nt new file mode 100644 index 0000000000000000000000000000000000000000..9871801070ce9403e6c67344a817c9d53a44c626 --- /dev/null +++ b/php/chunk84.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3563f81cf0df8fe20d8446d969e1de614c37a02e4560dc000356a740add971b +size 87320521 diff --git a/php/chunk85.nt b/php/chunk85.nt new file mode 100644 index 0000000000000000000000000000000000000000..62f2695ed1131d505fcb077eb7f0b0d00267f45c --- /dev/null +++ b/php/chunk85.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64166fdbc3c40c30cea4910d5c20d079f79ebd939012200856f76a2b4751afde +size 84920088 diff --git a/php/chunk86.nt b/php/chunk86.nt new file mode 100644 index 0000000000000000000000000000000000000000..ccc9a90a01f9f72f91d4a6125f9eb92b5310eec4 --- /dev/null +++ b/php/chunk86.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49bb886b13942efa03d8041fc8628920cc88c5d5c329a4d1574443a134c839ae +size 86347422 diff --git a/php/chunk87.nt b/php/chunk87.nt new file mode 100644 index 0000000000000000000000000000000000000000..ea1dec2d0c4734eb40244c6eaaa1ba27c55dbc06 --- /dev/null +++ b/php/chunk87.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b7006d4d4275e617767d4cebb5a32768d20bfa8eddada3856288a724bea010a +size 93469205 diff --git a/php/chunk88.nt b/php/chunk88.nt new file mode 100644 index 0000000000000000000000000000000000000000..6a41464db90866c710cf17b4277bc2f6c9bfb827 --- /dev/null +++ b/php/chunk88.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64abe667f4ec9b1cdee539e145f846ffee3c06c3f2e7bb415ca6b021aba3c78f +size 90948878 diff --git a/php/chunk89.nt b/php/chunk89.nt new file mode 100644 index 0000000000000000000000000000000000000000..a2f0045afa767973f5893f19ba348ed71faa9c23 --- /dev/null +++ b/php/chunk89.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c18d0328fc12d8e6aae89372df84feef472a27f0f6109fa2e1c4e997c17b78c +size 88525235 diff --git a/php/chunk9.nt b/php/chunk9.nt new file mode 100644 index 0000000000000000000000000000000000000000..97f70fc87f852c4be42ceeceaaf9e8ffbacb8d06 --- /dev/null +++ b/php/chunk9.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49e92303df70ac821b8572c13fc26c1c85c264ae1306219bd7641e87cf597d94 +size 88099748 diff --git a/php/chunk90.nt b/php/chunk90.nt new file mode 100644 index 0000000000000000000000000000000000000000..7571c063879b2f91f2c288e71cd579f6f22c157a --- /dev/null +++ b/php/chunk90.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:159d6a97e9897c161a08d276787d79d618244ee34b694eacb7210c5b29e34ebd +size 84071632 diff --git a/php/chunk91.nt b/php/chunk91.nt new file mode 100644 index 0000000000000000000000000000000000000000..39d98932e939730478738e3669b01bb58f1366d1 --- /dev/null +++ b/php/chunk91.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70ec8295885a0cae0587f02b77b4280c49963f66e8e92417cc1617204ba2cc9a +size 87133516 diff --git a/php/chunk92.nt b/php/chunk92.nt new file mode 100644 index 0000000000000000000000000000000000000000..6fcc668dd904ca2269c9819995a753bc4f6eb3bf --- /dev/null +++ b/php/chunk92.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66290a9402ce3f1ced1c34b3e46eb939bbab5b7584e3f09941b1dfe835f88934 +size 87715996 diff --git a/php/chunk93.nt b/php/chunk93.nt new file mode 100644 index 0000000000000000000000000000000000000000..9567f75c95b591beb91360ce88004b3fc966126f --- /dev/null +++ b/php/chunk93.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92600920b9374b27b6dc3959b558cb47211fea0209da319cc43cc678e1f95a0a +size 86946623 diff --git a/php/chunk94.nt b/php/chunk94.nt new file mode 100644 index 0000000000000000000000000000000000000000..33b88539ae35937a3183a7a896c5b585e4b63490 --- /dev/null +++ b/php/chunk94.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c3305cefb62e97870d7bd3a0ead1247d33c54cb67c15b2e1a25cfbf92c1d1a8 +size 90457752 diff --git a/php/chunk95.nt b/php/chunk95.nt new file mode 100644 index 0000000000000000000000000000000000000000..0d1b0f8139cce42ff282db4081540bf71c3cd565 --- /dev/null +++ b/php/chunk95.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf5e3a403b641d49cb7be575d19520f74aeff9c20c2ab61eb0664969d7e2b38e +size 88592360 diff --git a/php/chunk96.nt b/php/chunk96.nt new file mode 100644 index 0000000000000000000000000000000000000000..69fa49961189db91c35723b6b1de7e78c8bdf441 --- /dev/null +++ b/php/chunk96.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e05aab164c1dffc317bac97ccfd6e32d87f4ac378d5786a0017bd83f14fe060d +size 85226997 diff --git a/php/chunk97.nt b/php/chunk97.nt new file mode 100644 index 0000000000000000000000000000000000000000..978e981f6a0655d1a70c6b85e592df2c2026435d --- /dev/null +++ b/php/chunk97.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f045e943c5995538dbc8c4dd6807f28ae31112b0f4de8171e43c63c12889b28 +size 83059783 diff --git a/php/chunk98.nt b/php/chunk98.nt new file mode 100644 index 0000000000000000000000000000000000000000..cc4d3d8f9832a465c52b1ce20f51aaf977817049 --- /dev/null +++ b/php/chunk98.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cdbd68a2d4ef9bd5b323e6a912e087df408ecfebc41e9ce7aef7a0df9e739ede +size 86260696 diff --git a/php/chunk99.nt b/php/chunk99.nt new file mode 100644 index 0000000000000000000000000000000000000000..2e8205f68ffdfb6bca2a0a25c16f1fccf511e95f --- /dev/null +++ b/php/chunk99.nt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2fa7d06d1b1b88a944dfb8486daa44955cb1ac85ec214803de90e5fa5aab12b2 +size 84672139 diff --git a/schema.nt b/schema.nt new file mode 100644 index 0000000000000000000000000000000000000000..3647831ddccebd68c76df12632ddf085294b797a --- /dev/null +++ b/schema.nt @@ -0,0 +1,128 @@ + . + "The text content of a comment." . + "Comment" . + "has body" . + "The name of a tag." . + "score" . + "tagged with" . + . + "Unanswered Question" . + "favorite count" . + "answer count" . + . + . + . + "accepted answer of" . + "Inverse of hasTagWiki (wiki -> tag)." . + . + . + . + "A comment associated with an answer." . + . + "downvote count" . + "A question that does not have an accepted answer." . + . + . + . + "Question" . + . + "Links a question to an answer it has." . + "An answer that has been marked as accepted by the question author." . + "Tag" . + "upvote count" . + "Accepted Answer" . + . + "answers question" . + . + "has comment" . + . + "A comment associated with a question." . + . + "has tag wiki" . + . + . + "Content" . + . + "has text" . + . + "tag wiki of" . + "The main content (body) of a post, typically containing HTML." . + "accepted answer" . + "Links a question to a tag it is associated with." . + . + . + "Answer" . + "Links an answer to the question it answers." . + "Answer Comment" . + . + "Inverse of acceptedAnswer (answer -> question)." . + . + "has title" . + "Represents the wiki documentation post associated with a tag." . + . + "Links a question to an answer that might be better than the accepted one (potentially based on score or other heuristics)." . + "The number of upvotes a post has received." . + . + . + "Represents a comment on a Stack Overflow post." . + . + . + . + . + . + . + "Indicates that two questions are linked (e.g., related). This relationship is symmetric." . + "A question that has an accepted answer." . + "The score (upvotes - downvotes) of a post or comment." . + "A content item (either a Post or a Comment) that can have a score." . + "Inverse of taggedWith (tag -> question)." . + "The number of downvotes a post has received." . + . + "duplicate of" . + . + . + "Represents a question post on Stack Overflow." . + . + "Represents a tag used to categorize questions." . + . + "linked to" . + "Question Comment" . + "Answered Question" . + . + . + "Post" . + "Indicates that a question is considered a duplicate of another question." . + . + . + "The number of times a question has been favorited by users." . + "possible better answer" . + . + "tag name" . + . + . + "Links a tag to its associated tag wiki post." . + . + "Represents an answer post on Stack Overflow." . + . + "The title of a post (typically Question or TagWiki)." . + "tags question" . + . + . + "Links a comment to the post (question or answer) it is associated with." . + . + . + . + . + "The number of answers a question has." . + "Represents a post on Stack Overflow, which can be a question, answer, or tag wiki." . + . + . + "Links a post (question or answer) to a comment associated with it." . + . + . + "Tag Wiki" . + . + . + "has answer" . + "Links a question to its accepted answer." . + "comment on" .