About base_url on localhost...
Posted by: kreativizm (---.219.178.140.netspeed.com.tr)
Date: September 02, 2020 11:57AM

Hello, i am using wampserver 3.1.7 and i installed some php script but on localhost base_url function return empty...When i upload my script to my host then base_url working fine... what can i do for base_url working fine on localhost? my php version is 7+

Options: ReplyQuote
Re: About base_url on localhost...
Posted by: Otomatic (Moderator)
Date: September 02, 2020 12:17PM

Hi,

base_url is not a PHP function. What application does this function come from?

Please READ (and answer) BEFORE YOU ASK A QUESTION

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: About base_url on localhost...
Posted by: kreativizm (---.219.178.140.netspeed.com.tr)
Date: September 02, 2020 12:23PM

kreativizm Wrote:
-------------------------------------------------------
> Hello, i am using wampserver 3.1.7 and i installed
> some php script but on localhost base_url function
> return empty...When i upload my script to my host
> then base_url working fine... what can i do for
> base_url working fine on localhost? my php version
> is 7+

Thank you for reply,
<script src="<?php echo BASE_URL . '/assets/js/jquery.js'; ?>"></script>
on script using like this...and it return empty...
BASE_URL is on script

$baseUrl = getBaseUrl();

define('BASE_URL', $baseUrl);



Edited 1 time(s). Last edit at 09/02/2020 12:27PM by kreativizm.

Options: ReplyQuote
Re: About base_url on localhost...
Posted by: Otomatic (Moderator)
Date: September 02, 2020 02:16PM

Hi,

You have to ask the creator of the script and the function. This script is not part of Wampserver.

Moreover, for this kind of feature to have a chance to work properly, it is imperative that your local sites be defined as VirtualHost, as with all hosting providers.

See:
The need for Virtual Host
and
Wampserver 3 - Create or add a VirtualHost
and
Why to create a VirtualHost BEFORE installing a CMS

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: About base_url on localhost...
Posted by: kreativizm (---.219.178.195.netspeed.com.tr)
Date: September 03, 2020 03:20PM

kreativizm Wrote:
-------------------------------------------------------
> kreativizm Wrote:
> --------------------------------------------------
> -----
> > Hello, i am using wampserver 3.1.7 and i
> installed
> > some php script but on localhost base_url
> function
> > return empty...When i upload my script to my
> host
> > then base_url working fine... what can i do for
> > base_url working fine on localhost? my php
> version
> > is 7+
>
> Thank you for reply,

<script src="<?php echo BASE_URL . '/assets/js/jquery.js'; ?>"></script>
on script using like this...and it return empty...BASE_URL is on script

$baseUrl = getBaseUrl();

define('BASE_URL', $baseUrl);

Thank you so much my problem solved...



Edited 1 time(s). Last edit at 09/03/2020 05:41PM by RiggsFolly.

Options: ReplyQuote


Sorry, only registered users may post in this forum.