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

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.3 32 bit - Apache 2.4.46 - PHP 7.4.9…5.6.40 - MySQL 5.7.31 - MariaDB 10.5.5
Wampserver 3.2.3 64 bit - Apache 2.4.46 - PHP 7.4.9…5.6.40 - MySQL 5.7.31/8.0.21 - MariaDB 10.5.5
PhPMyadmin 5.0.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.3 32 bit - Apache 2.4.46 - PHP 7.4.9…5.6.40 - MySQL 5.7.31 - MariaDB 10.5.5
Wampserver 3.2.3 64 bit - Apache 2.4.46 - PHP 7.4.9…5.6.40 - MySQL 5.7.31/8.0.21 - MariaDB 10.5.5
PhPMyadmin 5.0.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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.