# Hosting problem

**URL:** <https://discourse.cakephp.org/t/hosting-problem/11539>\
**Category:** Need Help\
**Tags:** help\
**Created:** [September 27, 2023, 3:13am UTC](https://discourse.cakephp.org/t/hosting-problem/11539 "2023-09-27T03:13:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rest](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rest](https://discourse.cakephp.org/u/Rest)\
**Post date:** [September 27, 2023, 3:13am UTC](https://discourse.cakephp.org/t/hosting-problem/11539/1 "2023-09-27T03:13:37Z")

</div>

Hellow Good day! i seem to have encountered a problem in making my system to the web hosting. Before i deployed my system to the webhosting infinityfree (i’m a sutdent) my css/ links/ routes are all working fine. after i put all my files in there and open the site. all my css are working. then when i click login i get an error “Missing Helper” and want’s me to create urlHelper.php i the src/view/helper. after i created it i get too many warnings in my system but it will now redirect me to the login and i can login fine and do the main functionalities in my system add/edit/delete/view. here is an example of the warning when i made the urlHelper.php

[**Warning** (512)](javascript:void(0);): Method App\View\Helper\urlHelper::image does not exist [in **/home/vol1\_7/infinityfree.com/if0\_35085963/htdocs/vendor/cakephp/cakephp/src/View/Helper.php** , line **103**]

![](http://calpamoda.infinityfreeapp.com/users/login)

This is my first time using framework like cakephp and also my first time uploading it to web hosting using this framework. I’d be glad if someone can help me in this. Thank you!

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [September 27, 2023, 1:29pm UTC](https://discourse.cakephp.org/t/hosting-problem/11539/2 "2023-09-27T13:29:38Z")

</div>

Did you develop this on a Windows system, and now you’re deploying to a Linux host? There is no thing called “urlHelper”, it’s “UrlHelper”. Windows won’t differentiate between the two because it’s a case insensitive file system, but Linux definitely sees them as two different things.

---

<div class="post-metadata">

**Author:** ![Rest](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rest](https://discourse.cakephp.org/u/Rest)\
**Post date:** [September 29, 2023, 9:26am UTC](https://discourse.cakephp.org/t/hosting-problem/11539/3 "2023-09-29T09:26:51Z")

</div>

yes you are correct im using windows for my development. should i use UrlHelper in folder? and change the class urlHelper extends Helper to UrlHelper? also should i change my codes

- url-\>build(['controller'=\>'Users', 'action'=\>'login']);?\>\>Login

to

- \<a class=“getstarted scrollto” href=\<?= $this-\>Url-\>build(['controller'=\>'Users', 'action'=\>'login']);?\>\>Login
 ???  
thank you so much for giving time to comment on my problem. your advice would be a great help for me.

---

<div class="post-metadata">

**Author:** ![Rest](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rest](https://discourse.cakephp.org/u/Rest)\
**Post date:** [September 29, 2023, 9:35am UTC](https://discourse.cakephp.org/t/hosting-problem/11539/4 "2023-09-29T09:35:03Z")

</div>

my code is working properly before i go to hosting.  
i haven’t done any custom helpers also but I’m getting this error. i would be so glad if you can teach me where i did wrong.

---

<div class="post-metadata">

**Author:** ![Rest](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rest](https://discourse.cakephp.org/u/Rest)\
**Post date:** [September 29, 2023, 10:04am UTC](https://discourse.cakephp.org/t/hosting-problem/11539/5 "2023-09-29T10:04:45Z")

</div>

Update i have made them display without making another Urlhelper.php with this code

\<?php $this-\>Url-\>build('/posts', ['fullBase' =\> true]); ?\> from the cakebook helper

then when i get an email i just get this.

 ![Screenshot 2023-09-29 180210](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/9/91dce299d654352a48b0737fe9dd99dda1f17ec2.png)

my email shouldn’t be those. but with just a link instead like before i use hosting.

i would be so thankful if someone can help me with this

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [September 29, 2023, 1:00pm UTC](https://discourse.cakephp.org/t/hosting-problem/11539/6 "2023-09-29T13:00:43Z")

</div>

According to what it’s telling you in the error message, you’ve used a colon-prefixed route placeholder. If you’re not sure what that means, the output of `bin/cake routes` might help.

---

<div class="post-metadata">

**Author:** ![Rest](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rest](https://discourse.cakephp.org/u/Rest)\
**Post date:** [October 2, 2023, 2:08am UTC](https://discourse.cakephp.org/t/hosting-problem/11539/7 "2023-10-02T02:08:43Z")

</div>

hellow thank you for having time to reply to my post. here is my code to my forgot password as to what you said i was using colon-prefixed route.

//Forgot Password function  
public function forgotPassword()  
{

```
        $this->Authorization->skipAuthorization();

        if ($this->request->is('post')) {
            $user = $this->Users->findByEmail($this->request->getData('email'))->first();

            if ($user) {
                // Generate a unique token
                $token = bin2hex(random_bytes(32));
                $user->password_reset_token = $token;
                $user->password_reset_expires = FrozenTime::now()->addHours(1);

                if ($this->Users->save($user)) {
                    // Send the reset email
                    $mailer = new Mailer('default');
                    $mailer->setTo($user->email)
                        ->setSubject('Password Reset')
                        ->setViewVars(['token' => $token])
                        ->viewBuilder()
                            ->setTemplate('forgot_password')
                            ->setLayout('default'); // You can specify a layout if needed
                        
                    $mailer->setEmailFormat('both');
                    $mailer->deliver();
                  echo $this->Flash->success('An email with instructions to reset your password has been sent.');
                } else {
                    $this->Flash->error('Could not save token.');
                }
            } else {
                $this->Flash->error('No user found with that email address.');
            }
        }
    }

```

also is it possible to run the command bin/cake routes in an hosting environment already?

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [October 2, 2023, 2:18pm UTC](https://discourse.cakephp.org/t/hosting-problem/11539/8 "2023-10-02T14:18:05Z")

</div>

It’s not in that code. Maybe your `forgot_password` template?

You should be able to run `bin/cake routes` anywhere that you have shell access. Not all hosting environments provide that, but all good ones do. 🙂

---

<div class="post-metadata">

**Author:** ![Rest](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rest](https://discourse.cakephp.org/u/Rest)\
**Post date:** [October 5, 2023, 2:26am UTC](https://discourse.cakephp.org/t/hosting-problem/11539/9 "2023-10-05T02:26:02Z")

</div>

Thank you for the help i manage to solve the error in my code.
